@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.34.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,43 +31,43 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/commands": "^0.
|
|
40
|
-
"@wordpress/components": "^27.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
34
|
+
"@wordpress/a11y": "^3.57.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.54.0",
|
|
36
|
+
"@wordpress/blob": "^3.57.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.25.0",
|
|
38
|
+
"@wordpress/blocks": "^12.34.0",
|
|
39
|
+
"@wordpress/commands": "^0.28.0",
|
|
40
|
+
"@wordpress/components": "^27.5.0",
|
|
41
|
+
"@wordpress/compose": "^6.34.0",
|
|
42
|
+
"@wordpress/core-data": "^6.34.0",
|
|
43
|
+
"@wordpress/data": "^9.27.0",
|
|
44
|
+
"@wordpress/date": "^4.57.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.57.0",
|
|
46
|
+
"@wordpress/dom": "^3.57.0",
|
|
47
|
+
"@wordpress/element": "^5.34.0",
|
|
48
|
+
"@wordpress/hooks": "^3.57.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.57.0",
|
|
50
|
+
"@wordpress/i18n": "^4.57.0",
|
|
51
|
+
"@wordpress/icons": "^9.48.0",
|
|
52
|
+
"@wordpress/interface": "^5.34.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.34.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.57.0",
|
|
55
|
+
"@wordpress/media-utils": "^4.48.0",
|
|
56
|
+
"@wordpress/notices": "^4.25.0",
|
|
57
|
+
"@wordpress/patterns": "^1.18.0",
|
|
58
|
+
"@wordpress/plugins": "^6.25.0",
|
|
59
|
+
"@wordpress/preferences": "^3.34.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.39.0",
|
|
61
|
+
"@wordpress/reusable-blocks": "^4.34.0",
|
|
62
|
+
"@wordpress/rich-text": "^6.34.0",
|
|
63
|
+
"@wordpress/server-side-render": "^4.34.0",
|
|
64
|
+
"@wordpress/url": "^3.58.0",
|
|
65
|
+
"@wordpress/warning": "^2.57.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.57.0",
|
|
66
67
|
"classnames": "^2.3.1",
|
|
67
68
|
"date-fns": "^3.6.0",
|
|
68
69
|
"memize": "^2.1.0",
|
|
69
70
|
"react-autosize-textarea": "^7.1.0",
|
|
70
|
-
"rememo": "^4.0.2",
|
|
71
71
|
"remove-accents": "^0.5.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "581d8a5580dba8f600b7268d51eb554771ae482c"
|
|
81
81
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { useSelect } from '@wordpress/data';
|
|
4
|
+
import { store as coreDataStore } from '@wordpress/core-data';
|
|
6
5
|
import { _x } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
@@ -12,33 +12,17 @@ import { store as editorStore } from '../store';
|
|
|
12
12
|
export default {
|
|
13
13
|
name: 'core/post-meta',
|
|
14
14
|
label: _x( 'Post Meta', 'block bindings source' ),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
getPlaceholder( { args } ) {
|
|
16
|
+
return args.key;
|
|
17
|
+
},
|
|
18
|
+
getValue( { registry, context, args } ) {
|
|
19
19
|
const postType = context.postType
|
|
20
20
|
? context.postType
|
|
21
|
-
: getCurrentPostType();
|
|
22
|
-
|
|
23
|
-
const [ meta, setMeta ] = useEntityProp(
|
|
24
|
-
'postType',
|
|
25
|
-
context.postType,
|
|
26
|
-
'meta',
|
|
27
|
-
context.postId
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
if ( postType === 'wp_template' ) {
|
|
31
|
-
return { placeholder: metaKey };
|
|
32
|
-
}
|
|
33
|
-
const metaValue = meta[ metaKey ];
|
|
34
|
-
const updateMetaValue = ( newValue ) => {
|
|
35
|
-
setMeta( { ...meta, [ metaKey ]: newValue } );
|
|
36
|
-
};
|
|
21
|
+
: registry.select( editorStore ).getCurrentPostType();
|
|
37
22
|
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
23
|
+
return registry
|
|
24
|
+
.select( coreDataStore )
|
|
25
|
+
.getEditedEntityRecord( 'postType', postType, context.postId )
|
|
26
|
+
.meta?.[ args.key ];
|
|
43
27
|
},
|
|
44
28
|
};
|
|
@@ -11,17 +11,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
11
11
|
*/
|
|
12
12
|
import { store as editorStore } from '../../store';
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.
|
|
16
|
-
*
|
|
17
|
-
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
18
|
-
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
19
|
-
* the specific way of detecting changes.
|
|
20
|
-
*
|
|
21
|
-
* There are two caveats:
|
|
22
|
-
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
23
|
-
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
24
|
-
*/
|
|
25
14
|
export class AutosaveMonitor extends Component {
|
|
26
15
|
constructor( props ) {
|
|
27
16
|
super( props );
|
|
@@ -91,6 +80,29 @@ export class AutosaveMonitor extends Component {
|
|
|
91
80
|
}
|
|
92
81
|
}
|
|
93
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
85
|
+
*
|
|
86
|
+
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
87
|
+
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
88
|
+
* the specific way of detecting changes.
|
|
89
|
+
*
|
|
90
|
+
* There are two caveats:
|
|
91
|
+
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
92
|
+
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
93
|
+
*
|
|
94
|
+
* @param {Object} props - The properties passed to the component.
|
|
95
|
+
* @param {Function} props.autosave - The function to call when changes need to be saved.
|
|
96
|
+
* @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.
|
|
97
|
+
* @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.
|
|
98
|
+
* @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.
|
|
99
|
+
* @param {boolean} props.isDirty - Indicates if there are unsaved changes.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```jsx
|
|
103
|
+
* <AutosaveMonitor interval={30000} />
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
94
106
|
export default compose( [
|
|
95
107
|
withSelect( ( select, ownProps ) => {
|
|
96
108
|
const { getReferenceByDistinctEdits } = select( coreStore );
|
|
@@ -9,6 +9,11 @@ import { count as characterCount } from '@wordpress/wordcount';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Renders the character count of the post content.
|
|
14
|
+
*
|
|
15
|
+
* @return {number} The character count.
|
|
16
|
+
*/
|
|
12
17
|
export default function CharacterCount() {
|
|
13
18
|
const content = useSelect(
|
|
14
19
|
( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
BlockToolbar,
|
|
11
|
+
store as blockEditorStore,
|
|
12
|
+
privateApis as blockEditorPrivateApis,
|
|
13
|
+
} from '@wordpress/block-editor';
|
|
14
|
+
import { useEffect } from '@wordpress/element';
|
|
15
|
+
import { Button, Popover } from '@wordpress/components';
|
|
16
|
+
import { __ } from '@wordpress/i18n';
|
|
17
|
+
import { next, previous } from '@wordpress/icons';
|
|
18
|
+
import { useSelect } from '@wordpress/data';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
23
|
+
import { unlock } from '../../lock-unlock';
|
|
24
|
+
|
|
25
|
+
const { useHasBlockToolbar } = unlock( blockEditorPrivateApis );
|
|
26
|
+
|
|
27
|
+
function CollapsableBlockToolbar( { isCollapsed, onToggle } ) {
|
|
28
|
+
const { blockSelectionStart } = useSelect( ( select ) => {
|
|
29
|
+
return {
|
|
30
|
+
blockSelectionStart:
|
|
31
|
+
select( blockEditorStore ).getBlockSelectionStart(),
|
|
32
|
+
};
|
|
33
|
+
}, [] );
|
|
34
|
+
const hasBlockToolbar = useHasBlockToolbar();
|
|
35
|
+
|
|
36
|
+
const hasBlockSelection = !! blockSelectionStart;
|
|
37
|
+
|
|
38
|
+
useEffect( () => {
|
|
39
|
+
// If we have a new block selection, show the block tools
|
|
40
|
+
if ( blockSelectionStart ) {
|
|
41
|
+
onToggle( false );
|
|
42
|
+
}
|
|
43
|
+
}, [ blockSelectionStart, onToggle ] );
|
|
44
|
+
|
|
45
|
+
if ( ! hasBlockToolbar ) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<div
|
|
52
|
+
className={ classnames( 'editor-collapsible-block-toolbar', {
|
|
53
|
+
'is-collapsed': isCollapsed || ! hasBlockSelection,
|
|
54
|
+
} ) }
|
|
55
|
+
>
|
|
56
|
+
<BlockToolbar hideDragHandle />
|
|
57
|
+
</div>
|
|
58
|
+
<Popover.Slot name="block-toolbar" />
|
|
59
|
+
|
|
60
|
+
<Button
|
|
61
|
+
className="editor-collapsible-block-toolbar__toggle"
|
|
62
|
+
icon={ isCollapsed ? next : previous }
|
|
63
|
+
onClick={ () => {
|
|
64
|
+
onToggle( ! isCollapsed );
|
|
65
|
+
} }
|
|
66
|
+
label={
|
|
67
|
+
isCollapsed
|
|
68
|
+
? __( 'Show block tools' )
|
|
69
|
+
: __( 'Hide block tools' )
|
|
70
|
+
}
|
|
71
|
+
size="compact"
|
|
72
|
+
/>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default CollapsableBlockToolbar;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.editor-collapsible-block-toolbar {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
height: $header-height;
|
|
6
|
+
|
|
7
|
+
.block-editor-block-contextual-toolbar {
|
|
8
|
+
border-bottom: 0;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
|
|
13
|
+
.block-editor-block-toolbar {
|
|
14
|
+
height: 100%;
|
|
15
|
+
// Push down so that buttons are centered vertically.
|
|
16
|
+
// It should be 14px (60px header height - 32px compact button height = 28 / 2),
|
|
17
|
+
// but there is a -1px top-margin down the stack that affects this.
|
|
18
|
+
padding-top: math.div($header-height - $button-size-compact, 2) + 1;
|
|
19
|
+
|
|
20
|
+
// Match the height of other buttons in the header toolbar.
|
|
21
|
+
.components-button:not(.block-editor-block-mover-button) {
|
|
22
|
+
height: $button-size-compact;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&::after {
|
|
27
|
+
content: "";
|
|
28
|
+
width: $border-width;
|
|
29
|
+
height: $grid-unit-30;
|
|
30
|
+
background-color: $gray-300;
|
|
31
|
+
margin-right: $grid-unit - $border-width;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Modified group borders.
|
|
35
|
+
.components-toolbar-group,
|
|
36
|
+
.components-toolbar {
|
|
37
|
+
border-right: none;
|
|
38
|
+
position: relative;
|
|
39
|
+
|
|
40
|
+
&::after {
|
|
41
|
+
content: "";
|
|
42
|
+
width: $border-width;
|
|
43
|
+
height: $grid-unit-30;
|
|
44
|
+
background-color: $gray-300;
|
|
45
|
+
top: $grid-unit-05;
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: -$border-width;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
& .components-toolbar-group.components-toolbar-group {
|
|
51
|
+
&::after {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.block-editor-block-mover {
|
|
58
|
+
// Match the height of other buttons in the header toolbar.
|
|
59
|
+
&.is-horizontal .block-editor-block-mover-button {
|
|
60
|
+
height: $button-size-compact;
|
|
61
|
+
overflow: visible;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
|
|
65
|
+
@include break-small() {
|
|
66
|
+
&:not(.is-horizontal) .block-editor-block-mover__move-button-container {
|
|
67
|
+
position: relative;
|
|
68
|
+
top: -10px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.is-collapsed {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.editor-collapsible-block-toolbar__toggle {
|
|
79
|
+
margin-left: 2px; // Allow focus ring to be fully visible
|
|
80
|
+
}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { code, listView, external } from '@wordpress/icons';
|
|
6
|
+
import { code, listView, external, keyboard } from '@wordpress/icons';
|
|
7
7
|
import { useCommandLoader } from '@wordpress/commands';
|
|
8
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
9
|
import { store as noticesStore } from '@wordpress/notices';
|
|
10
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -55,6 +56,7 @@ function useEditorCommandLoader() {
|
|
|
55
56
|
switchEditorMode,
|
|
56
57
|
toggleDistractionFree,
|
|
57
58
|
} = useDispatch( editorStore );
|
|
59
|
+
const { openModal } = useDispatch( interfaceStore );
|
|
58
60
|
const { getCurrentPostId } = useSelect( editorStore );
|
|
59
61
|
const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
|
|
60
62
|
|
|
@@ -64,6 +66,15 @@ function useEditorCommandLoader() {
|
|
|
64
66
|
|
|
65
67
|
const commands = [];
|
|
66
68
|
|
|
69
|
+
commands.push( {
|
|
70
|
+
name: 'core/open-shortcut-help',
|
|
71
|
+
label: __( 'Keyboard shortcuts' ),
|
|
72
|
+
icon: keyboard,
|
|
73
|
+
callback: () => {
|
|
74
|
+
openModal( 'editor/keyboard-shortcut-help' );
|
|
75
|
+
},
|
|
76
|
+
} );
|
|
77
|
+
|
|
67
78
|
commands.push( {
|
|
68
79
|
name: 'core/toggle-distraction-free',
|
|
69
80
|
label: isDistractionFree
|
|
@@ -75,6 +86,14 @@ function useEditorCommandLoader() {
|
|
|
75
86
|
},
|
|
76
87
|
} );
|
|
77
88
|
|
|
89
|
+
commands.push( {
|
|
90
|
+
name: 'core/open-preferences',
|
|
91
|
+
label: __( 'Editor preferences' ),
|
|
92
|
+
callback: () => {
|
|
93
|
+
openModal( 'editor/preferences' );
|
|
94
|
+
},
|
|
95
|
+
} );
|
|
96
|
+
|
|
78
97
|
commands.push( {
|
|
79
98
|
name: 'core/toggle-spotlight-mode',
|
|
80
99
|
label: __( 'Toggle spotlight' ),
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Component check if there are any headings (core/heading blocks) present in the document.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} props Props.
|
|
11
|
+
* @param {Element} props.children Children to be rendered.
|
|
12
|
+
*
|
|
13
|
+
* @return {Component|null} The component to be rendered or null if there are headings.
|
|
14
|
+
*/
|
|
7
15
|
export default function DocumentOutlineCheck( { children } ) {
|
|
8
16
|
const hasHeadings = useSelect( ( select ) => {
|
|
9
17
|
const { getGlobalBlockCount } = select( blockEditorStore );
|
|
@@ -98,6 +98,16 @@ const isEmptyHeading = ( heading ) =>
|
|
|
98
98
|
! heading.attributes.content ||
|
|
99
99
|
heading.attributes.content.trim().length === 0;
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Renders a document outline component.
|
|
103
|
+
*
|
|
104
|
+
* @param {Object} props Props.
|
|
105
|
+
* @param {Function} props.onSelect Function to be called when an outline item is selected.
|
|
106
|
+
* @param {boolean} props.isTitleSupported Indicates whether the title is supported.
|
|
107
|
+
* @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
|
|
108
|
+
*
|
|
109
|
+
* @return {Component} The component to be rendered.
|
|
110
|
+
*/
|
|
101
111
|
export default function DocumentOutline( {
|
|
102
112
|
onSelect,
|
|
103
113
|
isTitleSupported,
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
NavigableToolbar,
|
|
14
14
|
ToolSelector,
|
|
15
15
|
store as blockEditorStore,
|
|
16
|
-
privateApis as blockEditorPrivateApis,
|
|
17
16
|
} from '@wordpress/block-editor';
|
|
18
17
|
import { Button, ToolbarItem } from '@wordpress/components';
|
|
19
18
|
import { listView, plus } from '@wordpress/icons';
|
|
@@ -29,8 +28,6 @@ import { store as editorStore } from '../../store';
|
|
|
29
28
|
import EditorHistoryRedo from '../editor-history/redo';
|
|
30
29
|
import EditorHistoryUndo from '../editor-history/undo';
|
|
31
30
|
|
|
32
|
-
const { useShowBlockTools } = unlock( blockEditorPrivateApis );
|
|
33
|
-
|
|
34
31
|
const preventDefault = ( event ) => {
|
|
35
32
|
event.preventDefault();
|
|
36
33
|
};
|
|
@@ -76,7 +73,6 @@ function DocumentTools( {
|
|
|
76
73
|
|
|
77
74
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
78
75
|
const isWideViewport = useViewportMatch( 'wide' );
|
|
79
|
-
const { showFixedToolbar } = useShowBlockTools();
|
|
80
76
|
|
|
81
77
|
/* translators: accessibility text for the editor toolbar */
|
|
82
78
|
const toolbarAriaLabel = __( 'Document tools' );
|
|
@@ -117,24 +113,25 @@ function DocumentTools( {
|
|
|
117
113
|
className
|
|
118
114
|
) }
|
|
119
115
|
aria-label={ toolbarAriaLabel }
|
|
120
|
-
shouldUseKeyboardFocusShortcut={ ! showFixedToolbar }
|
|
121
116
|
variant="unstyled"
|
|
122
117
|
>
|
|
123
118
|
<div className="editor-document-tools__left">
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
{ ! isDistractionFree && (
|
|
120
|
+
<ToolbarItem
|
|
121
|
+
ref={ inserterButton }
|
|
122
|
+
as={ Button }
|
|
123
|
+
className="editor-document-tools__inserter-toggle"
|
|
124
|
+
variant="primary"
|
|
125
|
+
isPressed={ isInserterOpened }
|
|
126
|
+
onMouseDown={ preventDefault }
|
|
127
|
+
onClick={ toggleInserter }
|
|
128
|
+
disabled={ disableBlockTools }
|
|
129
|
+
icon={ plus }
|
|
130
|
+
label={ showIconLabels ? shortLabel : longLabel }
|
|
131
|
+
showTooltip={ ! showIconLabels }
|
|
132
|
+
aria-expanded={ isInserterOpened }
|
|
133
|
+
/>
|
|
134
|
+
) }
|
|
138
135
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
139
136
|
<>
|
|
140
137
|
{ isLargeViewport && ! hasFixedToolbar && (
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
5
6
|
import { useEffect, useState } from '@wordpress/element';
|
|
6
7
|
import { __ } from '@wordpress/i18n';
|
|
7
8
|
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
@@ -37,10 +38,19 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
37
38
|
};
|
|
38
39
|
}, [] );
|
|
39
40
|
|
|
41
|
+
const canEditTemplate = useSelect(
|
|
42
|
+
( select ) =>
|
|
43
|
+
select( coreStore ).canUser( 'create', 'templates' ) ?? false
|
|
44
|
+
);
|
|
45
|
+
|
|
40
46
|
const [ isDialogOpen, setIsDialogOpen ] = useState( false );
|
|
41
47
|
|
|
42
48
|
useEffect( () => {
|
|
43
49
|
const handleDblClick = ( event ) => {
|
|
50
|
+
if ( ! canEditTemplate ) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
if ( ! event.target.classList.contains( 'is-root-container' ) ) {
|
|
45
55
|
return;
|
|
46
56
|
}
|
|
@@ -52,7 +62,11 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
52
62
|
return () => {
|
|
53
63
|
canvas?.removeEventListener( 'dblclick', handleDblClick );
|
|
54
64
|
};
|
|
55
|
-
}, [ contentRef ] );
|
|
65
|
+
}, [ contentRef, canEditTemplate ] );
|
|
66
|
+
|
|
67
|
+
if ( ! canEditTemplate ) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
56
70
|
|
|
57
71
|
return (
|
|
58
72
|
<ConfirmDialog
|
|
@@ -68,7 +82,7 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
68
82
|
onCancel={ () => setIsDialogOpen( false ) }
|
|
69
83
|
>
|
|
70
84
|
{ __(
|
|
71
|
-
'You’ve tried to select a block that is part of a template, which may be used on other posts and pages.'
|
|
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?'
|
|
72
86
|
) }
|
|
73
87
|
</ConfirmDialog>
|
|
74
88
|
);
|
|
@@ -39,8 +39,6 @@ const {
|
|
|
39
39
|
useFlashEditableBlocks,
|
|
40
40
|
} = unlock( blockEditorPrivateApis );
|
|
41
41
|
|
|
42
|
-
const noop = () => {};
|
|
43
|
-
|
|
44
42
|
/**
|
|
45
43
|
* These post types have a special editor where they don't allow you to fill the title
|
|
46
44
|
* and they don't apply the layout styles.
|
|
@@ -95,6 +93,7 @@ function EditorCanvas( {
|
|
|
95
93
|
styles,
|
|
96
94
|
disableIframe = false,
|
|
97
95
|
iframeProps,
|
|
96
|
+
contentRef,
|
|
98
97
|
children,
|
|
99
98
|
} ) {
|
|
100
99
|
const {
|
|
@@ -308,9 +307,10 @@ function EditorCanvas( {
|
|
|
308
307
|
|
|
309
308
|
const localRef = useRef();
|
|
310
309
|
const typewriterRef = useTypewriter();
|
|
311
|
-
|
|
310
|
+
contentRef = useMergeRefs( [
|
|
312
311
|
localRef,
|
|
313
|
-
|
|
312
|
+
contentRef,
|
|
313
|
+
renderingMode === 'post-only' ? typewriterRef : null,
|
|
314
314
|
useFlashEditableBlocks( {
|
|
315
315
|
isEnabled: renderingMode === 'template-locked',
|
|
316
316
|
} ),
|
|
@@ -41,4 +41,14 @@ function EditorHistoryRedo( props, ref ) {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/** @typedef {import('react').Ref<HTMLElement>} Ref */
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Renders the redo button for the editor history.
|
|
48
|
+
*
|
|
49
|
+
* @param {Object} props - Props.
|
|
50
|
+
* @param {Ref} ref - Forwarded ref.
|
|
51
|
+
*
|
|
52
|
+
* @return {Component} The component to be rendered.
|
|
53
|
+
*/
|
|
44
54
|
export default forwardRef( EditorHistoryRedo );
|
|
@@ -37,4 +37,14 @@ function EditorHistoryUndo( props, ref ) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** @typedef {import('react').Ref<HTMLElement>} Ref */
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Renders the undo button for the editor history.
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} props - Props.
|
|
46
|
+
* @param {Ref} ref - Forwarded ref.
|
|
47
|
+
*
|
|
48
|
+
* @return {Component} The component to be rendered.
|
|
49
|
+
*/
|
|
40
50
|
export default forwardRef( EditorHistoryUndo );
|
|
@@ -8,6 +8,11 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
8
8
|
// Last three notices. Slices from the tail end of the list.
|
|
9
9
|
const MAX_VISIBLE_NOTICES = -3;
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Renders the editor snackbars component.
|
|
13
|
+
*
|
|
14
|
+
* @return {JSX.Element} The rendered component.
|
|
15
|
+
*/
|
|
11
16
|
export default function EditorSnackbars() {
|
|
12
17
|
const notices = useSelect(
|
|
13
18
|
( select ) => select( noticesStore ).getNotices(),
|