@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
export const textFormattingShortcuts = [
|
|
7
|
+
{
|
|
8
|
+
keyCombination: { modifier: 'primary', character: 'b' },
|
|
9
|
+
description: __( 'Make the selected text bold.' ),
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
keyCombination: { modifier: 'primary', character: 'i' },
|
|
13
|
+
description: __( 'Make the selected text italic.' ),
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
keyCombination: { modifier: 'primary', character: 'k' },
|
|
17
|
+
description: __( 'Convert the selected text into a link.' ),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
keyCombination: { modifier: 'primaryShift', character: 'k' },
|
|
21
|
+
description: __( 'Remove a link.' ),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
keyCombination: { character: '[[' },
|
|
25
|
+
description: __( 'Insert a link to a post or page.' ),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
keyCombination: { modifier: 'primary', character: 'u' },
|
|
29
|
+
description: __( 'Underline the selected text.' ),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
keyCombination: { modifier: 'access', character: 'd' },
|
|
33
|
+
description: __( 'Strikethrough the selected text.' ),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
keyCombination: { modifier: 'access', character: 'x' },
|
|
37
|
+
description: __( 'Make the selected text inline code.' ),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
keyCombination: { modifier: 'access', character: '0' },
|
|
41
|
+
description: __( 'Convert the current heading to a paragraph.' ),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
keyCombination: { modifier: 'access', character: '1-6' },
|
|
45
|
+
description: __(
|
|
46
|
+
'Convert the current paragraph or heading to a heading of level 1 to 6.'
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
keyCombination: { modifier: 'primaryShift', character: 'SPACE' },
|
|
51
|
+
description: __( 'Add non breaking space.' ),
|
|
52
|
+
},
|
|
53
|
+
];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Shortcut from './shortcut';
|
|
11
|
+
|
|
12
|
+
function DynamicShortcut( { name } ) {
|
|
13
|
+
const { keyCombination, description, aliases } = useSelect(
|
|
14
|
+
( select ) => {
|
|
15
|
+
const {
|
|
16
|
+
getShortcutKeyCombination,
|
|
17
|
+
getShortcutDescription,
|
|
18
|
+
getShortcutAliases,
|
|
19
|
+
} = select( keyboardShortcutsStore );
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
keyCombination: getShortcutKeyCombination( name ),
|
|
23
|
+
aliases: getShortcutAliases( name ),
|
|
24
|
+
description: getShortcutDescription( name ),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[ name ]
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if ( ! keyCombination ) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Shortcut
|
|
36
|
+
keyCombination={ keyCombination }
|
|
37
|
+
description={ description }
|
|
38
|
+
aliases={ aliases }
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default DynamicShortcut;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Modal } from '@wordpress/components';
|
|
10
|
+
import { __ } from '@wordpress/i18n';
|
|
11
|
+
import {
|
|
12
|
+
useShortcut,
|
|
13
|
+
store as keyboardShortcutsStore,
|
|
14
|
+
} from '@wordpress/keyboard-shortcuts';
|
|
15
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
16
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import { textFormattingShortcuts } from './config';
|
|
22
|
+
import Shortcut from './shortcut';
|
|
23
|
+
import DynamicShortcut from './dynamic-shortcut';
|
|
24
|
+
|
|
25
|
+
const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';
|
|
26
|
+
|
|
27
|
+
const ShortcutList = ( { shortcuts } ) => (
|
|
28
|
+
/*
|
|
29
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
30
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
31
|
+
*/
|
|
32
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
33
|
+
<ul
|
|
34
|
+
className="editor-keyboard-shortcut-help-modal__shortcut-list"
|
|
35
|
+
role="list"
|
|
36
|
+
>
|
|
37
|
+
{ shortcuts.map( ( shortcut, index ) => (
|
|
38
|
+
<li
|
|
39
|
+
className="editor-keyboard-shortcut-help-modal__shortcut"
|
|
40
|
+
key={ index }
|
|
41
|
+
>
|
|
42
|
+
{ typeof shortcut === 'string' ? (
|
|
43
|
+
<DynamicShortcut name={ shortcut } />
|
|
44
|
+
) : (
|
|
45
|
+
<Shortcut { ...shortcut } />
|
|
46
|
+
) }
|
|
47
|
+
</li>
|
|
48
|
+
) ) }
|
|
49
|
+
</ul>
|
|
50
|
+
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const ShortcutSection = ( { title, shortcuts, className } ) => (
|
|
54
|
+
<section
|
|
55
|
+
className={ classnames(
|
|
56
|
+
'editor-keyboard-shortcut-help-modal__section',
|
|
57
|
+
className
|
|
58
|
+
) }
|
|
59
|
+
>
|
|
60
|
+
{ !! title && (
|
|
61
|
+
<h2 className="editor-keyboard-shortcut-help-modal__section-title">
|
|
62
|
+
{ title }
|
|
63
|
+
</h2>
|
|
64
|
+
) }
|
|
65
|
+
<ShortcutList shortcuts={ shortcuts } />
|
|
66
|
+
</section>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const ShortcutCategorySection = ( {
|
|
70
|
+
title,
|
|
71
|
+
categoryName,
|
|
72
|
+
additionalShortcuts = [],
|
|
73
|
+
} ) => {
|
|
74
|
+
const categoryShortcuts = useSelect(
|
|
75
|
+
( select ) => {
|
|
76
|
+
return select( keyboardShortcutsStore ).getCategoryShortcuts(
|
|
77
|
+
categoryName
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
[ categoryName ]
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<ShortcutSection
|
|
85
|
+
title={ title }
|
|
86
|
+
shortcuts={ categoryShortcuts.concat( additionalShortcuts ) }
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
function KeyboardShortcutHelpModal() {
|
|
92
|
+
const isModalActive = useSelect(
|
|
93
|
+
( select ) =>
|
|
94
|
+
select( interfaceStore ).isModalActive(
|
|
95
|
+
KEYBOARD_SHORTCUT_HELP_MODAL_NAME
|
|
96
|
+
),
|
|
97
|
+
[]
|
|
98
|
+
);
|
|
99
|
+
const { openModal, closeModal } = useDispatch( interfaceStore );
|
|
100
|
+
const toggleModal = () => {
|
|
101
|
+
if ( isModalActive ) {
|
|
102
|
+
closeModal();
|
|
103
|
+
} else {
|
|
104
|
+
openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
useShortcut( 'core/editor/keyboard-shortcuts', toggleModal );
|
|
108
|
+
|
|
109
|
+
if ( ! isModalActive ) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Modal
|
|
115
|
+
className="editor-keyboard-shortcut-help-modal"
|
|
116
|
+
title={ __( 'Keyboard shortcuts' ) }
|
|
117
|
+
closeButtonLabel={ __( 'Close' ) }
|
|
118
|
+
onRequestClose={ toggleModal }
|
|
119
|
+
>
|
|
120
|
+
<ShortcutSection
|
|
121
|
+
className="editor-keyboard-shortcut-help-modal__main-shortcuts"
|
|
122
|
+
shortcuts={ [ 'core/editor/keyboard-shortcuts' ] }
|
|
123
|
+
/>
|
|
124
|
+
<ShortcutCategorySection
|
|
125
|
+
title={ __( 'Global shortcuts' ) }
|
|
126
|
+
categoryName="global"
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
<ShortcutCategorySection
|
|
130
|
+
title={ __( 'Selection shortcuts' ) }
|
|
131
|
+
categoryName="selection"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<ShortcutCategorySection
|
|
135
|
+
title={ __( 'Block shortcuts' ) }
|
|
136
|
+
categoryName="block"
|
|
137
|
+
additionalShortcuts={ [
|
|
138
|
+
{
|
|
139
|
+
keyCombination: { character: '/' },
|
|
140
|
+
description: __(
|
|
141
|
+
'Change the block type after adding a new paragraph.'
|
|
142
|
+
),
|
|
143
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
144
|
+
ariaLabel: __( 'Forward-slash' ),
|
|
145
|
+
},
|
|
146
|
+
] }
|
|
147
|
+
/>
|
|
148
|
+
<ShortcutSection
|
|
149
|
+
title={ __( 'Text formatting' ) }
|
|
150
|
+
shortcuts={ textFormattingShortcuts }
|
|
151
|
+
/>
|
|
152
|
+
<ShortcutCategorySection
|
|
153
|
+
title={ __( 'List View shortcuts' ) }
|
|
154
|
+
categoryName="list-view"
|
|
155
|
+
/>
|
|
156
|
+
</Modal>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default KeyboardShortcutHelpModal;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Fragment } from '@wordpress/element';
|
|
5
|
+
import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
|
|
6
|
+
|
|
7
|
+
function KeyCombination( { keyCombination, forceAriaLabel } ) {
|
|
8
|
+
const shortcut = keyCombination.modifier
|
|
9
|
+
? displayShortcutList[ keyCombination.modifier ](
|
|
10
|
+
keyCombination.character
|
|
11
|
+
)
|
|
12
|
+
: keyCombination.character;
|
|
13
|
+
const ariaLabel = keyCombination.modifier
|
|
14
|
+
? shortcutAriaLabel[ keyCombination.modifier ](
|
|
15
|
+
keyCombination.character
|
|
16
|
+
)
|
|
17
|
+
: keyCombination.character;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<kbd
|
|
21
|
+
className="editor-keyboard-shortcut-help-modal__shortcut-key-combination"
|
|
22
|
+
aria-label={ forceAriaLabel || ariaLabel }
|
|
23
|
+
>
|
|
24
|
+
{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(
|
|
25
|
+
( character, index ) => {
|
|
26
|
+
if ( character === '+' ) {
|
|
27
|
+
return <Fragment key={ index }>{ character }</Fragment>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<kbd
|
|
32
|
+
key={ index }
|
|
33
|
+
className="editor-keyboard-shortcut-help-modal__shortcut-key"
|
|
34
|
+
>
|
|
35
|
+
{ character }
|
|
36
|
+
</kbd>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
) }
|
|
40
|
+
</kbd>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<div className="editor-keyboard-shortcut-help-modal__shortcut-description">
|
|
48
|
+
{ description }
|
|
49
|
+
</div>
|
|
50
|
+
<div className="editor-keyboard-shortcut-help-modal__shortcut-term">
|
|
51
|
+
<KeyCombination
|
|
52
|
+
keyCombination={ keyCombination }
|
|
53
|
+
forceAriaLabel={ ariaLabel }
|
|
54
|
+
/>
|
|
55
|
+
{ aliases.map( ( alias, index ) => (
|
|
56
|
+
<KeyCombination
|
|
57
|
+
keyCombination={ alias }
|
|
58
|
+
forceAriaLabel={ ariaLabel }
|
|
59
|
+
key={ index }
|
|
60
|
+
/>
|
|
61
|
+
) ) }
|
|
62
|
+
</div>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default Shortcut;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.editor-keyboard-shortcut-help-modal {
|
|
2
|
+
&__section {
|
|
3
|
+
margin: 0 0 2rem 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&__section-title {
|
|
7
|
+
font-size: 0.9rem;
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&__shortcut {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: baseline;
|
|
14
|
+
padding: 0.6rem 0;
|
|
15
|
+
border-top: 1px solid $gray-300;
|
|
16
|
+
margin-bottom: 0;
|
|
17
|
+
|
|
18
|
+
&:last-child {
|
|
19
|
+
border-bottom: 1px solid $gray-300;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:empty {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__shortcut-term {
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
margin: 0 0 0 1rem;
|
|
30
|
+
text-align: right;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__shortcut-description {
|
|
34
|
+
flex: 1;
|
|
35
|
+
margin: 0;
|
|
36
|
+
|
|
37
|
+
// IE 11 flex item fix - ensure the item does not collapse.
|
|
38
|
+
flex-basis: auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__shortcut-key-combination {
|
|
42
|
+
display: block;
|
|
43
|
+
background: none;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
|
|
47
|
+
& + .editor-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
48
|
+
margin-top: 10px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__shortcut-key {
|
|
53
|
+
padding: 0.25rem 0.5rem;
|
|
54
|
+
border-radius: 8%;
|
|
55
|
+
margin: 0 0.2rem 0 0.2rem;
|
|
56
|
+
|
|
57
|
+
&:last-child {
|
|
58
|
+
margin: 0 0 0 0.2rem;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as editorStore } from '../../store';
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
|
|
13
|
+
const { OverridesPanel } = unlock( patternsPrivateApis );
|
|
14
|
+
|
|
15
|
+
export default function PatternOverridesPanel() {
|
|
16
|
+
const supportsPatternOverridesPanel = useSelect(
|
|
17
|
+
( select ) => select( editorStore ).getCurrentPostType() === 'wp_block',
|
|
18
|
+
[]
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
if ( ! supportsPatternOverridesPanel ) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return <OverridesPanel />;
|
|
26
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { compose } from '@wordpress/compose';
|
|
5
|
+
import { MenuItem } from '@wordpress/components';
|
|
6
|
+
import { withPluginContext } from '@wordpress/plugins';
|
|
7
|
+
import { ActionItem } from '@wordpress/interface';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
|
|
11
|
+
* The text within the component appears as the menu item label.
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} props Component properties.
|
|
14
|
+
* @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
15
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
16
|
+
* @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
|
|
17
|
+
* @param {...*} [props.other] Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```js
|
|
21
|
+
* // Using ES5 syntax
|
|
22
|
+
* var __ = wp.i18n.__;
|
|
23
|
+
* var PluginMoreMenuItem = wp.editor.PluginMoreMenuItem;
|
|
24
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
25
|
+
*
|
|
26
|
+
* function onButtonClick() {
|
|
27
|
+
* alert( 'Button clicked.' );
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* function MyButtonMoreMenuItem() {
|
|
31
|
+
* return wp.element.createElement(
|
|
32
|
+
* PluginMoreMenuItem,
|
|
33
|
+
* {
|
|
34
|
+
* icon: moreIcon,
|
|
35
|
+
* onClick: onButtonClick,
|
|
36
|
+
* },
|
|
37
|
+
* __( 'My button title' )
|
|
38
|
+
* );
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* // Using ESNext syntax
|
|
45
|
+
* import { __ } from '@wordpress/i18n';
|
|
46
|
+
* import { PluginMoreMenuItem } from '@wordpress/editor';
|
|
47
|
+
* import { more } from '@wordpress/icons';
|
|
48
|
+
*
|
|
49
|
+
* function onButtonClick() {
|
|
50
|
+
* alert( 'Button clicked.' );
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* const MyButtonMoreMenuItem = () => (
|
|
54
|
+
* <PluginMoreMenuItem
|
|
55
|
+
* icon={ more }
|
|
56
|
+
* onClick={ onButtonClick }
|
|
57
|
+
* >
|
|
58
|
+
* { __( 'My button title' ) }
|
|
59
|
+
* </PluginMoreMenuItem>
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @return {Component} The component to be rendered.
|
|
64
|
+
*/
|
|
65
|
+
export default compose(
|
|
66
|
+
withPluginContext( ( context, ownProps ) => {
|
|
67
|
+
return {
|
|
68
|
+
as: ownProps.as ?? MenuItem,
|
|
69
|
+
icon: ownProps.icon || context.icon,
|
|
70
|
+
name: 'core/plugin-more-menu',
|
|
71
|
+
};
|
|
72
|
+
} )
|
|
73
|
+
)( ActionItem );
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
5
|
+
import { createSlotFill, PanelBody } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Renders provided content to the post-publish panel in the publish flow
|
|
11
|
+
* (side panel that opens after a user publishes the post).
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} props Component properties.
|
|
14
|
+
* @param {string} [props.className] An optional class name added to the panel.
|
|
15
|
+
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
16
|
+
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
17
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
18
|
+
* @param {Element} props.children Children to be rendered
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* // Using ESNext syntax
|
|
23
|
+
* import { __ } from '@wordpress/i18n';
|
|
24
|
+
* import { PluginPostPublishPanel } from '@wordpress/edit-post';
|
|
25
|
+
*
|
|
26
|
+
* const MyPluginPostPublishPanel = () => (
|
|
27
|
+
* <PluginPostPublishPanel
|
|
28
|
+
* className="my-plugin-post-publish-panel"
|
|
29
|
+
* title={ __( 'My panel title' ) }
|
|
30
|
+
* initialOpen={ true }
|
|
31
|
+
* >
|
|
32
|
+
* { __( 'My panel content' ) }
|
|
33
|
+
* </PluginPostPublishPanel>
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @return {Component} The component to be rendered.
|
|
38
|
+
*/
|
|
39
|
+
const PluginPostPublishPanel = ( {
|
|
40
|
+
children,
|
|
41
|
+
className,
|
|
42
|
+
title,
|
|
43
|
+
initialOpen = false,
|
|
44
|
+
icon,
|
|
45
|
+
} ) => {
|
|
46
|
+
const { icon: pluginIcon } = usePluginContext();
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Fill>
|
|
50
|
+
<PanelBody
|
|
51
|
+
className={ className }
|
|
52
|
+
initialOpen={ initialOpen || ! title }
|
|
53
|
+
title={ title }
|
|
54
|
+
icon={ icon ?? pluginIcon }
|
|
55
|
+
>
|
|
56
|
+
{ children }
|
|
57
|
+
</PanelBody>
|
|
58
|
+
</Fill>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
PluginPostPublishPanel.Slot = Slot;
|
|
63
|
+
|
|
64
|
+
export default PluginPostPublishPanel;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`PluginPostPublishPanel renders fill properly 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="components-panel__body my-plugin-post-publish-panel is-opened"
|
|
7
|
+
>
|
|
8
|
+
<h2
|
|
9
|
+
class="components-panel__body-title"
|
|
10
|
+
>
|
|
11
|
+
<button
|
|
12
|
+
aria-expanded="true"
|
|
13
|
+
class="components-button components-panel__body-toggle"
|
|
14
|
+
type="button"
|
|
15
|
+
>
|
|
16
|
+
<span
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
>
|
|
19
|
+
<svg
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
class="components-panel__arrow"
|
|
22
|
+
focusable="false"
|
|
23
|
+
height="24"
|
|
24
|
+
viewBox="0 0 24 24"
|
|
25
|
+
width="24"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path
|
|
29
|
+
d="M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
</span>
|
|
33
|
+
My panel title
|
|
34
|
+
</button>
|
|
35
|
+
</h2>
|
|
36
|
+
My panel content
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import PluginPostPublishPanel from '../';
|
|
15
|
+
|
|
16
|
+
describe( 'PluginPostPublishPanel', () => {
|
|
17
|
+
test( 'renders fill properly', () => {
|
|
18
|
+
const { container } = render(
|
|
19
|
+
<SlotFillProvider>
|
|
20
|
+
<PluginPostPublishPanel
|
|
21
|
+
className="my-plugin-post-publish-panel"
|
|
22
|
+
title="My panel title"
|
|
23
|
+
initialOpen
|
|
24
|
+
>
|
|
25
|
+
My panel content
|
|
26
|
+
</PluginPostPublishPanel>
|
|
27
|
+
<PluginPostPublishPanel.Slot />
|
|
28
|
+
</SlotFillProvider>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect( container ).toMatchSnapshot();
|
|
32
|
+
} );
|
|
33
|
+
} );
|