@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
|
@@ -31,12 +31,17 @@ function Editor( {
|
|
|
31
31
|
extraSidebarPanels,
|
|
32
32
|
...props
|
|
33
33
|
} ) {
|
|
34
|
-
const { post, template, hasLoadedPost } = useSelect(
|
|
34
|
+
const { post, template, hasLoadedPost, error } = useSelect(
|
|
35
35
|
( select ) => {
|
|
36
|
-
const {
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
getEntityRecord,
|
|
38
|
+
getResolutionError,
|
|
39
|
+
hasFinishedResolution,
|
|
40
|
+
} = select( coreStore );
|
|
41
|
+
|
|
42
|
+
const postArgs = [ 'postType', postType, postId ];
|
|
38
43
|
return {
|
|
39
|
-
post: getEntityRecord(
|
|
44
|
+
post: getEntityRecord( ...postArgs ),
|
|
40
45
|
template: templateId
|
|
41
46
|
? getEntityRecord(
|
|
42
47
|
'postType',
|
|
@@ -44,11 +49,12 @@ function Editor( {
|
|
|
44
49
|
templateId
|
|
45
50
|
)
|
|
46
51
|
: undefined,
|
|
47
|
-
hasLoadedPost: hasFinishedResolution(
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
hasLoadedPost: hasFinishedResolution(
|
|
53
|
+
'getEntityRecord',
|
|
54
|
+
postArgs
|
|
55
|
+
),
|
|
56
|
+
error: getResolutionError( 'getEntityRecord', postArgs )
|
|
57
|
+
?.message,
|
|
52
58
|
};
|
|
53
59
|
},
|
|
54
60
|
[ postType, postId, templateId ]
|
|
@@ -57,10 +63,15 @@ function Editor( {
|
|
|
57
63
|
return (
|
|
58
64
|
<>
|
|
59
65
|
{ hasLoadedPost && ! post && (
|
|
60
|
-
<Notice
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
<Notice
|
|
67
|
+
status={ !! error ? 'error' : 'warning' }
|
|
68
|
+
isDismissible={ false }
|
|
69
|
+
>
|
|
70
|
+
{ ! error
|
|
71
|
+
? __(
|
|
72
|
+
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
|
|
73
|
+
)
|
|
74
|
+
: error }
|
|
64
75
|
</Notice>
|
|
65
76
|
) }
|
|
66
77
|
{ !! post && (
|
|
@@ -26,7 +26,7 @@ function getEntityDescription( entity, count ) {
|
|
|
26
26
|
: __( 'These changes will affect your whole site.' );
|
|
27
27
|
case 'wp_template':
|
|
28
28
|
return __(
|
|
29
|
-
'This change will affect
|
|
29
|
+
'This change will affect other parts of your site that use this template.'
|
|
30
30
|
);
|
|
31
31
|
case 'page':
|
|
32
32
|
case 'post':
|
|
@@ -94,7 +94,11 @@ export default function EntityTypeList( {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
|
-
<PanelBody
|
|
97
|
+
<PanelBody
|
|
98
|
+
title={ entityLabel }
|
|
99
|
+
initialOpen
|
|
100
|
+
className="entities-saved-states__panel-body"
|
|
101
|
+
>
|
|
98
102
|
<EntityDescription record={ firstRecord } count={ count } />
|
|
99
103
|
{ list.map( ( record ) => {
|
|
100
104
|
return (
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -32,15 +37,21 @@ function identity( values ) {
|
|
|
32
37
|
* @param {Object} props The component props.
|
|
33
38
|
* @param {Function} props.close The function to close the dialog.
|
|
34
39
|
* @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.
|
|
40
|
+
* @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
|
|
35
41
|
*
|
|
36
42
|
* @return {React.ReactNode} The rendered component.
|
|
37
43
|
*/
|
|
38
|
-
export default function EntitiesSavedStates( {
|
|
44
|
+
export default function EntitiesSavedStates( {
|
|
45
|
+
close,
|
|
46
|
+
renderDialog,
|
|
47
|
+
variant,
|
|
48
|
+
} ) {
|
|
39
49
|
const isDirtyProps = useIsDirty();
|
|
40
50
|
return (
|
|
41
51
|
<EntitiesSavedStatesExtensible
|
|
42
52
|
close={ close }
|
|
43
53
|
renderDialog={ renderDialog }
|
|
54
|
+
variant={ variant }
|
|
44
55
|
{ ...isDirtyProps }
|
|
45
56
|
/>
|
|
46
57
|
);
|
|
@@ -60,6 +71,7 @@ export default function EntitiesSavedStates( { close, renderDialog } ) {
|
|
|
60
71
|
* @param {boolean} props.isDirty Flag indicating if there are dirty entities.
|
|
61
72
|
* @param {Function} props.setUnselectedEntities Function to set unselected entities.
|
|
62
73
|
* @param {Array} props.unselectedEntities Array of unselected entities.
|
|
74
|
+
* @param {string} props.variant Changes the layout of the component. When an `inline` value is provided, the action buttons are rendered at the end of the component instead of at the start.
|
|
63
75
|
*
|
|
64
76
|
* @return {React.ReactNode} The rendered component.
|
|
65
77
|
*/
|
|
@@ -74,6 +86,7 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
74
86
|
isDirty,
|
|
75
87
|
setUnselectedEntities,
|
|
76
88
|
unselectedEntities,
|
|
89
|
+
variant = 'default',
|
|
77
90
|
} ) {
|
|
78
91
|
const saveButtonRef = useRef();
|
|
79
92
|
const { saveDirtyEntities } = unlock( useDispatch( editorStore ) );
|
|
@@ -109,83 +122,100 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
109
122
|
const [ saveDialogRef, saveDialogProps ] = useDialog( {
|
|
110
123
|
onClose: () => dismissPanel(),
|
|
111
124
|
} );
|
|
112
|
-
const
|
|
113
|
-
|
|
125
|
+
const dialogLabelId = useInstanceId(
|
|
126
|
+
EntitiesSavedStatesExtensible,
|
|
127
|
+
'entities-saved-states__panel-label'
|
|
128
|
+
);
|
|
129
|
+
const dialogDescriptionId = useInstanceId(
|
|
114
130
|
EntitiesSavedStatesExtensible,
|
|
115
|
-
'description'
|
|
131
|
+
'entities-saved-states__panel-description'
|
|
116
132
|
);
|
|
117
133
|
|
|
118
134
|
const selectItemsToSaveDescription = !! dirtyEntityRecords.length
|
|
119
135
|
? __( 'Select the items you want to save.' )
|
|
120
136
|
: undefined;
|
|
121
137
|
|
|
138
|
+
const isInline = variant === 'inline';
|
|
139
|
+
|
|
140
|
+
const actionButtons = (
|
|
141
|
+
<>
|
|
142
|
+
<FlexItem
|
|
143
|
+
isBlock={ isInline ? false : true }
|
|
144
|
+
as={ Button }
|
|
145
|
+
variant={ isInline ? 'tertiary' : 'secondary' }
|
|
146
|
+
size={ isInline ? undefined : 'compact' }
|
|
147
|
+
onClick={ dismissPanel }
|
|
148
|
+
>
|
|
149
|
+
{ __( 'Cancel' ) }
|
|
150
|
+
</FlexItem>
|
|
151
|
+
<FlexItem
|
|
152
|
+
isBlock={ isInline ? false : true }
|
|
153
|
+
as={ Button }
|
|
154
|
+
ref={ saveButtonRef }
|
|
155
|
+
variant="primary"
|
|
156
|
+
size={ isInline ? undefined : 'compact' }
|
|
157
|
+
disabled={ ! saveEnabled }
|
|
158
|
+
accessibleWhenDisabled
|
|
159
|
+
onClick={ () =>
|
|
160
|
+
saveDirtyEntities( {
|
|
161
|
+
onSave,
|
|
162
|
+
dirtyEntityRecords,
|
|
163
|
+
entitiesToSkip: unselectedEntities,
|
|
164
|
+
close,
|
|
165
|
+
} )
|
|
166
|
+
}
|
|
167
|
+
className="editor-entities-saved-states__save-button"
|
|
168
|
+
>
|
|
169
|
+
{ saveLabel }
|
|
170
|
+
</FlexItem>
|
|
171
|
+
</>
|
|
172
|
+
);
|
|
173
|
+
|
|
122
174
|
return (
|
|
123
175
|
<div
|
|
124
176
|
ref={ renderDialog ? saveDialogRef : undefined }
|
|
125
177
|
{ ...( renderDialog && saveDialogProps ) }
|
|
126
|
-
className=
|
|
178
|
+
className={ clsx( 'entities-saved-states__panel', {
|
|
179
|
+
'is-inline': isInline,
|
|
180
|
+
} ) }
|
|
127
181
|
role={ renderDialog ? 'dialog' : undefined }
|
|
128
|
-
aria-labelledby={ renderDialog ?
|
|
129
|
-
aria-describedby={ renderDialog ?
|
|
182
|
+
aria-labelledby={ renderDialog ? dialogLabelId : undefined }
|
|
183
|
+
aria-describedby={ renderDialog ? dialogDescriptionId : undefined }
|
|
130
184
|
>
|
|
131
|
-
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
size="compact"
|
|
137
|
-
onClick={ dismissPanel }
|
|
138
|
-
>
|
|
139
|
-
{ __( 'Cancel' ) }
|
|
140
|
-
</FlexItem>
|
|
141
|
-
<FlexItem
|
|
142
|
-
isBlock
|
|
143
|
-
as={ Button }
|
|
144
|
-
ref={ saveButtonRef }
|
|
145
|
-
variant="primary"
|
|
146
|
-
size="compact"
|
|
147
|
-
disabled={ ! saveEnabled }
|
|
148
|
-
accessibleWhenDisabled
|
|
149
|
-
onClick={ () =>
|
|
150
|
-
saveDirtyEntities( {
|
|
151
|
-
onSave,
|
|
152
|
-
dirtyEntityRecords,
|
|
153
|
-
entitiesToSkip: unselectedEntities,
|
|
154
|
-
close,
|
|
155
|
-
} )
|
|
156
|
-
}
|
|
157
|
-
className="editor-entities-saved-states__save-button"
|
|
158
|
-
>
|
|
159
|
-
{ saveLabel }
|
|
160
|
-
</FlexItem>
|
|
161
|
-
</Flex>
|
|
185
|
+
{ ! isInline && (
|
|
186
|
+
<Flex className="entities-saved-states__panel-header" gap={ 2 }>
|
|
187
|
+
{ actionButtons }
|
|
188
|
+
</Flex>
|
|
189
|
+
) }
|
|
162
190
|
|
|
163
191
|
<div className="entities-saved-states__text-prompt">
|
|
164
|
-
<div
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
192
|
+
<div className="entities-saved-states__text-prompt--header-wrapper">
|
|
193
|
+
<strong
|
|
194
|
+
id={ renderDialog ? dialogLabelId : undefined }
|
|
195
|
+
className="entities-saved-states__text-prompt--header"
|
|
196
|
+
>
|
|
169
197
|
{ __( 'Are you ready to save?' ) }
|
|
170
198
|
</strong>
|
|
171
|
-
{ additionalPrompt }
|
|
172
199
|
</div>
|
|
173
|
-
<
|
|
174
|
-
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
200
|
+
<div id={ renderDialog ? dialogDescriptionId : undefined }>
|
|
201
|
+
{ additionalPrompt }
|
|
202
|
+
<p className="entities-saved-states__text-prompt--changes-count">
|
|
203
|
+
{ isDirty
|
|
204
|
+
? createInterpolateElement(
|
|
205
|
+
sprintf(
|
|
206
|
+
/* translators: %d: number of site changes waiting to be saved. */
|
|
207
|
+
_n(
|
|
208
|
+
'There is <strong>%d site change</strong> waiting to be saved.',
|
|
209
|
+
'There are <strong>%d site changes</strong> waiting to be saved.',
|
|
210
|
+
dirtyEntityRecords.length
|
|
211
|
+
),
|
|
181
212
|
dirtyEntityRecords.length
|
|
182
213
|
),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
</p>
|
|
214
|
+
{ strong: <strong /> }
|
|
215
|
+
)
|
|
216
|
+
: selectItemsToSaveDescription }
|
|
217
|
+
</p>
|
|
218
|
+
</div>
|
|
189
219
|
</div>
|
|
190
220
|
|
|
191
221
|
{ sortedPartitionedSavables.map( ( list ) => {
|
|
@@ -198,6 +228,16 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
198
228
|
/>
|
|
199
229
|
);
|
|
200
230
|
} ) }
|
|
231
|
+
|
|
232
|
+
{ isInline && (
|
|
233
|
+
<Flex
|
|
234
|
+
direction="row"
|
|
235
|
+
justify="flex-end"
|
|
236
|
+
className="entities-saved-states__panel-footer"
|
|
237
|
+
>
|
|
238
|
+
{ actionButtons }
|
|
239
|
+
</Flex>
|
|
240
|
+
) }
|
|
201
241
|
</div>
|
|
202
242
|
);
|
|
203
243
|
}
|
|
@@ -16,14 +16,49 @@
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.entities-saved-
|
|
20
|
-
|
|
19
|
+
.entities-saved-states__panel.is-inline {
|
|
20
|
+
.entities-saved-states__text-prompt {
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.entities-saved-states__panel-body {
|
|
25
|
+
padding-left: 0;
|
|
26
|
+
padding-right: 0;
|
|
27
|
+
border: 0;
|
|
28
|
+
|
|
29
|
+
> h2 {
|
|
30
|
+
margin-left: -1 * $grid-unit-20;
|
|
31
|
+
margin-right: -1 * $grid-unit-20;
|
|
32
|
+
margin-bottom: 0;
|
|
33
|
+
|
|
34
|
+
button {
|
|
35
|
+
font-size: $font-size-x-small;
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.entities-saved-states__text-prompt--header-wrapper {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.entities-saved-states__text-prompt--changes-count {
|
|
46
|
+
margin-top: 0;
|
|
47
|
+
margin-bottom: $grid-unit-10;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.entities-saved-states__panel-footer {
|
|
51
|
+
margin-top: $grid-unit-20;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.entities-saved-states__change-control {
|
|
56
|
+
flex: 1;
|
|
21
57
|
}
|
|
22
58
|
|
|
23
59
|
.entities-saved-states__changes {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
margin: $grid-unit-10 $grid-unit-20 0 $grid-unit-20;
|
|
60
|
+
font-size: $default-font-size;
|
|
61
|
+
margin: $grid-unit-05 $grid-unit-20 0 $grid-unit-30;
|
|
27
62
|
list-style: disc;
|
|
28
63
|
|
|
29
64
|
li {
|
|
@@ -61,47 +61,63 @@ export const getItemPriority = ( name, searchValue ) => {
|
|
|
61
61
|
export function PageAttributesParent() {
|
|
62
62
|
const { editPost } = useDispatch( editorStore );
|
|
63
63
|
const [ fieldValue, setFieldValue ] = useState( false );
|
|
64
|
-
const {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
const {
|
|
65
|
+
isHierarchical,
|
|
66
|
+
parentPostId,
|
|
67
|
+
parentPostTitle,
|
|
68
|
+
pageItems,
|
|
69
|
+
isLoading,
|
|
70
|
+
} = useSelect(
|
|
71
|
+
( select ) => {
|
|
72
|
+
const {
|
|
73
|
+
getPostType,
|
|
74
|
+
getEntityRecords,
|
|
75
|
+
getEntityRecord,
|
|
76
|
+
isResolving,
|
|
77
|
+
} = select( coreStore );
|
|
78
|
+
const { getCurrentPostId, getEditedPostAttribute } =
|
|
79
|
+
select( editorStore );
|
|
80
|
+
const postTypeSlug = getEditedPostAttribute( 'type' );
|
|
81
|
+
const pageId = getEditedPostAttribute( 'parent' );
|
|
82
|
+
const pType = getPostType( postTypeSlug );
|
|
83
|
+
const postId = getCurrentPostId();
|
|
84
|
+
const postIsHierarchical = pType?.hierarchical ?? false;
|
|
85
|
+
const query = {
|
|
86
|
+
per_page: 100,
|
|
87
|
+
exclude: postId,
|
|
88
|
+
parent_exclude: postId,
|
|
89
|
+
orderby: 'menu_order',
|
|
90
|
+
order: 'asc',
|
|
91
|
+
_fields: 'id,title,parent',
|
|
92
|
+
};
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
// Perform a search when the field is changed.
|
|
95
|
+
if ( !! fieldValue ) {
|
|
96
|
+
query.search = fieldValue;
|
|
97
|
+
}
|
|
89
98
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
const parentPost = pageId
|
|
100
|
+
? getEntityRecord( 'postType', postTypeSlug, pageId )
|
|
101
|
+
: null;
|
|
93
102
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
return {
|
|
104
|
+
isHierarchical: postIsHierarchical,
|
|
105
|
+
parentPostId: pageId,
|
|
106
|
+
parentPostTitle: parentPost ? getTitle( parentPost ) : '',
|
|
107
|
+
pageItems: postIsHierarchical
|
|
108
|
+
? getEntityRecords( 'postType', postTypeSlug, query )
|
|
109
|
+
: null,
|
|
110
|
+
isLoading: postIsHierarchical
|
|
111
|
+
? isResolving( 'getEntityRecords', [
|
|
112
|
+
'postType',
|
|
113
|
+
postTypeSlug,
|
|
114
|
+
query,
|
|
115
|
+
] )
|
|
116
|
+
: false,
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
[ fieldValue ]
|
|
120
|
+
);
|
|
105
121
|
|
|
106
122
|
const parentOptions = useMemo( () => {
|
|
107
123
|
const getOptionsFromTree = ( tree, level = 0 ) => {
|
|
@@ -187,6 +203,7 @@ export function PageAttributesParent() {
|
|
|
187
203
|
onFilterValueChange={ debounce( handleKeydown, 300 ) }
|
|
188
204
|
onChange={ handleChange }
|
|
189
205
|
hideLabelFromVision
|
|
206
|
+
isLoading={ isLoading }
|
|
190
207
|
/>
|
|
191
208
|
);
|
|
192
209
|
}
|
|
@@ -20,57 +20,39 @@ import { usePostActions } from './actions';
|
|
|
20
20
|
|
|
21
21
|
const { Menu, kebabCase } = unlock( componentsPrivateApis );
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
const
|
|
23
|
+
export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
24
|
+
const [ activeModalAction, setActiveModalAction ] = useState( null );
|
|
25
|
+
|
|
26
|
+
const { item, permissions } = useSelect(
|
|
25
27
|
( select ) => {
|
|
26
28
|
const { getEditedEntityRecord, getEntityRecordPermissions } =
|
|
27
29
|
unlock( select( coreStore ) );
|
|
28
30
|
return {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
item: getEditedEntityRecord( 'postType', postType, postId ),
|
|
32
|
+
permissions: getEntityRecordPermissions(
|
|
33
|
+
'postType',
|
|
34
|
+
postType,
|
|
35
|
+
postId
|
|
34
36
|
),
|
|
35
37
|
};
|
|
36
38
|
},
|
|
37
|
-
[
|
|
39
|
+
[ postId, postType ]
|
|
38
40
|
);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return items.map( ( item, index ) => ( {
|
|
41
|
+
const itemWithPermissions = useMemo( () => {
|
|
42
|
+
return {
|
|
42
43
|
...item,
|
|
43
|
-
permissions
|
|
44
|
-
}
|
|
45
|
-
}, [
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
49
|
-
const [ activeModalAction, setActiveModalAction ] = useState( null );
|
|
50
|
-
const _postIds = useMemo( () => {
|
|
51
|
-
if ( Array.isArray( postId ) ) {
|
|
52
|
-
return postId;
|
|
53
|
-
}
|
|
54
|
-
return postId ? [ postId ] : [];
|
|
55
|
-
}, [ postId ] );
|
|
56
|
-
|
|
57
|
-
const itemsWithPermissions = useEditedEntityRecordsWithPermissions(
|
|
58
|
-
postType,
|
|
59
|
-
_postIds
|
|
60
|
-
);
|
|
44
|
+
permissions,
|
|
45
|
+
};
|
|
46
|
+
}, [ item, permissions ] );
|
|
61
47
|
const allActions = usePostActions( { postType, onActionPerformed } );
|
|
62
48
|
|
|
63
49
|
const actions = useMemo( () => {
|
|
64
50
|
return allActions.filter( ( action ) => {
|
|
65
51
|
return (
|
|
66
|
-
|
|
67
|
-
itemsWithPermissions.some( ( itemWithPermissions ) =>
|
|
68
|
-
action.isEligible( itemWithPermissions )
|
|
69
|
-
) ) &&
|
|
70
|
-
( itemsWithPermissions.length < 2 || action.supportsBulk )
|
|
52
|
+
! action.isEligible || action.isEligible( itemWithPermissions )
|
|
71
53
|
);
|
|
72
54
|
} );
|
|
73
|
-
}, [ allActions,
|
|
55
|
+
}, [ allActions, itemWithPermissions ] );
|
|
74
56
|
|
|
75
57
|
return (
|
|
76
58
|
<>
|
|
@@ -90,7 +72,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
|
90
72
|
<Menu.Popover>
|
|
91
73
|
<ActionsDropdownMenuGroup
|
|
92
74
|
actions={ actions }
|
|
93
|
-
items={
|
|
75
|
+
items={ [ itemWithPermissions ] }
|
|
94
76
|
setActiveModalAction={ setActiveModalAction }
|
|
95
77
|
/>
|
|
96
78
|
</Menu.Popover>
|
|
@@ -98,7 +80,7 @@ export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
|
98
80
|
{ !! activeModalAction && (
|
|
99
81
|
<ActionModal
|
|
100
82
|
action={ activeModalAction }
|
|
101
|
-
items={
|
|
83
|
+
items={ [ itemWithPermissions ] }
|
|
102
84
|
closeModal={ () => setActiveModalAction( null ) }
|
|
103
85
|
/>
|
|
104
86
|
) }
|
|
@@ -23,11 +23,14 @@ import { AUTHORS_QUERY } from './constants';
|
|
|
23
23
|
export default function PostAuthorCheck( { children } ) {
|
|
24
24
|
const { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {
|
|
25
25
|
const post = select( editorStore ).getCurrentPost();
|
|
26
|
-
const
|
|
26
|
+
const canAssignAuthor = post?._links?.[ 'wp:action-assign-author' ]
|
|
27
|
+
? true
|
|
28
|
+
: false;
|
|
27
29
|
return {
|
|
28
|
-
hasAssignAuthorAction:
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
hasAssignAuthorAction: canAssignAuthor,
|
|
31
|
+
hasAuthors: canAssignAuthor
|
|
32
|
+
? select( coreStore ).getUsers( AUTHORS_QUERY )?.length >= 1
|
|
33
|
+
: false,
|
|
31
34
|
};
|
|
32
35
|
}, [] );
|
|
33
36
|
|
|
@@ -17,7 +17,8 @@ export default function PostAuthorCombobox() {
|
|
|
17
17
|
const [ fieldValue, setFieldValue ] = useState();
|
|
18
18
|
|
|
19
19
|
const { editPost } = useDispatch( editorStore );
|
|
20
|
-
const { authorId, authorOptions } =
|
|
20
|
+
const { authorId, authorOptions, isLoading } =
|
|
21
|
+
useAuthorsQuery( fieldValue );
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Handle author selection.
|
|
@@ -51,6 +52,7 @@ export default function PostAuthorCombobox() {
|
|
|
51
52
|
onChange={ handleSelect }
|
|
52
53
|
allowReset={ false }
|
|
53
54
|
hideLabelFromVision
|
|
55
|
+
isLoading={ isLoading }
|
|
54
56
|
/>
|
|
55
57
|
);
|
|
56
58
|
}
|
|
@@ -14,9 +14,9 @@ import { store as editorStore } from '../../store';
|
|
|
14
14
|
import { AUTHORS_QUERY, BASE_QUERY } from './constants';
|
|
15
15
|
|
|
16
16
|
export function useAuthorsQuery( search ) {
|
|
17
|
-
const { authorId, authors, postAuthor } = useSelect(
|
|
17
|
+
const { authorId, authors, postAuthor, isLoading } = useSelect(
|
|
18
18
|
( select ) => {
|
|
19
|
-
const { getUser, getUsers } = select( coreStore );
|
|
19
|
+
const { getUser, getUsers, isResolving } = select( coreStore );
|
|
20
20
|
const { getEditedPostAttribute } = select( editorStore );
|
|
21
21
|
const _authorId = getEditedPostAttribute( 'author' );
|
|
22
22
|
const query = { ...AUTHORS_QUERY };
|
|
@@ -30,6 +30,7 @@ export function useAuthorsQuery( search ) {
|
|
|
30
30
|
authorId: _authorId,
|
|
31
31
|
authors: getUsers( query ),
|
|
32
32
|
postAuthor: getUser( _authorId, BASE_QUERY ),
|
|
33
|
+
isLoading: isResolving( 'getUsers', [ query ] ),
|
|
33
34
|
};
|
|
34
35
|
},
|
|
35
36
|
[ search ]
|
|
@@ -68,5 +69,5 @@ export function useAuthorsQuery( search ) {
|
|
|
68
69
|
return [ ...currentAuthor, ...fetchedAuthors ];
|
|
69
70
|
}, [ authors, postAuthor ] );
|
|
70
71
|
|
|
71
|
-
return { authorId, authorOptions, postAuthor };
|
|
72
|
+
return { authorId, authorOptions, postAuthor, isLoading };
|
|
72
73
|
}
|
|
@@ -118,11 +118,13 @@ export default function PostCardPanel( {
|
|
|
118
118
|
<Badge>{ pageTypeBadge }</Badge>
|
|
119
119
|
) }
|
|
120
120
|
</Text>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
{ postIds.length === 1 && (
|
|
122
|
+
<PostActions
|
|
123
|
+
postType={ postType }
|
|
124
|
+
postId={ postIds[ 0 ] }
|
|
125
|
+
onActionPerformed={ onActionPerformed }
|
|
126
|
+
/>
|
|
127
|
+
) }
|
|
126
128
|
</HStack>
|
|
127
129
|
{ postIds.length > 1 && (
|
|
128
130
|
<Text className="editor-post-card-panel__description">
|
|
@@ -125,6 +125,7 @@ function PostFeaturedImage( {
|
|
|
125
125
|
noticeOperations.removeAllNotices();
|
|
126
126
|
noticeOperations.createErrorNotice( message );
|
|
127
127
|
},
|
|
128
|
+
multiple: false,
|
|
128
129
|
} );
|
|
129
130
|
}
|
|
130
131
|
|
|
@@ -345,6 +346,7 @@ const applyWithDispatch = withDispatch(
|
|
|
345
346
|
noticeOperations.removeAllNotices();
|
|
346
347
|
noticeOperations.createErrorNotice( message );
|
|
347
348
|
},
|
|
349
|
+
multiple: false,
|
|
348
350
|
} );
|
|
349
351
|
},
|
|
350
352
|
onRemoveImage() {
|