@wordpress/editor 14.3.0 → 14.5.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 +8 -0
- package/README.md +2 -1
- package/build/bindings/api.js +65 -0
- package/build/bindings/api.js.map +1 -0
- package/build/bindings/pattern-overrides.js +23 -13
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +35 -12
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +4 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/blog-title/index.js +7 -3
- package/build/components/blog-title/index.js.map +1 -1
- package/build/components/collapsible-block-toolbar/index.js +2 -3
- package/build/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build/components/commands/index.js +8 -2
- package/build/components/commands/index.js.map +1 -1
- package/build/components/document-bar/index.js +1 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +15 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/back-button.js +7 -8
- package/build/components/header/back-button.js.map +1 -1
- package/build/components/header/index.js +21 -20
- package/build/components/header/index.js.map +1 -1
- package/build/components/page-attributes/order.js +1 -67
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +1 -4
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +6 -2
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +131 -344
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +16 -6
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/hook.js +10 -3
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-author/panel.js +2 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +9 -3
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +6 -20
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +7 -1
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +2 -2
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/panel.js +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +3 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +2 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -11
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +4 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +2 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-status/index.js +47 -51
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +17 -6
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +7 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-template/block-theme.js +4 -4
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +8 -2
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +3 -0
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js +4 -1
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/hooks.js +5 -1
- package/build/components/post-template/hooks.js.map +1 -1
- package/build/components/post-template/panel.js +8 -2
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-trash/check.js +6 -4
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-url/panel.js +9 -4
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/posts-per-page/index.js +6 -2
- package/build/components/posts-per-page/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +82 -17
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +14 -18
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +15 -6
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +1 -2
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -9
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/site-discussion/index.js +12 -22
- package/build/components/site-discussion/index.js.map +1 -1
- package/build/components/template-content-panel/index.js +17 -15
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +4 -4
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +7 -3
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
- package/build/dataviews/actions/delete-post.js +2 -0
- package/build/dataviews/actions/delete-post.js.map +1 -1
- package/build/dataviews/actions/export-pattern.native.js +9 -0
- package/build/dataviews/actions/export-pattern.native.js.map +1 -0
- package/build/dataviews/actions/permanently-delete-post.js +107 -0
- package/build/dataviews/actions/permanently-delete-post.js.map +1 -0
- package/build/dataviews/actions/restore-post.js +112 -0
- package/build/dataviews/actions/restore-post.js.map +1 -0
- package/build/dataviews/actions/trash-post.js +142 -0
- package/build/dataviews/actions/trash-post.js.map +1 -0
- package/build/dataviews/store/private-actions.js +45 -0
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/private-selectors.js +10 -10
- package/build/dataviews/store/private-selectors.js.map +1 -1
- package/build/dataviews/store/reducer.js +15 -1
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/dataviews/types.js.map +1 -1
- package/build/hooks/pattern-overrides.js +1 -1
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +16 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +8 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +33 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/utils/media-upload/index.js +35 -2
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/bindings/api.js +57 -0
- package/build-module/bindings/api.js.map +1 -0
- package/build-module/bindings/pattern-overrides.js +23 -13
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +35 -12
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +4 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +7 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +1 -2
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +8 -2
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +1 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +15 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/back-button.js +5 -7
- package/build-module/components/header/back-button.js.map +1 -1
- package/build-module/components/header/index.js +21 -22
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/page-attributes/order.js +4 -70
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +1 -6
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +7 -3
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +137 -350
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +16 -6
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/hook.js +10 -3
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-author/panel.js +2 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -3
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +8 -24
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +7 -1
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +3 -3
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +3 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -11
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-status/index.js +49 -53
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +17 -6
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +7 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +4 -4
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +8 -2
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +3 -0
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +4 -1
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/hooks.js +5 -1
- package/build-module/components/post-template/hooks.js.map +1 -1
- package/build-module/components/post-template/panel.js +8 -2
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-trash/check.js +6 -4
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-url/panel.js +10 -7
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +6 -2
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +84 -19
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +15 -19
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +15 -6
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -2
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -9
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/site-discussion/index.js +14 -24
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +18 -16
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -4
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +7 -3
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
- package/build-module/dataviews/actions/delete-post.js +2 -0
- package/build-module/dataviews/actions/delete-post.js.map +1 -1
- package/build-module/dataviews/actions/export-pattern.native.js +3 -0
- package/build-module/dataviews/actions/export-pattern.native.js.map +1 -0
- package/build-module/dataviews/actions/permanently-delete-post.js +99 -0
- package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -0
- package/build-module/dataviews/actions/restore-post.js +104 -0
- package/build-module/dataviews/actions/restore-post.js.map +1 -0
- package/build-module/dataviews/actions/trash-post.js +135 -0
- package/build-module/dataviews/actions/trash-post.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js +40 -0
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/private-selectors.js +8 -9
- package/build-module/dataviews/store/private-selectors.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +15 -1
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/dataviews/types.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -1
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +3 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +16 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +8 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +32 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js +36 -3
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +97 -45
- package/build-style/style.css +97 -45
- package/build-types/bindings/api.d.ts +25 -0
- package/build-types/bindings/api.d.ts.map +1 -0
- package/build-types/bindings/pattern-overrides.d.ts +5 -6
- package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
- package/build-types/bindings/post-meta.d.ts +11 -7
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/autocompleters/user.d.ts +2 -2
- package/build-types/components/autocompleters/user.d.ts.map +1 -1
- package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
- package/build-types/components/blog-title/index.d.ts.map +1 -1
- package/build-types/components/collapsible-block-toolbar/index.d.ts +1 -2
- package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/document-outline/index.d.ts.map +1 -1
- package/build-types/components/editor-history/redo.d.ts +1 -1
- package/build-types/components/editor-history/undo.d.ts +1 -1
- package/build-types/components/editor-notices/index.d.ts.map +1 -1
- package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts +1 -0
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/media-categories/index.d.ts.map +1 -1
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/page-attributes/order.d.ts +1 -1
- package/build-types/components/page-attributes/order.d.ts.map +1 -1
- package/build-types/components/page-attributes/panel.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.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/hook.d.ts +1 -1
- package/build-types/components/post-author/hook.d.ts.map +1 -1
- package/build-types/components/post-author/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-comments/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-discussion/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/check.d.ts.map +1 -1
- package/build-types/components/post-excerpt/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
- package/build-types/components/post-featured-image/check.d.ts.map +1 -1
- package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts.map +1 -1
- package/build-types/components/post-format/panel.d.ts.map +1 -1
- package/build-types/components/post-last-revision/check.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/index.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/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-saved-state/index.d.ts +1 -1
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/index.d.ts.map +1 -1
- package/build-types/components/post-schedule/label.d.ts.map +1 -1
- package/build-types/components/post-schedule/panel.d.ts.map +1 -1
- package/build-types/components/post-slug/check.d.ts.map +1 -1
- package/build-types/components/post-slug/index.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts +2 -1
- package/build-types/components/post-status/index.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/index.d.ts.map +1 -1
- package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
- package/build-types/components/post-sync-status/index.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 +9 -7
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +13 -11
- package/build-types/components/post-taxonomies/hierarchical-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/create-new-template.d.ts.map +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/post-text-editor/index.d.ts.map +1 -1
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/label.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/post-visibility/check.d.ts.map +1 -1
- package/build-types/components/post-visibility/index.d.ts.map +1 -1
- package/build-types/components/posts-per-page/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/site-discussion/index.d.ts.map +1 -1
- package/build-types/components/template-content-panel/index.d.ts +1 -3
- package/build-types/components/template-content-panel/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/components/time-to-read/index.d.ts.map +1 -1
- package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -0
- package/build-types/components/word-count/index.d.ts.map +1 -1
- package/build-types/dataviews/actions/delete-post.d.ts.map +1 -1
- package/build-types/dataviews/actions/export-pattern.native.d.ts +3 -0
- package/build-types/dataviews/actions/export-pattern.native.d.ts.map +1 -0
- package/build-types/dataviews/actions/permanently-delete-post.d.ts +5 -0
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/restore-post.d.ts +5 -0
- package/build-types/dataviews/actions/restore-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/trash-post.d.ts +5 -0
- package/build-types/dataviews/actions/trash-post.d.ts.map +1 -0
- package/build-types/dataviews/api.d.ts +1 -1
- package/build-types/dataviews/api.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +8 -3
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/dataviews/store/private-selectors.d.ts +2 -2
- package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +4 -1
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/dataviews/types.d.ts +9 -0
- package/build-types/dataviews/types.d.ts.map +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
- package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +11 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +1 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +0 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +38 -37
- package/src/bindings/api.js +57 -0
- package/src/bindings/pattern-overrides.js +28 -17
- package/src/bindings/post-meta.js +39 -14
- package/src/components/block-settings-menu/content-only-settings-menu.js +4 -4
- package/src/components/blog-title/index.js +8 -3
- package/src/components/collapsible-block-toolbar/index.js +1 -3
- package/src/components/collapsible-block-toolbar/style.scss +0 -3
- package/src/components/commands/index.js +4 -2
- package/src/components/document-bar/index.js +1 -1
- package/src/components/document-bar/style.scss +2 -6
- package/src/components/document-tools/style.scss +4 -4
- package/src/components/editor-interface/style.scss +9 -0
- package/src/components/global-styles-provider/index.js +22 -11
- package/src/components/header/back-button.js +6 -6
- package/src/components/header/index.js +27 -27
- package/src/components/header/style.scss +64 -21
- package/src/components/inserter-sidebar/style.scss +1 -6
- package/src/components/list-view-sidebar/style.scss +4 -0
- package/src/components/page-attributes/order.js +3 -77
- package/src/components/page-attributes/panel.js +1 -7
- package/src/components/page-attributes/parent.js +25 -7
- package/src/components/post-actions/actions.js +158 -463
- package/src/components/post-actions/index.js +19 -7
- package/src/components/post-author/hook.js +11 -3
- package/src/components/post-author/panel.js +3 -1
- package/src/components/post-card-panel/index.js +9 -3
- package/src/components/post-comments/index.js +8 -21
- package/src/components/post-content-information/index.js +7 -1
- package/src/components/post-discussion/panel.js +5 -3
- package/src/components/post-excerpt/panel.js +2 -1
- package/src/components/post-featured-image/index.js +5 -1
- package/src/components/post-last-revision/index.js +1 -0
- package/src/components/post-panel-row/style.scss +0 -1
- package/src/components/post-publish-button/index.js +4 -17
- package/src/components/post-publish-panel/maybe-category-panel.js +4 -1
- package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-status/index.js +29 -51
- package/src/components/post-taxonomies/flat-term-selector.js +19 -5
- package/src/components/post-taxonomies/index.js +8 -1
- package/src/components/post-template/block-theme.js +5 -1
- package/src/components/post-template/classic-theme.js +8 -3
- package/src/components/post-template/create-new-template-modal.js +7 -1
- package/src/components/post-template/create-new-template.js +4 -1
- package/src/components/post-template/hooks.js +8 -2
- package/src/components/post-template/panel.js +10 -2
- package/src/components/post-trash/check.js +9 -5
- package/src/components/post-url/panel.js +15 -4
- package/src/components/posts-per-page/index.js +7 -2
- package/src/components/preview-dropdown/index.js +113 -35
- package/src/components/preview-dropdown/style.scss +5 -0
- package/src/components/provider/disable-non-page-content-blocks.js +27 -24
- package/src/components/provider/use-block-editor-settings.js +15 -6
- package/src/components/save-publish-panels/index.js +1 -4
- package/src/components/sidebar/index.js +2 -5
- package/src/components/site-discussion/index.js +15 -22
- package/src/components/template-content-panel/index.js +37 -21
- package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
- package/src/components/visual-editor/index.js +13 -8
- package/src/components/visual-editor/style.scss +1 -4
- package/src/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
- package/src/dataviews/actions/delete-post.tsx +2 -0
- package/src/dataviews/actions/export-pattern.native.tsx +3 -0
- package/src/dataviews/actions/permanently-delete-post.tsx +116 -0
- package/src/dataviews/actions/restore-post.tsx +134 -0
- package/src/dataviews/actions/trash-post.tsx +196 -0
- package/src/dataviews/store/private-actions.ts +68 -0
- package/src/dataviews/store/private-selectors.ts +9 -17
- package/src/dataviews/store/reducer.ts +20 -1
- package/src/dataviews/types.ts +11 -0
- package/src/hooks/pattern-overrides.js +1 -1
- package/src/index.js +0 -1
- package/src/private-apis.js +6 -2
- package/src/store/actions.js +36 -13
- package/src/store/private-actions.js +8 -4
- package/src/store/private-selectors.js +45 -2
- package/src/store/test/actions.js +9 -3
- package/src/store/test/private-selectors.js +78 -0
- package/src/utils/media-upload/index.js +38 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/build/bindings/index.js +0 -22
- package/build/bindings/index.js.map +0 -1
- package/build/dataviews/actions/index.js +0 -32
- package/build/dataviews/actions/index.js.map +0 -1
- package/build/hooks/use-select-nearest-editable-block.js.map +0 -1
- package/build/store/utils/get-filtered-template-parts.js +0 -71
- package/build/store/utils/get-filtered-template-parts.js.map +0 -1
- package/build/utils/set-nested-value.js +0 -44
- package/build/utils/set-nested-value.js.map +0 -1
- package/build-module/bindings/index.js +0 -17
- package/build-module/bindings/index.js.map +0 -1
- package/build-module/dataviews/actions/index.js +0 -24
- package/build-module/dataviews/actions/index.js.map +0 -1
- package/build-module/hooks/use-select-nearest-editable-block.js.map +0 -1
- package/build-module/store/utils/get-filtered-template-parts.js +0 -64
- package/build-module/store/utils/get-filtered-template-parts.js.map +0 -1
- package/build-module/utils/set-nested-value.js +0 -38
- package/build-module/utils/set-nested-value.js.map +0 -1
- package/build-types/bindings/index.d.ts +0 -2
- package/build-types/bindings/index.d.ts.map +0 -1
- package/build-types/dataviews/actions/index.d.ts +0 -2
- package/build-types/dataviews/actions/index.d.ts.map +0 -1
- package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +0 -1
- package/build-types/store/utils/get-filtered-template-parts.d.ts +0 -3
- package/build-types/store/utils/get-filtered-template-parts.d.ts.map +0 -1
- package/build-types/utils/set-nested-value.d.ts +0 -20
- package/build-types/utils/set-nested-value.d.ts.map +0 -1
- package/src/bindings/index.js +0 -15
- package/src/components/document-outline/test/__snapshots__/index.js.snap +0 -111
- package/src/components/document-outline/test/index.js +0 -185
- package/src/dataviews/actions/index.ts +0 -25
- package/src/store/utils/get-filtered-template-parts.js +0 -69
- package/src/store/utils/test/get-filtered-template-parts.js +0 -189
- package/src/utils/set-nested-value.js +0 -39
- /package/build-types/{hooks → components/visual-editor}/use-select-nearest-editable-block.d.ts +0 -0
|
@@ -29,26 +29,38 @@ const {
|
|
|
29
29
|
|
|
30
30
|
export default function PostActions( { onActionPerformed, buttonProps } ) {
|
|
31
31
|
const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
|
|
32
|
-
const { item, postType } = useSelect( ( select ) => {
|
|
32
|
+
const { item, permissions, postType } = useSelect( ( select ) => {
|
|
33
33
|
const { getCurrentPostType, getCurrentPostId } = select( editorStore );
|
|
34
|
-
const { getEditedEntityRecord } =
|
|
34
|
+
const { getEditedEntityRecord, getEntityRecordPermissions } = unlock(
|
|
35
|
+
select( coreStore )
|
|
36
|
+
);
|
|
35
37
|
const _postType = getCurrentPostType();
|
|
38
|
+
const _id = getCurrentPostId();
|
|
36
39
|
return {
|
|
37
|
-
item: getEditedEntityRecord(
|
|
40
|
+
item: getEditedEntityRecord( 'postType', _postType, _id ),
|
|
41
|
+
permissions: getEntityRecordPermissions(
|
|
38
42
|
'postType',
|
|
39
43
|
_postType,
|
|
40
|
-
|
|
44
|
+
_id
|
|
41
45
|
),
|
|
42
46
|
postType: _postType,
|
|
43
47
|
};
|
|
44
48
|
}, [] );
|
|
49
|
+
const itemWithPermissions = useMemo( () => {
|
|
50
|
+
return {
|
|
51
|
+
...item,
|
|
52
|
+
permissions,
|
|
53
|
+
};
|
|
54
|
+
}, [ item, permissions ] );
|
|
45
55
|
const allActions = usePostActions( { postType, onActionPerformed } );
|
|
46
56
|
|
|
47
57
|
const actions = useMemo( () => {
|
|
48
58
|
return allActions.filter( ( action ) => {
|
|
49
|
-
return
|
|
59
|
+
return (
|
|
60
|
+
! action.isEligible || action.isEligible( itemWithPermissions )
|
|
61
|
+
);
|
|
50
62
|
} );
|
|
51
|
-
}, [ allActions,
|
|
63
|
+
}, [ allActions, itemWithPermissions ] );
|
|
52
64
|
|
|
53
65
|
return (
|
|
54
66
|
<DropdownMenu
|
|
@@ -72,7 +84,7 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
|
|
|
72
84
|
>
|
|
73
85
|
<ActionsDropdownMenuGroup
|
|
74
86
|
actions={ actions }
|
|
75
|
-
item={
|
|
87
|
+
item={ itemWithPermissions }
|
|
76
88
|
onClose={ () => {
|
|
77
89
|
setIsActionsMenuOpen( false );
|
|
78
90
|
} }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { useMemo } from '@wordpress/element';
|
|
5
6
|
import { useSelect } from '@wordpress/data';
|
|
6
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -46,17 +47,24 @@ export function useAuthorsQuery( search ) {
|
|
|
46
47
|
( { value } ) => postAuthor?.id === value
|
|
47
48
|
);
|
|
48
49
|
|
|
50
|
+
let currentAuthor = [];
|
|
49
51
|
if ( foundAuthor < 0 && postAuthor ) {
|
|
50
|
-
|
|
52
|
+
currentAuthor = [
|
|
51
53
|
{
|
|
52
54
|
value: postAuthor.id,
|
|
53
55
|
label: decodeEntities( postAuthor.name ),
|
|
54
56
|
},
|
|
55
|
-
|
|
57
|
+
];
|
|
58
|
+
} else if ( foundAuthor < 0 && ! postAuthor ) {
|
|
59
|
+
currentAuthor = [
|
|
60
|
+
{
|
|
61
|
+
value: 0,
|
|
62
|
+
label: __( '(No author)' ),
|
|
63
|
+
},
|
|
56
64
|
];
|
|
57
65
|
}
|
|
58
66
|
|
|
59
|
-
return fetchedAuthors;
|
|
67
|
+
return [ ...currentAuthor, ...fetchedAuthors ];
|
|
60
68
|
}, [ authors, postAuthor ] );
|
|
61
69
|
|
|
62
70
|
return { authorId, authorOptions, postAuthor };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { Button, Dropdown } from '@wordpress/components';
|
|
6
6
|
import { useState, useMemo } from '@wordpress/element';
|
|
7
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
7
8
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -16,7 +17,8 @@ import { useAuthorsQuery } from './hook';
|
|
|
16
17
|
|
|
17
18
|
function PostAuthorToggle( { isOpen, onClick } ) {
|
|
18
19
|
const { postAuthor } = useAuthorsQuery();
|
|
19
|
-
const authorName =
|
|
20
|
+
const authorName =
|
|
21
|
+
decodeEntities( postAuthor?.name ) || __( '(No author)' );
|
|
20
22
|
return (
|
|
21
23
|
<Button
|
|
22
24
|
size="compact"
|
|
@@ -36,8 +36,14 @@ export default function PostCardPanel( { actions } ) {
|
|
|
36
36
|
getCurrentPostId,
|
|
37
37
|
__experimentalGetTemplateInfo,
|
|
38
38
|
} = select( editorStore );
|
|
39
|
+
const { canUser } = select( coreStore );
|
|
39
40
|
const { getEditedEntityRecord } = select( coreStore );
|
|
40
|
-
const siteSettings =
|
|
41
|
+
const siteSettings = canUser( 'read', {
|
|
42
|
+
kind: 'root',
|
|
43
|
+
name: 'site',
|
|
44
|
+
} )
|
|
45
|
+
? getEditedEntityRecord( 'root', 'site' )
|
|
46
|
+
: undefined;
|
|
41
47
|
const _type = getCurrentPostType();
|
|
42
48
|
const _id = getCurrentPostId();
|
|
43
49
|
const _record = getEditedEntityRecord( 'postType', _type, _id );
|
|
@@ -95,10 +101,10 @@ export default function PostCardPanel( { actions } ) {
|
|
|
95
101
|
as="h2"
|
|
96
102
|
lineHeight="20px"
|
|
97
103
|
>
|
|
98
|
-
{ title ? decodeEntities( title ) : __( 'No
|
|
104
|
+
{ title ? decodeEntities( title ) : __( 'No title' ) }
|
|
99
105
|
{ isFrontPage && (
|
|
100
106
|
<span className="editor-post-card-panel__title-badge">
|
|
101
|
-
{ __( '
|
|
107
|
+
{ __( 'Homepage' ) }
|
|
102
108
|
</span>
|
|
103
109
|
) }
|
|
104
110
|
{ isPostsPage && (
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
RadioControl,
|
|
7
|
-
__experimentalText as Text,
|
|
8
7
|
__experimentalVStack as VStack,
|
|
9
8
|
} from '@wordpress/components';
|
|
10
9
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
@@ -16,29 +15,17 @@ import { store as editorStore } from '../../store';
|
|
|
16
15
|
|
|
17
16
|
const COMMENT_OPTIONS = [
|
|
18
17
|
{
|
|
19
|
-
label: (
|
|
20
|
-
<>
|
|
21
|
-
{ __( 'Open' ) }
|
|
22
|
-
<Text variant="muted" size={ 12 }>
|
|
23
|
-
{ __( 'Visitors can add new comments and replies.' ) }
|
|
24
|
-
</Text>
|
|
25
|
-
</>
|
|
26
|
-
),
|
|
18
|
+
label: _x( 'Open', 'Adjective: e.g. "Comments are open"' ),
|
|
27
19
|
value: 'open',
|
|
20
|
+
description: __( 'Visitors can add new comments and replies.' ),
|
|
28
21
|
},
|
|
29
22
|
{
|
|
30
|
-
label: (
|
|
31
|
-
<>
|
|
32
|
-
{ __( 'Closed' ) }
|
|
33
|
-
<Text variant="muted" size={ 12 }>
|
|
34
|
-
{ __( 'Visitors cannot add new comments or replies.' ) }
|
|
35
|
-
</Text>
|
|
36
|
-
<Text variant="muted" size={ 12 }>
|
|
37
|
-
{ __( 'Existing comments remain visible.' ) }
|
|
38
|
-
</Text>
|
|
39
|
-
</>
|
|
40
|
-
),
|
|
23
|
+
label: __( 'Closed' ),
|
|
41
24
|
value: 'closed',
|
|
25
|
+
description: [
|
|
26
|
+
__( 'Visitors cannot add new comments or replies.' ),
|
|
27
|
+
__( 'Existing comments remain visible.' ),
|
|
28
|
+
].join( ' ' ),
|
|
42
29
|
},
|
|
43
30
|
];
|
|
44
31
|
|
|
@@ -25,8 +25,14 @@ export default function PostContentInformation() {
|
|
|
25
25
|
const { postContent } = useSelect( ( select ) => {
|
|
26
26
|
const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =
|
|
27
27
|
select( editorStore );
|
|
28
|
+
const { canUser } = select( coreStore );
|
|
28
29
|
const { getEntityRecord } = select( coreStore );
|
|
29
|
-
const siteSettings =
|
|
30
|
+
const siteSettings = canUser( 'read', {
|
|
31
|
+
kind: 'root',
|
|
32
|
+
name: 'site',
|
|
33
|
+
} )
|
|
34
|
+
? getEntityRecord( 'root', 'site' )
|
|
35
|
+
: undefined;
|
|
30
36
|
const postType = getCurrentPostType();
|
|
31
37
|
const _id = getCurrentPostId();
|
|
32
38
|
const isPostsPage = +_id === siteSettings?.page_for_posts;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
Dropdown,
|
|
7
7
|
Button,
|
|
@@ -62,9 +62,11 @@ function PostDiscussionToggle( { isOpen, onClick } ) {
|
|
|
62
62
|
let label;
|
|
63
63
|
if ( commentStatus === 'open' ) {
|
|
64
64
|
if ( pingStatus === 'open' ) {
|
|
65
|
-
label =
|
|
65
|
+
label = _x( 'Open', 'Adjective: e.g. "Comments are open"' );
|
|
66
66
|
} else {
|
|
67
|
-
label = trackbacksSupported
|
|
67
|
+
label = trackbacksSupported
|
|
68
|
+
? __( 'Comments only' )
|
|
69
|
+
: _x( 'Open', 'Adjective: e.g. "Comments are open"' );
|
|
68
70
|
}
|
|
69
71
|
} else if ( pingStatus === 'open' ) {
|
|
70
72
|
label = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );
|
|
@@ -148,7 +148,8 @@ function PrivateExcerpt() {
|
|
|
148
148
|
isPattern ||
|
|
149
149
|
( template &&
|
|
150
150
|
template.source === TEMPLATE_ORIGINS.custom &&
|
|
151
|
-
! template.has_theme_file
|
|
151
|
+
! template.has_theme_file &&
|
|
152
|
+
template.is_custom ) ),
|
|
152
153
|
};
|
|
153
154
|
}, [] );
|
|
154
155
|
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
@@ -170,13 +170,16 @@ function PostFeaturedImage( {
|
|
|
170
170
|
aria-label={
|
|
171
171
|
! featuredImageId
|
|
172
172
|
? null
|
|
173
|
-
: __(
|
|
173
|
+
: __(
|
|
174
|
+
'Edit or replace the featured image'
|
|
175
|
+
)
|
|
174
176
|
}
|
|
175
177
|
aria-describedby={
|
|
176
178
|
! featuredImageId
|
|
177
179
|
? null
|
|
178
180
|
: `editor-post-featured-image-${ featuredImageId }-describedby`
|
|
179
181
|
}
|
|
182
|
+
aria-haspopup="dialog"
|
|
180
183
|
>
|
|
181
184
|
{ !! featuredImageId && media && (
|
|
182
185
|
<img
|
|
@@ -197,6 +200,7 @@ function PostFeaturedImage( {
|
|
|
197
200
|
<Button
|
|
198
201
|
className="editor-post-featured-image__action"
|
|
199
202
|
onClick={ open }
|
|
203
|
+
aria-haspopup="dialog"
|
|
200
204
|
>
|
|
201
205
|
{ __( 'Replace' ) }
|
|
202
206
|
</Button>
|
|
@@ -11,7 +11,6 @@ import { compose } from '@wordpress/compose';
|
|
|
11
11
|
*/
|
|
12
12
|
import PublishButtonLabel from './label';
|
|
13
13
|
import { store as editorStore } from '../../store';
|
|
14
|
-
import { unlock } from '../../lock-unlock';
|
|
15
14
|
|
|
16
15
|
const noop = () => {};
|
|
17
16
|
|
|
@@ -46,24 +45,14 @@ export class PostPublishButton extends Component {
|
|
|
46
45
|
|
|
47
46
|
createOnClick( callback ) {
|
|
48
47
|
return ( ...args ) => {
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
hasPostMetaChanges,
|
|
52
|
-
setEntitiesSavedStatesCallback,
|
|
53
|
-
isPublished,
|
|
54
|
-
} = this.props;
|
|
48
|
+
const { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =
|
|
49
|
+
this.props;
|
|
55
50
|
// If a post with non-post entities is published, but the user
|
|
56
51
|
// elects to not save changes to the non-post entities, those
|
|
57
52
|
// entities will still be dirty when the Publish button is clicked.
|
|
58
53
|
// We also need to check that the `setEntitiesSavedStatesCallback`
|
|
59
54
|
// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
|
|
60
|
-
|
|
61
|
-
// TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.
|
|
62
|
-
if (
|
|
63
|
-
( hasNonPostEntityChanges ||
|
|
64
|
-
( hasPostMetaChanges && isPublished ) ) &&
|
|
65
|
-
setEntitiesSavedStatesCallback
|
|
66
|
-
) {
|
|
55
|
+
if ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {
|
|
67
56
|
// The modal for multiple entity saving will open,
|
|
68
57
|
// hold the callback for saving/publishing the post
|
|
69
58
|
// so that we can call it if the post entity is checked.
|
|
@@ -226,8 +215,7 @@ export default compose( [
|
|
|
226
215
|
isSavingNonPostEntityChanges,
|
|
227
216
|
getEditedPostAttribute,
|
|
228
217
|
getPostEdits,
|
|
229
|
-
|
|
230
|
-
} = unlock( select( editorStore ) );
|
|
218
|
+
} = select( editorStore );
|
|
231
219
|
return {
|
|
232
220
|
isSaving: isSavingPost(),
|
|
233
221
|
isAutoSaving: isAutosavingPost(),
|
|
@@ -244,7 +232,6 @@ export default compose( [
|
|
|
244
232
|
postStatus: getEditedPostAttribute( 'status' ),
|
|
245
233
|
postStatusHasChanged: getPostEdits()?.status,
|
|
246
234
|
hasNonPostEntityChanges: hasNonPostEntityChanges(),
|
|
247
|
-
hasPostMetaChanges: hasPostMetaChanges(),
|
|
248
235
|
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
|
|
249
236
|
};
|
|
250
237
|
} ),
|
|
@@ -18,7 +18,10 @@ function MaybeCategoryPanel() {
|
|
|
18
18
|
const postType = select( editorStore ).getCurrentPostType();
|
|
19
19
|
const { canUser, getEntityRecord, getTaxonomy } = select( coreStore );
|
|
20
20
|
const categoriesTaxonomy = getTaxonomy( 'category' );
|
|
21
|
-
const defaultCategoryId = canUser( 'read',
|
|
21
|
+
const defaultCategoryId = canUser( 'read', {
|
|
22
|
+
kind: 'root',
|
|
23
|
+
name: 'site',
|
|
24
|
+
} )
|
|
22
25
|
? getEntityRecord( 'root', 'site' )?.default_category
|
|
23
26
|
: undefined;
|
|
24
27
|
const defaultCategory = defaultCategoryId
|
|
@@ -28,7 +28,7 @@ const TagsPanel = () => {
|
|
|
28
28
|
'Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.'
|
|
29
29
|
) }
|
|
30
30
|
</p>
|
|
31
|
-
<FlatTermSelector slug="post_tag" />
|
|
31
|
+
<FlatTermSelector slug="post_tag" __nextHasNoMarginBottom />
|
|
32
32
|
</PanelBody>
|
|
33
33
|
);
|
|
34
34
|
};
|
|
@@ -22,7 +22,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
22
22
|
font-weight: 500;
|
|
23
23
|
line-height: 1.4;
|
|
24
24
|
text-transform: uppercase;
|
|
25
|
-
display:
|
|
25
|
+
display: block;
|
|
26
26
|
margin-bottom: calc(4px * 2);
|
|
27
27
|
padding: 0;
|
|
28
28
|
}
|
|
@@ -214,7 +214,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
214
214
|
font-weight: 500;
|
|
215
215
|
line-height: 1.4;
|
|
216
216
|
text-transform: uppercase;
|
|
217
|
-
display:
|
|
217
|
+
display: block;
|
|
218
218
|
margin-bottom: calc(4px * 2);
|
|
219
219
|
padding: 0;
|
|
220
220
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
Button,
|
|
6
6
|
CheckboxControl,
|
|
7
7
|
Dropdown,
|
|
8
|
-
__experimentalText as Text,
|
|
9
8
|
__experimentalVStack as VStack,
|
|
10
9
|
TextControl,
|
|
11
10
|
RadioControl,
|
|
@@ -16,6 +15,13 @@ import { useState, useMemo } from '@wordpress/element';
|
|
|
16
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
16
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
18
17
|
import { useInstanceId } from '@wordpress/compose';
|
|
18
|
+
import {
|
|
19
|
+
drafts,
|
|
20
|
+
published,
|
|
21
|
+
scheduled,
|
|
22
|
+
pending,
|
|
23
|
+
notAllowed,
|
|
24
|
+
} from '@wordpress/icons';
|
|
19
25
|
|
|
20
26
|
/**
|
|
21
27
|
* Internal dependencies
|
|
@@ -31,70 +37,40 @@ import PostSticky from '../post-sticky';
|
|
|
31
37
|
import { PrivatePostSchedule } from '../post-schedule';
|
|
32
38
|
import { store as editorStore } from '../../store';
|
|
33
39
|
|
|
34
|
-
const
|
|
35
|
-
'auto-draft': __( 'Draft' ),
|
|
36
|
-
draft: __( 'Draft' ),
|
|
37
|
-
pending: __( 'Pending' ),
|
|
38
|
-
private: __( 'Private' ),
|
|
39
|
-
future: __( 'Scheduled' ),
|
|
40
|
-
publish: __( 'Published' ),
|
|
40
|
+
const postStatusesInfo = {
|
|
41
|
+
'auto-draft': { label: __( 'Draft' ), icon: drafts },
|
|
42
|
+
draft: { label: __( 'Draft' ), icon: drafts },
|
|
43
|
+
pending: { label: __( 'Pending' ), icon: pending },
|
|
44
|
+
private: { label: __( 'Private' ), icon: notAllowed },
|
|
45
|
+
future: { label: __( 'Scheduled' ), icon: scheduled },
|
|
46
|
+
publish: { label: __( 'Published' ), icon: published },
|
|
41
47
|
};
|
|
42
48
|
|
|
43
49
|
export const STATUS_OPTIONS = [
|
|
44
50
|
{
|
|
45
|
-
label: (
|
|
46
|
-
<>
|
|
47
|
-
{ __( 'Draft' ) }
|
|
48
|
-
<Text variant="muted" size={ 12 }>
|
|
49
|
-
{ __( 'Not ready to publish.' ) }
|
|
50
|
-
</Text>
|
|
51
|
-
</>
|
|
52
|
-
),
|
|
51
|
+
label: __( 'Draft' ),
|
|
53
52
|
value: 'draft',
|
|
53
|
+
description: __( 'Not ready to publish.' ),
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
label: (
|
|
57
|
-
<>
|
|
58
|
-
{ __( 'Pending' ) }
|
|
59
|
-
<Text variant="muted" size={ 12 }>
|
|
60
|
-
{ __( 'Waiting for review before publishing.' ) }
|
|
61
|
-
</Text>
|
|
62
|
-
</>
|
|
63
|
-
),
|
|
56
|
+
label: __( 'Pending' ),
|
|
64
57
|
value: 'pending',
|
|
58
|
+
description: __( 'Waiting for review before publishing.' ),
|
|
65
59
|
},
|
|
66
60
|
{
|
|
67
|
-
label: (
|
|
68
|
-
<>
|
|
69
|
-
{ __( 'Private' ) }
|
|
70
|
-
<Text variant="muted" size={ 12 }>
|
|
71
|
-
{ __( 'Only visible to site admins and editors.' ) }
|
|
72
|
-
</Text>
|
|
73
|
-
</>
|
|
74
|
-
),
|
|
61
|
+
label: __( 'Private' ),
|
|
75
62
|
value: 'private',
|
|
63
|
+
description: __( 'Only visible to site admins and editors.' ),
|
|
76
64
|
},
|
|
77
65
|
{
|
|
78
|
-
label: (
|
|
79
|
-
<>
|
|
80
|
-
{ __( 'Scheduled' ) }
|
|
81
|
-
<Text variant="muted" size={ 12 }>
|
|
82
|
-
{ __( 'Publish automatically on a chosen date.' ) }
|
|
83
|
-
</Text>
|
|
84
|
-
</>
|
|
85
|
-
),
|
|
66
|
+
label: __( 'Scheduled' ),
|
|
86
67
|
value: 'future',
|
|
68
|
+
description: __( 'Publish automatically on a chosen date.' ),
|
|
87
69
|
},
|
|
88
70
|
{
|
|
89
|
-
label: (
|
|
90
|
-
<>
|
|
91
|
-
{ __( 'Published' ) }
|
|
92
|
-
<Text variant="muted" size={ 12 }>
|
|
93
|
-
{ __( 'Visible to everyone.' ) }
|
|
94
|
-
</Text>
|
|
95
|
-
</>
|
|
96
|
-
),
|
|
71
|
+
label: __( 'Published' ),
|
|
97
72
|
value: 'publish',
|
|
73
|
+
description: __( 'Visible to everyone.' ),
|
|
98
74
|
},
|
|
99
75
|
];
|
|
100
76
|
|
|
@@ -200,13 +176,14 @@ export default function PostStatus() {
|
|
|
200
176
|
variant="tertiary"
|
|
201
177
|
size="compact"
|
|
202
178
|
onClick={ onToggle }
|
|
179
|
+
icon={ postStatusesInfo[ status ]?.icon }
|
|
203
180
|
aria-label={ sprintf(
|
|
204
181
|
// translators: %s: Current post status.
|
|
205
182
|
__( 'Change post status: %s' ),
|
|
206
|
-
|
|
183
|
+
postStatusesInfo[ status ]?.label
|
|
207
184
|
) }
|
|
208
185
|
>
|
|
209
|
-
{
|
|
186
|
+
{ postStatusesInfo[ status ]?.label }
|
|
210
187
|
</Button>
|
|
211
188
|
) }
|
|
212
189
|
renderContent={ ( { onClose } ) => (
|
|
@@ -277,6 +254,7 @@ export default function PostStatus() {
|
|
|
277
254
|
id={ passwordInputId }
|
|
278
255
|
__next40pxDefaultSize
|
|
279
256
|
__nextHasNoMarginBottom
|
|
257
|
+
maxLength={ 255 }
|
|
280
258
|
/>
|
|
281
259
|
</div>
|
|
282
260
|
) }
|
|
@@ -290,7 +268,7 @@ export default function PostStatus() {
|
|
|
290
268
|
/>
|
|
291
269
|
) : (
|
|
292
270
|
<div className="editor-post-status is-read-only">
|
|
293
|
-
{
|
|
271
|
+
{ postStatusesInfo[ status ]?.label }
|
|
294
272
|
</div>
|
|
295
273
|
) }
|
|
296
274
|
</PostPanelRow>
|
|
@@ -5,6 +5,7 @@ import { __, _x, sprintf } from '@wordpress/i18n';
|
|
|
5
5
|
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
6
6
|
import { FormTokenField, withFilters } from '@wordpress/components';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
+
import deprecated from '@wordpress/deprecated';
|
|
8
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
10
|
import { useDebounce } from '@wordpress/compose';
|
|
10
11
|
import { speak } from '@wordpress/a11y';
|
|
@@ -55,16 +56,28 @@ const termNamesToIds = ( names, terms ) => {
|
|
|
55
56
|
/**
|
|
56
57
|
* Renders a flat term selector component.
|
|
57
58
|
*
|
|
58
|
-
* @param {Object}
|
|
59
|
-
* @param {string}
|
|
59
|
+
* @param {Object} props The component props.
|
|
60
|
+
* @param {string} props.slug The slug of the taxonomy.
|
|
61
|
+
* @param {boolean} props.__nextHasNoMarginBottom Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
|
|
60
62
|
*
|
|
61
63
|
* @return {JSX.Element} The rendered flat term selector component.
|
|
62
64
|
*/
|
|
63
|
-
export function FlatTermSelector( { slug } ) {
|
|
65
|
+
export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
|
|
64
66
|
const [ values, setValues ] = useState( [] );
|
|
65
67
|
const [ search, setSearch ] = useState( '' );
|
|
66
68
|
const debouncedSearch = useDebounce( setSearch, 500 );
|
|
67
69
|
|
|
70
|
+
if ( ! __nextHasNoMarginBottom ) {
|
|
71
|
+
deprecated(
|
|
72
|
+
'Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector',
|
|
73
|
+
{
|
|
74
|
+
since: '6.7',
|
|
75
|
+
version: '7.0',
|
|
76
|
+
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
68
81
|
const {
|
|
69
82
|
terms,
|
|
70
83
|
termIds,
|
|
@@ -86,7 +99,7 @@ export function FlatTermSelector( { slug } ) {
|
|
|
86
99
|
|
|
87
100
|
const query = {
|
|
88
101
|
...DEFAULT_QUERY,
|
|
89
|
-
include: _termIds
|
|
102
|
+
include: _termIds?.join( ',' ),
|
|
90
103
|
per_page: -1,
|
|
91
104
|
};
|
|
92
105
|
|
|
@@ -103,7 +116,7 @@ export function FlatTermSelector( { slug } ) {
|
|
|
103
116
|
: false,
|
|
104
117
|
taxonomy: _taxonomy,
|
|
105
118
|
termIds: _termIds,
|
|
106
|
-
terms: _termIds
|
|
119
|
+
terms: _termIds?.length
|
|
107
120
|
? getEntityRecords( 'taxonomy', slug, query )
|
|
108
121
|
: EMPTY_ARRAY,
|
|
109
122
|
hasResolvedTerms: hasFinishedResolution( 'getEntityRecords', [
|
|
@@ -290,6 +303,7 @@ export function FlatTermSelector( { slug } ) {
|
|
|
290
303
|
removed: termRemovedLabel,
|
|
291
304
|
remove: removeTermLabel,
|
|
292
305
|
} }
|
|
306
|
+
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
293
307
|
/>
|
|
294
308
|
<MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
|
|
295
309
|
</>
|
|
@@ -32,10 +32,17 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
|
|
|
32
32
|
const TaxonomyComponent = taxonomy.hierarchical
|
|
33
33
|
? HierarchicalTermSelector
|
|
34
34
|
: FlatTermSelector;
|
|
35
|
+
const taxonomyComponentProps = {
|
|
36
|
+
slug: taxonomy.slug,
|
|
37
|
+
...( taxonomy.hierarchical
|
|
38
|
+
? {}
|
|
39
|
+
: { __nextHasNoMarginBottom: true } ),
|
|
40
|
+
};
|
|
41
|
+
|
|
35
42
|
return (
|
|
36
43
|
<Fragment key={ `taxonomy-${ taxonomy.slug }` }>
|
|
37
44
|
{ taxonomyWrapper(
|
|
38
|
-
<TaxonomyComponent
|
|
45
|
+
<TaxonomyComponent { ...taxonomyComponentProps } />,
|
|
39
46
|
taxonomy
|
|
40
47
|
) }
|
|
41
48
|
</Fragment>
|
|
@@ -53,7 +53,11 @@ export default function BlockThemeControl( { id } ) {
|
|
|
53
53
|
|
|
54
54
|
const canCreateTemplate = useSelect(
|
|
55
55
|
( select ) =>
|
|
56
|
-
select( coreStore ).canUser( 'create',
|
|
56
|
+
!! select( coreStore ).canUser( 'create', {
|
|
57
|
+
kind: 'postType',
|
|
58
|
+
name: 'wp_template',
|
|
59
|
+
} ),
|
|
60
|
+
[]
|
|
57
61
|
);
|
|
58
62
|
|
|
59
63
|
if ( ! hasResolved ) {
|
|
@@ -33,8 +33,10 @@ function PostTemplateToggle( { isOpen, onClick } ) {
|
|
|
33
33
|
return availableTemplates[ templateSlug ];
|
|
34
34
|
}
|
|
35
35
|
const template =
|
|
36
|
-
select( coreStore ).canUser( 'create',
|
|
37
|
-
|
|
36
|
+
select( coreStore ).canUser( 'create', {
|
|
37
|
+
kind: 'postType',
|
|
38
|
+
name: 'wp_template',
|
|
39
|
+
} ) && select( editorStore ).getCurrentTemplateId();
|
|
38
40
|
return (
|
|
39
41
|
template?.title ||
|
|
40
42
|
template?.slug ||
|
|
@@ -78,7 +80,10 @@ function PostTemplateDropdownContent( { onClose } ) {
|
|
|
78
80
|
( select ) => {
|
|
79
81
|
const { canUser, getEntityRecords } = select( coreStore );
|
|
80
82
|
const editorSettings = select( editorStore ).getEditorSettings();
|
|
81
|
-
const canCreateTemplates = canUser( 'create',
|
|
83
|
+
const canCreateTemplates = canUser( 'create', {
|
|
84
|
+
kind: 'postType',
|
|
85
|
+
name: 'wp_template',
|
|
86
|
+
} );
|
|
82
87
|
const _currentTemplateId =
|
|
83
88
|
select( editorStore ).getCurrentTemplateId();
|
|
84
89
|
return {
|
|
@@ -118,6 +118,7 @@ export default function CreateNewTemplateModal( { onClose } ) {
|
|
|
118
118
|
>
|
|
119
119
|
<VStack spacing="3">
|
|
120
120
|
<TextControl
|
|
121
|
+
__next40pxDefaultSize
|
|
121
122
|
__nextHasNoMarginBottom
|
|
122
123
|
label={ __( 'Name' ) }
|
|
123
124
|
value={ title }
|
|
@@ -129,11 +130,16 @@ export default function CreateNewTemplateModal( { onClose } ) {
|
|
|
129
130
|
) }
|
|
130
131
|
/>
|
|
131
132
|
<HStack justify="right">
|
|
132
|
-
<Button
|
|
133
|
+
<Button
|
|
134
|
+
__next40pxDefaultSize
|
|
135
|
+
variant="tertiary"
|
|
136
|
+
onClick={ cancel }
|
|
137
|
+
>
|
|
133
138
|
{ __( 'Cancel' ) }
|
|
134
139
|
</Button>
|
|
135
140
|
|
|
136
141
|
<Button
|
|
142
|
+
__next40pxDefaultSize
|
|
137
143
|
variant="primary"
|
|
138
144
|
type="submit"
|
|
139
145
|
isBusy={ isBusy }
|