@wordpress/editor 13.32.0 → 13.34.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 +4 -0
- package/README.md +355 -20
- package/build/bindings/index.js.map +1 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +12 -30
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +24 -11
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- 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/commands/index.js +19 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/commands/index.native.js.map +1 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js.map +1 -1
- 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.map +1 -1
- package/build/components/document-tools/index.js +1 -8
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +2 -2
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.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-notices/index.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/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +31 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +52 -0
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +33 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +1 -4
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +82 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/list-view-sidebar/index.js +1 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/mode-switcher/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/offline-status/index.native.js.map +1 -1
- 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/pattern-overrides-panel/index.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +78 -0
- package/build/components/plugin-more-menu-item/index.js.map +1 -0
- 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-post-status-info/index.js +73 -0
- package/build/components/plugin-post-status-info/index.js.map +1 -0
- 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 +108 -0
- package/build/components/plugin-sidebar/index.js.map +1 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/post-actions/actions.js +316 -20
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +160 -0
- package/build/components/post-actions/index.js.map +1 -0
- package/build/components/post-author/check.js +9 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/hook.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-author/select.js.map +1 -1
- package/build/components/post-card-panel/index.js +14 -15
- package/build/components/post-card-panel/index.js.map +1 -1
- 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 +9 -7
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +7 -18
- 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/check.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-featured-image/panel.js.map +1 -1
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js.map +1 -1
- 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-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +31 -31
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +51 -43
- package/build/components/post-publish-button/label.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-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +10 -6
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +9 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +43 -68
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +239 -0
- package/build/components/post-status/index.js.map +1 -0
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +8 -4
- 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/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/hooks.js.map +1 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-template/reset-default-template.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-text-editor/index.js.map +1 -1
- package/build/components/post-title/constants.js.map +1 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-title/use-post-title-focus.js.map +1 -1
- package/build/components/post-title/use-post-title.js.map +1 -1
- package/build/components/post-trash/check.js +23 -25
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +2 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +45 -19
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +15 -8
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-view-link/index.js.map +1 -1
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +2 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-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 +26 -18
- 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 +4 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +6 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
- package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build/components/provider/use-block-editor-settings.js +64 -43
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -0
- package/build/components/provider/with-registry-provider.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/start-page-options/index.js +143 -0
- package/build/components/start-page-options/index.js.map +1 -0
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-areas/index.js.map +1 -1
- package/build/components/template-validation-notice/index.js +23 -29
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +10 -16
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/pattern-overrides.js +22 -10
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +38 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +8 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +177 -4
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +8 -11
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js.map +1 -1
- package/build/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build/store/utils/is-template-revertable.js +28 -0
- package/build/store/utils/is-template-revertable.js.map +1 -0
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/media-upload/index.native.js.map +1 -1
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js.map +1 -1
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +14 -31
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +24 -12
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- 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/commands/index.js +20 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/commands/index.native.js.map +1 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- 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.map +1 -1
- package/build-module/components/document-tools/index.js +2 -9
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +2 -2
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.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-notices/index.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/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +32 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +53 -0
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +4 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -5
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +75 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- 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/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/mode-switcher/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/offline-status/index.native.js.map +1 -1
- 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/pattern-overrides-panel/index.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +73 -0
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
- 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-post-status-info/index.js +66 -0
- package/build-module/components/plugin-post-status-info/index.js.map +1 -0
- 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 +102 -0
- package/build-module/components/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +317 -19
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +153 -0
- package/build-module/components/post-actions/index.js.map +1 -0
- 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/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/hook.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-author/select.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +16 -17
- package/build-module/components/post-card-panel/index.js.map +1 -1
- 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 +8 -6
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +8 -18
- 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/check.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-featured-image/panel.js.map +1 -1
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- 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-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +31 -31
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +51 -42
- package/build-module/components/post-publish-button/label.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-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +10 -6
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +9 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +44 -68
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +231 -0
- package/build-module/components/post-status/index.js.map +1 -0
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +7 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +9 -5
- 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/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/hooks.js.map +1 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-template/reset-default-template.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-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/constants.js.map +1 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
- package/build-module/components/post-title/use-post-title.js.map +1 -1
- package/build-module/components/post-trash/check.js +24 -26
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +2 -1
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +47 -21
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +15 -8
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-view-link/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +2 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-plugin-document-setting-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 +26 -18
- 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 +5 -3
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build-module/components/provider/use-block-editor-settings.js +66 -45
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +1 -0
- package/build-module/components/provider/with-registry-provider.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/start-page-options/index.js +136 -0
- package/build-module/components/start-page-options/index.js.map +1 -0
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-areas/index.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +25 -31
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +11 -16
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +22 -10
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +36 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/constants.js +7 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +174 -4
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +4 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/selectors.native.js.map +1 -1
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/store/utils/is-template-revertable.js +22 -0
- package/build-module/store/utils/is-template-revertable.js.map +1 -0
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/index.native.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.native.js.map +1 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +703 -53
- package/build-style/style.css +703 -53
- package/package.json +35 -35
- package/src/bindings/post-meta.js +11 -27
- package/src/components/autosave-monitor/index.js +23 -11
- 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/commands/index.js +20 -1
- package/src/components/document-outline/check.js +8 -0
- package/src/components/document-outline/index.js +10 -0
- package/src/components/document-tools/index.js +16 -19
- package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
- package/src/components/editor-canvas/index.js +4 -4
- 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/error-boundary/style.native.scss +1 -1
- package/src/components/global-keyboard-shortcuts/index.js +32 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +61 -0
- package/src/components/index.js +4 -0
- package/src/components/inserter-sidebar/index.js +2 -5
- package/src/components/keyboard-shortcut-help-modal/config.js +62 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
- package/src/components/list-view-sidebar/index.js +1 -1
- package/src/components/list-view-sidebar/style.scss +2 -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/plugin-more-menu-item/index.js +73 -0
- package/src/components/plugin-post-publish-panel/index.js +1 -1
- package/src/components/plugin-post-status-info/index.js +63 -0
- package/src/components/plugin-pre-publish-panel/index.js +1 -1
- package/src/components/plugin-sidebar/index.js +98 -0
- package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/post-actions/actions.js +413 -18
- package/src/components/post-actions/index.js +190 -0
- package/src/components/post-actions/style.scss +3 -0
- 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 +28 -23
- package/src/components/post-card-panel/style.scss +2 -6
- 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 +24 -20
- package/src/components/post-excerpt/check.js +8 -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-last-edited-panel/index.js +35 -0
- package/src/components/post-last-edited-panel/style.scss +6 -0
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-publish-button/index.js +23 -36
- package/src/components/post-publish-button/label.js +54 -39
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
- package/src/components/post-publish-button/test/index.js +15 -26
- package/src/components/post-publish-button/test/label.js +44 -21
- package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
- package/src/components/post-publish-panel/style.scss +43 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
- package/src/components/post-saved-state/index.js +13 -6
- package/src/components/post-saved-state/test/index.js +4 -0
- package/src/components/post-schedule/panel.js +23 -1
- package/src/components/post-schedule/style.scss +2 -4
- package/src/components/post-slug/index.js +50 -68
- package/src/components/post-slug/test/index.js +29 -6
- package/src/components/post-status/index.js +318 -0
- package/src/components/post-status/style.scss +74 -0
- package/src/components/post-switch-to-draft-button/index.js +5 -0
- package/src/components/post-template/block-theme.js +33 -24
- 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/style.scss +1 -1
- package/src/components/post-trash/check.js +19 -19
- package/src/components/post-trash/index.js +1 -0
- package/src/components/post-url/index.js +132 -101
- package/src/components/post-url/panel.js +21 -8
- package/src/components/post-url/style.scss +8 -6
- package/src/components/post-visibility/index.js +1 -0
- package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
- package/src/components/preferences-modal/index.js +40 -22
- 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 +17 -8
- package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
- package/src/components/provider/use-block-editor-settings.js +59 -33
- package/src/components/provider/with-registry-provider.js +1 -0
- package/src/components/save-publish-panels/index.js +96 -0
- package/src/components/save-publish-panels/style.scss +36 -0
- package/src/components/start-page-options/index.js +140 -0
- package/src/components/start-page-options/style.scss +26 -0
- package/src/components/template-validation-notice/index.js +48 -50
- package/src/components/theme-support-check/index.js +9 -16
- package/src/components/theme-support-check/test/index.js +44 -43
- package/src/hooks/pattern-overrides.js +25 -14
- package/src/private-apis.js +33 -2
- package/src/store/constants.js +7 -0
- package/src/store/private-actions.js +269 -4
- package/src/store/private-selectors.js +1 -6
- package/src/store/selectors.js +4 -7
- package/src/store/utils/is-template-revertable.js +23 -0
- package/src/style.scss +10 -2
- package/src/components/post-publish-button/style.scss +0 -8
- package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
- package/src/components/template-validation-notice/style.scss +0 -9
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
PanelBody,
|
|
12
|
+
__experimentalText as Text,
|
|
13
|
+
Dropdown,
|
|
14
|
+
Button,
|
|
15
|
+
__experimentalVStack as VStack,
|
|
16
|
+
} from '@wordpress/components';
|
|
6
17
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
18
|
+
import { useMemo, useState } from '@wordpress/element';
|
|
19
|
+
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
20
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
21
|
|
|
8
22
|
/**
|
|
9
23
|
* Internal dependencies
|
|
@@ -11,6 +25,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
11
25
|
import PostExcerptForm from './index';
|
|
12
26
|
import PostExcerptCheck from './check';
|
|
13
27
|
import PluginPostExcerpt from './plugin';
|
|
28
|
+
import { TEMPLATE_ORIGINS } from '../../store/constants';
|
|
14
29
|
import { store as editorStore } from '../../store';
|
|
15
30
|
|
|
16
31
|
/**
|
|
@@ -18,14 +33,18 @@ import { store as editorStore } from '../../store';
|
|
|
18
33
|
*/
|
|
19
34
|
const PANEL_NAME = 'post-excerpt';
|
|
20
35
|
|
|
21
|
-
|
|
22
|
-
const { isOpened, isEnabled } = useSelect( ( select ) => {
|
|
23
|
-
const {
|
|
24
|
-
|
|
36
|
+
function ExcerptPanel() {
|
|
37
|
+
const { isOpened, isEnabled, postType } = useSelect( ( select ) => {
|
|
38
|
+
const {
|
|
39
|
+
isEditorPanelOpened,
|
|
40
|
+
isEditorPanelEnabled,
|
|
41
|
+
getCurrentPostType,
|
|
42
|
+
} = select( editorStore );
|
|
25
43
|
|
|
26
44
|
return {
|
|
27
45
|
isOpened: isEditorPanelOpened( PANEL_NAME ),
|
|
28
46
|
isEnabled: isEditorPanelEnabled( PANEL_NAME ),
|
|
47
|
+
postType: getCurrentPostType(),
|
|
29
48
|
};
|
|
30
49
|
}, [] );
|
|
31
50
|
|
|
@@ -36,22 +55,180 @@ export default function PostExcerptPanel() {
|
|
|
36
55
|
return null;
|
|
37
56
|
}
|
|
38
57
|
|
|
58
|
+
// There are special cases where we want to label the excerpt as a description.
|
|
59
|
+
const shouldUseDescriptionLabel = [
|
|
60
|
+
'wp_template',
|
|
61
|
+
'wp_template_part',
|
|
62
|
+
'wp_block',
|
|
63
|
+
].includes( postType );
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<PanelBody
|
|
67
|
+
title={
|
|
68
|
+
shouldUseDescriptionLabel
|
|
69
|
+
? __( 'Description' )
|
|
70
|
+
: __( 'Excerpt' )
|
|
71
|
+
}
|
|
72
|
+
opened={ isOpened }
|
|
73
|
+
onToggle={ toggleExcerptPanel }
|
|
74
|
+
>
|
|
75
|
+
<PluginPostExcerpt.Slot>
|
|
76
|
+
{ ( fills ) => (
|
|
77
|
+
<>
|
|
78
|
+
<PostExcerptForm />
|
|
79
|
+
{ fills }
|
|
80
|
+
</>
|
|
81
|
+
) }
|
|
82
|
+
</PluginPostExcerpt.Slot>
|
|
83
|
+
</PanelBody>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default function PostExcerptPanel() {
|
|
39
88
|
return (
|
|
40
89
|
<PostExcerptCheck>
|
|
41
|
-
<
|
|
42
|
-
title={ __( 'Excerpt' ) }
|
|
43
|
-
opened={ isOpened }
|
|
44
|
-
onToggle={ toggleExcerptPanel }
|
|
45
|
-
>
|
|
46
|
-
<PluginPostExcerpt.Slot>
|
|
47
|
-
{ ( fills ) => (
|
|
48
|
-
<>
|
|
49
|
-
<PostExcerptForm />
|
|
50
|
-
{ fills }
|
|
51
|
-
</>
|
|
52
|
-
) }
|
|
53
|
-
</PluginPostExcerpt.Slot>
|
|
54
|
-
</PanelBody>
|
|
90
|
+
<ExcerptPanel />
|
|
55
91
|
</PostExcerptCheck>
|
|
56
92
|
);
|
|
57
93
|
}
|
|
94
|
+
|
|
95
|
+
export function PrivatePostExcerptPanel() {
|
|
96
|
+
return (
|
|
97
|
+
<PostExcerptCheck>
|
|
98
|
+
<PrivateExcerpt />
|
|
99
|
+
</PostExcerptCheck>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function PrivateExcerpt() {
|
|
104
|
+
const { shouldRender, excerpt, shouldBeUsedAsDescription, allowEditing } =
|
|
105
|
+
useSelect( ( select ) => {
|
|
106
|
+
const {
|
|
107
|
+
getCurrentPostType,
|
|
108
|
+
getCurrentPostId,
|
|
109
|
+
getEditedPostAttribute,
|
|
110
|
+
isEditorPanelEnabled,
|
|
111
|
+
} = select( editorStore );
|
|
112
|
+
const postType = getCurrentPostType();
|
|
113
|
+
const isTemplateOrTemplatePart = [
|
|
114
|
+
'wp_template',
|
|
115
|
+
'wp_template_part',
|
|
116
|
+
].includes( postType );
|
|
117
|
+
const isPattern = postType === 'wp_block';
|
|
118
|
+
// These post types use the `excerpt` field as a description semantically, so we need to
|
|
119
|
+
// handle proper labeling and some flows where we should always render them as text.
|
|
120
|
+
const _shouldBeUsedAsDescription =
|
|
121
|
+
isTemplateOrTemplatePart || isPattern;
|
|
122
|
+
const _usedAttribute = isTemplateOrTemplatePart
|
|
123
|
+
? 'description'
|
|
124
|
+
: 'excerpt';
|
|
125
|
+
// We need to fetch the entity in this case to check if we'll allow editing.
|
|
126
|
+
const template =
|
|
127
|
+
isTemplateOrTemplatePart &&
|
|
128
|
+
select( coreStore ).getEntityRecord(
|
|
129
|
+
'postType',
|
|
130
|
+
postType,
|
|
131
|
+
getCurrentPostId()
|
|
132
|
+
);
|
|
133
|
+
// For post types that use excerpt as description, we do not abide
|
|
134
|
+
// by the `isEnabled` panel flag in order to render them as text.
|
|
135
|
+
const _shouldRender =
|
|
136
|
+
isEditorPanelEnabled( PANEL_NAME ) ||
|
|
137
|
+
_shouldBeUsedAsDescription;
|
|
138
|
+
return {
|
|
139
|
+
excerpt: getEditedPostAttribute( _usedAttribute ),
|
|
140
|
+
shouldRender: _shouldRender,
|
|
141
|
+
shouldBeUsedAsDescription: _shouldBeUsedAsDescription,
|
|
142
|
+
// If we should render, allow editing for all post types that are not used as description.
|
|
143
|
+
// For the rest allow editing only for user generated entities.
|
|
144
|
+
allowEditing:
|
|
145
|
+
_shouldRender &&
|
|
146
|
+
( ! _shouldBeUsedAsDescription ||
|
|
147
|
+
isPattern ||
|
|
148
|
+
( template &&
|
|
149
|
+
template.source === TEMPLATE_ORIGINS.custom &&
|
|
150
|
+
! template.has_theme_file ) ),
|
|
151
|
+
};
|
|
152
|
+
}, [] );
|
|
153
|
+
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
154
|
+
const label = shouldBeUsedAsDescription
|
|
155
|
+
? __( 'Description' )
|
|
156
|
+
: __( 'Excerpt' );
|
|
157
|
+
// Memoize popoverProps to avoid returning a new object every time.
|
|
158
|
+
const popoverProps = useMemo(
|
|
159
|
+
() => ( {
|
|
160
|
+
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
161
|
+
// move around when the label changes.
|
|
162
|
+
anchor: popoverAnchor,
|
|
163
|
+
'aria-label': label,
|
|
164
|
+
headerTitle: label,
|
|
165
|
+
placement: 'left-start',
|
|
166
|
+
offset: 36,
|
|
167
|
+
shift: true,
|
|
168
|
+
} ),
|
|
169
|
+
[ popoverAnchor, label ]
|
|
170
|
+
);
|
|
171
|
+
if ( ! shouldRender ) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
const excerptText = !! excerpt && (
|
|
175
|
+
<Text align="left" numberOfLines={ 4 } truncate>
|
|
176
|
+
{ excerpt }
|
|
177
|
+
</Text>
|
|
178
|
+
);
|
|
179
|
+
if ( ! allowEditing ) {
|
|
180
|
+
return excerptText;
|
|
181
|
+
}
|
|
182
|
+
const excerptPlaceholder = shouldBeUsedAsDescription
|
|
183
|
+
? __( 'Add a description…' )
|
|
184
|
+
: __( 'Add an excerpt…' );
|
|
185
|
+
const triggerEditLabel = shouldBeUsedAsDescription
|
|
186
|
+
? __( 'Edit description' )
|
|
187
|
+
: __( 'Edit excerpt' );
|
|
188
|
+
return (
|
|
189
|
+
<Dropdown
|
|
190
|
+
className="editor-post-excerpt__dropdown"
|
|
191
|
+
contentClassName="editor-post-excerpt__dropdown__content"
|
|
192
|
+
popoverProps={ popoverProps }
|
|
193
|
+
focusOnMount
|
|
194
|
+
ref={ setPopoverAnchor }
|
|
195
|
+
renderToggle={ ( { onToggle } ) => (
|
|
196
|
+
<Button
|
|
197
|
+
className={ classnames(
|
|
198
|
+
'editor-post-excerpt__dropdown__trigger',
|
|
199
|
+
{ 'has-excerpt': !! excerpt }
|
|
200
|
+
) }
|
|
201
|
+
onClick={ onToggle }
|
|
202
|
+
label={
|
|
203
|
+
!! excerptText ? triggerEditLabel : excerptPlaceholder
|
|
204
|
+
}
|
|
205
|
+
showTooltip={ !! excerptText }
|
|
206
|
+
>
|
|
207
|
+
{ excerptText || excerptPlaceholder }
|
|
208
|
+
</Button>
|
|
209
|
+
) }
|
|
210
|
+
renderContent={ ( { onClose } ) => (
|
|
211
|
+
<>
|
|
212
|
+
<InspectorPopoverHeader
|
|
213
|
+
title={ label }
|
|
214
|
+
onClose={ onClose }
|
|
215
|
+
/>
|
|
216
|
+
|
|
217
|
+
<VStack spacing={ 4 }>
|
|
218
|
+
<PluginPostExcerpt.Slot>
|
|
219
|
+
{ ( fills ) => (
|
|
220
|
+
<>
|
|
221
|
+
<PostExcerptForm
|
|
222
|
+
hideLabelFromVision
|
|
223
|
+
updateOnBlur
|
|
224
|
+
/>
|
|
225
|
+
{ fills }
|
|
226
|
+
</>
|
|
227
|
+
) }
|
|
228
|
+
</PluginPostExcerpt.Slot>
|
|
229
|
+
</VStack>
|
|
230
|
+
</>
|
|
231
|
+
) }
|
|
232
|
+
/>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
@@ -20,7 +20,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
|
|
|
20
20
|
* ```js
|
|
21
21
|
* // Using ES5 syntax
|
|
22
22
|
* var __ = wp.i18n.__;
|
|
23
|
-
* var PluginPostExcerpt = wp.editPost.
|
|
23
|
+
* var PluginPostExcerpt = wp.editPost.__experimentalPluginPostExcerpt;
|
|
24
24
|
*
|
|
25
25
|
* function MyPluginPostExcerpt() {
|
|
26
26
|
* return React.createElement(
|
|
@@ -37,7 +37,7 @@ const { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );
|
|
|
37
37
|
* ```jsx
|
|
38
38
|
* // Using ESNext syntax
|
|
39
39
|
* import { __ } from '@wordpress/i18n';
|
|
40
|
-
* import { PluginPostExcerpt } from '@wordpress/edit-post';
|
|
40
|
+
* import { __experimentalPluginPostExcerpt as PluginPostExcerpt } from '@wordpress/edit-post';
|
|
41
41
|
*
|
|
42
42
|
* const MyPluginPostExcerpt = () => (
|
|
43
43
|
* <PluginPostExcerpt className="my-plugin-post-excerpt">
|
|
@@ -2,3 +2,27 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
margin-bottom: 10px;
|
|
4
4
|
}
|
|
5
|
+
|
|
6
|
+
.editor-post-excerpt__dropdown__trigger {
|
|
7
|
+
height: auto;
|
|
8
|
+
padding: 0;
|
|
9
|
+
|
|
10
|
+
&:not(.has-excerpt) {
|
|
11
|
+
color: $gray-700;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
color: $gray-900;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.editor-post-excerpt__dropdown {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.editor-post-excerpt__dropdown__content {
|
|
24
|
+
.components-popover__content {
|
|
25
|
+
min-width: 320px;
|
|
26
|
+
padding: $grid-unit-20;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -32,7 +32,7 @@ const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
|
32
32
|
|
|
33
33
|
// Used when labels from post type were not yet loaded or when they are not present.
|
|
34
34
|
const DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );
|
|
35
|
-
const DEFAULT_SET_FEATURE_IMAGE_LABEL = __( '
|
|
35
|
+
const DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Add a featured image' );
|
|
36
36
|
|
|
37
37
|
const instructions = (
|
|
38
38
|
<p>
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
box-shadow: 0 0 0 0 var(--wp-admin-theme-color);
|
|
32
32
|
overflow: hidden; // Ensure the focus style properly encapsulates the image.
|
|
33
33
|
outline-offset: -#{$border-width};
|
|
34
|
-
min-height: $grid-unit-50
|
|
35
|
-
margin-bottom: $grid-unit-20;
|
|
34
|
+
min-height: $grid-unit-50;
|
|
36
35
|
|
|
37
36
|
display: flex;
|
|
38
37
|
justify-content: center;
|
|
@@ -52,16 +51,11 @@
|
|
|
52
51
|
|
|
53
52
|
.editor-post-featured-image__toggle {
|
|
54
53
|
border-radius: $radius-block-ui;
|
|
55
|
-
background-color: $gray-100;
|
|
56
54
|
height: 100%;
|
|
57
55
|
line-height: 20px;
|
|
58
56
|
padding: $grid-unit-10 0;
|
|
59
57
|
text-align: center;
|
|
60
|
-
|
|
61
|
-
&:hover {
|
|
62
|
-
background: $gray-300;
|
|
63
|
-
color: $gray-900;
|
|
64
|
-
}
|
|
58
|
+
box-shadow: inset 0 0 0 $border-width $gray-400;
|
|
65
59
|
}
|
|
66
60
|
|
|
67
61
|
.editor-post-featured-image__actions {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalText as Text } from '@wordpress/components';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
7
|
+
import { humanTimeDiff } from '@wordpress/date';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { store as editorStore } from '../../store';
|
|
13
|
+
|
|
14
|
+
export default function PostLastEditedPanel() {
|
|
15
|
+
const modified = useSelect(
|
|
16
|
+
( select ) =>
|
|
17
|
+
select( editorStore ).getEditedPostAttribute( 'modified' ),
|
|
18
|
+
[]
|
|
19
|
+
);
|
|
20
|
+
const lastEditedText =
|
|
21
|
+
modified &&
|
|
22
|
+
sprintf(
|
|
23
|
+
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
24
|
+
__( 'Last edited %s.' ),
|
|
25
|
+
humanTimeDiff( modified )
|
|
26
|
+
);
|
|
27
|
+
if ( ! lastEditedText ) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
<div className="editor-post-last-edited-panel">
|
|
32
|
+
<Text>{ lastEditedText }</Text>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.editor-post-panel__row {
|
|
2
2
|
width: 100%;
|
|
3
|
-
min-height: $
|
|
3
|
+
min-height: $grid-unit-40;
|
|
4
4
|
justify-content: flex-start !important;
|
|
5
5
|
align-items: flex-start !important;
|
|
6
6
|
}
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
.editor-post-panel__row-label {
|
|
9
9
|
width: 30%;
|
|
10
10
|
flex-shrink: 0;
|
|
11
|
-
min-height: $
|
|
11
|
+
min-height: $grid-unit-40;
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.editor-post-panel__row-control {
|
|
17
17
|
flex-grow: 1;
|
|
18
|
-
min-height: $
|
|
18
|
+
min-height: $grid-unit-40;
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -10,7 +5,6 @@ import { Button } from '@wordpress/components';
|
|
|
10
5
|
import { Component, createRef } from '@wordpress/element';
|
|
11
6
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
12
7
|
import { compose } from '@wordpress/compose';
|
|
13
|
-
import { __ } from '@wordpress/i18n';
|
|
14
8
|
|
|
15
9
|
/**
|
|
16
10
|
* Internal dependencies
|
|
@@ -112,13 +106,14 @@ export class PostPublishButton extends Component {
|
|
|
112
106
|
isSaving,
|
|
113
107
|
isAutoSaving,
|
|
114
108
|
isToggle,
|
|
115
|
-
|
|
116
|
-
onStatusChange,
|
|
109
|
+
savePostStatus,
|
|
117
110
|
onSubmit = noop,
|
|
118
111
|
onToggle,
|
|
119
112
|
visibility,
|
|
120
113
|
hasNonPostEntityChanges,
|
|
121
114
|
isSavingNonPostEntityChanges,
|
|
115
|
+
postStatus,
|
|
116
|
+
postStatusHasChanged,
|
|
122
117
|
} = this.props;
|
|
123
118
|
|
|
124
119
|
const isButtonDisabled =
|
|
@@ -135,15 +130,19 @@ export class PostPublishButton extends Component {
|
|
|
135
130
|
( ! isPublishable && ! forceIsDirty ) ) &&
|
|
136
131
|
( ! hasNonPostEntityChanges || isSavingNonPostEntityChanges );
|
|
137
132
|
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
// If the new status has not changed explicitely, we derive it from
|
|
134
|
+
// other factors, like having a publish action, etc.. We need to preserve
|
|
135
|
+
// this because it affects when to show the pre and post publish panels.
|
|
136
|
+
// If it has changed though explicitely, we need to respect that.
|
|
137
|
+
let publishStatus = 'publish';
|
|
138
|
+
if ( postStatusHasChanged ) {
|
|
139
|
+
publishStatus = postStatus;
|
|
140
|
+
} else if ( ! hasPublishAction ) {
|
|
140
141
|
publishStatus = 'pending';
|
|
141
142
|
} else if ( visibility === 'private' ) {
|
|
142
143
|
publishStatus = 'private';
|
|
143
144
|
} else if ( isBeingScheduled ) {
|
|
144
145
|
publishStatus = 'future';
|
|
145
|
-
} else {
|
|
146
|
-
publishStatus = 'publish';
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
const onClickButton = () => {
|
|
@@ -151,10 +150,10 @@ export class PostPublishButton extends Component {
|
|
|
151
150
|
return;
|
|
152
151
|
}
|
|
153
152
|
onSubmit();
|
|
154
|
-
|
|
155
|
-
onSave();
|
|
153
|
+
savePostStatus( publishStatus );
|
|
156
154
|
};
|
|
157
155
|
|
|
156
|
+
// Callback to open the publish panel.
|
|
158
157
|
const onClickToggle = () => {
|
|
159
158
|
if ( isToggleDisabled ) {
|
|
160
159
|
return;
|
|
@@ -179,33 +178,16 @@ export class PostPublishButton extends Component {
|
|
|
179
178
|
size: 'compact',
|
|
180
179
|
onClick: this.createOnClick( onClickToggle ),
|
|
181
180
|
};
|
|
182
|
-
|
|
183
|
-
const toggleChildren = isBeingScheduled
|
|
184
|
-
? __( 'Schedule…' )
|
|
185
|
-
: __( 'Publish' );
|
|
186
|
-
const buttonChildren = (
|
|
187
|
-
<PublishButtonLabel
|
|
188
|
-
hasNonPostEntityChanges={ hasNonPostEntityChanges }
|
|
189
|
-
/>
|
|
190
|
-
);
|
|
191
|
-
|
|
192
181
|
const componentProps = isToggle ? toggleProps : buttonProps;
|
|
193
|
-
const componentChildren = isToggle ? toggleChildren : buttonChildren;
|
|
194
182
|
return (
|
|
195
183
|
<>
|
|
196
184
|
<Button
|
|
197
185
|
ref={ this.buttonNode }
|
|
198
186
|
{ ...componentProps }
|
|
199
|
-
className={
|
|
200
|
-
componentProps.className,
|
|
201
|
-
'editor-post-publish-button__button',
|
|
202
|
-
{
|
|
203
|
-
'has-changes-dot': hasNonPostEntityChanges,
|
|
204
|
-
}
|
|
205
|
-
) }
|
|
187
|
+
className={ `${ componentProps.className } editor-post-publish-button__button` }
|
|
206
188
|
size="compact"
|
|
207
189
|
>
|
|
208
|
-
|
|
190
|
+
<PublishButtonLabel />
|
|
209
191
|
</Button>
|
|
210
192
|
</>
|
|
211
193
|
);
|
|
@@ -228,6 +210,8 @@ export default compose( [
|
|
|
228
210
|
getCurrentPostId,
|
|
229
211
|
hasNonPostEntityChanges,
|
|
230
212
|
isSavingNonPostEntityChanges,
|
|
213
|
+
getEditedPostAttribute,
|
|
214
|
+
getPostEdits,
|
|
231
215
|
} = select( editorStore );
|
|
232
216
|
return {
|
|
233
217
|
isSaving: isSavingPost(),
|
|
@@ -242,6 +226,8 @@ export default compose( [
|
|
|
242
226
|
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
243
227
|
postType: getCurrentPostType(),
|
|
244
228
|
postId: getCurrentPostId(),
|
|
229
|
+
postStatus: getEditedPostAttribute( 'status' ),
|
|
230
|
+
postStatusHasChanged: getPostEdits()?.status,
|
|
245
231
|
hasNonPostEntityChanges: hasNonPostEntityChanges(),
|
|
246
232
|
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
|
|
247
233
|
};
|
|
@@ -249,9 +235,10 @@ export default compose( [
|
|
|
249
235
|
withDispatch( ( dispatch ) => {
|
|
250
236
|
const { editPost, savePost } = dispatch( editorStore );
|
|
251
237
|
return {
|
|
252
|
-
|
|
253
|
-
editPost( { status }, { undoIgnore: true } )
|
|
254
|
-
|
|
238
|
+
savePostStatus: ( status ) => {
|
|
239
|
+
editPost( { status }, { undoIgnore: true } );
|
|
240
|
+
savePost();
|
|
241
|
+
},
|
|
255
242
|
};
|
|
256
243
|
} ),
|
|
257
244
|
] )( PostPublishButton );
|
|
@@ -2,49 +2,27 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { store as editorStore } from '../../store';
|
|
12
12
|
|
|
13
|
-
export function PublishButtonLabel( {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
/* translators: button label text should, if possible, be under 16 characters. */
|
|
27
|
-
return __( 'Updating…' );
|
|
28
|
-
} else if ( isBeingScheduled && isSaving && ! isAutosaving ) {
|
|
29
|
-
/* translators: button label text should, if possible, be under 16 characters. */
|
|
30
|
-
return __( 'Scheduling…' );
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if ( ! hasPublishAction ) {
|
|
34
|
-
return hasNonPostEntityChanges
|
|
35
|
-
? __( 'Submit for Review…' )
|
|
36
|
-
: __( 'Submit for Review' );
|
|
37
|
-
} else if ( isPublished ) {
|
|
38
|
-
return hasNonPostEntityChanges ? __( 'Update…' ) : __( 'Update' );
|
|
39
|
-
} else if ( isBeingScheduled ) {
|
|
40
|
-
return hasNonPostEntityChanges ? __( 'Schedule…' ) : __( 'Schedule' );
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return __( 'Publish' );
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default compose( [
|
|
47
|
-
withSelect( ( select ) => {
|
|
13
|
+
export default function PublishButtonLabel() {
|
|
14
|
+
const isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );
|
|
15
|
+
const {
|
|
16
|
+
isPublished,
|
|
17
|
+
isBeingScheduled,
|
|
18
|
+
isSaving,
|
|
19
|
+
isPublishing,
|
|
20
|
+
hasPublishAction,
|
|
21
|
+
isAutosaving,
|
|
22
|
+
hasNonPostEntityChanges,
|
|
23
|
+
postStatusHasChanged,
|
|
24
|
+
postStatus,
|
|
25
|
+
} = useSelect( ( select ) => {
|
|
48
26
|
const {
|
|
49
27
|
isCurrentPostPublished,
|
|
50
28
|
isEditedPostBeingScheduled,
|
|
@@ -53,6 +31,8 @@ export default compose( [
|
|
|
53
31
|
getCurrentPost,
|
|
54
32
|
getCurrentPostType,
|
|
55
33
|
isAutosavingPost,
|
|
34
|
+
getPostEdits,
|
|
35
|
+
getEditedPostAttribute,
|
|
56
36
|
} = select( editorStore );
|
|
57
37
|
return {
|
|
58
38
|
isPublished: isCurrentPostPublished(),
|
|
@@ -63,6 +43,41 @@ export default compose( [
|
|
|
63
43
|
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
64
44
|
postType: getCurrentPostType(),
|
|
65
45
|
isAutosaving: isAutosavingPost(),
|
|
46
|
+
hasNonPostEntityChanges:
|
|
47
|
+
select( editorStore ).hasNonPostEntityChanges(),
|
|
48
|
+
postStatusHasChanged: !! getPostEdits()?.status,
|
|
49
|
+
postStatus: getEditedPostAttribute( 'status' ),
|
|
66
50
|
};
|
|
67
|
-
} )
|
|
68
|
-
|
|
51
|
+
}, [] );
|
|
52
|
+
if ( isPublishing ) {
|
|
53
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
54
|
+
return __( 'Publishing…' );
|
|
55
|
+
} else if (
|
|
56
|
+
( isPublished || isBeingScheduled ) &&
|
|
57
|
+
isSaving &&
|
|
58
|
+
! isAutosaving
|
|
59
|
+
) {
|
|
60
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
61
|
+
return __( 'Saving…' );
|
|
62
|
+
}
|
|
63
|
+
if ( ! hasPublishAction ) {
|
|
64
|
+
// TODO: this is because "Submit for review" string is too long in some languages.
|
|
65
|
+
// @see https://github.com/WordPress/gutenberg/issues/10475
|
|
66
|
+
return isSmallerThanMediumViewport
|
|
67
|
+
? __( 'Publish' )
|
|
68
|
+
: __( 'Submit for Review' );
|
|
69
|
+
}
|
|
70
|
+
if (
|
|
71
|
+
hasNonPostEntityChanges ||
|
|
72
|
+
isPublished ||
|
|
73
|
+
( postStatusHasChanged &&
|
|
74
|
+
! [ 'future', 'publish' ].includes( postStatus ) ) ||
|
|
75
|
+
( ! postStatusHasChanged && postStatus === 'future' )
|
|
76
|
+
) {
|
|
77
|
+
return __( 'Save' );
|
|
78
|
+
}
|
|
79
|
+
if ( isBeingScheduled ) {
|
|
80
|
+
return __( 'Schedule' );
|
|
81
|
+
}
|
|
82
|
+
return __( 'Publish' );
|
|
83
|
+
}
|