diff --git a/package-lock.json b/package-lock.json index 6849e395790b6..040fe3911f377 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28177,9 +28177,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001434", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001434.tgz", - "integrity": "sha512-aOBHrLmTQw//WFa2rcF1If9fa3ypkC1wzqqiKHgfdrXTWcU8C4gKVZT77eQAPWN1APys3+uQ0Df07rKauXGEYA==" + "version": "1.0.30001488", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001488.tgz", + "integrity": "sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ==" }, "capital-case": { "version": "1.0.4", diff --git a/packages/block-editor/src/components/publish-date-time-picker/index.js b/packages/block-editor/src/components/publish-date-time-picker/index.js index 364fb09594802..418006cf854c1 100644 --- a/packages/block-editor/src/components/publish-date-time-picker/index.js +++ b/packages/block-editor/src/components/publish-date-time-picker/index.js @@ -29,8 +29,6 @@ function PublishDateTimePicker( /> diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index d4cc445dd379d..6c00d6e22027b 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking Changes + +- `DateTime`: Remove previously deprecated props, `__nextRemoveHelpButton` and `__nextRemoveResetButton` ([#50724](https://github.com/WordPress/gutenberg/pull/50724)). + ### Internal - `Modal`: Remove children container's unused class name ([#50655](https://github.com/WordPress/gutenberg/pull/50655)). diff --git a/packages/components/src/date-time/README.md b/packages/components/src/date-time/README.md index e01d9074953f2..c65cf6d3a1aae 100644 --- a/packages/components/src/date-time/README.md +++ b/packages/components/src/date-time/README.md @@ -26,8 +26,6 @@ const MyDateTimePicker = () => { currentDate={ date } onChange={ ( newDate ) => setDate( newDate ) } is12Hour={ true } - __nextRemoveHelpButton - __nextRemoveResetButton /> ); }; @@ -83,17 +81,3 @@ The day that the week should start on. 0 for Sunday, 1 for Monday, etc. - Required: No - Default: 0 - -### `__nextRemoveHelpButton`: `boolean` - -Start opting in to not displaying a Help button which will become the default in a future version. - -- Required: No -- Default: `false` - -### `__nextRemoveResetButton`: `boolean` - -Start opting in to not displaying a Reset button which will become the default in a future version. - -- Required: No -- Default: `false` diff --git a/packages/components/src/date-time/date-time/index.tsx b/packages/components/src/date-time/date-time/index.tsx index 123f20e76c640..a75b9fe57c14e 100644 --- a/packages/components/src/date-time/date-time/index.tsx +++ b/packages/components/src/date-time/date-time/index.tsx @@ -6,21 +6,16 @@ import type { ForwardedRef } from 'react'; /** * WordPress dependencies */ -import { useState, forwardRef } from '@wordpress/element'; +import { forwardRef } from '@wordpress/element'; import { __, _x } from '@wordpress/i18n'; -import deprecated from '@wordpress/deprecated'; /** * Internal dependencies */ -import Button from '../../button'; import { default as DatePicker } from '../date'; import { default as TimePicker } from '../time'; import type { DateTimePickerProps } from '../types'; -import { Wrapper, CalendarHelp } from './styles'; -import { HStack } from '../../h-stack'; -import { Heading } from '../../heading'; -import { Spacer } from '../../spacer'; +import { Wrapper } from './styles'; export { DatePicker, TimePicker }; @@ -35,157 +30,26 @@ function UnforwardedDateTimePicker( onChange, events, startOfWeek, - __nextRemoveHelpButton = false, - __nextRemoveResetButton = false, }: DateTimePickerProps, ref: ForwardedRef< any > ) { - if ( ! __nextRemoveHelpButton ) { - deprecated( 'Help button in wp.components.DateTimePicker', { - since: '13.4', - version: '15.8', // One year of plugin releases. - hint: 'Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.', - } ); - } - if ( ! __nextRemoveResetButton ) { - deprecated( 'Reset button in wp.components.DateTimePicker', { - since: '13.4', - version: '15.8', // One year of plugin releases. - hint: 'Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.', - } ); - } - - const [ calendarHelpIsVisible, setCalendarHelpIsVisible ] = - useState( false ); - - function onClickDescriptionToggle() { - setCalendarHelpIsVisible( ! calendarHelpIsVisible ); - } - return ( - { ! calendarHelpIsVisible && ( - <> - - - - ) } - { calendarHelpIsVisible && ( - - { __( 'Click to Select' ) } -
    -
  • - { __( - 'Click the right or left arrows to select other months in the past or the future.' - ) } -
  • -
  • { __( 'Click the desired day to select it.' ) }
  • -
- - { __( 'Navigating with a keyboard' ) } - -
    -
  • - - ↵ - - { - ' ' /* JSX removes whitespace, but a space is required for screen readers. */ - } - { __( 'Select the date in focus.' ) } -
  • -
  • - - ←/→ - - { - ' ' /* JSX removes whitespace, but a space is required for screen readers. */ - } - { __( - 'Move backward (left) or forward (right) by one day.' - ) } -
  • -
  • - - ↑/↓ - - { - ' ' /* JSX removes whitespace, but a space is required for screen readers. */ - } - { __( - 'Move backward (up) or forward (down) by one week.' - ) } -
  • -
  • - - { __( 'PgUp/PgDn' ) } - - { - ' ' /* JSX removes whitespace, but a space is required for screen readers. */ - } - { __( - 'Move backward (PgUp) or forward (PgDn) by one month.' - ) } -
  • -
  • - - { /* Translators: Home/End reffer to the 'Home' and 'End' buttons on the keyboard.*/ } - { __( 'Home/End' ) } - - { - ' ' /* JSX removes whitespace, but a space is required for screen readers. */ - } - { __( - 'Go to the first (Home) or last (End) day of a week.' - ) } -
  • -
-
- ) } - { ( ! __nextRemoveResetButton || ! __nextRemoveHelpButton ) && ( - - { ! __nextRemoveResetButton && - ! calendarHelpIsVisible && - currentDate && ( - - ) } - - { ! __nextRemoveHelpButton && ( - - ) } - - ) } + <> + + +
); } @@ -207,8 +71,6 @@ function UnforwardedDateTimePicker( * currentDate={ date } * onChange={ ( newDate ) => setDate( newDate ) } * is12Hour - * __nextRemoveHelpButton - * __nextRemoveResetButton * /> * ); * }; diff --git a/packages/components/src/date-time/date-time/styles.ts b/packages/components/src/date-time/date-time/styles.ts index a7f23eb276e04..51dc6e71f0c46 100644 --- a/packages/components/src/date-time/date-time/styles.ts +++ b/packages/components/src/date-time/date-time/styles.ts @@ -11,7 +11,3 @@ import { VStack } from '../../v-stack'; export const Wrapper = styled( VStack )` box-sizing: border-box; `; - -export const CalendarHelp = styled.div` - min-width: 260px; -`; diff --git a/packages/components/src/date-time/stories/date-time.tsx b/packages/components/src/date-time/stories/date-time.tsx index 53d369728d34d..447b9cf265ab8 100644 --- a/packages/components/src/date-time/stories/date-time.tsx +++ b/packages/components/src/date-time/stories/date-time.tsx @@ -52,10 +52,6 @@ const Template: ComponentStory< typeof DateTimePicker > = ( { export const Default: ComponentStory< typeof DateTimePicker > = Template.bind( {} ); -Default.args = { - __nextRemoveHelpButton: true, - __nextRemoveResetButton: true, -}; export const WithEvents: ComponentStory< typeof DateTimePicker > = Template.bind( {} ); diff --git a/packages/components/src/date-time/types.ts b/packages/components/src/date-time/types.ts index ae99a7082dcd2..02df096a866b9 100644 --- a/packages/components/src/date-time/types.ts +++ b/packages/components/src/date-time/types.ts @@ -73,20 +73,4 @@ export type DateTimePickerProps = Omit< DatePickerProps, 'onChange' > & * passed the date and time as an argument. */ onChange?: ( date: string | null ) => void; - - /** - * Start opting in to not displaying a Help button which will become the - * default in a future version. - * - * @default false - */ - __nextRemoveHelpButton?: boolean; - - /** - * Start opting in to not displaying a Reset button which will become - * the default in a future version. - * - * @default false - */ - __nextRemoveResetButton?: boolean; }; diff --git a/packages/dependency-extraction-webpack-plugin/test/__snapshots__/build.js.snap b/packages/dependency-extraction-webpack-plugin/test/__snapshots__/build.js.snap index f5bf010b1ef8d..42102ca2cb132 100644 --- a/packages/dependency-extraction-webpack-plugin/test/__snapshots__/build.js.snap +++ b/packages/dependency-extraction-webpack-plugin/test/__snapshots__/build.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DependencyExtractionWebpackPlugin Webpack \`combine-assets\` should produce expected output: Asset file 'assets.php' should match snapshot 1`] = ` -" array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'bf200ecb3dcb6881a1f3'), 'fileB.js' => array('dependencies' => array('wp-token-list'), 'version' => '0af6c51a8e6ac934b85a')); +" array('dependencies' => array('lodash', 'wp-blob'), 'version' => 'cf268e19006bef774112'), 'fileB.js' => array('dependencies' => array('wp-token-list'), 'version' => '7f3970305cf0aecb54ab')); " `; @@ -32,7 +32,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`combine-assets\` should pro `; exports[`DependencyExtractionWebpackPlugin Webpack \`dynamic-import\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array('wp-blob'), 'version' => '782d84ec5d7303bb6bd2'); +" array('wp-blob'), 'version' => 'c8be4fceac30d1d00ca7'); " `; @@ -50,7 +50,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`dynamic-import\` should pro `; exports[`DependencyExtractionWebpackPlugin Webpack \`function-output-filename\` should produce expected output: Asset file 'chunk--main--main.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '4c78134607e6ed966df3'); +" array('lodash', 'wp-blob'), 'version' => '9b7ebe61044661fdabda'); " `; @@ -73,7 +73,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`function-output-filename\` `; exports[`DependencyExtractionWebpackPlugin Webpack \`has-extension-suffix\` should produce expected output: Asset file 'index.min.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => 'dabeb91f3cb9dd73d48d'); +" array('lodash', 'wp-blob'), 'version' => '49dba68ef238f954b358'); " `; @@ -96,21 +96,21 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`has-extension-suffix\` shou `; exports[`DependencyExtractionWebpackPlugin Webpack \`no-default\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array(), 'version' => 'bb85a9737103c7054b00'); +" array(), 'version' => 'f7e2cb527e601f74f8bd'); " `; exports[`DependencyExtractionWebpackPlugin Webpack \`no-default\` should produce expected output: External modules should match snapshot 1`] = `[]`; exports[`DependencyExtractionWebpackPlugin Webpack \`no-deps\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array(), 'version' => '091ffcd70d94dd16e773'); +" array(), 'version' => '143ed23d4b8be5611fcb'); " `; exports[`DependencyExtractionWebpackPlugin Webpack \`no-deps\` should produce expected output: External modules should match snapshot 1`] = `[]`; exports[`DependencyExtractionWebpackPlugin Webpack \`option-function-output-filename\` should produce expected output: Asset file 'chunk--main--main.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '4c78134607e6ed966df3'); +" array('lodash', 'wp-blob'), 'version' => '9b7ebe61044661fdabda'); " `; @@ -133,7 +133,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`option-function-output-file `; exports[`DependencyExtractionWebpackPlugin Webpack \`option-output-filename\` should produce expected output: Asset file 'main-foo.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '4c78134607e6ed966df3'); +" array('lodash', 'wp-blob'), 'version' => '9b7ebe61044661fdabda'); " `; @@ -155,7 +155,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`option-output-filename\` sh ] `; -exports[`DependencyExtractionWebpackPlugin Webpack \`output-format-json\` should produce expected output: Asset file 'main.asset.json' should match snapshot 1`] = `"{"dependencies":["lodash"],"version":"a8f35bfc9f46482cc48a"}"`; +exports[`DependencyExtractionWebpackPlugin Webpack \`output-format-json\` should produce expected output: Asset file 'main.asset.json' should match snapshot 1`] = `"{"dependencies":["lodash"],"version":"4c42b9646049ad2e9438"}"`; exports[`DependencyExtractionWebpackPlugin Webpack \`output-format-json\` should produce expected output: External modules should match snapshot 1`] = ` [ @@ -168,7 +168,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`output-format-json\` should `; exports[`DependencyExtractionWebpackPlugin Webpack \`overrides\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array('wp-blob', 'wp-script-handle-for-rxjs', 'wp-url'), 'version' => '2a29b245fc3d0509b5a8'); +" array('wp-blob', 'wp-script-handle-for-rxjs', 'wp-url'), 'version' => '708c71445153f1d07e4a'); " `; @@ -207,17 +207,17 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`overrides\` should produce `; exports[`DependencyExtractionWebpackPlugin Webpack \`runtime-chunk-single\` should produce expected output: Asset file 'a.asset.php' should match snapshot 1`] = ` -" array('wp-blob'), 'version' => '4514ed711f6c035e0887'); +" array('wp-blob'), 'version' => '09a0c551770a351c5ca7'); " `; exports[`DependencyExtractionWebpackPlugin Webpack \`runtime-chunk-single\` should produce expected output: Asset file 'b.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '168d32b5fb42f9e5d8ce'); +" array('lodash', 'wp-blob'), 'version' => 'c9f00d690a9f72438910'); " `; exports[`DependencyExtractionWebpackPlugin Webpack \`runtime-chunk-single\` should produce expected output: Asset file 'runtime.asset.php' should match snapshot 1`] = ` -" array(), 'version' => 'd3c2ce2cb84ff74b92e0'); +" array(), 'version' => '46ea0ff11ac53fa5e88b'); " `; @@ -240,7 +240,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`runtime-chunk-single\` shou `; exports[`DependencyExtractionWebpackPlugin Webpack \`style-imports\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '04b9da7eff6fbfcb0452'); +" array('lodash', 'wp-blob'), 'version' => 'd8c0ee89d933a3809c0e'); " `; @@ -263,7 +263,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`style-imports\` should prod `; exports[`DependencyExtractionWebpackPlugin Webpack \`wordpress\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => '4c78134607e6ed966df3'); +" array('lodash', 'wp-blob'), 'version' => '9b7ebe61044661fdabda'); " `; @@ -286,7 +286,7 @@ exports[`DependencyExtractionWebpackPlugin Webpack \`wordpress\` should produce `; exports[`DependencyExtractionWebpackPlugin Webpack \`wordpress-require\` should produce expected output: Asset file 'main.asset.php' should match snapshot 1`] = ` -" array('lodash', 'wp-blob'), 'version' => 'ed2bd4e7df46768bb3c2'); +" array('lodash', 'wp-blob'), 'version' => '40370eb4ce6428562da6'); " `; diff --git a/packages/readable-js-assets-webpack-plugin/test/__snapshots__/build.js.snap b/packages/readable-js-assets-webpack-plugin/test/__snapshots__/build.js.snap index e5a7d6f6accc8..c033e572e8e5e 100644 --- a/packages/readable-js-assets-webpack-plugin/test/__snapshots__/build.js.snap +++ b/packages/readable-js-assets-webpack-plugin/test/__snapshots__/build.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ReadableJsAssetsWebpackPlugin should produce the expected output: Asset file index.js should match snapshot 1`] = ` -"/******/ (function() { // webpackBootstrap +"/******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; function notMinified() { // eslint-disable-next-line no-console @@ -16,7 +16,7 @@ notMinified(); exports[`ReadableJsAssetsWebpackPlugin should produce the expected output: Asset file index.min.js should match snapshot 1`] = `"console.log("hello");"`; exports[`ReadableJsAssetsWebpackPlugin should produce the expected output: Asset file view.js should match snapshot 1`] = ` -"/******/ (function() { // webpackBootstrap +"/******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; function notMinified() { // eslint-disable-next-line no-console