@wordpress/editor 14.38.0 → 14.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/document-bar/useEditedSectionDetails.cjs +0 -3
- package/build/components/document-bar/useEditedSectionDetails.cjs.map +2 -2
- package/build/components/editor-interface/index.cjs +33 -9
- package/build/components/editor-interface/index.cjs.map +2 -2
- package/build/components/header/header-skeleton.cjs +100 -0
- package/build/components/header/header-skeleton.cjs.map +7 -0
- package/build/components/header/index.cjs +63 -106
- package/build/components/header/index.cjs.map +3 -3
- package/build/components/media/index.cjs +44 -0
- package/build/components/media/index.cjs.map +7 -0
- package/build/components/media/metadata-panel.cjs +96 -0
- package/build/components/media/metadata-panel.cjs.map +7 -0
- package/build/components/media/preview.cjs +39 -0
- package/build/components/media/preview.cjs.map +7 -0
- package/build/components/more-menu/index.cjs +3 -2
- package/build/components/more-menu/index.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +33 -4
- package/build/components/post-card-panel/index.cjs.map +3 -3
- package/build/components/post-content-information/index.cjs +9 -0
- package/build/components/post-content-information/index.cjs.map +2 -2
- package/build/components/post-last-edited-panel/index.cjs +5 -6
- package/build/components/post-last-edited-panel/index.cjs.map +2 -2
- package/build/components/post-last-revision/index.cjs +5 -7
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +6 -1
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs +8 -3
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs.map +2 -2
- package/build/components/post-revisions-preview/index.cjs +44 -0
- package/build/components/post-revisions-preview/index.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs +82 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-header.cjs +119 -0
- package/build/components/post-revisions-preview/revisions-header.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs +110 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +7 -0
- package/build/components/post-saved-state/index.cjs +8 -2
- package/build/components/post-saved-state/index.cjs.map +2 -2
- package/build/components/post-title/index.cjs +5 -4
- package/build/components/post-title/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +19 -0
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +2 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
- package/build/components/revision-author-panel/index.cjs +59 -0
- package/build/components/revision-author-panel/index.cjs.map +7 -0
- package/build/components/revision-created-panel/index.cjs +47 -0
- package/build/components/revision-created-panel/index.cjs.map +7 -0
- package/build/components/sidebar/header.cjs +27 -12
- package/build/components/sidebar/header.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +36 -15
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +44 -19
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/start-page-options/index.cjs +1 -1
- package/build/components/start-page-options/index.cjs.map +2 -2
- package/build/dataviews/store/private-actions.cjs +47 -26
- package/build/dataviews/store/private-actions.cjs.map +3 -3
- package/build/store/constants.cjs +3 -0
- package/build/store/constants.cjs.map +2 -2
- package/build/store/private-actions.cjs +40 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +33 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +10 -0
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +3 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/store/utils/notice-builder.cjs +4 -0
- package/build/store/utils/notice-builder.cjs.map +2 -2
- package/build-module/components/document-bar/useEditedSectionDetails.mjs +0 -3
- package/build-module/components/document-bar/useEditedSectionDetails.mjs.map +2 -2
- package/build-module/components/editor-interface/index.mjs +33 -9
- package/build-module/components/editor-interface/index.mjs.map +2 -2
- package/build-module/components/header/header-skeleton.mjs +69 -0
- package/build-module/components/header/header-skeleton.mjs.map +7 -0
- package/build-module/components/header/index.mjs +65 -107
- package/build-module/components/header/index.mjs.map +2 -2
- package/build-module/components/media/index.mjs +8 -0
- package/build-module/components/media/index.mjs.map +7 -0
- package/build-module/components/media/metadata-panel.mjs +65 -0
- package/build-module/components/media/metadata-panel.mjs.map +7 -0
- package/build-module/components/media/preview.mjs +21 -0
- package/build-module/components/media/preview.mjs.map +7 -0
- package/build-module/components/more-menu/index.mjs +3 -2
- package/build-module/components/more-menu/index.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +35 -5
- package/build-module/components/post-card-panel/index.mjs.map +3 -3
- package/build-module/components/post-content-information/index.mjs +9 -0
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-last-edited-panel/index.mjs +5 -6
- package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
- package/build-module/components/post-last-revision/index.mjs +6 -8
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +6 -1
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs +8 -3
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/index.mjs +8 -0
- package/build-module/components/post-revisions-preview/index.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +54 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs +92 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +89 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +7 -0
- package/build-module/components/post-saved-state/index.mjs +8 -2
- package/build-module/components/post-saved-state/index.mjs.map +2 -2
- package/build-module/components/post-title/index.mjs +5 -4
- package/build-module/components/post-title/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +19 -0
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +2 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/revision-author-panel/index.mjs +28 -0
- package/build-module/components/revision-author-panel/index.mjs.map +7 -0
- package/build-module/components/revision-created-panel/index.mjs +26 -0
- package/build-module/components/revision-created-panel/index.mjs.map +7 -0
- package/build-module/components/sidebar/header.mjs +22 -7
- package/build-module/components/sidebar/header.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +38 -16
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +48 -20
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/start-page-options/index.mjs +2 -1
- package/build-module/components/start-page-options/index.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +59 -27
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/constants.mjs +2 -0
- package/build-module/store/constants.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +38 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +29 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +9 -0
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +4 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/store/utils/notice-builder.mjs +4 -0
- package/build-module/store/utils/notice-builder.mjs.map +2 -2
- package/build-style/style-rtl.css +182 -16
- package/build-style/style.css +182 -16
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/header/header-skeleton.d.ts +17 -0
- package/build-types/components/header/header-skeleton.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/media/index.d.ts +3 -0
- package/build-types/components/media/index.d.ts.map +1 -0
- package/build-types/components/media/metadata-panel.d.ts +12 -0
- package/build-types/components/media/metadata-panel.d.ts.map +1 -0
- package/build-types/components/media/preview.d.ts +9 -0
- package/build-types/components/media/preview.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +3 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/index.d.ts +3 -0
- package/build-types/components/post-revisions-preview/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +7 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/revision-author-panel/index.d.ts +2 -0
- package/build-types/components/revision-author-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-created-panel/index.d.ts +2 -0
- package/build-types/components/revision-created-panel/index.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +1 -0
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +13 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +25 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +11 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/package.json +42 -40
- package/src/components/document-bar/useEditedSectionDetails.js +0 -5
- package/src/components/editor-interface/index.js +39 -9
- package/src/components/header/header-skeleton.js +90 -0
- package/src/components/header/index.js +69 -102
- package/src/components/header/style.scss +4 -0
- package/src/components/media/index.js +2 -0
- package/src/components/media/metadata-panel.js +77 -0
- package/src/components/media/preview.js +35 -0
- package/src/components/more-menu/index.js +2 -1
- package/src/components/post-card-panel/index.js +43 -7
- package/src/components/post-content-information/index.js +11 -0
- package/src/components/post-last-edited-panel/index.js +8 -9
- package/src/components/post-last-revision/index.js +7 -8
- package/src/components/post-publish-button/label.js +9 -0
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +13 -5
- package/src/components/post-revisions-preview/index.js +2 -0
- package/src/components/post-revisions-preview/revisions-canvas.js +73 -0
- package/src/components/post-revisions-preview/revisions-header.js +108 -0
- package/src/components/post-revisions-preview/revisions-slider.js +123 -0
- package/src/components/post-revisions-preview/style.scss +22 -0
- package/src/components/post-saved-state/index.js +8 -0
- package/src/components/post-title/index.js +4 -3
- package/src/components/provider/index.js +26 -0
- package/src/components/provider/use-block-editor-settings.js +2 -3
- package/src/components/revision-author-panel/index.js +36 -0
- package/src/components/revision-created-panel/index.js +36 -0
- package/src/components/sidebar/header.js +35 -14
- package/src/components/sidebar/index.js +40 -13
- package/src/components/sidebar/post-summary.js +45 -11
- package/src/components/sidebar/style.scss +7 -0
- package/src/components/start-page-options/index.js +2 -0
- package/src/dataviews/store/private-actions.ts +79 -33
- package/src/store/constants.ts +1 -0
- package/src/store/private-actions.js +70 -0
- package/src/store/private-selectors.js +54 -0
- package/src/store/reducer.js +17 -0
- package/src/store/selectors.js +6 -0
- package/src/store/test/selectors.js +7 -0
- package/src/store/utils/notice-builder.js +9 -0
- package/src/style.scss +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/more-menu/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\ttoggleDistractionFree( {\n\t\t\t\t\t\t\t\t\t\tcreateNotice: false,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Panels' ) }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,uBAAuB;AAChC,SAAS,UAAU,oBAAoB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,SAAS,gBAAgB,kBAAkB;AAKpD,OAAO,yBAAyB;AAChC,OAAO,kBAAkB;AACzB,OAAO,wBAAwB;AAC/B,OAAO,uBAAuB;AAC9B,SAAS,SAAS,mBAAmB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu( { disabled = false } ) {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t\tdisabled,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\ttoggleDistractionFree( {\n\t\t\t\t\t\t\t\t\t\tcreateNotice: false,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Panels' ) }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,uBAAuB;AAChC,SAAS,UAAU,oBAAoB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AAC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aAAI,sBAAuB;AAAA,iBAE7B;AAAA;AAAA;AAAA,UACD;AAAA,UACA;AAAA,YAAC,mBAAmB;AAAA,YAAnB;AAAA,cACA,WAAY,EAAE,QAAQ;AAAA;AAAA,UACvB;AAAA,WACD;AAAA,QACA,oBAAC,aACA;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,MACT,UAAW,oBAAqB;AAAA,YAG/B,aAAI,aAAc;AAAA;AAAA,QACrB,GACD;AAAA,SACD;AAAA;AAAA,EAEF,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// packages/editor/src/components/post-card-panel/index.js
|
|
2
2
|
import {
|
|
3
3
|
Icon,
|
|
4
|
+
Button,
|
|
4
5
|
__experimentalHStack as HStack,
|
|
5
6
|
__experimentalVStack as VStack,
|
|
6
7
|
__experimentalText as Text,
|
|
7
8
|
privateApis as componentsPrivateApis
|
|
8
9
|
} from "@wordpress/components";
|
|
10
|
+
import { moreVertical } from "@wordpress/icons";
|
|
9
11
|
import { store as coreStore } from "@wordpress/core-data";
|
|
10
12
|
import { useSelect } from "@wordpress/data";
|
|
11
13
|
import { useMemo } from "@wordpress/element";
|
|
@@ -20,7 +22,7 @@ import { unlock } from "../../lock-unlock.mjs";
|
|
|
20
22
|
import PostActions from "../post-actions/index.mjs";
|
|
21
23
|
import usePageTypeBadge from "../../utils/pageTypeBadge.mjs";
|
|
22
24
|
import { getTemplateInfo } from "../../utils/get-template-info.mjs";
|
|
23
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
26
|
var { Badge } = unlock(componentsPrivateApis);
|
|
25
27
|
function PostCardPanel({
|
|
26
28
|
postType,
|
|
@@ -31,11 +33,29 @@ function PostCardPanel({
|
|
|
31
33
|
() => Array.isArray(postId) ? postId : [postId],
|
|
32
34
|
[postId]
|
|
33
35
|
);
|
|
34
|
-
const { postTitle, icon, labels } = useSelect(
|
|
36
|
+
const { postTitle, icon, labels, isRevision } = useSelect(
|
|
35
37
|
(select) => {
|
|
36
38
|
const { getEditedEntityRecord, getCurrentTheme, getPostType } = select(coreStore);
|
|
37
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
getPostIcon,
|
|
41
|
+
getCurrentPostType,
|
|
42
|
+
isRevisionsMode,
|
|
43
|
+
getCurrentRevision
|
|
44
|
+
} = unlock(select(editorStore));
|
|
38
45
|
let _title = "";
|
|
46
|
+
if (isRevisionsMode()) {
|
|
47
|
+
const parentPostType = getCurrentPostType();
|
|
48
|
+
const _record2 = getCurrentRevision();
|
|
49
|
+
_title = _record2?.title?.rendered || _record2?.title?.raw || "";
|
|
50
|
+
return {
|
|
51
|
+
postTitle: _title,
|
|
52
|
+
icon: getPostIcon(parentPostType, {
|
|
53
|
+
area: _record2?.area
|
|
54
|
+
}),
|
|
55
|
+
labels: getPostType(parentPostType)?.labels,
|
|
56
|
+
isRevision: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
39
59
|
const _record = getEditedEntityRecord(
|
|
40
60
|
"postType",
|
|
41
61
|
postType,
|
|
@@ -96,14 +116,24 @@ function PostCardPanel({
|
|
|
96
116
|
]
|
|
97
117
|
}
|
|
98
118
|
),
|
|
99
|
-
postIds.length === 1 && /* @__PURE__ */ jsx(
|
|
119
|
+
postIds.length === 1 && /* @__PURE__ */ jsx(Fragment, { children: isRevision ? /* @__PURE__ */ jsx(
|
|
120
|
+
Button,
|
|
121
|
+
{
|
|
122
|
+
size: "small",
|
|
123
|
+
icon: moreVertical,
|
|
124
|
+
label: __("Actions"),
|
|
125
|
+
disabled: true,
|
|
126
|
+
accessibleWhenDisabled: true,
|
|
127
|
+
className: "editor-all-actions-button"
|
|
128
|
+
}
|
|
129
|
+
) : /* @__PURE__ */ jsx(
|
|
100
130
|
PostActions,
|
|
101
131
|
{
|
|
102
132
|
postType,
|
|
103
133
|
postId: postIds[0],
|
|
104
134
|
onActionPerformed
|
|
105
135
|
}
|
|
106
|
-
)
|
|
136
|
+
) })
|
|
107
137
|
]
|
|
108
138
|
}
|
|
109
139
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-card-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.\n *\n * @param {Object} props - Component props.\n * @param {string} [props.postType] - The post type string.\n * @param {string|string[]} [props.postId] - The post id or list of post ids.\n * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst postIds = useMemo(\n\t\t() => ( Array.isArray( postId ) ? postId : [ postId ] ),\n\t\t[ postId ]\n\t);\n\tconst { postTitle, icon, labels } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getCurrentTheme, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst {
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,eAAe;AAAA,OACT;AACP,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,IAAI,eAAe;AAC5B,SAAS,uBAAuB,iBAAiB;AAKjD,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AACvB,OAAO,iBAAiB;AACxB,OAAO,sBAAsB;AAC7B,SAAS,uBAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.\n *\n * @param {Object} props - Component props.\n * @param {string} [props.postType] - The post type string.\n * @param {string|string[]} [props.postId] - The post id or list of post ids.\n * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst postIds = useMemo(\n\t\t() => ( Array.isArray( postId ) ? postId : [ postId ] ),\n\t\t[ postId ]\n\t);\n\tconst { postTitle, icon, labels, isRevision } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getCurrentTheme, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst {\n\t\t\t\tgetPostIcon,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tisRevisionsMode,\n\t\t\t\tgetCurrentRevision,\n\t\t\t} = unlock( select( editorStore ) );\n\t\t\tlet _title = '';\n\n\t\t\t// In revisions mode, use the current revision.\n\t\t\tif ( isRevisionsMode() ) {\n\t\t\t\tconst parentPostType = getCurrentPostType();\n\t\t\t\tconst _record = getCurrentRevision();\n\t\t\t\t_title = _record?.title?.rendered || _record?.title?.raw || '';\n\t\t\t\treturn {\n\t\t\t\t\tpostTitle: _title,\n\t\t\t\t\ticon: getPostIcon( parentPostType, {\n\t\t\t\t\t\tarea: _record?.area,\n\t\t\t\t\t} ),\n\t\t\t\t\tlabels: getPostType( parentPostType )?.labels,\n\t\t\t\t\tisRevision: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostIds[ 0 ]\n\t\t\t);\n\t\t\tif ( postIds.length === 1 ) {\n\t\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\t\tconst _templateInfo = [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t].includes( postType )\n\t\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\t\ttemplate: _record,\n\t\t\t\t\t\t\ttemplateTypes,\n\t\t\t\t\t } )\n\t\t\t\t\t: {};\n\t\t\t\t_title = _templateInfo?.title || _record?.title;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpostTitle: _title,\n\t\t\t\ticon: getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t};\n\t\t},\n\t\t[ postIds, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\tlet title = __( 'No title' );\n\tif ( labels?.name && postIds.length > 1 ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: %1$d number of selected items %2$s: Name of the plural post type e.g: \"Posts\".\n\t\t\t__( '%1$d %2$s' ),\n\t\t\tpostIds.length,\n\t\t\tlabels?.name\n\t\t);\n\t} else if ( postTitle ) {\n\t\ttitle = stripHTML( postTitle );\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 } className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talignment=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"editor-post-card-panel__title-name\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t{ pageTypeBadge && postIds.length === 1 && (\n\t\t\t\t\t\t<Badge>{ pageTypeBadge }</Badge>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t{ postIds.length === 1 && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isRevision ? (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tpostId={ postIds[ 0 ] }\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ postIds.length > 1 && (\n\t\t\t\t<Text className=\"editor-post-card-panel__description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t\t\t\t__( 'Changes will be applied to all selected %s.' ),\n\t\t\t\t\t\tlabels?.name.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,eAAe;AAAA,OACT;AACP,SAAS,oBAAoB;AAC7B,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,IAAI,eAAe;AAC5B,SAAS,uBAAuB,iBAAiB;AAKjD,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AACvB,OAAO,iBAAiB;AACxB,OAAO,sBAAsB;AAC7B,SAAS,uBAAuB;AAoG5B,SAeC,UAfD,KACA,YADA;AAnGJ,IAAM,EAAE,MAAM,IAAI,OAAQ,qBAAsB;AAWjC,SAAR,cAAgC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,UAAU;AAAA,IACf,MAAQ,MAAM,QAAS,MAAO,IAAI,SAAS,C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
|
|
7
7
|
import { store as coreStore } from "@wordpress/core-data";
|
|
8
8
|
import { store as editorStore } from "../../store/index.mjs";
|
|
9
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
9
10
|
import {
|
|
10
11
|
TEMPLATE_POST_TYPE,
|
|
11
12
|
TEMPLATE_PART_POST_TYPE
|
|
@@ -15,6 +16,14 @@ var AVERAGE_READING_RATE = 189;
|
|
|
15
16
|
function PostContentInformation() {
|
|
16
17
|
const { postContent } = useSelect((select) => {
|
|
17
18
|
const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } = select(editorStore);
|
|
19
|
+
const { getCurrentRevision, isRevisionsMode } = unlock(
|
|
20
|
+
select(editorStore)
|
|
21
|
+
);
|
|
22
|
+
if (isRevisionsMode()) {
|
|
23
|
+
return {
|
|
24
|
+
postContent: getCurrentRevision()?.content?.raw
|
|
25
|
+
};
|
|
26
|
+
}
|
|
18
27
|
const { canUser } = select(coreStore);
|
|
19
28
|
const { getEntityRecord } = select(coreStore);
|
|
20
29
|
const siteSettings = canUser("read", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-content-information/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\n// This component renders the wordcount and reading time for the post.\nexport default function PostContentInformation() {\n\tconst { postContent } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst postType = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst isPostsPage = +_id === siteSettings?.page_for_posts;\n\t\tconst showPostContentInfo =\n\t\t\t! isPostsPage &&\n\t\t\t! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\treturn {\n\t\t\tpostContent:\n\t\t\t\tshowPostContentInfo && getEditedPostAttribute( 'content' ),\n\t\t};\n\t}, [] );\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = useMemo(\n\t\t() => ( postContent ? wordCount( postContent, wordCountType ) : 0 ),\n\t\t[ postContent, wordCountType ]\n\t);\n\tif ( ! wordsCounted ) {\n\t\treturn null;\n\t}\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\tconst wordsCountText = sprintf(\n\t\t// translators: %s: the number of words in the post.\n\t\t_n( '%s word', '%s words', wordsCounted ),\n\t\twordsCounted.toLocaleString()\n\t);\n\tconst minutesText =\n\t\treadingTime <= 1\n\t\t\t? __( '1 minute' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t_n( '%s minute', '%s minutes', readingTime ),\n\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t );\n\treturn (\n\t\t<div className=\"editor-post-content-information\">\n\t\t\t<Text>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */\n\t\t\t\t\t__( '%1$s, %2$s read time.' ),\n\t\t\t\t\twordsCountText,\n\t\t\t\t\tminutesText\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,sBAAsB,YAAY;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,IAAI,IAAI,IAAI,eAAe;AACpC,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe;AACxB,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\n// This component renders the wordcount and reading time for the post.\nexport default function PostContentInformation() {\n\tconst { postContent } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =\n\t\t\tselect( editorStore );\n\t\tconst { getCurrentRevision, isRevisionsMode } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\n\t\tif ( isRevisionsMode() ) {\n\t\t\treturn {\n\t\t\t\tpostContent: getCurrentRevision()?.content?.raw,\n\t\t\t};\n\t\t}\n\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst postType = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst isPostsPage = +_id === siteSettings?.page_for_posts;\n\t\tconst showPostContentInfo =\n\t\t\t! isPostsPage &&\n\t\t\t! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\treturn {\n\t\t\tpostContent:\n\t\t\t\tshowPostContentInfo && getEditedPostAttribute( 'content' ),\n\t\t};\n\t}, [] );\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = useMemo(\n\t\t() => ( postContent ? wordCount( postContent, wordCountType ) : 0 ),\n\t\t[ postContent, wordCountType ]\n\t);\n\tif ( ! wordsCounted ) {\n\t\treturn null;\n\t}\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\tconst wordsCountText = sprintf(\n\t\t// translators: %s: the number of words in the post.\n\t\t_n( '%s word', '%s words', wordsCounted ),\n\t\twordsCounted.toLocaleString()\n\t);\n\tconst minutesText =\n\t\treadingTime <= 1\n\t\t\t? __( '1 minute' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t_n( '%s minute', '%s minutes', readingTime ),\n\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t );\n\treturn (\n\t\t<div className=\"editor-post-content-information\">\n\t\t\t<Text>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */\n\t\t\t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CAAqC;AACxE,QAAM,eAAe;AAAA,IACpB,MAAQ,cAAc,UAAW,aAAa,aAAc,IAAI;AAAA,IAChE,CAAE,aAAa,aAAc;AAAA,EAC9B;AACA,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AACA,QAAM,cAAc,KAAK,MAAO,eAAe,oBAAqB;AACpE,QAAM,iBAAiB;AAAA;AAAA,IAEtB,GAAI,WAAW,YAAY,YAAa;AAAA,IACxC,aAAa,eAAe;AAAA,EAC7B;AACA,QAAM,cACL,eAAe,IACZ,GAAI,UAAW,IACf;AAAA;AAAA,IAEA,GAAI,aAAa,cAAc,WAAY;AAAA,IAC3C,YAAY,eAAe;AAAA,EAC3B;AACJ,SACC,oBAAC,SAAI,WAAU,mCACd,8BAAC,QACE;AAAA;AAAA,IAED,GAAI,uBAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,EACD,GACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,15 +10,14 @@ function PostLastEditedPanel() {
|
|
|
10
10
|
(select) => select(editorStore).getEditedPostAttribute("modified"),
|
|
11
11
|
[]
|
|
12
12
|
);
|
|
13
|
-
|
|
13
|
+
if (!modified) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ jsx(Text, { children: sprintf(
|
|
14
17
|
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
15
18
|
__("Last edited %s."),
|
|
16
19
|
humanTimeDiff(modified)
|
|
17
|
-
);
|
|
18
|
-
if (!lastEditedText) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
return /* @__PURE__ */ jsx("div", { className: "editor-post-last-edited-panel", children: /* @__PURE__ */ jsx(Text, { children: lastEditedText }) });
|
|
20
|
+
) }) });
|
|
22
21
|
}
|
|
23
22
|
export {
|
|
24
23
|
PostLastEditedPanel as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-last-edited-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLastEditedPanel() {\n\tconst modified = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'modified' ),\n\t\t[]\n\t);\n\
|
|
5
|
-
"mappings": ";AAGA,SAAS,sBAAsB,YAAY;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAK9B,SAAS,SAAS,mBAAmB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLastEditedPanel() {\n\tconst modified = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'modified' ),\n\t\t[]\n\t);\n\tif ( ! modified ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<div className=\"editor-post-last-edited-panel\">\n\t\t\t<Text>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t__( 'Last edited %s.' ),\n\t\t\t\t\thumanTimeDiff( modified )\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,sBAAsB,YAAY;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAK9B,SAAS,SAAS,mBAAmB;AAalC;AAXY,SAAR,sBAAuC;AAC7C,QAAM,WAAW;AAAA,IAChB,CAAE,WACD,OAAQ,WAAY,EAAE,uBAAwB,UAAW;AAAA,IAC1D,CAAC;AAAA,EACF;AACA,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AACA,SACC,oBAAC,SAAI,WAAU,iCACd,8BAAC,QACE;AAAA;AAAA,IAED,GAAI,iBAAkB;AAAA,IACtB,cAAe,QAAS;AAAA,EACzB,GACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// packages/editor/src/components/post-last-revision/index.js
|
|
2
2
|
import { sprintf, __ } from "@wordpress/i18n";
|
|
3
3
|
import { Button } from "@wordpress/components";
|
|
4
|
-
import { useSelect } from "@wordpress/data";
|
|
4
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
5
5
|
import { backup } from "@wordpress/icons";
|
|
6
|
-
import { addQueryArgs } from "@wordpress/url";
|
|
7
6
|
import PostLastRevisionCheck from "./check.mjs";
|
|
8
7
|
import PostPanelRow from "../post-panel-row/index.mjs";
|
|
9
8
|
import { store as editorStore } from "../../store/index.mjs";
|
|
9
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
function usePostLastRevisionInfo() {
|
|
12
12
|
return useSelect((select) => {
|
|
@@ -19,13 +19,12 @@ function usePostLastRevisionInfo() {
|
|
|
19
19
|
}
|
|
20
20
|
function PostLastRevision() {
|
|
21
21
|
const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
|
|
22
|
+
const { setCurrentRevisionId } = unlock(useDispatch(editorStore));
|
|
22
23
|
return /* @__PURE__ */ jsx(PostLastRevisionCheck, { children: /* @__PURE__ */ jsx(
|
|
23
24
|
Button,
|
|
24
25
|
{
|
|
25
26
|
__next40pxDefaultSize: true,
|
|
26
|
-
|
|
27
|
-
revision: lastRevisionId
|
|
28
|
-
}),
|
|
27
|
+
onClick: () => setCurrentRevisionId(lastRevisionId),
|
|
29
28
|
className: "editor-post-last-revision__title",
|
|
30
29
|
icon: backup,
|
|
31
30
|
iconPosition: "right",
|
|
@@ -39,12 +38,11 @@ function PostLastRevision() {
|
|
|
39
38
|
}
|
|
40
39
|
function PrivatePostLastRevision() {
|
|
41
40
|
const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
|
|
41
|
+
const { setCurrentRevisionId } = unlock(useDispatch(editorStore));
|
|
42
42
|
return /* @__PURE__ */ jsx(PostLastRevisionCheck, { children: /* @__PURE__ */ jsx(PostPanelRow, { label: __("Revisions"), children: /* @__PURE__ */ jsx(
|
|
43
43
|
Button,
|
|
44
44
|
{
|
|
45
|
-
|
|
46
|
-
revision: lastRevisionId
|
|
47
|
-
}),
|
|
45
|
+
onClick: () => setCurrentRevisionId(lastRevisionId),
|
|
48
46
|
className: "editor-private-post-last-revision__button",
|
|
49
47
|
text: revisionsCount,
|
|
50
48
|
variant: "tertiary",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-last-revision/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\
|
|
5
|
-
"mappings": ";AAGA,SAAS,SAAS,UAAU;AAC5B,SAAS,cAAc;AACvB,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => setCurrentRevisionId( lastRevisionId ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n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
|
@@ -3,6 +3,7 @@ import { __ } from "@wordpress/i18n";
|
|
|
3
3
|
import { useSelect } from "@wordpress/data";
|
|
4
4
|
import { useViewportMatch } from "@wordpress/compose";
|
|
5
5
|
import { store as editorStore } from "../../store/index.mjs";
|
|
6
|
+
import { ATTACHMENT_POST_TYPE } from "../../store/constants.mjs";
|
|
6
7
|
function PublishButtonLabel() {
|
|
7
8
|
const isSmallerThanMediumViewport = useViewportMatch("medium", "<");
|
|
8
9
|
const {
|
|
@@ -14,7 +15,8 @@ function PublishButtonLabel() {
|
|
|
14
15
|
isAutosaving,
|
|
15
16
|
hasNonPostEntityChanges,
|
|
16
17
|
postStatusHasChanged,
|
|
17
|
-
postStatus
|
|
18
|
+
postStatus,
|
|
19
|
+
postType
|
|
18
20
|
} = useSelect((select) => {
|
|
19
21
|
const {
|
|
20
22
|
isCurrentPostPublished,
|
|
@@ -46,6 +48,9 @@ function PublishButtonLabel() {
|
|
|
46
48
|
return __("Saving\u2026");
|
|
47
49
|
}
|
|
48
50
|
if (!hasPublishAction) {
|
|
51
|
+
if (postType === ATTACHMENT_POST_TYPE && window?.__experimentalMediaEditor) {
|
|
52
|
+
return __("Save");
|
|
53
|
+
}
|
|
49
54
|
return isSmallerThanMediumViewport ? __("Publish") : __("Submit for Review");
|
|
50
55
|
}
|
|
51
56
|
if (hasNonPostEntityChanges || isPublished || postStatusHasChanged && !["future", "publish"].includes(postStatus) || !postStatusHasChanged && postStatus === "future") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-button/label.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the label for the publish button.\n *\n * @return {string} The label for the publish button.\n */\nexport default function PublishButtonLabel() {\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\tisPublished,\n\t\tisBeingScheduled,\n\t\tisSaving,\n\t\tisPublishing,\n\t\thasPublishAction,\n\t\tisAutosaving,\n\t\thasNonPostEntityChanges,\n\t\tpostStatusHasChanged,\n\t\tpostStatus,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tisAutosavingPost,\n\t\t\tgetPostEdits,\n\t\t\tgetEditedPostAttribute,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing\u2026' );\n\t} else if (\n\t\t( isPublished || isBeingScheduled ) &&\n\t\tisSaving &&\n\t\t! isAutosaving\n\t) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Saving\u2026' );\n\t}\n\tif ( ! hasPublishAction ) {\n\t\t// TODO: this is because \"Submit for review\" string is too long in some languages.\n\t\t// @see https://github.com/WordPress/gutenberg/issues/10475\n\t\treturn isSmallerThanMediumViewport\n\t\t\t? __( 'Publish' )\n\t\t\t: __( 'Submit for Review' );\n\t}\n\tif (\n\t\thasNonPostEntityChanges ||\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( ! postStatusHasChanged && postStatus === 'future' )\n\t) {\n\t\treturn __( 'Save' );\n\t}\n\tif ( isBeingScheduled ) {\n\t\treturn __( 'Schedule' );\n\t}\n\treturn __( 'Publish' );\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAKjC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,qBAAsC;AAC5C,QAAM,8BAA8B,iBAAkB,UAAU,GAAI;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,WAAY;AACxB,WAAO;AAAA,MACN,aAAa,uBAAuB;AAAA,MACpC,kBAAkB,2BAA2B;AAAA,MAC7C,UAAU,aAAa;AAAA,MACvB,cAAc,iBAAiB;AAAA,MAC/B,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,UAAU,mBAAmB;AAAA,MAC7B,cAAc,iBAAiB;AAAA,MAC/B,yBACC,OAAQ,WAAY,EAAE,wBAAwB;AAAA,MAC/C,sBAAsB,CAAC,CAAE,aAAa,GAAG;AAAA,MACzC,YAAY,uBAAwB,QAAS;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,cAAe;AAEnB,WAAO,GAAI,kBAAc;AAAA,EAC1B,YACG,eAAe,qBACjB,YACA,CAAE,cACD;AAED,WAAO,GAAI,cAAU;AAAA,EACtB;AACA,MAAK,CAAE,kBAAmB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE } from '../../store/constants';\n\n/**\n * Renders the label for the publish button.\n *\n * @return {string} The label for the publish button.\n */\nexport default function PublishButtonLabel() {\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\tisPublished,\n\t\tisBeingScheduled,\n\t\tisSaving,\n\t\tisPublishing,\n\t\thasPublishAction,\n\t\tisAutosaving,\n\t\thasNonPostEntityChanges,\n\t\tpostStatusHasChanged,\n\t\tpostStatus,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisSavingPost,\n\t\t\tisPublishingPost,\n\t\t\tgetCurrentPost,\n\t\t\tgetCurrentPostType,\n\t\t\tisAutosavingPost,\n\t\t\tgetPostEdits,\n\t\t\tgetEditedPostAttribute,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisSaving: isSavingPost(),\n\t\t\tisPublishing: isPublishingPost(),\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t};\n\t}, [] );\n\tif ( isPublishing ) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Publishing\u2026' );\n\t} else if (\n\t\t( isPublished || isBeingScheduled ) &&\n\t\tisSaving &&\n\t\t! isAutosaving\n\t) {\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\treturn __( 'Saving\u2026' );\n\t}\n\tif ( ! hasPublishAction ) {\n\t\t// For attachments, always show \"Save\" since they don't have a publish workflow\n\t\tif (\n\t\t\tpostType === ATTACHMENT_POST_TYPE &&\n\t\t\twindow?.__experimentalMediaEditor\n\t\t) {\n\t\t\treturn __( 'Save' );\n\t\t}\n\t\t// TODO: this is because \"Submit for review\" string is too long in some languages.\n\t\t// @see https://github.com/WordPress/gutenberg/issues/10475\n\t\treturn isSmallerThanMediumViewport\n\t\t\t? __( 'Publish' )\n\t\t\t: __( 'Submit for Review' );\n\t}\n\tif (\n\t\thasNonPostEntityChanges ||\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( ! postStatusHasChanged && postStatus === 'future' )\n\t) {\n\t\treturn __( 'Save' );\n\t}\n\tif ( isBeingScheduled ) {\n\t\treturn __( 'Schedule' );\n\t}\n\treturn __( 'Publish' );\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB;AAKjC,SAAS,SAAS,mBAAmB;AACrC,SAAS,4BAA4B;AAOtB,SAAR,qBAAsC;AAC5C,QAAM,8BAA8B,iBAAkB,UAAU,GAAI;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,WAAY;AACxB,WAAO;AAAA,MACN,aAAa,uBAAuB;AAAA,MACpC,kBAAkB,2BAA2B;AAAA,MAC7C,UAAU,aAAa;AAAA,MACvB,cAAc,iBAAiB;AAAA,MAC/B,kBACC,eAAe,EAAE,SAAU,mBAAoB,KAAK;AAAA,MACrD,UAAU,mBAAmB;AAAA,MAC7B,cAAc,iBAAiB;AAAA,MAC/B,yBACC,OAAQ,WAAY,EAAE,wBAAwB;AAAA,MAC/C,sBAAsB,CAAC,CAAE,aAAa,GAAG;AAAA,MACzC,YAAY,uBAAwB,QAAS;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,cAAe;AAEnB,WAAO,GAAI,kBAAc;AAAA,EAC1B,YACG,eAAe,qBACjB,YACA,CAAE,cACD;AAED,WAAO,GAAI,cAAU;AAAA,EACtB;AACA,MAAK,CAAE,kBAAmB;AAEzB,QACC,aAAa,wBACb,QAAQ,2BACP;AACD,aAAO,GAAI,MAAO;AAAA,IACnB;AAGA,WAAO,8BACJ,GAAI,SAAU,IACd,GAAI,mBAAoB;AAAA,EAC5B;AACA,MACC,2BACA,eACE,wBACD,CAAE,CAAE,UAAU,SAAU,EAAE,SAAU,UAAW,KAC9C,CAAE,wBAAwB,eAAe,UAC1C;AACD,WAAO,GAAI,MAAO;AAAA,EACnB;AACA,MAAK,kBAAmB;AACvB,WAAO,GAAI,UAAW;AAAA,EACvB;AACA,SAAO,GAAI,SAAU;AACtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import { useViewportMatch } from "@wordpress/compose";
|
|
|
3
3
|
import { useDispatch, useSelect } from "@wordpress/data";
|
|
4
4
|
import PostPublishButton from "./index.mjs";
|
|
5
5
|
import { store as editorStore } from "../../store/index.mjs";
|
|
6
|
+
import { ATTACHMENT_POST_TYPE } from "../../store/constants.mjs";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
var IS_TOGGLE = "toggle";
|
|
8
9
|
var IS_BUTTON = "button";
|
|
@@ -22,7 +23,8 @@ function PostPublishButtonOrToggle({
|
|
|
22
23
|
isPublishSidebarOpened,
|
|
23
24
|
isScheduled,
|
|
24
25
|
postStatus,
|
|
25
|
-
postStatusHasChanged
|
|
26
|
+
postStatusHasChanged,
|
|
27
|
+
postType
|
|
26
28
|
} = useSelect((select) => {
|
|
27
29
|
return {
|
|
28
30
|
hasPublishAction: !!select(editorStore).getCurrentPost()?._links?.["wp:action-publish"],
|
|
@@ -33,10 +35,13 @@ function PostPublishButtonOrToggle({
|
|
|
33
35
|
isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
|
|
34
36
|
isScheduled: select(editorStore).isCurrentPostScheduled(),
|
|
35
37
|
postStatus: select(editorStore).getEditedPostAttribute("status"),
|
|
36
|
-
postStatusHasChanged: select(editorStore).getPostEdits()?.status
|
|
38
|
+
postStatusHasChanged: select(editorStore).getPostEdits()?.status,
|
|
39
|
+
postType: select(editorStore).getCurrentPostType()
|
|
37
40
|
};
|
|
38
41
|
}, []);
|
|
39
|
-
if (
|
|
42
|
+
if (postType === ATTACHMENT_POST_TYPE) {
|
|
43
|
+
component = IS_BUTTON;
|
|
44
|
+
} else if (isPublished || postStatusHasChanged && !["future", "publish"].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
|
|
40
45
|
component = IS_BUTTON;
|
|
41
46
|
} else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
|
|
42
47
|
component = IS_TOGGLE;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/post-publish-button/post-publish-button-or-toggle.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\n\nconst IS_TOGGLE = 'toggle';\nconst IS_BUTTON = 'button';\n\nexport default function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tlet component;\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst { togglePublishSidebar } = useDispatch( editorStore );\n\tconst {\n\t\thasPublishAction,\n\t\tisBeingScheduled,\n\t\tisPending,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisPublishSidebarOpened,\n\t\tisScheduled,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\t!! select( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t\t'wp:action-publish'\n\t\t\t\t],\n\t\t\tisBeingScheduled:\n\t\t\t\tselect( editorStore ).isEditedPostBeingScheduled(),\n\t\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t *
|
|
5
|
-
"mappings": ";AAGA,SAAS,wBAAwB;AACjC,SAAS,aAAa,iBAAiB;AAKvC,OAAO,uBAAuB;AAC9B,SAAS,SAAS,mBAAmB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from './index';\nimport { store as editorStore } from '../../store';\nimport { ATTACHMENT_POST_TYPE } from '../../store/constants';\n\nconst IS_TOGGLE = 'toggle';\nconst IS_BUTTON = 'button';\n\nexport default function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tlet component;\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tconst { togglePublishSidebar } = useDispatch( editorStore );\n\tconst {\n\t\thasPublishAction,\n\t\tisBeingScheduled,\n\t\tisPending,\n\t\tisPublished,\n\t\tisPublishSidebarEnabled,\n\t\tisPublishSidebarOpened,\n\t\tisScheduled,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\t!! select( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t\t'wp:action-publish'\n\t\t\t\t],\n\t\t\tisBeingScheduled:\n\t\t\t\tselect( editorStore ).isEditedPostBeingScheduled(),\n\t\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) Attachments always show a BUTTON since they don't have a publish workflow\n\t * and should save directly without pre-publish checks.\n\t *\n\t * 2) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitly to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 3) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 4) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif ( postType === ATTACHMENT_POST_TYPE ) {\n\t\tcomponent = IS_BUTTON;\n\t} else if (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,wBAAwB;AACjC,SAAS,aAAa,iBAAiB;AAKvC,OAAO,uBAAuB;AAC9B,SAAS,SAAS,mBAAmB;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A,MACA,QAAS;AAAA,MACT,UAAW,cAAc;AAAA,MACzB,UAAW;AAAA,MACX;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// packages/editor/src/components/post-revisions-preview/index.js
|
|
2
|
+
import { default as default2 } from "./revisions-header.mjs";
|
|
3
|
+
import { default as default3 } from "./revisions-canvas.mjs";
|
|
4
|
+
export {
|
|
5
|
+
default3 as RevisionsCanvas,
|
|
6
|
+
default2 as RevisionsHeader
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/post-revisions-preview/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as RevisionsHeader } from './revisions-header';\nexport { default as RevisionsCanvas } from './revisions-canvas';\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAoB,WAAXA,gBAAkC;AAC3C,SAAoB,WAAXA,gBAAkC;",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// packages/editor/src/components/post-revisions-preview/revisions-canvas.js
|
|
2
|
+
import { Spinner } from "@wordpress/components";
|
|
3
|
+
import {
|
|
4
|
+
privateApis as blockEditorPrivateApis,
|
|
5
|
+
store as blockEditorStore
|
|
6
|
+
} from "@wordpress/block-editor";
|
|
7
|
+
import { createBlock, parse } from "@wordpress/blocks";
|
|
8
|
+
import { useSelect } from "@wordpress/data";
|
|
9
|
+
import { useMemo } from "@wordpress/element";
|
|
10
|
+
import { unlock } from "../../lock-unlock.mjs";
|
|
11
|
+
import { store as editorStore } from "../../store/index.mjs";
|
|
12
|
+
import VisualEditor from "../visual-editor/index.mjs";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var { ExperimentalBlockEditorProvider } = unlock(blockEditorPrivateApis);
|
|
15
|
+
function RevisionsCanvas() {
|
|
16
|
+
const { revision, postType, blockEditorSettings } = useSelect(
|
|
17
|
+
(select) => {
|
|
18
|
+
const { getCurrentRevision, getCurrentPostType } = unlock(
|
|
19
|
+
select(editorStore)
|
|
20
|
+
);
|
|
21
|
+
return {
|
|
22
|
+
revision: getCurrentRevision(),
|
|
23
|
+
postType: getCurrentPostType(),
|
|
24
|
+
blockEditorSettings: select(blockEditorStore).getSettings()
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[]
|
|
28
|
+
);
|
|
29
|
+
const blocks = useMemo(() => {
|
|
30
|
+
const parsedBlocks = parse(revision?.content?.raw ?? "");
|
|
31
|
+
if (postType === "wp_navigation") {
|
|
32
|
+
return [
|
|
33
|
+
createBlock(
|
|
34
|
+
"core/navigation",
|
|
35
|
+
{ templateLock: false },
|
|
36
|
+
parsedBlocks
|
|
37
|
+
)
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
return parsedBlocks;
|
|
41
|
+
}, [revision?.content?.raw, postType]);
|
|
42
|
+
const settings = useMemo(
|
|
43
|
+
() => ({
|
|
44
|
+
...blockEditorSettings,
|
|
45
|
+
isPreviewMode: true
|
|
46
|
+
}),
|
|
47
|
+
[blockEditorSettings]
|
|
48
|
+
);
|
|
49
|
+
return revision ? /* @__PURE__ */ jsx(ExperimentalBlockEditorProvider, { value: blocks, settings, children: /* @__PURE__ */ jsx(VisualEditor, {}) }) : /* @__PURE__ */ jsx("div", { className: "editor-revisions-canvas__loading", children: /* @__PURE__ */ jsx(Spinner, {}) });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
RevisionsCanvas as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=revisions-canvas.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/post-revisions-preview/revisions-canvas.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Spinner } from '@wordpress/components';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createBlock, parse } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport VisualEditor from '../visual-editor';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\n\n/**\n * Canvas component that renders a post revision in read-only mode.\n *\n * @return {JSX.Element} The revisions canvas component.\n */\nexport default function RevisionsCanvas() {\n\tconst { revision, postType, blockEditorSettings } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentRevision, getCurrentPostType } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\trevision: getCurrentRevision(),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tblockEditorSettings: select( blockEditorStore ).getSettings(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst blocks = useMemo( () => {\n\t\tconst parsedBlocks = parse( revision?.content?.raw ?? '' );\n\t\tif ( postType === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/navigation',\n\t\t\t\t\t{ templateLock: false },\n\t\t\t\t\tparsedBlocks\n\t\t\t\t),\n\t\t\t];\n\t\t}\n\t\treturn parsedBlocks;\n\t}, [ revision?.content?.raw, postType ] );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...blockEditorSettings,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ blockEditorSettings ]\n\t);\n\n\treturn revision ? (\n\t\t<ExperimentalBlockEditorProvider value={ blocks } settings={ settings }>\n\t\t\t<VisualEditor />\n\t\t</ExperimentalBlockEditorProvider>\n\t) : (\n\t\t<div className=\"editor-revisions-canvas__loading\">\n\t\t\t<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