@wordpress/editor 13.31.0 → 13.33.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 +1080 -0
- 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 +10 -0
- 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 +107 -0
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/commands/index.js +20 -1
- package/build/components/commands/index.js.map +1 -1
- package/build/components/commands/index.native.js.map +1 -1
- package/build/components/deprecated.js +158 -0
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/document-bar/index.js +5 -8
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js.map +1 -1
- 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 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +12 -38
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +5 -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.map +1 -1
- 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.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 +11 -85
- 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 +24 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +57 -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 +5 -1
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +78 -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 +2 -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/offline-status/index.native.js.map +1 -1
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js +30 -0
- package/build/components/pattern-overrides-panel/index.js.map +1 -0
- 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 +68 -0
- package/build/components/plugin-post-publish-panel/index.js.map +1 -0
- 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 +71 -0
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
- 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 +656 -0
- package/build/components/post-actions/actions.js.map +1 -0
- package/build/components/post-actions/index.js +137 -0
- package/build/components/post-actions/index.js.map +1 -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.map +1 -1
- 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 +127 -0
- package/build/components/post-card-panel/index.js.map +1 -0
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +8 -0
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- 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.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-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-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 +8 -0
- 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 +6 -2
- package/build/components/post-template/block-theme.js.map +1 -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.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 +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 +44 -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 +14 -7
- 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/index.js +19 -17
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +36 -20
- 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 +70 -50
- 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/start-page-options/index.js +139 -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 +70 -0
- package/build/components/template-areas/index.js.map +1 -0
- 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 +87 -0
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
- 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 +26 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +46 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +10 -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 +253 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +50 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +14 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +25 -20
- 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 +71 -0
- package/build/store/utils/get-filtered-template-parts.js.map +1 -0
- 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 +10 -0
- 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 +100 -0
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/commands/index.js +21 -2
- 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 +159 -0
- 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 +6 -9
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js.map +1 -1
- 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 +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +14 -40
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +5 -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.map +1 -1
- 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.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 +11 -85
- 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 +24 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +7 -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 +5 -1
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -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 +2 -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/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js +23 -0
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
- 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 +61 -0
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
- 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 +64 -0
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
- 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 +648 -0
- package/build-module/components/post-actions/actions.js.map +1 -0
- package/build-module/components/post-actions/index.js +130 -0
- package/build-module/components/post-actions/index.js.map +1 -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.map +1 -1
- 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 +119 -0
- package/build-module/components/post-card-panel/index.js.map +1 -0
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +9 -0
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- 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.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-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-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 +8 -0
- 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 +7 -3
- package/build-module/components/post-template/block-theme.js.map +1 -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.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 +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 +46 -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 +14 -7
- 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/index.js +19 -17
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
- 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 +73 -53
- 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/start-page-options/index.js +132 -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 +63 -0
- package/build-module/components/template-areas/index.js.map +1 -0
- 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 +80 -0
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
- 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 +24 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +37 -3
- 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 +9 -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 +249 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +50 -4
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +13 -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 +20 -16
- 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 +64 -0
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
- 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 +565 -49
- package/build-style/style.css +565 -49
- package/package.json +36 -36
- package/src/bindings/post-meta.js +11 -27
- package/src/components/autosave-monitor/index.js +9 -0
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
- package/src/components/commands/index.js +21 -2
- package/src/components/deprecated.js +157 -0
- package/src/components/document-bar/index.js +9 -15
- package/src/components/document-bar/style.scss +9 -12
- package/src/components/document-tools/index.js +16 -14
- package/src/components/document-tools/style.scss +4 -11
- package/src/components/editor-canvas/edit-template-blocks-notification.js +17 -53
- package/src/components/editor-canvas/index.js +8 -4
- package/src/components/entities-saved-states/index.js +12 -113
- package/src/components/error-boundary/style.native.scss +1 -1
- package/src/components/global-keyboard-shortcuts/index.js +25 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
- package/src/components/index.js +7 -0
- package/src/components/inserter-sidebar/index.js +7 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +53 -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 -0
- package/src/components/list-view-sidebar/style.scss +1 -1
- package/src/components/pattern-overrides-panel/index.js +26 -0
- package/src/components/plugin-more-menu-item/index.js +73 -0
- package/src/components/plugin-post-publish-panel/index.js +64 -0
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
- package/src/components/plugin-post-publish-panel/test/index.js +33 -0
- package/src/components/plugin-post-status-info/index.js +63 -0
- package/src/components/plugin-pre-publish-panel/index.js +67 -0
- package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
- 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 +862 -0
- package/src/components/post-actions/index.js +156 -0
- package/src/components/post-actions/style.scss +3 -0
- package/src/components/post-card-panel/index.js +168 -0
- package/src/components/post-card-panel/style.scss +32 -0
- package/src/components/post-excerpt/check.js +8 -0
- package/src/components/post-featured-image/style.scss +3 -2
- 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/test/index.js +15 -26
- package/src/components/post-publish-button/test/label.js +44 -21
- 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 +22 -0
- 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 +310 -0
- package/src/components/post-status/style.scss +75 -0
- package/src/components/post-switch-to-draft-button/index.js +5 -0
- package/src/components/post-template/block-theme.js +31 -22
- package/src/components/post-title/index.native.js +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 +131 -101
- package/src/components/post-url/panel.js +20 -7
- package/src/components/post-url/style.scss +8 -6
- package/src/components/post-visibility/index.js +1 -0
- package/src/components/preferences-modal/index.js +26 -22
- package/src/components/provider/disable-non-page-content-blocks.js +40 -20
- 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 +70 -44
- package/src/components/provider/with-registry-provider.js +1 -0
- package/src/components/start-page-options/index.js +135 -0
- package/src/components/start-page-options/style.scss +26 -0
- package/src/components/template-areas/index.js +85 -0
- package/src/components/template-areas/style.scss +23 -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/hooks/use-select-nearest-editable-block.js +95 -0
- package/src/private-apis.js +21 -0
- package/src/store/actions.js +37 -3
- package/src/store/constants.js +9 -0
- package/src/store/private-actions.js +377 -1
- package/src/store/private-selectors.js +101 -18
- package/src/store/reducer.js +13 -0
- package/src/store/selectors.js +51 -46
- package/src/store/utils/get-filtered-template-parts.js +69 -0
- package/src/store/utils/is-template-revertable.js +23 -0
- package/src/store/utils/test/get-filtered-template-parts.js +189 -0
- package/src/style.scss +8 -2
- package/src/components/post-publish-button/style.scss +0 -8
- package/src/components/provider/test/disable-non-page-content-blocks.js +0 -90
- package/src/components/template-validation-notice/style.scss +0 -9
|
@@ -15,13 +15,7 @@ import {
|
|
|
15
15
|
__unstableAnimatePresence as AnimatePresence,
|
|
16
16
|
} from '@wordpress/components';
|
|
17
17
|
import { BlockIcon } from '@wordpress/block-editor';
|
|
18
|
-
import {
|
|
19
|
-
chevronLeftSmall,
|
|
20
|
-
chevronRightSmall,
|
|
21
|
-
page as pageIcon,
|
|
22
|
-
navigation as navigationIcon,
|
|
23
|
-
symbol,
|
|
24
|
-
} from '@wordpress/icons';
|
|
18
|
+
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
25
19
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
26
20
|
import { store as coreStore } from '@wordpress/core-data';
|
|
27
21
|
import { store as commandsStore } from '@wordpress/commands';
|
|
@@ -32,6 +26,7 @@ import { useReducedMotion } from '@wordpress/compose';
|
|
|
32
26
|
* Internal dependencies
|
|
33
27
|
*/
|
|
34
28
|
import { store as editorStore } from '../../store';
|
|
29
|
+
import { unlock } from '../../lock-unlock';
|
|
35
30
|
|
|
36
31
|
const TYPE_LABELS = {
|
|
37
32
|
// translators: 1: Pattern title.
|
|
@@ -44,11 +39,6 @@ const TYPE_LABELS = {
|
|
|
44
39
|
wp_template_part: __( 'Editing template part: %s' ),
|
|
45
40
|
};
|
|
46
41
|
|
|
47
|
-
const ICONS = {
|
|
48
|
-
wp_block: symbol,
|
|
49
|
-
wp_navigation: navigationIcon,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
42
|
const TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];
|
|
53
43
|
|
|
54
44
|
const GLOBAL_POST_TYPES = [
|
|
@@ -93,7 +83,12 @@ export default function DocumentBar() {
|
|
|
93
83
|
_postType,
|
|
94
84
|
_postId
|
|
95
85
|
),
|
|
96
|
-
templateIcon:
|
|
86
|
+
templateIcon: unlock( select( editorStore ) ).getPostIcon(
|
|
87
|
+
_postType,
|
|
88
|
+
{
|
|
89
|
+
area: _document?.area,
|
|
90
|
+
}
|
|
91
|
+
),
|
|
97
92
|
templateTitle: _templateInfo.title,
|
|
98
93
|
onNavigateToPreviousEntityRecord:
|
|
99
94
|
getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
@@ -104,7 +99,6 @@ export default function DocumentBar() {
|
|
|
104
99
|
const isReducedMotion = useReducedMotion();
|
|
105
100
|
|
|
106
101
|
const isNotFound = ! document && ! isResolving;
|
|
107
|
-
const icon = ICONS[ postType ] ?? pageIcon;
|
|
108
102
|
const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
|
|
109
103
|
const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
|
|
110
104
|
const hasBackButton = !! onNavigateToPreviousEntityRecord;
|
|
@@ -177,7 +171,7 @@ export default function DocumentBar() {
|
|
|
177
171
|
isReducedMotion ? { duration: 0 } : undefined
|
|
178
172
|
}
|
|
179
173
|
>
|
|
180
|
-
<BlockIcon icon={
|
|
174
|
+
<BlockIcon icon={ templateIcon } />
|
|
181
175
|
<Text
|
|
182
176
|
size="body"
|
|
183
177
|
as="h1"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
min-width: 0;
|
|
11
11
|
background: $gray-100;
|
|
12
12
|
border-radius: $grid-unit-05;
|
|
13
|
-
width: min(100%,
|
|
13
|
+
width: min(100%, 416px);
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
background-color: $gray-200;
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
.components-button {
|
|
20
20
|
border-radius: $grid-unit-05;
|
|
21
|
+
transition: all 0.1s ease-out;
|
|
22
|
+
@include reduce-motion("transition");
|
|
21
23
|
|
|
22
24
|
&:hover {
|
|
23
|
-
color: var(--wp-block-synced-color);
|
|
24
25
|
background: $gray-200;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -39,19 +40,15 @@
|
|
|
39
40
|
.editor-document-bar__title {
|
|
40
41
|
flex-grow: 1;
|
|
41
42
|
overflow: hidden;
|
|
42
|
-
color: $gray-
|
|
43
|
+
color: $gray-900;
|
|
43
44
|
gap: $grid-unit-05;
|
|
44
45
|
display: flex;
|
|
45
46
|
justify-content: center;
|
|
46
47
|
align-items: center;
|
|
47
48
|
|
|
48
49
|
// Offset the layout based on the width of the ⌘K label. This ensures the title is centrally aligned.
|
|
49
|
-
@include break-
|
|
50
|
-
padding-left: $grid-unit-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&:hover {
|
|
54
|
-
color: var(--wp-block-synced-color);
|
|
50
|
+
@include break-medium() {
|
|
51
|
+
padding-left: $grid-unit-30;
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
.editor-document-bar.is-global & {
|
|
@@ -67,14 +64,14 @@
|
|
|
67
64
|
white-space: nowrap;
|
|
68
65
|
overflow: hidden;
|
|
69
66
|
text-overflow: ellipsis;
|
|
70
|
-
max-width:
|
|
67
|
+
max-width: 70%;
|
|
71
68
|
color: currentColor;
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
.editor-document-bar__shortcut {
|
|
76
73
|
color: $gray-800;
|
|
77
|
-
min-width: $grid-unit-
|
|
74
|
+
min-width: $grid-unit-30;
|
|
78
75
|
display: none;
|
|
79
76
|
|
|
80
77
|
@include break-medium() {
|
|
@@ -91,7 +88,7 @@
|
|
|
91
88
|
position: absolute;
|
|
92
89
|
|
|
93
90
|
&:hover {
|
|
94
|
-
color:
|
|
91
|
+
color: $gray-900;
|
|
95
92
|
background-color: transparent;
|
|
96
93
|
}
|
|
97
94
|
}
|
|
@@ -121,20 +121,22 @@ function DocumentTools( {
|
|
|
121
121
|
variant="unstyled"
|
|
122
122
|
>
|
|
123
123
|
<div className="editor-document-tools__left">
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
{ ! isDistractionFree && (
|
|
125
|
+
<ToolbarItem
|
|
126
|
+
ref={ inserterButton }
|
|
127
|
+
as={ Button }
|
|
128
|
+
className="editor-document-tools__inserter-toggle"
|
|
129
|
+
variant="primary"
|
|
130
|
+
isPressed={ isInserterOpened }
|
|
131
|
+
onMouseDown={ preventDefault }
|
|
132
|
+
onClick={ toggleInserter }
|
|
133
|
+
disabled={ disableBlockTools }
|
|
134
|
+
icon={ plus }
|
|
135
|
+
label={ showIconLabels ? shortLabel : longLabel }
|
|
136
|
+
showTooltip={ ! showIconLabels }
|
|
137
|
+
aria-expanded={ isInserterOpened }
|
|
138
|
+
/>
|
|
139
|
+
) }
|
|
138
140
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
139
141
|
<>
|
|
140
142
|
{ isLargeViewport && ! hasFixedToolbar && (
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
|
5
5
|
// Hide all action buttons except the inserter on mobile.
|
|
6
|
-
.editor-document-tools__left > .
|
|
6
|
+
.editor-document-tools__left > .editor-history__redo,
|
|
7
|
+
.editor-document-tools__left > .editor-history__undo {
|
|
7
8
|
display: none;
|
|
8
9
|
|
|
9
|
-
@include break-
|
|
10
|
+
@include break-medium() {
|
|
10
11
|
display: inline-flex;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
// here to the original button styles
|
|
40
41
|
.editor-document-tools__left > .components-button.has-icon,
|
|
41
42
|
.editor-document-tools__left > .components-dropdown > .components-button.has-icon {
|
|
42
|
-
// @todo
|
|
43
|
+
// @todo override toolbar group inherited paddings from components/block-tools/style.scss.
|
|
43
44
|
// This is best fixed by making the mover control area a proper single toolbar group.
|
|
44
45
|
// It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon.
|
|
45
46
|
height: $button-size-compact;
|
|
@@ -70,14 +71,6 @@
|
|
|
70
71
|
// Some plugins add buttons here despite best practices.
|
|
71
72
|
// Push them a bit rightwards to fit the top toolbar.
|
|
72
73
|
margin-right: $grid-unit-10;
|
|
73
|
-
|
|
74
|
-
@include break-medium() {
|
|
75
|
-
padding-left: $grid-unit-50 * 0.5;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@include break-wide() {
|
|
79
|
-
padding-right: $grid-unit-10;
|
|
80
|
-
}
|
|
81
74
|
}
|
|
82
75
|
|
|
83
76
|
.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
9
9
|
|
|
@@ -38,73 +38,35 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
38
38
|
};
|
|
39
39
|
}, [] );
|
|
40
40
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const canEditTemplate = useSelect(
|
|
42
|
+
( select ) =>
|
|
43
|
+
select( coreStore ).canUser( 'create', 'templates' ) ?? false
|
|
44
|
+
);
|
|
44
45
|
|
|
45
46
|
const [ isDialogOpen, setIsDialogOpen ] = useState( false );
|
|
46
47
|
|
|
47
|
-
const lastNoticeId = useRef( 0 );
|
|
48
|
-
|
|
49
48
|
useEffect( () => {
|
|
50
|
-
const
|
|
51
|
-
if ( !
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const isNoticeAlreadyShowing = getNotices().some(
|
|
56
|
-
( notice ) => notice.id === lastNoticeId.current
|
|
57
|
-
);
|
|
58
|
-
if ( isNoticeAlreadyShowing ) {
|
|
49
|
+
const handleDblClick = ( event ) => {
|
|
50
|
+
if ( ! canEditTemplate ) {
|
|
59
51
|
return;
|
|
60
52
|
}
|
|
61
53
|
|
|
62
|
-
const { notice } = await createInfoNotice(
|
|
63
|
-
__( 'Edit your template to edit this block.' ),
|
|
64
|
-
{
|
|
65
|
-
isDismissible: true,
|
|
66
|
-
type: 'snackbar',
|
|
67
|
-
actions: [
|
|
68
|
-
{
|
|
69
|
-
label: __( 'Edit template' ),
|
|
70
|
-
onClick: () =>
|
|
71
|
-
onNavigateToEntityRecord( {
|
|
72
|
-
postId: templateId,
|
|
73
|
-
postType: 'wp_template',
|
|
74
|
-
} ),
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
lastNoticeId.current = notice.id;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const handleDblClick = ( event ) => {
|
|
83
54
|
if ( ! event.target.classList.contains( 'is-root-container' ) ) {
|
|
84
55
|
return;
|
|
85
56
|
}
|
|
86
|
-
if ( lastNoticeId.current ) {
|
|
87
|
-
removeNotice( lastNoticeId.current );
|
|
88
|
-
}
|
|
89
57
|
setIsDialogOpen( true );
|
|
90
58
|
};
|
|
91
59
|
|
|
92
60
|
const canvas = contentRef.current;
|
|
93
|
-
canvas?.addEventListener( 'click', handleClick );
|
|
94
61
|
canvas?.addEventListener( 'dblclick', handleDblClick );
|
|
95
62
|
return () => {
|
|
96
|
-
canvas?.removeEventListener( 'click', handleClick );
|
|
97
63
|
canvas?.removeEventListener( 'dblclick', handleDblClick );
|
|
98
64
|
};
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onNavigateToEntityRecord,
|
|
105
|
-
templateId,
|
|
106
|
-
removeNotice,
|
|
107
|
-
] );
|
|
65
|
+
}, [ contentRef, canEditTemplate ] );
|
|
66
|
+
|
|
67
|
+
if ( ! canEditTemplate ) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
108
70
|
|
|
109
71
|
return (
|
|
110
72
|
<ConfirmDialog
|
|
@@ -119,7 +81,9 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
119
81
|
} }
|
|
120
82
|
onCancel={ () => setIsDialogOpen( false ) }
|
|
121
83
|
>
|
|
122
|
-
{ __(
|
|
84
|
+
{ __(
|
|
85
|
+
'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?.'
|
|
86
|
+
) }
|
|
123
87
|
</ConfirmDialog>
|
|
124
88
|
);
|
|
125
89
|
}
|
|
@@ -29,6 +29,7 @@ import PostTitle from '../post-title';
|
|
|
29
29
|
import { store as editorStore } from '../../store';
|
|
30
30
|
import { unlock } from '../../lock-unlock';
|
|
31
31
|
import EditTemplateBlocksNotification from './edit-template-blocks-notification';
|
|
32
|
+
import useSelectNearestEditableBlock from '../../hooks/use-select-nearest-editable-block';
|
|
32
33
|
|
|
33
34
|
const {
|
|
34
35
|
LayoutStyle,
|
|
@@ -38,8 +39,6 @@ const {
|
|
|
38
39
|
useFlashEditableBlocks,
|
|
39
40
|
} = unlock( blockEditorPrivateApis );
|
|
40
41
|
|
|
41
|
-
const noop = () => {};
|
|
42
|
-
|
|
43
42
|
/**
|
|
44
43
|
* These post types have a special editor where they don't allow you to fill the title
|
|
45
44
|
* and they don't apply the layout styles.
|
|
@@ -94,6 +93,7 @@ function EditorCanvas( {
|
|
|
94
93
|
styles,
|
|
95
94
|
disableIframe = false,
|
|
96
95
|
iframeProps,
|
|
96
|
+
contentRef,
|
|
97
97
|
children,
|
|
98
98
|
} ) {
|
|
99
99
|
const {
|
|
@@ -307,12 +307,16 @@ function EditorCanvas( {
|
|
|
307
307
|
|
|
308
308
|
const localRef = useRef();
|
|
309
309
|
const typewriterRef = useTypewriter();
|
|
310
|
-
|
|
310
|
+
contentRef = useMergeRefs( [
|
|
311
311
|
localRef,
|
|
312
|
-
|
|
312
|
+
contentRef,
|
|
313
|
+
renderingMode === 'post-only' ? typewriterRef : null,
|
|
313
314
|
useFlashEditableBlocks( {
|
|
314
315
|
isEnabled: renderingMode === 'template-locked',
|
|
315
316
|
} ),
|
|
317
|
+
useSelectNearestEditableBlock( {
|
|
318
|
+
isEnabled: renderingMode === 'template-locked',
|
|
319
|
+
} ),
|
|
316
320
|
] );
|
|
317
321
|
|
|
318
322
|
return (
|
|
@@ -3,32 +3,24 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Button, Flex, FlexItem } from '@wordpress/components';
|
|
5
5
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
6
|
import {
|
|
8
7
|
useCallback,
|
|
9
8
|
useRef,
|
|
10
9
|
createInterpolateElement,
|
|
11
10
|
} from '@wordpress/element';
|
|
12
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
14
11
|
import {
|
|
15
12
|
__experimentalUseDialog as useDialog,
|
|
16
13
|
useInstanceId,
|
|
17
14
|
} from '@wordpress/compose';
|
|
18
|
-
import {
|
|
15
|
+
import { useDispatch } from '@wordpress/data';
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
* Internal dependencies
|
|
22
19
|
*/
|
|
23
20
|
import EntityTypeList from './entity-type-list';
|
|
24
21
|
import { useIsDirty } from './hooks/use-is-dirty';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
kind: 'postType',
|
|
29
|
-
name: 'wp_navigation',
|
|
30
|
-
},
|
|
31
|
-
];
|
|
22
|
+
import { store as editorStore } from '../../store';
|
|
23
|
+
import { unlock } from '../../lock-unlock';
|
|
32
24
|
|
|
33
25
|
function identity( values ) {
|
|
34
26
|
return values;
|
|
@@ -55,25 +47,13 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
55
47
|
saveEnabled: saveEnabledProp = undefined,
|
|
56
48
|
saveLabel = __( 'Save' ),
|
|
57
49
|
renderDialog = undefined,
|
|
58
|
-
|
|
59
50
|
dirtyEntityRecords,
|
|
60
51
|
isDirty,
|
|
61
52
|
setUnselectedEntities,
|
|
62
53
|
unselectedEntities,
|
|
63
54
|
} ) {
|
|
64
55
|
const saveButtonRef = useRef();
|
|
65
|
-
const {
|
|
66
|
-
editEntityRecord,
|
|
67
|
-
saveEditedEntityRecord,
|
|
68
|
-
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,
|
|
69
|
-
} = useDispatch( coreStore );
|
|
70
|
-
|
|
71
|
-
const { __unstableMarkLastChangeAsPersistent } =
|
|
72
|
-
useDispatch( blockEditorStore );
|
|
73
|
-
|
|
74
|
-
const { createSuccessNotice, createErrorNotice, removeNotice } =
|
|
75
|
-
useDispatch( noticesStore );
|
|
76
|
-
|
|
56
|
+
const { saveDirtyEntities } = unlock( useDispatch( editorStore ) );
|
|
77
57
|
// To group entities by type.
|
|
78
58
|
const partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {
|
|
79
59
|
const { name } = record;
|
|
@@ -99,94 +79,6 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
99
79
|
].filter( Array.isArray );
|
|
100
80
|
|
|
101
81
|
const saveEnabled = saveEnabledProp ?? isDirty;
|
|
102
|
-
|
|
103
|
-
const { homeUrl } = useSelect( ( select ) => {
|
|
104
|
-
const {
|
|
105
|
-
getUnstableBase, // Site index.
|
|
106
|
-
} = select( coreStore );
|
|
107
|
-
return {
|
|
108
|
-
homeUrl: getUnstableBase()?.home,
|
|
109
|
-
};
|
|
110
|
-
}, [] );
|
|
111
|
-
|
|
112
|
-
const saveCheckedEntities = () => {
|
|
113
|
-
const saveNoticeId = 'site-editor-save-success';
|
|
114
|
-
removeNotice( saveNoticeId );
|
|
115
|
-
const entitiesToSave = dirtyEntityRecords.filter(
|
|
116
|
-
( { kind, name, key, property } ) => {
|
|
117
|
-
return ! unselectedEntities.some(
|
|
118
|
-
( elt ) =>
|
|
119
|
-
elt.kind === kind &&
|
|
120
|
-
elt.name === name &&
|
|
121
|
-
elt.key === key &&
|
|
122
|
-
elt.property === property
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
close( entitiesToSave );
|
|
128
|
-
|
|
129
|
-
const siteItemsToSave = [];
|
|
130
|
-
const pendingSavedRecords = [];
|
|
131
|
-
entitiesToSave.forEach( ( { kind, name, key, property } ) => {
|
|
132
|
-
if ( 'root' === kind && 'site' === name ) {
|
|
133
|
-
siteItemsToSave.push( property );
|
|
134
|
-
} else {
|
|
135
|
-
if (
|
|
136
|
-
PUBLISH_ON_SAVE_ENTITIES.some(
|
|
137
|
-
( typeToPublish ) =>
|
|
138
|
-
typeToPublish.kind === kind &&
|
|
139
|
-
typeToPublish.name === name
|
|
140
|
-
)
|
|
141
|
-
) {
|
|
142
|
-
editEntityRecord( kind, name, key, { status: 'publish' } );
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
pendingSavedRecords.push(
|
|
146
|
-
saveEditedEntityRecord( kind, name, key )
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
} );
|
|
150
|
-
if ( siteItemsToSave.length ) {
|
|
151
|
-
pendingSavedRecords.push(
|
|
152
|
-
saveSpecifiedEntityEdits(
|
|
153
|
-
'root',
|
|
154
|
-
'site',
|
|
155
|
-
undefined,
|
|
156
|
-
siteItemsToSave
|
|
157
|
-
)
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
__unstableMarkLastChangeAsPersistent();
|
|
162
|
-
|
|
163
|
-
Promise.all( pendingSavedRecords )
|
|
164
|
-
.then( ( values ) => {
|
|
165
|
-
return onSave( values );
|
|
166
|
-
} )
|
|
167
|
-
.then( ( values ) => {
|
|
168
|
-
if (
|
|
169
|
-
values.some( ( value ) => typeof value === 'undefined' )
|
|
170
|
-
) {
|
|
171
|
-
createErrorNotice( __( 'Saving failed.' ) );
|
|
172
|
-
} else {
|
|
173
|
-
createSuccessNotice( __( 'Site updated.' ), {
|
|
174
|
-
type: 'snackbar',
|
|
175
|
-
id: saveNoticeId,
|
|
176
|
-
actions: [
|
|
177
|
-
{
|
|
178
|
-
label: __( 'View site' ),
|
|
179
|
-
url: homeUrl,
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
} );
|
|
183
|
-
}
|
|
184
|
-
} )
|
|
185
|
-
.catch( ( error ) =>
|
|
186
|
-
createErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )
|
|
187
|
-
);
|
|
188
|
-
};
|
|
189
|
-
|
|
190
82
|
// Explicitly define this with no argument passed. Using `close` on
|
|
191
83
|
// its own will use the event object in place of the expected saved entities.
|
|
192
84
|
const dismissPanel = useCallback( () => close(), [ close ] );
|
|
@@ -217,7 +109,14 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
217
109
|
variant="primary"
|
|
218
110
|
disabled={ ! saveEnabled }
|
|
219
111
|
__experimentalIsFocusable
|
|
220
|
-
onClick={
|
|
112
|
+
onClick={ () =>
|
|
113
|
+
saveDirtyEntities( {
|
|
114
|
+
onSave,
|
|
115
|
+
dirtyEntityRecords,
|
|
116
|
+
entitiesToSkip: unselectedEntities,
|
|
117
|
+
close,
|
|
118
|
+
} )
|
|
119
|
+
}
|
|
221
120
|
className="editor-entities-saved-states__save-button"
|
|
222
121
|
>
|
|
223
122
|
{ saveLabel }
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
7
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Internal dependencies
|
|
@@ -15,6 +17,10 @@ export default function EditorKeyboardShortcuts() {
|
|
|
15
17
|
select( editorStore ).getEditorSettings();
|
|
16
18
|
return ! richEditingEnabled || ! codeEditingEnabled;
|
|
17
19
|
}, [] );
|
|
20
|
+
const { getBlockSelectionStart } = useSelect( blockEditorStore );
|
|
21
|
+
const { getActiveComplementaryArea } = useSelect( interfaceStore );
|
|
22
|
+
const { enableComplementaryArea, disableComplementaryArea } =
|
|
23
|
+
useDispatch( interfaceStore );
|
|
18
24
|
const {
|
|
19
25
|
redo,
|
|
20
26
|
undo,
|
|
@@ -86,5 +92,24 @@ export default function EditorKeyboardShortcuts() {
|
|
|
86
92
|
}
|
|
87
93
|
} );
|
|
88
94
|
|
|
95
|
+
useShortcut( 'core/editor/toggle-sidebar', ( event ) => {
|
|
96
|
+
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
97
|
+
// obscure shortcuts from triggering.
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
const isEditorSidebarOpened = [
|
|
100
|
+
'edit-post/document',
|
|
101
|
+
'edit-post/block',
|
|
102
|
+
].includes( getActiveComplementaryArea( 'core' ) );
|
|
103
|
+
|
|
104
|
+
if ( isEditorSidebarOpened ) {
|
|
105
|
+
disableComplementaryArea( 'core' );
|
|
106
|
+
} else {
|
|
107
|
+
const sidebarToOpen = getBlockSelectionStart()
|
|
108
|
+
? 'edit-post/block'
|
|
109
|
+
: 'edit-post/document';
|
|
110
|
+
enableComplementaryArea( 'core', sidebarToOpen );
|
|
111
|
+
}
|
|
112
|
+
} );
|
|
113
|
+
|
|
89
114
|
return null;
|
|
90
115
|
}
|
|
@@ -83,6 +83,26 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
83
83
|
character: '\\',
|
|
84
84
|
},
|
|
85
85
|
} );
|
|
86
|
+
|
|
87
|
+
registerShortcut( {
|
|
88
|
+
name: 'core/editor/toggle-sidebar',
|
|
89
|
+
category: 'global',
|
|
90
|
+
description: __( 'Show or hide the Settings sidebar.' ),
|
|
91
|
+
keyCombination: {
|
|
92
|
+
modifier: 'primaryShift',
|
|
93
|
+
character: ',',
|
|
94
|
+
},
|
|
95
|
+
} );
|
|
96
|
+
|
|
97
|
+
registerShortcut( {
|
|
98
|
+
name: 'core/editor/keyboard-shortcuts',
|
|
99
|
+
category: 'main',
|
|
100
|
+
description: __( 'Display these keyboard shortcuts.' ),
|
|
101
|
+
keyCombination: {
|
|
102
|
+
modifier: 'access',
|
|
103
|
+
character: 'h',
|
|
104
|
+
},
|
|
105
|
+
} );
|
|
86
106
|
}, [ registerShortcut ] );
|
|
87
107
|
|
|
88
108
|
return <BlockEditorKeyboardShortcuts.Register />;
|
package/src/components/index.js
CHANGED
|
@@ -27,6 +27,13 @@ export { default as PageAttributesPanel } from './page-attributes/panel';
|
|
|
27
27
|
export { default as PageAttributesParent } from './page-attributes/parent';
|
|
28
28
|
export { default as PageTemplate } from './post-template/classic-theme';
|
|
29
29
|
export { default as PluginDocumentSettingPanel } from './plugin-document-setting-panel';
|
|
30
|
+
export { default as PluginBlockSettingsMenuItem } from './block-settings-menu/plugin-block-settings-menu-item';
|
|
31
|
+
export { default as PluginMoreMenuItem } from './plugin-more-menu-item';
|
|
32
|
+
export { default as PluginPostPublishPanel } from './plugin-post-publish-panel';
|
|
33
|
+
export { default as PluginPostStatusInfo } from './plugin-post-status-info';
|
|
34
|
+
export { default as PluginPrePublishPanel } from './plugin-pre-publish-panel';
|
|
35
|
+
export { default as PluginSidebar } from './plugin-sidebar';
|
|
36
|
+
export { default as PluginSidebarMoreMenuItem } from './plugin-sidebar-more-menu-item';
|
|
30
37
|
export { default as PostTemplatePanel } from './post-template/panel';
|
|
31
38
|
export { default as PostAuthor } from './post-author';
|
|
32
39
|
export { default as PostAuthorCheck } from './post-author/check';
|
|
@@ -19,7 +19,10 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
19
19
|
import { unlock } from '../../lock-unlock';
|
|
20
20
|
import { store as editorStore } from '../../store';
|
|
21
21
|
|
|
22
|
-
export default function InserterSidebar(
|
|
22
|
+
export default function InserterSidebar( {
|
|
23
|
+
closeGeneralSidebar,
|
|
24
|
+
isRightSidebarOpen,
|
|
25
|
+
} ) {
|
|
23
26
|
const { insertionPoint, showMostUsedBlocks } = useSelect( ( select ) => {
|
|
24
27
|
const { getInsertionPoint } = unlock( select( editorStore ) );
|
|
25
28
|
const { get } = select( preferencesStore );
|
|
@@ -65,6 +68,9 @@ export default function InserterSidebar() {
|
|
|
65
68
|
insertionPoint.insertionIndex
|
|
66
69
|
}
|
|
67
70
|
__experimentalFilterValue={ insertionPoint.filterValue }
|
|
71
|
+
__experimentalOnPatternCategorySelection={
|
|
72
|
+
isRightSidebarOpen ? closeGeneralSidebar : undefined
|
|
73
|
+
}
|
|
68
74
|
ref={ libraryRef }
|
|
69
75
|
/>
|
|
70
76
|
</div>
|