@wordpress/editor 14.17.1 → 14.19.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 +2 -0
- package/build/bindings/pattern-overrides.js +0 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +0 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +0 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +0 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/comments.js +0 -1
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/collab-sidebar/index.js +0 -1
- package/build/components/collab-sidebar/index.js.map +1 -1
- package/build/components/collab-sidebar/utils.js +0 -1
- package/build/components/collab-sidebar/utils.js.map +1 -1
- package/build/components/deprecated.js +0 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/index.js +16 -17
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/editor/index.js +9 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +0 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-notices/index.js +0 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +0 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +2 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +2 -2
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +66 -43
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +0 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +0 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +0 -1
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +8 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +0 -1
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +19 -29
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +3 -4
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +4 -2
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/hook.js +8 -5
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-card-panel/index.js +2 -2
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +4 -2
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-fields/index.js +0 -1
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/index.js +0 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +0 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-publish-button/index.js +0 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -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 +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 +0 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +0 -1
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-saved-state/index.js +0 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +0 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -2
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +0 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/block-theme.js +68 -48
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +30 -19
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +3 -1
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/panel.js +3 -11
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +0 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +0 -1
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-type-support-check/index.js +0 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +2 -2
- package/build/components/preferences-modal/block-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -2
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +6 -3
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +19 -19
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +0 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/header.js +1 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +1 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +148 -23
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +0 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +0 -1
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +0 -1
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/store/private-actions.js +0 -1
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/reducer.js +0 -1
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/pattern-overrides.js +0 -1
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/store/actions.js +0 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +29 -3
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +44 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +0 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +0 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +0 -1
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/media-upload/index.js +5 -2
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/terms.js +0 -1
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +0 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +0 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +0 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +0 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/collab-sidebar/comments.js +0 -1
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/collab-sidebar/index.js +0 -1
- package/build-module/components/collab-sidebar/index.js.map +1 -1
- package/build-module/components/collab-sidebar/utils.js +0 -1
- package/build-module/components/collab-sidebar/utils.js.map +1 -1
- package/build-module/components/deprecated.js +0 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/index.js +17 -18
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/editor/index.js +9 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +0 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +0 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +0 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +2 -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 +2 -2
- 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 +0 -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 +67 -44
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +0 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +0 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +0 -1
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +8 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +0 -1
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +19 -29
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -4
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +4 -2
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/hook.js +8 -5
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +2 -2
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +4 -2
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +0 -1
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-format/index.js +0 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +0 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +0 -1
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- 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 +0 -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 +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 +0 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +0 -1
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +0 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +0 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -2
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +68 -48
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +30 -19
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +3 -1
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/panel.js +3 -11
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +0 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +0 -1
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +0 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +2 -2
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -2
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +6 -3
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +19 -19
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +0 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/header.js +1 -1
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +148 -24
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +0 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +0 -1
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +0 -1
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +0 -1
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +0 -1
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +0 -1
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/store/actions.js +0 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +25 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +43 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +0 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +0 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +0 -1
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/media-upload/index.js +5 -2
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/terms.js +0 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +49 -8
- package/build-style/style.css +49 -8
- package/build-types/components/document-outline/index.d.ts.map +1 -1
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts +6 -2
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/combobox.d.ts.map +1 -1
- package/build-types/components/post-author/hook.d.ts +1 -0
- package/build-types/components/post-author/hook.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
- package/build-types/components/post-template/block-theme.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/post-template/panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +2 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +4 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +13 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/utils/media-upload/index.d.ts +3 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/document-outline/index.js +22 -16
- package/src/components/editor/index.js +24 -13
- package/src/components/entities-saved-states/entity-record-item.js +1 -0
- package/src/components/entities-saved-states/entity-type-list.js +6 -2
- package/src/components/entities-saved-states/index.js +98 -58
- package/src/components/entities-saved-states/style.scss +40 -5
- package/src/components/page-attributes/parent.js +55 -38
- package/src/components/post-actions/index.js +19 -37
- package/src/components/post-author/check.js +7 -4
- package/src/components/post-author/combobox.js +3 -1
- package/src/components/post-author/hook.js +4 -3
- package/src/components/post-card-panel/index.js +7 -5
- package/src/components/post-featured-image/index.js +2 -0
- package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
- package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
- package/src/components/post-taxonomies/check.js +5 -3
- package/src/components/post-taxonomies/flat-term-selector.js +2 -2
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-taxonomies/index.js +5 -1
- package/src/components/post-taxonomies/test/index.js +32 -18
- package/src/components/post-template/block-theme.js +76 -56
- package/src/components/post-template/classic-theme.js +31 -15
- package/src/components/post-template/create-new-template-modal.js +1 -0
- package/src/components/post-template/panel.js +2 -12
- package/src/components/post-text-editor/style.scss +0 -2
- package/src/components/preferences-modal/block-visibility.js +2 -1
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/preview-dropdown/index.js +8 -6
- package/src/components/provider/index.js +21 -30
- package/src/components/sidebar/header.js +1 -1
- package/src/components/sidebar/index.js +1 -1
- package/src/components/start-page-options/index.js +149 -23
- package/src/components/start-page-options/style.scss +27 -0
- package/src/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/src/store/private-actions.js +33 -0
- package/src/store/private-selectors.js +57 -0
- package/src/utils/media-upload/index.js +3 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { Flex, FlexItem, Modal, ToggleControl } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useState, useMemo, useEffect } from '@wordpress/element';
|
|
7
|
+
import {
|
|
8
|
+
store as blockEditorStore,
|
|
9
|
+
__experimentalBlockPatternsList as BlockPatternsList,
|
|
10
|
+
} from '@wordpress/block-editor';
|
|
5
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
+
import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
6
14
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
7
15
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
8
16
|
|
|
@@ -11,11 +19,132 @@ import { store as interfaceStore } from '@wordpress/interface';
|
|
|
11
19
|
*/
|
|
12
20
|
import { store as editorStore } from '../../store';
|
|
13
21
|
|
|
22
|
+
export function useStartPatterns() {
|
|
23
|
+
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
|
|
24
|
+
// and it has no postTypes declared and the current post type is page or if
|
|
25
|
+
// the current post type is part of the postTypes declared.
|
|
26
|
+
const { blockPatternsWithPostContentBlockType, postType } = useSelect(
|
|
27
|
+
( select ) => {
|
|
28
|
+
const { getPatternsByBlockTypes, getBlocksByName } =
|
|
29
|
+
select( blockEditorStore );
|
|
30
|
+
const { getCurrentPostType, getRenderingMode } =
|
|
31
|
+
select( editorStore );
|
|
32
|
+
const rootClientId =
|
|
33
|
+
getRenderingMode() === 'post-only'
|
|
34
|
+
? ''
|
|
35
|
+
: getBlocksByName( 'core/post-content' )?.[ 0 ];
|
|
36
|
+
return {
|
|
37
|
+
blockPatternsWithPostContentBlockType: getPatternsByBlockTypes(
|
|
38
|
+
'core/post-content',
|
|
39
|
+
rootClientId
|
|
40
|
+
),
|
|
41
|
+
postType: getCurrentPostType(),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return useMemo( () => {
|
|
48
|
+
if ( ! blockPatternsWithPostContentBlockType?.length ) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* Filter patterns without postTypes declared if the current postType is page
|
|
54
|
+
* or patterns that declare the current postType in its post type array.
|
|
55
|
+
*/
|
|
56
|
+
return blockPatternsWithPostContentBlockType.filter( ( pattern ) => {
|
|
57
|
+
return (
|
|
58
|
+
( postType === 'page' && ! pattern.postTypes ) ||
|
|
59
|
+
( Array.isArray( pattern.postTypes ) &&
|
|
60
|
+
pattern.postTypes.includes( postType ) )
|
|
61
|
+
);
|
|
62
|
+
} );
|
|
63
|
+
}, [ postType, blockPatternsWithPostContentBlockType ] );
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function PatternSelection( { blockPatterns, onChoosePattern } ) {
|
|
67
|
+
const { editEntityRecord } = useDispatch( coreStore );
|
|
68
|
+
const { postType, postId } = useSelect( ( select ) => {
|
|
69
|
+
const { getCurrentPostType, getCurrentPostId } = select( editorStore );
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
postType: getCurrentPostType(),
|
|
73
|
+
postId: getCurrentPostId(),
|
|
74
|
+
};
|
|
75
|
+
}, [] );
|
|
76
|
+
return (
|
|
77
|
+
<BlockPatternsList
|
|
78
|
+
blockPatterns={ blockPatterns }
|
|
79
|
+
onClickPattern={ ( _pattern, blocks ) => {
|
|
80
|
+
editEntityRecord( 'postType', postType, postId, {
|
|
81
|
+
blocks,
|
|
82
|
+
content: ( { blocks: blocksForSerialization = [] } ) =>
|
|
83
|
+
__unstableSerializeAndClean( blocksForSerialization ),
|
|
84
|
+
} );
|
|
85
|
+
onChoosePattern();
|
|
86
|
+
} }
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function StartPageOptionsModal( { onClose } ) {
|
|
92
|
+
const [ showStartPatterns, setShowStartPatterns ] = useState( true );
|
|
93
|
+
const { set: setPreference } = useDispatch( preferencesStore );
|
|
94
|
+
const startPatterns = useStartPatterns();
|
|
95
|
+
const hasStartPattern = startPatterns.length > 0;
|
|
96
|
+
|
|
97
|
+
if ( ! hasStartPattern ) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function handleClose() {
|
|
102
|
+
onClose();
|
|
103
|
+
setPreference( 'core', 'enableChoosePatternModal', showStartPatterns );
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Modal
|
|
108
|
+
className="editor-start-page-options__modal"
|
|
109
|
+
title={ __( 'Choose a pattern' ) }
|
|
110
|
+
isFullScreen
|
|
111
|
+
onRequestClose={ handleClose }
|
|
112
|
+
>
|
|
113
|
+
<div className="editor-start-page-options__modal-content">
|
|
114
|
+
<PatternSelection
|
|
115
|
+
blockPatterns={ startPatterns }
|
|
116
|
+
onChoosePattern={ handleClose }
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
<Flex
|
|
120
|
+
className="editor-start-page-options__modal__actions"
|
|
121
|
+
justify="flex-end"
|
|
122
|
+
expanded={ false }
|
|
123
|
+
>
|
|
124
|
+
<FlexItem>
|
|
125
|
+
<ToggleControl
|
|
126
|
+
__nextHasNoMarginBottom
|
|
127
|
+
checked={ showStartPatterns }
|
|
128
|
+
label={ __( 'Show starter patterns' ) }
|
|
129
|
+
help={ __(
|
|
130
|
+
'Shows starter patterns when creating a new page.'
|
|
131
|
+
) }
|
|
132
|
+
onChange={ ( newValue ) => {
|
|
133
|
+
setShowStartPatterns( newValue );
|
|
134
|
+
} }
|
|
135
|
+
/>
|
|
136
|
+
</FlexItem>
|
|
137
|
+
</Flex>
|
|
138
|
+
</Modal>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
14
142
|
export default function StartPageOptions() {
|
|
15
|
-
const
|
|
143
|
+
const [ isOpen, setIsOpen ] = useState( false );
|
|
144
|
+
const { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );
|
|
145
|
+
const { isModalActive } = useSelect( interfaceStore );
|
|
146
|
+
const { enabled, postId } = useSelect( ( select ) => {
|
|
16
147
|
const { getCurrentPostId, getCurrentPostType } = select( editorStore );
|
|
17
|
-
const preferencesModalActive =
|
|
18
|
-
select( interfaceStore ).isModalActive( 'editor/preferences' );
|
|
19
148
|
const choosePatternModalEnabled = select( preferencesStore ).get(
|
|
20
149
|
'core',
|
|
21
150
|
'enableChoosePatternModal'
|
|
@@ -23,36 +152,33 @@ export default function StartPageOptions() {
|
|
|
23
152
|
return {
|
|
24
153
|
postId: getCurrentPostId(),
|
|
25
154
|
enabled:
|
|
26
|
-
choosePatternModalEnabled &&
|
|
27
|
-
! preferencesModalActive &&
|
|
28
|
-
'page' === getCurrentPostType(),
|
|
155
|
+
choosePatternModalEnabled && 'page' === getCurrentPostType(),
|
|
29
156
|
};
|
|
30
157
|
}, [] );
|
|
31
|
-
const { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );
|
|
32
|
-
const { setIsInserterOpened } = useDispatch( editorStore );
|
|
33
158
|
|
|
159
|
+
// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.
|
|
160
|
+
// Examples: changing pages in the List View, creating a new page via Command Palette.
|
|
34
161
|
useEffect( () => {
|
|
35
|
-
if ( ! enabled ) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
162
|
const isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} );
|
|
163
|
+
// Prevents immediately opening when features is enabled via preferences modal.
|
|
164
|
+
const isPreferencesModalActive = isModalActive( 'editor/preferences' );
|
|
165
|
+
if ( ! enabled || ! isFreshPage || isPreferencesModalActive ) {
|
|
166
|
+
return;
|
|
45
167
|
}
|
|
46
168
|
|
|
47
|
-
//
|
|
48
|
-
|
|
169
|
+
// Open the modal after the initial render for a new page.
|
|
170
|
+
setIsOpen( true );
|
|
49
171
|
}, [
|
|
50
|
-
postId,
|
|
51
172
|
enabled,
|
|
52
|
-
|
|
173
|
+
postId,
|
|
53
174
|
isEditedPostDirty,
|
|
54
175
|
isEditedPostEmpty,
|
|
176
|
+
isModalActive,
|
|
55
177
|
] );
|
|
56
178
|
|
|
57
|
-
|
|
179
|
+
if ( ! isOpen ) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return <StartPageOptionsModal onClose={ () => setIsOpen( false ) } />;
|
|
58
184
|
}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
$actions-height: 92px;
|
|
2
|
+
|
|
3
|
+
.editor-start-page-options__modal {
|
|
4
|
+
.editor-start-page-options__modal__actions {
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: $actions-height;
|
|
9
|
+
background-color: $white;
|
|
10
|
+
margin-left: - $grid-unit-40;
|
|
11
|
+
margin-right: - $grid-unit-40;
|
|
12
|
+
padding-left: $grid-unit-40;
|
|
13
|
+
padding-right: $grid-unit-40;
|
|
14
|
+
border-top: 1px solid $gray-300;
|
|
15
|
+
z-index: z-index(".editor-start-page-options__modal__actions");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.block-editor-block-patterns-list {
|
|
19
|
+
// Since the actions container is positioned absolutely,
|
|
20
|
+
// this padding bottom ensures that the content wrapper will properly
|
|
21
|
+
// detect overflowing content and start showing scrollbars at the right
|
|
22
|
+
// moment. Without this padding, the content would render under the actions
|
|
23
|
+
// bar without causing the wrapper to show a scrollbar.
|
|
24
|
+
padding-bottom: $actions-height;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
1
28
|
// 2 column masonry layout.
|
|
2
29
|
.editor-start-page-options__modal-content .block-editor-block-patterns-list {
|
|
3
30
|
column-count: 2;
|
|
@@ -94,7 +94,7 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
94
94
|
size="medium"
|
|
95
95
|
>
|
|
96
96
|
{ __(
|
|
97
|
-
'You’ve tried to select a block that is part of a template
|
|
97
|
+
'You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?'
|
|
98
98
|
) }
|
|
99
99
|
</ConfirmDialog>
|
|
100
100
|
);
|
|
@@ -492,3 +492,36 @@ export const removeTemplates =
|
|
|
492
492
|
.createErrorNotice( errorMessage, { type: 'snackbar' } );
|
|
493
493
|
}
|
|
494
494
|
};
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Set the default rendering mode preference for the current post type.
|
|
498
|
+
*
|
|
499
|
+
* @param {string} mode The rendering mode to set as default.
|
|
500
|
+
*/
|
|
501
|
+
export const setDefaultRenderingMode =
|
|
502
|
+
( mode ) =>
|
|
503
|
+
( { select, registry } ) => {
|
|
504
|
+
const postType = select.getCurrentPostType();
|
|
505
|
+
const theme = registry
|
|
506
|
+
.select( coreStore )
|
|
507
|
+
.getCurrentTheme()?.stylesheet;
|
|
508
|
+
const renderingModes =
|
|
509
|
+
registry
|
|
510
|
+
.select( preferencesStore )
|
|
511
|
+
.get( 'core', 'renderingModes' )?.[ theme ] ?? {};
|
|
512
|
+
|
|
513
|
+
if ( renderingModes[ postType ] === mode ) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const newModes = {
|
|
518
|
+
[ theme ]: {
|
|
519
|
+
...renderingModes,
|
|
520
|
+
[ postType ]: mode,
|
|
521
|
+
},
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
registry
|
|
525
|
+
.dispatch( preferencesStore )
|
|
526
|
+
.set( 'core', 'renderingModes', newModes );
|
|
527
|
+
};
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
verse,
|
|
17
17
|
} from '@wordpress/icons';
|
|
18
18
|
import { store as coreStore } from '@wordpress/core-data';
|
|
19
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Internal dependencies
|
|
@@ -34,6 +35,11 @@ const EMPTY_INSERTION_POINT = {
|
|
|
34
35
|
filterValue: undefined,
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* These are rendering modes that the editor supports.
|
|
40
|
+
*/
|
|
41
|
+
const RENDERING_MODES = [ 'post-only', 'template-locked' ];
|
|
42
|
+
|
|
37
43
|
/**
|
|
38
44
|
* Get the inserter.
|
|
39
45
|
*
|
|
@@ -215,3 +221,54 @@ export const getPostBlocksByName = createRegistrySelector( ( select ) =>
|
|
|
215
221
|
() => [ select( blockEditorStore ).getBlocks() ]
|
|
216
222
|
)
|
|
217
223
|
);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Returns the default rendering mode for a post type by user preference or post type configuration.
|
|
227
|
+
*
|
|
228
|
+
* @param {Object} state Global application state.
|
|
229
|
+
* @param {string} postType The post type.
|
|
230
|
+
*
|
|
231
|
+
* @return {string} The default rendering mode. Returns `undefined` while resolving value.
|
|
232
|
+
*/
|
|
233
|
+
export const getDefaultRenderingMode = createRegistrySelector(
|
|
234
|
+
( select ) => ( state, postType ) => {
|
|
235
|
+
const { getPostType, getCurrentTheme, hasFinishedResolution } =
|
|
236
|
+
select( coreStore );
|
|
237
|
+
|
|
238
|
+
// This needs to be called before `hasFinishedResolution`.
|
|
239
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
240
|
+
const currentTheme = getCurrentTheme();
|
|
241
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
242
|
+
const postTypeEntity = getPostType( postType );
|
|
243
|
+
|
|
244
|
+
// Wait for the post type and theme resolution.
|
|
245
|
+
if (
|
|
246
|
+
! hasFinishedResolution( 'getPostType', [ postType ] ) ||
|
|
247
|
+
! hasFinishedResolution( 'getCurrentTheme' )
|
|
248
|
+
) {
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const theme = currentTheme?.stylesheet;
|
|
253
|
+
const defaultModePreference = select( preferencesStore ).get(
|
|
254
|
+
'core',
|
|
255
|
+
'renderingModes'
|
|
256
|
+
)?.[ theme ]?.[ postType ];
|
|
257
|
+
const postTypeDefaultMode = Array.isArray(
|
|
258
|
+
postTypeEntity?.supports?.editor
|
|
259
|
+
)
|
|
260
|
+
? postTypeEntity.supports.editor.find(
|
|
261
|
+
( features ) => 'default-mode' in features
|
|
262
|
+
)?.[ 'default-mode' ]
|
|
263
|
+
: undefined;
|
|
264
|
+
|
|
265
|
+
const defaultMode = defaultModePreference || postTypeDefaultMode;
|
|
266
|
+
|
|
267
|
+
// Fallback gracefully to 'post-only' when rendering mode is not supported.
|
|
268
|
+
if ( ! RENDERING_MODES.includes( defaultMode ) ) {
|
|
269
|
+
return 'post-only';
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return defaultMode;
|
|
273
|
+
}
|
|
274
|
+
);
|
|
@@ -28,6 +28,7 @@ const noop = () => {};
|
|
|
28
28
|
* @param {Function} $0.onError Function called when an error happens.
|
|
29
29
|
* @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.
|
|
30
30
|
* @param {Function} $0.onSuccess Function called after the final representation of the file is available.
|
|
31
|
+
* @param {boolean} $0.multiple Whether to allow multiple files to be uploaded.
|
|
31
32
|
*/
|
|
32
33
|
export default function mediaUpload( {
|
|
33
34
|
additionalData = {},
|
|
@@ -37,6 +38,7 @@ export default function mediaUpload( {
|
|
|
37
38
|
onError = noop,
|
|
38
39
|
onFileChange,
|
|
39
40
|
onSuccess,
|
|
41
|
+
multiple = true,
|
|
40
42
|
} ) {
|
|
41
43
|
const { getCurrentPost, getEditorSettings } = select( editorStore );
|
|
42
44
|
const {
|
|
@@ -92,5 +94,6 @@ export default function mediaUpload( {
|
|
|
92
94
|
onError( message );
|
|
93
95
|
},
|
|
94
96
|
wpAllowedMimeTypes,
|
|
97
|
+
multiple,
|
|
95
98
|
} );
|
|
96
99
|
}
|