@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
|
@@ -24,7 +24,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
24
24
|
|
|
25
25
|
const { useHasBlockToolbar } = unlock( blockEditorPrivateApis );
|
|
26
26
|
|
|
27
|
-
function
|
|
27
|
+
export default function CollapsibleBlockToolbar( { isCollapsed, onToggle } ) {
|
|
28
28
|
const { blockSelectionStart } = useSelect( ( select ) => {
|
|
29
29
|
return {
|
|
30
30
|
blockSelectionStart:
|
|
@@ -73,5 +73,3 @@ function CollapsableBlockToolbar( { isCollapsed, onToggle } ) {
|
|
|
73
73
|
</>
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
export default CollapsableBlockToolbar;
|
|
@@ -89,7 +89,8 @@ function useEditorCommandLoader() {
|
|
|
89
89
|
name: 'core/open-shortcut-help',
|
|
90
90
|
label: __( 'Keyboard shortcuts' ),
|
|
91
91
|
icon: keyboard,
|
|
92
|
-
callback: () => {
|
|
92
|
+
callback: ( { close } ) => {
|
|
93
|
+
close();
|
|
93
94
|
openModal( 'editor/keyboard-shortcut-help' );
|
|
94
95
|
},
|
|
95
96
|
} );
|
|
@@ -108,7 +109,8 @@ function useEditorCommandLoader() {
|
|
|
108
109
|
commands.push( {
|
|
109
110
|
name: 'core/open-preferences',
|
|
110
111
|
label: __( 'Editor preferences' ),
|
|
111
|
-
callback: () => {
|
|
112
|
+
callback: ( { close } ) => {
|
|
113
|
+
close();
|
|
112
114
|
openModal( 'editor/preferences' );
|
|
113
115
|
},
|
|
114
116
|
} );
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
min-width: 0;
|
|
11
11
|
background: $gray-100;
|
|
12
12
|
border-radius: $grid-unit-05;
|
|
13
|
-
width: min(100%,
|
|
13
|
+
width: min(100%, 450px);
|
|
14
14
|
|
|
15
15
|
&:hover {
|
|
16
16
|
background-color: $gray-200;
|
|
@@ -25,10 +25,6 @@
|
|
|
25
25
|
background: $gray-200;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
@include break-large() {
|
|
30
|
-
width: min(100%, 450px);
|
|
31
|
-
}
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
.editor-document-bar__command {
|
|
@@ -38,7 +34,7 @@
|
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
.editor-document-bar__title {
|
|
41
|
-
flex
|
|
37
|
+
flex: 1;
|
|
42
38
|
overflow: hidden;
|
|
43
39
|
color: $gray-900;
|
|
44
40
|
gap: $grid-unit-05;
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
.editor-document-tools__left {
|
|
66
66
|
display: inline-flex;
|
|
67
67
|
align-items: center;
|
|
68
|
-
padding-left: $grid-unit-20;
|
|
69
68
|
gap: $grid-unit-10;
|
|
70
69
|
|
|
71
|
-
// Some plugins add buttons here despite best practices.
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
// Some plugins add buttons here despite best practices — accommodate them with a gap.
|
|
71
|
+
&:not(:last-child) {
|
|
72
|
+
margin-inline-end: $grid-unit-10;
|
|
73
|
+
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
.editor-editor-interface .entities-saved-states__panel-header {
|
|
2
2
|
height: $header-height + $border-width;
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
.editor-editor-interface .interface-interface-skeleton__content {
|
|
6
|
+
// Make this a stacking context to contain the z-index of children elements.
|
|
7
|
+
isolation: isolate;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.editor-visual-editor {
|
|
11
|
+
flex: 1 0 auto;
|
|
12
|
+
}
|
|
@@ -33,17 +33,24 @@ export function mergeBaseAndUserConfigs( base, user ) {
|
|
|
33
33
|
function useGlobalStylesUserConfig() {
|
|
34
34
|
const { globalStylesId, isReady, settings, styles, _links } = useSelect(
|
|
35
35
|
( select ) => {
|
|
36
|
-
const { getEditedEntityRecord, hasFinishedResolution } =
|
|
36
|
+
const { getEditedEntityRecord, hasFinishedResolution, canUser } =
|
|
37
37
|
select( coreStore );
|
|
38
38
|
const _globalStylesId =
|
|
39
39
|
select( coreStore ).__experimentalGetCurrentGlobalStylesId();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
|
|
41
|
+
const record =
|
|
42
|
+
_globalStylesId &&
|
|
43
|
+
canUser( 'read', {
|
|
44
|
+
kind: 'root',
|
|
45
|
+
name: 'globalStyles',
|
|
46
|
+
id: _globalStylesId,
|
|
47
|
+
} )
|
|
48
|
+
? getEditedEntityRecord(
|
|
49
|
+
'root',
|
|
50
|
+
'globalStyles',
|
|
51
|
+
_globalStylesId
|
|
52
|
+
)
|
|
53
|
+
: undefined;
|
|
47
54
|
|
|
48
55
|
let hasResolved = false;
|
|
49
56
|
if (
|
|
@@ -126,9 +133,13 @@ function useGlobalStylesUserConfig() {
|
|
|
126
133
|
|
|
127
134
|
function useGlobalStylesBaseConfig() {
|
|
128
135
|
const baseConfig = useSelect( ( select ) => {
|
|
129
|
-
|
|
130
|
-
coreStore
|
|
131
|
-
|
|
136
|
+
const { __experimentalGetCurrentThemeBaseGlobalStyles, canUser } =
|
|
137
|
+
select( coreStore );
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
canUser( 'read', { kind: 'root', name: 'theme' } ) &&
|
|
141
|
+
__experimentalGetCurrentThemeBaseGlobalStyles()
|
|
142
|
+
);
|
|
132
143
|
}, [] );
|
|
133
144
|
|
|
134
145
|
return [ !! baseConfig, baseConfig ];
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
// Keeping an old name for backward compatibility.
|
|
10
10
|
const slotName = '__experimentalMainDashboardButton';
|
|
11
11
|
|
|
12
|
+
export const useHasBackButton = () => {
|
|
13
|
+
const fills = useSlotFills( slotName );
|
|
14
|
+
return Boolean( fills && fills.length );
|
|
15
|
+
};
|
|
16
|
+
|
|
12
17
|
const { Fill, Slot } = createSlotFill( slotName );
|
|
13
18
|
|
|
14
19
|
const BackButton = Fill;
|
|
15
|
-
const BackButtonSlot = (
|
|
20
|
+
const BackButtonSlot = () => {
|
|
16
21
|
const fills = useSlotFills( slotName );
|
|
17
|
-
const hasFills = Boolean( fills && fills.length );
|
|
18
|
-
|
|
19
|
-
if ( ! hasFills ) {
|
|
20
|
-
return children;
|
|
21
|
-
}
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Slot
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
4
|
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
5
|
+
import { useMediaQuery, useViewportMatch } from '@wordpress/compose';
|
|
11
6
|
import { __unstableMotion as motion } from '@wordpress/components';
|
|
12
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
8
|
import { useState } from '@wordpress/element';
|
|
@@ -17,8 +12,8 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
17
12
|
/**
|
|
18
13
|
* Internal dependencies
|
|
19
14
|
*/
|
|
20
|
-
import BackButton from './back-button';
|
|
21
|
-
import
|
|
15
|
+
import BackButton, { useHasBackButton } from './back-button';
|
|
16
|
+
import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
|
|
22
17
|
import DocumentBar from '../document-bar';
|
|
23
18
|
import DocumentTools from '../document-tools';
|
|
24
19
|
import MoreMenu from '../more-menu';
|
|
@@ -55,13 +50,13 @@ function Header( {
|
|
|
55
50
|
} ) {
|
|
56
51
|
const isWideViewport = useViewportMatch( 'large' );
|
|
57
52
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
53
|
+
const isTooNarrowForDocumentBar = useMediaQuery( '(max-width: 403px)' );
|
|
58
54
|
const {
|
|
59
55
|
isTextEditor,
|
|
60
56
|
isPublishSidebarOpened,
|
|
61
57
|
showIconLabels,
|
|
62
58
|
hasFixedToolbar,
|
|
63
59
|
isNestedEntity,
|
|
64
|
-
isZoomedOutView,
|
|
65
60
|
} = useSelect( ( select ) => {
|
|
66
61
|
const { get: getPreference } = select( preferencesStore );
|
|
67
62
|
const {
|
|
@@ -82,21 +77,25 @@ function Header( {
|
|
|
82
77
|
};
|
|
83
78
|
}, [] );
|
|
84
79
|
|
|
85
|
-
const hasTopToolbar = isLargeViewport && hasFixedToolbar;
|
|
86
|
-
|
|
87
80
|
const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
|
|
88
81
|
useState( true );
|
|
89
82
|
|
|
83
|
+
const hasCenter = isBlockToolsCollapsed && ! isTooNarrowForDocumentBar;
|
|
84
|
+
const hasBackButton = useHasBackButton();
|
|
85
|
+
|
|
90
86
|
// The edit-post-header classname is only kept for backward compatibilty
|
|
91
87
|
// as some plugins might be relying on its presence.
|
|
92
88
|
return (
|
|
93
89
|
<div className="editor-header edit-post-header">
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
{ hasBackButton && (
|
|
91
|
+
<motion.div
|
|
92
|
+
className="editor-header__back-button"
|
|
93
|
+
variants={ backButtonVariations }
|
|
94
|
+
transition={ { type: 'tween' } }
|
|
95
|
+
>
|
|
96
|
+
<BackButton.Slot />
|
|
97
|
+
</motion.div>
|
|
98
|
+
) }
|
|
100
99
|
<motion.div
|
|
101
100
|
variants={ toolbarVariations }
|
|
102
101
|
className="editor-header__toolbar"
|
|
@@ -105,21 +104,22 @@ function Header( {
|
|
|
105
104
|
<DocumentTools
|
|
106
105
|
disableBlockTools={ forceDisableBlockTools || isTextEditor }
|
|
107
106
|
/>
|
|
108
|
-
{
|
|
109
|
-
<
|
|
107
|
+
{ hasFixedToolbar && isLargeViewport && (
|
|
108
|
+
<CollapsibleBlockToolbar
|
|
110
109
|
isCollapsed={ isBlockToolsCollapsed }
|
|
111
110
|
onToggle={ setIsBlockToolsCollapsed }
|
|
112
111
|
/>
|
|
113
112
|
) }
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
</motion.div>
|
|
114
|
+
{ hasCenter && (
|
|
115
|
+
<motion.div
|
|
116
|
+
className="editor-header__center"
|
|
117
|
+
variants={ toolbarVariations }
|
|
118
|
+
transition={ { type: 'tween' } }
|
|
119
119
|
>
|
|
120
120
|
<DocumentBar title={ title } icon={ icon } />
|
|
121
|
-
</div>
|
|
122
|
-
|
|
121
|
+
</motion.div>
|
|
122
|
+
) }
|
|
123
123
|
<motion.div
|
|
124
124
|
variants={ toolbarVariations }
|
|
125
125
|
transition={ { type: 'tween' } }
|
|
@@ -135,7 +135,7 @@ function Header( {
|
|
|
135
135
|
) }
|
|
136
136
|
<PreviewDropdown
|
|
137
137
|
forceIsAutosaveable={ forceIsDirty }
|
|
138
|
-
disabled={ isNestedEntity
|
|
138
|
+
disabled={ isNestedEntity }
|
|
139
139
|
/>
|
|
140
140
|
<PostPreviewButton
|
|
141
141
|
className="editor-header__post-preview-button"
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
.editor-header {
|
|
2
2
|
height: $header-height;
|
|
3
3
|
background: $white;
|
|
4
|
-
display:
|
|
5
|
-
|
|
4
|
+
display: grid;
|
|
5
|
+
grid-auto-flow: row;
|
|
6
|
+
grid-template: auto / $header-height minmax(0, max-content) minmax(min-content, 1fr) $header-height;
|
|
7
|
+
&:has(> .editor-header__center) {
|
|
8
|
+
grid-template: auto / $header-height min-content 1fr min-content $header-height;
|
|
9
|
+
@include break-medium {
|
|
10
|
+
grid-template: auto / $header-height minmax(min-content, 1fr) 2fr minmax(min-content, 1fr) $header-height;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
@include break-mobile {
|
|
14
|
+
gap: $grid-unit-20;
|
|
15
|
+
}
|
|
6
16
|
align-items: center;
|
|
7
17
|
// The header should never be wider than the viewport, or buttons might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket.
|
|
8
18
|
max-width: 100vw;
|
|
@@ -15,19 +25,32 @@
|
|
|
15
25
|
}
|
|
16
26
|
|
|
17
27
|
.editor-header__toolbar {
|
|
28
|
+
grid-column: 1 / 3;
|
|
29
|
+
// When there is no back button or the viewport is <= mobile the margin keeps the content off
|
|
30
|
+
// the starting edge.
|
|
31
|
+
> :first-child {
|
|
32
|
+
margin-inline: $grid-unit-20 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// This is the typical case, the back button takes up the first column.
|
|
36
|
+
.editor-header__back-button + & {
|
|
37
|
+
grid-column: 2 / 3;
|
|
38
|
+
|
|
39
|
+
@include break-mobile {
|
|
40
|
+
// Clears the margin; at this breakpoint the parent’s `gap` takes its place.
|
|
41
|
+
> :first-child {
|
|
42
|
+
margin-inline: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
18
46
|
display: flex;
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
// Take up the space of the toolbar so it can be justified to the left side of the toolbar.
|
|
22
|
-
flex-grow: 3;
|
|
23
|
-
// Hide the overflow so flex will limit its width. Block toolbar will allow scrolling on fixed toolbar.
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
// Leave enough room for the focus ring to show.
|
|
26
|
-
padding: 2px 0;
|
|
47
|
+
// Make narrowing to less than content width possible. Block toolbar will hide overflow and allow scrolling on fixed toolbar.
|
|
48
|
+
min-width: 0;
|
|
27
49
|
align-items: center;
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
50
|
+
// Clip the box while leaving room for focus rings.
|
|
51
|
+
clip-path: inset(-2px);
|
|
52
|
+
@include break-mobile {
|
|
53
|
+
clip-path: none;
|
|
31
54
|
}
|
|
32
55
|
|
|
33
56
|
.table-of-contents {
|
|
@@ -37,20 +60,35 @@
|
|
|
37
60
|
display: block;
|
|
38
61
|
}
|
|
39
62
|
}
|
|
63
|
+
|
|
64
|
+
// Add a gap before the block toolbar or its toggle button when collapsed.
|
|
65
|
+
.editor-collapsible-block-toolbar {
|
|
66
|
+
margin-inline: $grid-unit 0;
|
|
67
|
+
|
|
68
|
+
&.is-collapsed ~ .editor-collapsible-block-toolbar__toggle {
|
|
69
|
+
margin-inline: $grid-unit 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
40
72
|
}
|
|
41
73
|
|
|
42
74
|
.editor-header__center {
|
|
43
|
-
|
|
75
|
+
grid-column: 3 / 4;
|
|
44
76
|
display: flex;
|
|
45
77
|
justify-content: center;
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
// subsequently truncate child text, we set an explicit min-width.
|
|
49
|
-
// See https://dev.w3.org/csswg/css-flexbox/#min-size-auto
|
|
78
|
+
align-items: center;
|
|
79
|
+
// To enable shrinking and truncating of child text, apply an explicit min-width.
|
|
50
80
|
min-width: 0;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
81
|
+
// Clip the box while leaving room for focus rings.
|
|
82
|
+
clip-path: inset(-2px);
|
|
83
|
+
// At less than mobile the header’s `gap` is zero so margins are added to create a smaller
|
|
84
|
+
// gap around the center’s contents.
|
|
85
|
+
@media (max-width: #{$break-mobile - 1}) {
|
|
86
|
+
> :first-child {
|
|
87
|
+
margin-inline-start: $grid-unit;
|
|
88
|
+
}
|
|
89
|
+
> :last-child {
|
|
90
|
+
margin-inline-end: $grid-unit;
|
|
91
|
+
}
|
|
54
92
|
}
|
|
55
93
|
}
|
|
56
94
|
|
|
@@ -59,6 +97,11 @@
|
|
|
59
97
|
*/
|
|
60
98
|
|
|
61
99
|
.editor-header__settings {
|
|
100
|
+
grid-column: 3 / -1;
|
|
101
|
+
.editor-header:has(> .editor-header__center) & {
|
|
102
|
+
grid-column: 4 / -1;
|
|
103
|
+
}
|
|
104
|
+
justify-self: end;
|
|
62
105
|
display: inline-flex;
|
|
63
106
|
align-items: center;
|
|
64
107
|
flex-wrap: nowrap;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
|
-
Button,
|
|
7
|
-
Dropdown,
|
|
8
6
|
Flex,
|
|
9
7
|
FlexBlock,
|
|
10
8
|
__experimentalNumberControl as NumberControl,
|
|
11
9
|
} from '@wordpress/components';
|
|
12
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
-
import { useState
|
|
14
|
-
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
11
|
+
import { useState } from '@wordpress/element';
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
14
|
* Internal dependencies
|
|
18
15
|
*/
|
|
19
|
-
import PostPanelRow from '../post-panel-row';
|
|
20
16
|
import PostTypeSupportCheck from '../post-type-support-check';
|
|
21
17
|
import { store as editorStore } from '../../store';
|
|
22
18
|
|
|
@@ -61,6 +57,7 @@ function PageAttributesOrder() {
|
|
|
61
57
|
/**
|
|
62
58
|
* Renders the Page Attributes Order component. A number input in an editor interface
|
|
63
59
|
* for setting the order of a given page.
|
|
60
|
+
* The component is now not used in core but was kept for backward compatibility.
|
|
64
61
|
*
|
|
65
62
|
* @return {Component} The component to be rendered.
|
|
66
63
|
*/
|
|
@@ -71,74 +68,3 @@ export default function PageAttributesOrderWithChecks() {
|
|
|
71
68
|
</PostTypeSupportCheck>
|
|
72
69
|
);
|
|
73
70
|
}
|
|
74
|
-
|
|
75
|
-
function PostOrderToggle( { isOpen, onClick } ) {
|
|
76
|
-
const order = useSelect(
|
|
77
|
-
( select ) =>
|
|
78
|
-
select( editorStore ).getEditedPostAttribute( 'menu_order' ) ?? 0,
|
|
79
|
-
[]
|
|
80
|
-
);
|
|
81
|
-
return (
|
|
82
|
-
<Button
|
|
83
|
-
size="compact"
|
|
84
|
-
className="editor-post-order__panel-toggle"
|
|
85
|
-
variant="tertiary"
|
|
86
|
-
aria-expanded={ isOpen }
|
|
87
|
-
// translators: %s: Current post parent.
|
|
88
|
-
aria-label={ sprintf( __( 'Change order: %s' ), order ) }
|
|
89
|
-
onClick={ onClick }
|
|
90
|
-
>
|
|
91
|
-
{ order }
|
|
92
|
-
</Button>
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function OrderRow() {
|
|
97
|
-
// Use internal state instead of a ref to make sure that the component
|
|
98
|
-
// re-renders when the popover's anchor updates.
|
|
99
|
-
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
100
|
-
// Memoize popoverProps to avoid returning a new object every time.
|
|
101
|
-
const popoverProps = useMemo(
|
|
102
|
-
() => ( {
|
|
103
|
-
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
104
|
-
// move around when the label changes.
|
|
105
|
-
anchor: popoverAnchor,
|
|
106
|
-
placement: 'left-start',
|
|
107
|
-
offset: 36,
|
|
108
|
-
shift: true,
|
|
109
|
-
} ),
|
|
110
|
-
[ popoverAnchor ]
|
|
111
|
-
);
|
|
112
|
-
return (
|
|
113
|
-
<PostPanelRow label={ __( 'Order' ) } ref={ setPopoverAnchor }>
|
|
114
|
-
<Dropdown
|
|
115
|
-
popoverProps={ popoverProps }
|
|
116
|
-
className="editor-post-order__panel-dropdown"
|
|
117
|
-
contentClassName="editor-post-order__panel-dialog"
|
|
118
|
-
focusOnMount
|
|
119
|
-
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
120
|
-
<PostOrderToggle isOpen={ isOpen } onClick={ onToggle } />
|
|
121
|
-
) }
|
|
122
|
-
renderContent={ ( { onClose } ) => (
|
|
123
|
-
<div className="editor-post-order">
|
|
124
|
-
<InspectorPopoverHeader
|
|
125
|
-
title={ __( 'Order' ) }
|
|
126
|
-
onClose={ onClose }
|
|
127
|
-
/>
|
|
128
|
-
<div>
|
|
129
|
-
{ __(
|
|
130
|
-
'This attribute determines the order of pages in the Pages List block.'
|
|
131
|
-
) }
|
|
132
|
-
<p>
|
|
133
|
-
{ __(
|
|
134
|
-
'Pages with the same order value will sorted alphabetically. Negative order values are also supported.'
|
|
135
|
-
) }
|
|
136
|
-
</p>
|
|
137
|
-
</div>
|
|
138
|
-
<PageAttributesOrder />
|
|
139
|
-
</div>
|
|
140
|
-
) }
|
|
141
|
-
/>
|
|
142
|
-
</PostPanelRow>
|
|
143
|
-
);
|
|
144
|
-
}
|
|
@@ -8,7 +8,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
8
8
|
*/
|
|
9
9
|
import { store as editorStore } from '../../store';
|
|
10
10
|
import PageAttributesCheck from './check';
|
|
11
|
-
import { OrderRow } from './order';
|
|
12
11
|
import { ParentRow } from './parent';
|
|
13
12
|
|
|
14
13
|
const PANEL_NAME = 'page-attributes';
|
|
@@ -28,12 +27,7 @@ function AttributesPanel() {
|
|
|
28
27
|
return null;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
return
|
|
32
|
-
<>
|
|
33
|
-
<ParentRow />
|
|
34
|
-
<OrderRow />
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
30
|
+
return <ParentRow />;
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
/**
|
|
@@ -14,11 +14,16 @@ import {
|
|
|
14
14
|
ExternalLink,
|
|
15
15
|
} from '@wordpress/components';
|
|
16
16
|
import { debounce } from '@wordpress/compose';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
createInterpolateElement,
|
|
19
|
+
useState,
|
|
20
|
+
useMemo,
|
|
21
|
+
} from '@wordpress/element';
|
|
18
22
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
19
23
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
20
24
|
import { store as coreStore } from '@wordpress/core-data';
|
|
21
25
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
26
|
+
import { filterURLForDisplay } from '@wordpress/url';
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
29
|
* Internal dependencies
|
|
@@ -217,6 +222,10 @@ function PostParentToggle( { isOpen, onClick } ) {
|
|
|
217
222
|
}
|
|
218
223
|
|
|
219
224
|
export function ParentRow() {
|
|
225
|
+
const homeUrl = useSelect(
|
|
226
|
+
( select ) => select( coreStore ).getUnstableBase()?.home,
|
|
227
|
+
[]
|
|
228
|
+
);
|
|
220
229
|
// Use internal state instead of a ref to make sure that the component
|
|
221
230
|
// re-renders when the popover's anchor updates.
|
|
222
231
|
const [ popoverAnchor, setPopoverAnchor ] = useState( null );
|
|
@@ -249,12 +258,21 @@ export function ParentRow() {
|
|
|
249
258
|
onClose={ onClose }
|
|
250
259
|
/>
|
|
251
260
|
<div>
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
261
|
+
{ createInterpolateElement(
|
|
262
|
+
sprintf(
|
|
263
|
+
/* translators: %1$s The home URL of the WordPress installation without the scheme. */
|
|
264
|
+
__(
|
|
265
|
+
'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'
|
|
266
|
+
),
|
|
267
|
+
filterURLForDisplay( homeUrl ).replace(
|
|
268
|
+
/([/.])/g,
|
|
269
|
+
'<wbr />$1'
|
|
270
|
+
)
|
|
271
|
+
),
|
|
272
|
+
{
|
|
273
|
+
wbr: <wbr />,
|
|
274
|
+
}
|
|
275
|
+
) }
|
|
258
276
|
<p>
|
|
259
277
|
{ __(
|
|
260
278
|
'They also show up as sub-items in the default navigation menu. '
|