@wordpress/editor 13.33.0 → 13.35.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 +12 -4
- package/README.md +132 -20
- package/build/bindings/pattern-overrides.js +70 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/components/autosave-monitor/index.js +15 -12
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build/components/character-count/index.js +5 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/collapsible-block-toolbar/index.js +73 -0
- package/build/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +8 -0
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +11 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +2 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +15 -25
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +19 -8
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-history/redo.js +11 -0
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +11 -0
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-snackbars/index.js +6 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +7 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +130 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/index.js +147 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +56 -34
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +59 -0
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/more-menu/index.js +119 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/more-menu/tools-more-menu-group.js +23 -0
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build/components/more-menu/view-more-menu-group.js +24 -0
- package/build/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build/components/page-attributes/check.js +8 -0
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -0
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +14 -8
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +7 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +1 -1
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +1 -1
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -1
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/actions.js +219 -66
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +32 -16
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +9 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +6 -0
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +5 -0
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -66
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +28 -8
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +72 -0
- package/build/components/post-content-information/index.js.map +1 -0
- package/build/components/post-discussion/panel.js +104 -20
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +0 -19
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +52 -12
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +118 -7
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +2 -2
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/index.js +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/panel.js +27 -0
- package/build/components/post-format/panel.js.map +1 -0
- package/build/components/post-last-edited-panel/index.js +33 -0
- package/build/components/post-last-edited-panel/index.js.map +1 -0
- package/build/components/post-panel-row/index.js +2 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +28 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- package/build/components/post-pingbacks/index.js +5 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build/components/post-saved-state/index.js +2 -2
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/panel.js +27 -0
- package/build/components/post-slug/panel.js.map +1 -0
- package/build/components/post-status/index.js +13 -13
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +21 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- package/build/components/post-template/block-theme.js +2 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +2 -5
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-title/index.js +2 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +2 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/panel.js +18 -0
- package/build/components/post-trash/panel.js.map +1 -0
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/index.js +2 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +11 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +3 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +23 -16
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +21 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +89 -0
- package/build/components/save-publish-panels/index.js.map +1 -0
- package/build/components/sidebar/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +53 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +157 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +84 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- package/build/components/start-page-options/index.js +10 -8
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +192 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/template-content-panel/index.js +38 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- package/build/hooks/pattern-overrides.js +10 -5
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +19 -8
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +72 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/store/private-selectors.js +6 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +69 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +15 -13
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build-module/components/character-count/index.js +6 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +65 -0
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +9 -0
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +11 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +2 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +17 -27
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +19 -8
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +11 -0
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +11 -0
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +6 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +120 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/index.js +139 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +59 -37
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/more-menu/index.js +111 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build-module/components/more-menu/view-more-menu-group.js +17 -0
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build-module/components/page-attributes/check.js +9 -0
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -0
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +13 -6
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +7 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -1
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +223 -70
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +33 -17
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +10 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +6 -0
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +6 -0
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -67
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +30 -10
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +66 -0
- package/build-module/components/post-content-information/index.js.map +1 -0
- package/build-module/components/post-discussion/panel.js +105 -21
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +0 -19
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +52 -11
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +118 -8
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +2 -2
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +18 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- package/build-module/components/post-last-edited-panel/index.js +26 -0
- package/build-module/components/post-last-edited-panel/index.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +2 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +20 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- package/build-module/components/post-pingbacks/index.js +6 -3
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +2 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/panel.js +18 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- package/build-module/components/post-status/index.js +13 -13
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +12 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- package/build-module/components/post-template/block-theme.js +2 -2
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +3 -6
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-title/index.js +2 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +2 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- package/build-module/components/post-trash/panel.js +10 -0
- package/build-module/components/post-trash/panel.js.map +1 -0
- package/build-module/components/post-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/index.js +2 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +11 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +3 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +21 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +80 -0
- package/build-module/components/save-publish-panels/index.js.map +1 -0
- package/build-module/components/sidebar/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +46 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +149 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +77 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- package/build-module/components/start-page-options/index.js +10 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +185 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/template-content-panel/index.js +31 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +10 -5
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +19 -8
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +62 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +535 -48
- package/build-style/style.css +535 -48
- package/package.json +38 -36
- package/src/bindings/pattern-overrides.js +83 -1
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/autosave-monitor/index.js +15 -12
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/character-count/index.js +5 -0
- package/src/components/collapsible-block-toolbar/index.js +77 -0
- package/src/components/collapsible-block-toolbar/style.scss +80 -0
- package/src/components/document-bar/index.js +2 -2
- package/src/components/document-outline/check.js +8 -0
- package/src/components/document-outline/index.js +10 -0
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +19 -26
- package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/src/components/editor-canvas/index.js +18 -6
- package/src/components/editor-history/redo.js +10 -0
- package/src/components/editor-history/undo.js +10 -0
- package/src/components/editor-snackbars/index.js +5 -0
- package/src/components/entities-saved-states/style.scss +7 -0
- package/src/components/global-keyboard-shortcuts/index.js +7 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
- package/src/components/global-styles-provider/index.js +162 -0
- package/src/components/header/index.js +154 -0
- package/src/components/header/style.scss +231 -0
- package/src/components/inserter-sidebar/index.js +52 -32
- package/src/components/inserter-sidebar/style.scss +10 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/index.js +1 -1
- package/src/components/list-view-sidebar/style.scss +3 -2
- package/src/components/more-menu/copy-content-menu-item.js +51 -0
- package/src/components/more-menu/index.js +158 -0
- package/src/components/more-menu/tools-more-menu-group.js +11 -0
- package/src/components/more-menu/view-more-menu-group.js +13 -0
- package/src/components/page-attributes/check.js +8 -0
- package/src/components/page-attributes/order.js +6 -0
- package/src/components/page-attributes/panel.js +21 -17
- package/src/components/page-attributes/parent.js +6 -0
- package/src/components/page-attributes/test/order.js +5 -1
- package/src/components/plugin-post-publish-panel/index.js +1 -1
- package/src/components/plugin-pre-publish-panel/index.js +1 -1
- package/src/components/plugin-sidebar/index.js +1 -1
- package/src/components/post-actions/actions.js +373 -152
- package/src/components/post-actions/index.js +34 -33
- package/src/components/post-author/check.js +9 -0
- package/src/components/post-author/index.js +5 -0
- package/src/components/post-author/panel.js +5 -0
- package/src/components/post-card-panel/index.js +40 -141
- package/src/components/post-card-panel/style.scss +2 -6
- package/src/components/post-comments/index.js +47 -9
- package/src/components/post-content-information/index.js +83 -0
- package/src/components/post-content-information/style.scss +6 -0
- package/src/components/post-discussion/panel.js +108 -27
- package/src/components/post-discussion/style.scss +26 -0
- package/src/components/post-excerpt/check.js +0 -18
- package/src/components/post-excerpt/index.js +66 -15
- package/src/components/post-excerpt/panel.js +196 -19
- package/src/components/post-excerpt/plugin.js +2 -2
- package/src/components/post-excerpt/style.scss +24 -0
- package/src/components/post-featured-image/index.js +1 -1
- package/src/components/post-featured-image/style.scss +2 -8
- package/src/components/post-format/panel.js +22 -0
- package/src/components/post-format/style.scss +6 -0
- package/src/components/post-last-edited-panel/index.js +35 -0
- package/src/components/post-last-edited-panel/style.scss +6 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -0
- package/src/components/post-pingbacks/index.js +11 -2
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
- package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
- package/src/components/post-publish-panel/style.scss +48 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
- package/src/components/post-saved-state/index.js +2 -2
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-schedule/style.scss +2 -4
- package/src/components/post-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- package/src/components/post-status/index.js +88 -80
- package/src/components/post-status/style.scss +0 -1
- package/src/components/post-sticky/panel.js +18 -0
- package/src/components/post-template/block-theme.js +2 -2
- package/src/components/post-template/classic-theme.js +0 -1
- package/src/components/post-template/swap-template-button.js +3 -6
- package/src/components/post-text-editor/style.scss +1 -1
- package/src/components/post-title/index.js +2 -2
- package/src/components/post-title/post-title-raw.js +2 -2
- package/src/components/post-title/style.scss +1 -1
- package/src/components/post-transform-panel/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +99 -0
- package/src/components/post-trash/panel.js +13 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- package/src/components/post-url/index.js +1 -0
- package/src/components/post-url/panel.js +1 -1
- package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
- package/src/components/preferences-modal/index.js +17 -3
- package/src/components/preview-dropdown/index.js +3 -1
- package/src/components/provider/disable-non-page-content-blocks.js +23 -21
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +19 -4
- package/src/components/save-publish-panels/index.js +96 -0
- package/src/components/save-publish-panels/style.scss +36 -0
- package/src/components/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +200 -0
- package/src/components/sidebar/post-summary.js +104 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/start-page-options/index.js +12 -5
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +55 -0
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- package/src/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +22 -8
- package/src/private-apis.native.js +61 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +12 -0
- package/src/store/selectors.js +3 -1
- package/src/style.scss +11 -0
- package/src/components/post-slug/test/check.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","Fill","Slot","PluginPrePublishPanel","children","className","title","initialOpen","icon","pluginIcon","createElement"],"sources":["@wordpress/editor/src/components/plugin-pre-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );\n\n/**\n * Renders provided content to the pre-publish side panel in the publish flow\n * (side panel that opens when a user first pushes \"Publish\" from the main editor).\n *\n * @param {Object} props Component props.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.\n * When no title is provided it is always opened.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)\n * icon slug string, or an SVG WP element, to be rendered when\n * the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPrePublishPanel } from '@wordpress/
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelBody","usePluginContext","Fill","Slot","PluginPrePublishPanel","children","className","title","initialOpen","icon","pluginIcon","createElement"],"sources":["@wordpress/editor/src/components/plugin-pre-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );\n\n/**\n * Renders provided content to the pre-publish side panel in the publish flow\n * (side panel that opens when a user first pushes \"Publish\" from the main editor).\n *\n * @param {Object} props Component props.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened.\n * When no title is provided it is always opened.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/)\n * icon slug string, or an SVG WP element, to be rendered when\n * the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPrePublishPanel } from '@wordpress/editor';\n *\n * const MyPluginPrePublishPanel = () => (\n * \t<PluginPrePublishPanel\n * \t\tclassName=\"my-plugin-pre-publish-panel\"\n * \t\ttitle={ __( 'My panel title' ) }\n * \t\tinitialOpen={ true }\n * \t>\n * \t { __( 'My panel content' ) }\n * \t</PluginPrePublishPanel>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPrePublishPanel = ( {\n\tchildren,\n\tclassName,\n\ttitle,\n\tinitialOpen = false,\n\ticon,\n} ) => {\n\tconst { icon: pluginIcon } = usePluginContext();\n\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelBody\n\t\t\t\tclassName={ className }\n\t\t\t\tinitialOpen={ initialOpen || ! title }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon ?? pluginIcon }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</PanelBody>\n\t\t</Fill>\n\t);\n};\n\nPluginPrePublishPanel.Slot = Slot;\n\nexport default PluginPrePublishPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGJ,cAAc,CAAE,uBAAwB,CAAC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,qBAAqB,GAAGA,CAAE;EAC/BC,QAAQ;EACRC,SAAS;EACTC,KAAK;EACLC,WAAW,GAAG,KAAK;EACnBC;AACD,CAAC,KAAM;EACN,MAAM;IAAEA,IAAI,EAAEC;EAAW,CAAC,GAAGT,gBAAgB,CAAC,CAAC;EAE/C,OACCU,aAAA,CAACT,IAAI,QACJS,aAAA,CAACX,SAAS;IACTM,SAAS,EAAGA,SAAW;IACvBE,WAAW,EAAGA,WAAW,IAAI,CAAED,KAAO;IACtCA,KAAK,EAAGA,KAAO;IACfE,IAAI,EAAGA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIC;EAAY,GAEzBL,QACQ,CACN,CAAC;AAET,CAAC;AAEDD,qBAAqB,CAACD,IAAI,GAAGA,IAAI;AAEjC,eAAeC,qBAAqB","ignoreList":[]}
|
|
@@ -61,7 +61,7 @@ import { store as editorStore } from '../../store';
|
|
|
61
61
|
* // Using ESNext syntax
|
|
62
62
|
* import { __ } from '@wordpress/i18n';
|
|
63
63
|
* import { PanelBody } from '@wordpress/components';
|
|
64
|
-
* import { PluginSidebar } from '@wordpress/
|
|
64
|
+
* import { PluginSidebar } from '@wordpress/editor';
|
|
65
65
|
* import { more } from '@wordpress/icons';
|
|
66
66
|
*
|
|
67
67
|
* const MyPluginSidebar = () => (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","__","store","keyboardShortcutsStore","ComplementaryArea","editorStore","PluginSidebar","className","props","postTitle","shortcut","select","getEditedPostAttribute","getShortcutRepresentation","createElement","panelClassName","smallScreenTitle","scope","toggleShortcut"],"sources":["@wordpress/editor/src/components/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editor.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/
|
|
1
|
+
{"version":3,"names":["useSelect","__","store","keyboardShortcutsStore","ComplementaryArea","editorStore","PluginSidebar","className","props","postTitle","shortcut","select","getEditedPostAttribute","getShortcutRepresentation","createElement","panelClassName","smallScreenTitle","scope","toggleShortcut"],"sources":["@wordpress/editor/src/components/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editor.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/editor';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebar( { className, ...props } ) {\n\tconst { postTitle, shortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"editor-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASC,iBAAiB,QAAQ,sBAAsB;;AAExD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EAChE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IACxD,OAAO;MACNF,SAAS,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,OAAQ,CAAC;MAClEF,QAAQ,EAAEC,MAAM,CACfR,sBACD,CAAC,CAACU,yBAAyB,CAAE,4BAA6B;IAC3D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACCC,aAAA,CAACV,iBAAiB;IACjBW,cAAc,EAAGR,SAAW;IAC5BA,SAAS,EAAC,gBAAgB;IAC1BS,gBAAgB,EAAGP,SAAS,IAAIR,EAAE,CAAE,YAAa,CAAG;IACpDgB,KAAK,EAAC,MAAM;IACZC,cAAc,EAAGR,QAAU;IAAA,GACtBF;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -2,12 +2,12 @@ import { createElement } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { external, trash,
|
|
5
|
+
import { external, trash, backup } from '@wordpress/icons';
|
|
6
6
|
import { addQueryArgs } from '@wordpress/url';
|
|
7
|
-
import { useDispatch } from '@wordpress/data';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
8
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
-
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
10
|
+
import { __, _n, sprintf, _x } from '@wordpress/i18n';
|
|
11
11
|
import { store as noticesStore } from '@wordpress/notices';
|
|
12
12
|
import { useMemo, useState } from '@wordpress/element';
|
|
13
13
|
import { Button, TextControl, __experimentalText as Text, __experimentalHStack as HStack, __experimentalVStack as VStack } from '@wordpress/components';
|
|
@@ -15,7 +15,7 @@ import { Button, TextControl, __experimentalText as Text, __experimentalHStack a
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
|
-
import { TEMPLATE_ORIGINS, TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
18
|
+
import { TEMPLATE_ORIGINS, TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_POST_TYPE } from '../../store/constants';
|
|
19
19
|
import { store as editorStore } from '../../store';
|
|
20
20
|
import { unlock } from '../../lock-unlock';
|
|
21
21
|
import isTemplateRevertable from '../../store/utils/is-template-revertable';
|
|
@@ -40,8 +40,10 @@ const trashPostAction = {
|
|
|
40
40
|
RenderModal: ({
|
|
41
41
|
items: posts,
|
|
42
42
|
closeModal,
|
|
43
|
+
onActionStart,
|
|
43
44
|
onActionPerformed
|
|
44
45
|
}) => {
|
|
46
|
+
const [isBusy, setIsBusy] = useState(false);
|
|
45
47
|
const {
|
|
46
48
|
createSuccessNotice,
|
|
47
49
|
createErrorNotice
|
|
@@ -59,10 +61,16 @@ const trashPostAction = {
|
|
|
59
61
|
justify: "right"
|
|
60
62
|
}, createElement(Button, {
|
|
61
63
|
variant: "tertiary",
|
|
62
|
-
onClick: closeModal
|
|
64
|
+
onClick: closeModal,
|
|
65
|
+
disabled: isBusy,
|
|
66
|
+
__experimentalIsFocusable: true
|
|
63
67
|
}, __('Cancel')), createElement(Button, {
|
|
64
68
|
variant: "primary",
|
|
65
69
|
onClick: async () => {
|
|
70
|
+
setIsBusy(true);
|
|
71
|
+
if (onActionStart) {
|
|
72
|
+
onActionStart(posts);
|
|
73
|
+
}
|
|
66
74
|
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
67
75
|
return deleteEntityRecord('postType', post.type, post.id, {}, {
|
|
68
76
|
throwOnError: true
|
|
@@ -76,12 +84,16 @@ const trashPostAction = {
|
|
|
76
84
|
if (promiseResult.length === 1) {
|
|
77
85
|
successMessage = sprintf( /* translators: The posts's title. */
|
|
78
86
|
__('"%s" moved to the Trash.'), getItemTitle(posts[0]));
|
|
87
|
+
} else if (posts[0].type === 'page') {
|
|
88
|
+
successMessage = sprintf( /* translators: The number of pages. */
|
|
89
|
+
__('%s pages moved to the Trash.'), posts.length);
|
|
79
90
|
} else {
|
|
80
|
-
successMessage =
|
|
91
|
+
successMessage = sprintf( /* translators: The number of posts. */
|
|
92
|
+
__('%s posts moved to the Trash.'), posts.length);
|
|
81
93
|
}
|
|
82
94
|
createSuccessNotice(successMessage, {
|
|
83
95
|
type: 'snackbar',
|
|
84
|
-
id: '
|
|
96
|
+
id: 'trash-post-action'
|
|
85
97
|
});
|
|
86
98
|
} else {
|
|
87
99
|
// If there was at lease one failure.
|
|
@@ -121,8 +133,12 @@ const trashPostAction = {
|
|
|
121
133
|
if (onActionPerformed) {
|
|
122
134
|
onActionPerformed(posts);
|
|
123
135
|
}
|
|
136
|
+
setIsBusy(false);
|
|
124
137
|
closeModal();
|
|
125
|
-
}
|
|
138
|
+
},
|
|
139
|
+
isBusy: isBusy,
|
|
140
|
+
disabled: isBusy,
|
|
141
|
+
__experimentalIsFocusable: true
|
|
126
142
|
}, __('Delete'))));
|
|
127
143
|
}
|
|
128
144
|
};
|
|
@@ -164,7 +180,7 @@ function usePermanentlyDeletePostAction() {
|
|
|
164
180
|
}
|
|
165
181
|
createSuccessNotice(successMessage, {
|
|
166
182
|
type: 'snackbar',
|
|
167
|
-
id: '
|
|
183
|
+
id: 'permanently-delete-post-action'
|
|
168
184
|
});
|
|
169
185
|
if (onActionPerformed) {
|
|
170
186
|
onActionPerformed(posts);
|
|
@@ -228,32 +244,67 @@ function useRestorePostAction() {
|
|
|
228
244
|
return status === 'trash';
|
|
229
245
|
},
|
|
230
246
|
async callback(posts, onActionPerformed) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
247
|
+
await Promise.allSettled(posts.map(post => {
|
|
248
|
+
return editEntityRecord('postType', post.type, post.id, {
|
|
249
|
+
status: 'draft'
|
|
250
|
+
});
|
|
251
|
+
}));
|
|
252
|
+
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
253
|
+
return saveEditedEntityRecord('postType', post.type, post.id, {
|
|
254
|
+
throwOnError: true
|
|
255
|
+
});
|
|
256
|
+
}));
|
|
257
|
+
if (promiseResult.every(({
|
|
258
|
+
status
|
|
259
|
+
}) => status === 'fulfilled')) {
|
|
260
|
+
let successMessage;
|
|
261
|
+
if (posts.length === 1) {
|
|
262
|
+
successMessage = sprintf( /* translators: The number of posts. */
|
|
263
|
+
__('"%s" has been restored.'), getItemTitle(posts[0]));
|
|
264
|
+
} else if (posts[0].type === 'page') {
|
|
265
|
+
successMessage = sprintf( /* translators: The number of posts. */
|
|
266
|
+
__('%d pages have been restored.'), posts.length);
|
|
267
|
+
} else {
|
|
268
|
+
successMessage = sprintf( /* translators: The number of posts. */
|
|
269
|
+
__('%d posts have been restored.'), posts.length);
|
|
239
270
|
}
|
|
240
|
-
createSuccessNotice(
|
|
241
|
-
__('%d posts have been restored.'), posts.length) : sprintf( /* translators: The number of posts. */
|
|
242
|
-
__('"%s" has been restored.'), getItemTitle(posts[0])), {
|
|
271
|
+
createSuccessNotice(successMessage, {
|
|
243
272
|
type: 'snackbar',
|
|
244
|
-
id: '
|
|
273
|
+
id: 'restore-post-action'
|
|
245
274
|
});
|
|
246
275
|
if (onActionPerformed) {
|
|
247
276
|
onActionPerformed(posts);
|
|
248
277
|
}
|
|
249
|
-
}
|
|
278
|
+
} else {
|
|
279
|
+
// If there was at lease one failure.
|
|
250
280
|
let errorMessage;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
281
|
+
// If we were trying to move a single post to the trash.
|
|
282
|
+
if (promiseResult.length === 1) {
|
|
283
|
+
if (promiseResult[0].reason?.message) {
|
|
284
|
+
errorMessage = promiseResult[0].reason.message;
|
|
285
|
+
} else {
|
|
286
|
+
errorMessage = __('An error occurred while restoring the post.');
|
|
287
|
+
}
|
|
288
|
+
// If we were trying to move multiple posts to the trash
|
|
255
289
|
} else {
|
|
256
|
-
|
|
290
|
+
const errorMessages = new Set();
|
|
291
|
+
const failedPromises = promiseResult.filter(({
|
|
292
|
+
status
|
|
293
|
+
}) => status === 'rejected');
|
|
294
|
+
for (const failedPromise of failedPromises) {
|
|
295
|
+
if (failedPromise.reason?.message) {
|
|
296
|
+
errorMessages.add(failedPromise.reason.message);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (errorMessages.size === 0) {
|
|
300
|
+
errorMessage = __('An error occurred while restoring the posts.');
|
|
301
|
+
} else if (errorMessages.size === 1) {
|
|
302
|
+
errorMessage = sprintf( /* translators: %s: an error message */
|
|
303
|
+
__('An error occurred while restoring the posts: %s'), [...errorMessages][0]);
|
|
304
|
+
} else {
|
|
305
|
+
errorMessage = sprintf( /* translators: %s: a list of comma separated error messages */
|
|
306
|
+
__('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(','));
|
|
307
|
+
}
|
|
257
308
|
}
|
|
258
309
|
createErrorNotice(errorMessage, {
|
|
259
310
|
type: 'snackbar'
|
|
@@ -278,22 +329,6 @@ const viewPostAction = {
|
|
|
278
329
|
}
|
|
279
330
|
}
|
|
280
331
|
};
|
|
281
|
-
const editPostAction = {
|
|
282
|
-
id: 'edit-post',
|
|
283
|
-
label: __('Edit'),
|
|
284
|
-
isPrimary: true,
|
|
285
|
-
icon: edit,
|
|
286
|
-
isEligible({
|
|
287
|
-
status
|
|
288
|
-
}) {
|
|
289
|
-
return status !== 'trash';
|
|
290
|
-
},
|
|
291
|
-
callback(posts, onActionPerformed) {
|
|
292
|
-
if (onActionPerformed) {
|
|
293
|
-
onActionPerformed(posts);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
332
|
const postRevisionsAction = {
|
|
298
333
|
id: 'view-post-revisions',
|
|
299
334
|
label: __('View revisions'),
|
|
@@ -390,17 +425,114 @@ const renamePostAction = {
|
|
|
390
425
|
}, __('Save')))));
|
|
391
426
|
}
|
|
392
427
|
};
|
|
428
|
+
const duplicatePostAction = {
|
|
429
|
+
id: 'duplicate-post',
|
|
430
|
+
label: _x('Duplicate', 'action label'),
|
|
431
|
+
isEligible({
|
|
432
|
+
status
|
|
433
|
+
}) {
|
|
434
|
+
return status !== 'trash';
|
|
435
|
+
},
|
|
436
|
+
RenderModal: ({
|
|
437
|
+
items,
|
|
438
|
+
closeModal,
|
|
439
|
+
onActionPerformed
|
|
440
|
+
}) => {
|
|
441
|
+
const [item] = items;
|
|
442
|
+
const [isCreatingPage, setIsCreatingPage] = useState(false);
|
|
443
|
+
const [title, setTitle] = useState(sprintf( /* translators: %s: Existing item title */
|
|
444
|
+
__('%s (Copy)'), getItemTitle(item)));
|
|
445
|
+
const {
|
|
446
|
+
saveEntityRecord
|
|
447
|
+
} = useDispatch(coreStore);
|
|
448
|
+
const {
|
|
449
|
+
createSuccessNotice,
|
|
450
|
+
createErrorNotice
|
|
451
|
+
} = useDispatch(noticesStore);
|
|
452
|
+
async function createPage(event) {
|
|
453
|
+
event.preventDefault();
|
|
454
|
+
if (isCreatingPage) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
setIsCreatingPage(true);
|
|
458
|
+
try {
|
|
459
|
+
const newItem = await saveEntityRecord('postType', item.type, {
|
|
460
|
+
status: 'draft',
|
|
461
|
+
title,
|
|
462
|
+
slug: title || __('No title'),
|
|
463
|
+
author: item.author,
|
|
464
|
+
comment_status: item.comment_status,
|
|
465
|
+
content: typeof item.content === 'string' ? item.content : item.content.raw,
|
|
466
|
+
excerpt: item.excerpt.raw,
|
|
467
|
+
meta: item.meta,
|
|
468
|
+
parent: item.parent,
|
|
469
|
+
password: item.password,
|
|
470
|
+
template: item.template,
|
|
471
|
+
format: item.format,
|
|
472
|
+
featured_media: item.featured_media,
|
|
473
|
+
menu_order: item.menu_order,
|
|
474
|
+
ping_status: item.ping_status,
|
|
475
|
+
categories: item.categories,
|
|
476
|
+
tags: item.tags
|
|
477
|
+
}, {
|
|
478
|
+
throwOnError: true
|
|
479
|
+
});
|
|
480
|
+
createSuccessNotice(sprintf(
|
|
481
|
+
// translators: %s: Title of the created template e.g: "Category".
|
|
482
|
+
__('"%s" successfully created.'), newItem.title?.rendered || title), {
|
|
483
|
+
id: 'duplicate-post-action',
|
|
484
|
+
type: 'snackbar'
|
|
485
|
+
});
|
|
486
|
+
if (onActionPerformed) {
|
|
487
|
+
onActionPerformed([newItem]);
|
|
488
|
+
}
|
|
489
|
+
} catch (error) {
|
|
490
|
+
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while duplicating the page.');
|
|
491
|
+
createErrorNotice(errorMessage, {
|
|
492
|
+
type: 'snackbar'
|
|
493
|
+
});
|
|
494
|
+
} finally {
|
|
495
|
+
setIsCreatingPage(false);
|
|
496
|
+
closeModal();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return createElement("form", {
|
|
500
|
+
onSubmit: createPage
|
|
501
|
+
}, createElement(VStack, {
|
|
502
|
+
spacing: 3
|
|
503
|
+
}, createElement(TextControl, {
|
|
504
|
+
label: __('Title'),
|
|
505
|
+
onChange: setTitle,
|
|
506
|
+
placeholder: __('No title'),
|
|
507
|
+
value: title
|
|
508
|
+
}), createElement(HStack, {
|
|
509
|
+
spacing: 2,
|
|
510
|
+
justify: "end"
|
|
511
|
+
}, createElement(Button, {
|
|
512
|
+
variant: "tertiary",
|
|
513
|
+
onClick: closeModal
|
|
514
|
+
}, __('Cancel')), createElement(Button, {
|
|
515
|
+
variant: "primary",
|
|
516
|
+
type: "submit",
|
|
517
|
+
isBusy: isCreatingPage,
|
|
518
|
+
"aria-disabled": isCreatingPage
|
|
519
|
+
}, _x('Duplicate', 'action label')))));
|
|
520
|
+
}
|
|
521
|
+
};
|
|
393
522
|
const resetTemplateAction = {
|
|
394
523
|
id: 'reset-template',
|
|
395
524
|
label: __('Reset'),
|
|
396
525
|
isEligible: isTemplateRevertable,
|
|
526
|
+
icon: backup,
|
|
397
527
|
supportsBulk: true,
|
|
398
528
|
hideModalHeader: true,
|
|
399
529
|
RenderModal: ({
|
|
400
530
|
items,
|
|
401
531
|
closeModal,
|
|
532
|
+
onActionStart,
|
|
402
533
|
onActionPerformed
|
|
403
534
|
}) => {
|
|
535
|
+
const [isBusy, setIsBusy] = useState(false);
|
|
404
536
|
const {
|
|
405
537
|
revertTemplate
|
|
406
538
|
} = unlock(useDispatch(editorStore));
|
|
@@ -423,7 +555,7 @@ const resetTemplateAction = {
|
|
|
423
555
|
__('%s items reset.'), items.length) : sprintf( /* translators: The template/part's name. */
|
|
424
556
|
__('"%s" reset.'), decodeEntities(items[0].title.rendered)), {
|
|
425
557
|
type: 'snackbar',
|
|
426
|
-
id: '
|
|
558
|
+
id: 'revert-template-action'
|
|
427
559
|
});
|
|
428
560
|
} catch (error) {
|
|
429
561
|
let fallbackErrorMessage;
|
|
@@ -444,14 +576,24 @@ const resetTemplateAction = {
|
|
|
444
576
|
justify: "right"
|
|
445
577
|
}, createElement(Button, {
|
|
446
578
|
variant: "tertiary",
|
|
447
|
-
onClick: closeModal
|
|
579
|
+
onClick: closeModal,
|
|
580
|
+
disabled: isBusy,
|
|
581
|
+
__experimentalIsFocusable: true
|
|
448
582
|
}, __('Cancel')), createElement(Button, {
|
|
449
583
|
variant: "primary",
|
|
450
584
|
onClick: async () => {
|
|
585
|
+
setIsBusy(true);
|
|
586
|
+
if (onActionStart) {
|
|
587
|
+
onActionStart(items);
|
|
588
|
+
}
|
|
451
589
|
await onConfirm(items);
|
|
452
590
|
onActionPerformed?.(items);
|
|
453
591
|
closeModal();
|
|
454
|
-
|
|
592
|
+
isBusy(false);
|
|
593
|
+
},
|
|
594
|
+
isBusy: isBusy,
|
|
595
|
+
disabled: isBusy,
|
|
596
|
+
__experimentalIsFocusable: true
|
|
455
597
|
}, __('Reset'))));
|
|
456
598
|
}
|
|
457
599
|
};
|
|
@@ -473,13 +615,16 @@ const deleteTemplateAction = {
|
|
|
473
615
|
id: 'delete-template',
|
|
474
616
|
label: __('Delete'),
|
|
475
617
|
isEligible: isTemplateRemovable,
|
|
618
|
+
icon: trash,
|
|
476
619
|
supportsBulk: true,
|
|
477
620
|
hideModalHeader: true,
|
|
478
621
|
RenderModal: ({
|
|
479
622
|
items: templates,
|
|
480
623
|
closeModal,
|
|
624
|
+
onActionStart,
|
|
481
625
|
onActionPerformed
|
|
482
626
|
}) => {
|
|
627
|
+
const [isBusy, setIsBusy] = useState(false);
|
|
483
628
|
const {
|
|
484
629
|
removeTemplates
|
|
485
630
|
} = unlock(useDispatch(editorStore));
|
|
@@ -493,16 +638,26 @@ const deleteTemplateAction = {
|
|
|
493
638
|
justify: "right"
|
|
494
639
|
}, createElement(Button, {
|
|
495
640
|
variant: "tertiary",
|
|
496
|
-
onClick: closeModal
|
|
641
|
+
onClick: closeModal,
|
|
642
|
+
disabled: isBusy,
|
|
643
|
+
__experimentalIsFocusable: true
|
|
497
644
|
}, __('Cancel')), createElement(Button, {
|
|
498
645
|
variant: "primary",
|
|
499
646
|
onClick: async () => {
|
|
647
|
+
setIsBusy(true);
|
|
648
|
+
if (onActionStart) {
|
|
649
|
+
onActionStart(templates);
|
|
650
|
+
}
|
|
500
651
|
await removeTemplates(templates, {
|
|
501
652
|
allowUndo: false
|
|
502
653
|
});
|
|
503
654
|
onActionPerformed?.(templates);
|
|
655
|
+
setIsBusy(false);
|
|
504
656
|
closeModal();
|
|
505
|
-
}
|
|
657
|
+
},
|
|
658
|
+
isBusy: isBusy,
|
|
659
|
+
disabled: isBusy,
|
|
660
|
+
__experimentalIsFocusable: true
|
|
506
661
|
}, __('Delete'))));
|
|
507
662
|
}
|
|
508
663
|
};
|
|
@@ -584,18 +739,27 @@ const renameTemplateAction = {
|
|
|
584
739
|
}, __('Save')))));
|
|
585
740
|
}
|
|
586
741
|
};
|
|
587
|
-
export function usePostActions(
|
|
742
|
+
export function usePostActions(postType, onActionPerformed) {
|
|
743
|
+
const {
|
|
744
|
+
postTypeObject
|
|
745
|
+
} = useSelect(select => {
|
|
746
|
+
const {
|
|
747
|
+
getPostType
|
|
748
|
+
} = select(coreStore);
|
|
749
|
+
return {
|
|
750
|
+
postTypeObject: getPostType(postType)
|
|
751
|
+
};
|
|
752
|
+
}, [postType]);
|
|
588
753
|
const permanentlyDeletePostAction = usePermanentlyDeletePostAction();
|
|
589
754
|
const restorePostAction = useRestorePostAction();
|
|
755
|
+
const isTemplateOrTemplatePart = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
|
|
756
|
+
const isPattern = postType === PATTERN_POST_TYPE;
|
|
757
|
+
const isLoaded = !!postTypeObject;
|
|
590
758
|
return useMemo(() => {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
// actions matching the given IDs.
|
|
596
|
-
const actions = actionIds ? actionIds.map(actionId => defaultActions.find(({
|
|
597
|
-
id
|
|
598
|
-
}) => actionId === id)) : defaultActions;
|
|
759
|
+
if (!isLoaded) {
|
|
760
|
+
return [];
|
|
761
|
+
}
|
|
762
|
+
const actions = [isTemplateOrTemplatePart && resetTemplateAction, postTypeObject?.viewable && viewPostAction, !isTemplateOrTemplatePart && restorePostAction, isTemplateOrTemplatePart && deleteTemplateAction, !isTemplateOrTemplatePart && permanentlyDeletePostAction, postRevisionsAction, process.env.IS_GUTENBERG_PLUGIN ? !isTemplateOrTemplatePart && !isPattern && duplicatePostAction : false, !isTemplateOrTemplatePart && renamePostAction, isTemplateOrTemplatePart && renameTemplateAction, !isTemplateOrTemplatePart && trashPostAction].filter(Boolean);
|
|
599
763
|
if (onActionPerformed) {
|
|
600
764
|
for (let i = 0; i < actions.length; ++i) {
|
|
601
765
|
if (actions[i].callback) {
|
|
@@ -618,8 +782,7 @@ export function usePostActions(onActionPerformed, actionIds = null) {
|
|
|
618
782
|
...actions[i],
|
|
619
783
|
RenderModal: props => {
|
|
620
784
|
return createElement(ExistingRenderModal, {
|
|
621
|
-
|
|
622
|
-
closeModal: props.closeModal,
|
|
785
|
+
...props,
|
|
623
786
|
onActionPerformed: _items => {
|
|
624
787
|
if (props.onActionPerformed) {
|
|
625
788
|
props.onActionPerformed(_items);
|
|
@@ -633,16 +796,6 @@ export function usePostActions(onActionPerformed, actionIds = null) {
|
|
|
633
796
|
}
|
|
634
797
|
}
|
|
635
798
|
return actions;
|
|
636
|
-
},
|
|
637
|
-
// Disable reason: if provided, `actionIds` is a shallow array of
|
|
638
|
-
// strings, and the strings themselves should be part of the useMemo
|
|
639
|
-
// dependencies. Two different disable statements are needed, as the
|
|
640
|
-
// first flags what it thinks are missing dependencies, and the second
|
|
641
|
-
// flags the array spread operation.
|
|
642
|
-
//
|
|
643
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
644
|
-
[
|
|
645
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
646
|
-
...(actionIds || []), permanentlyDeletePostAction, restorePostAction, onActionPerformed]);
|
|
799
|
+
}, [isTemplateOrTemplatePart, isPattern, postTypeObject?.viewable, permanentlyDeletePostAction, restorePostAction, onActionPerformed, isLoaded]);
|
|
647
800
|
}
|
|
648
801
|
//# sourceMappingURL=actions.js.map
|