@wordpress/editor 14.10.0 → 14.12.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 -10
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +119 -0
- package/build/components/collab-sidebar/add-comment.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build/components/collab-sidebar/comment-button.js +37 -0
- package/build/components/collab-sidebar/comment-button.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +321 -0
- package/build/components/collab-sidebar/comments.js.map +1 -0
- package/build/components/collab-sidebar/constants.js +8 -0
- package/build/components/collab-sidebar/constants.js.map +1 -0
- package/build/components/collab-sidebar/index.js +274 -0
- package/build/components/collab-sidebar/index.js.map +1 -0
- package/build/components/collab-sidebar/utils.js +16 -0
- package/build/components/collab-sidebar/utils.js.map +1 -0
- package/build/components/commands/index.js +148 -40
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/document-bar/index.js +17 -10
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-tools/index.js +7 -7
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -4
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +25 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +12 -11
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/more-menu/index.js +9 -7
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +13 -11
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +15 -13
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +0 -15
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/index.js +5 -5
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/panel.js +4 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -36
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-content-information/index.js +1 -2
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +26 -7
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +11 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +0 -3
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/index.js +0 -3
- package/build/components/post-transform-panel/index.js.map +1 -1
- package/build/components/post-url/index.js +1 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +3 -3
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +26 -22
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +23 -8
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -12
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +11 -10
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/header.js +2 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +3 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +2 -2
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/start-page-options/index.js +0 -3
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +0 -3
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/index.js +30 -29
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build/components/zoom-out-toggle/index.js +37 -5
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +2 -2
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/store/actions.js +68 -18
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +0 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +0 -4
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +2 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +5 -4
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pageTypeBadge.js +51 -0
- package/build/utils/pageTypeBadge.js.map +1 -0
- package/build/utils/terms.js +2 -2
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +113 -0
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button.js +30 -0
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +314 -0
- package/build-module/components/collab-sidebar/comments.js.map +1 -0
- package/build-module/components/collab-sidebar/constants.js +2 -0
- package/build-module/components/collab-sidebar/constants.js.map +1 -0
- package/build-module/components/collab-sidebar/index.js +266 -0
- package/build-module/components/collab-sidebar/index.js.map +1 -0
- package/build-module/components/collab-sidebar/utils.js +10 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -0
- package/build-module/components/commands/index.js +151 -44
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +19 -12
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +8 -8
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +4 -4
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +25 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +12 -11
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +9 -7
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +12 -10
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +14 -12
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +0 -15
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +5 -5
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +4 -4
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +8 -36
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +1 -2
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +26 -7
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +14 -4
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +0 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/index.js +0 -3
- package/build-module/components/post-transform-panel/index.js.map +1 -1
- package/build-module/components/post-url/index.js +1 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +3 -3
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +26 -22
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +24 -9
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +10 -12
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +12 -11
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/header.js +2 -1
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +2 -2
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/start-page-options/index.js +0 -3
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +0 -3
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +31 -30
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build-module/components/zoom-out-toggle/index.js +37 -5
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +3 -3
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/store/actions.js +64 -16
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +0 -4
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +3 -3
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +5 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +45 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -0
- package/build-module/utils/terms.js +2 -2
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +118 -60
- package/build-style/style.css +118 -60
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +19 -0
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/constants.d.ts +2 -0
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/index.d.ts +5 -0
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +8 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts +1 -2
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/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-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +2 -2
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
- package/build-types/components/post-transform-panel/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/dataviews/store/reducer.d.ts +5 -2
- package/build-types/dataviews/store/reducer.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts +2 -2
- package/build-types/store/actions.d.ts +9 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +0 -2
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/index.d.ts +9 -11
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +24 -4
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +3 -3
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +5 -0
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts.map +1 -1
- package/package.json +39 -37
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +121 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
- package/src/components/collab-sidebar/comment-button.js +31 -0
- package/src/components/collab-sidebar/comments.js +404 -0
- package/src/components/collab-sidebar/constants.js +1 -0
- package/src/components/collab-sidebar/index.js +298 -0
- package/src/components/collab-sidebar/style.scss +111 -0
- package/src/components/collab-sidebar/utils.js +9 -0
- package/src/components/commands/index.js +390 -268
- package/src/components/create-template-part-modal/index.js +1 -0
- package/src/components/document-bar/index.js +25 -8
- package/src/components/document-bar/style.scss +13 -4
- package/src/components/document-tools/index.js +8 -8
- package/src/components/editor-interface/index.js +4 -4
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/src/components/global-styles-provider/index.js +32 -6
- package/src/components/header/index.js +20 -10
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/more-menu/index.js +12 -7
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
- package/src/components/plugin-preview-menu-item/index.js +14 -13
- package/src/components/plugin-sidebar/index.js +0 -13
- package/src/components/post-actions/index.js +8 -11
- package/src/components/post-author/panel.js +4 -2
- package/src/components/post-card-panel/index.js +9 -43
- package/src/components/post-card-panel/style.scss +1 -9
- package/src/components/post-content-information/index.js +1 -1
- package/src/components/post-featured-image/index.js +31 -16
- package/src/components/post-featured-image/style.scss +5 -2
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-sticky/test/index.js +6 -6
- package/src/components/post-taxonomies/flat-term-selector.js +15 -4
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-template/swap-template-button.js +0 -3
- package/src/components/post-transform-panel/index.js +0 -3
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-url/panel.js +4 -2
- package/src/components/preferences-modal/index.js +26 -19
- package/src/components/preferences-modal/test/index.js +1 -1
- package/src/components/preview-dropdown/index.js +45 -18
- package/src/components/provider/index.js +31 -24
- package/src/components/provider/use-block-editor-settings.js +11 -10
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/sidebar/post-summary.js +1 -1
- package/src/components/sidebar/style.scss +1 -3
- package/src/components/start-page-options/index.js +0 -3
- package/src/components/start-template-options/index.js +0 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/index.js +39 -42
- package/src/components/visual-editor/style.scss +11 -0
- package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
- package/src/components/zoom-out-toggle/index.js +39 -5
- package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
- package/src/store/actions.js +113 -34
- package/src/store/constants.ts +0 -2
- package/src/store/index.js +0 -4
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +5 -4
- package/src/style.scss +1 -0
- package/src/utils/pageTypeBadge.js +41 -0
- package/src/utils/terms.js +4 -2
- package/src/utils/test/terms.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -158,6 +158,7 @@ export function CreateTemplatePartModalContents( {
|
|
|
158
158
|
{ templatePartAreas.map(
|
|
159
159
|
( { icon, label, area: value, description } ) => (
|
|
160
160
|
<Radio
|
|
161
|
+
__next40pxDefaultSize
|
|
161
162
|
key={ label }
|
|
162
163
|
value={ value }
|
|
163
164
|
className="editor-create-template-part-modal__area-radio"
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
__unstableAnimatePresence as AnimatePresence,
|
|
16
16
|
} from '@wordpress/components';
|
|
17
17
|
import { BlockIcon } from '@wordpress/block-editor';
|
|
18
|
-
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
18
|
+
import { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';
|
|
19
19
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
20
20
|
import { store as coreStore } from '@wordpress/core-data';
|
|
21
21
|
import { store as commandsStore } from '@wordpress/commands';
|
|
@@ -26,8 +26,9 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
import { TEMPLATE_POST_TYPES
|
|
29
|
+
import { TEMPLATE_POST_TYPES } from '../../store/constants';
|
|
30
30
|
import { store as editorStore } from '../../store';
|
|
31
|
+
import usePageTypeBadge from '../../utils/pageTypeBadge';
|
|
31
32
|
|
|
32
33
|
/** @typedef {import("@wordpress/components").IconType} IconType */
|
|
33
34
|
|
|
@@ -56,15 +57,16 @@ export default function DocumentBar( props ) {
|
|
|
56
57
|
postTypeLabel,
|
|
57
58
|
documentTitle,
|
|
58
59
|
isNotFound,
|
|
59
|
-
isUnsyncedPattern,
|
|
60
60
|
templateTitle,
|
|
61
61
|
onNavigateToPreviousEntityRecord,
|
|
62
|
+
isTemplatePreview,
|
|
62
63
|
} = useSelect( ( select ) => {
|
|
63
64
|
const {
|
|
64
65
|
getCurrentPostType,
|
|
65
66
|
getCurrentPostId,
|
|
66
67
|
getEditorSettings,
|
|
67
68
|
__experimentalGetTemplateInfo: getTemplateInfo,
|
|
69
|
+
getRenderingMode,
|
|
68
70
|
} = select( editorStore );
|
|
69
71
|
const {
|
|
70
72
|
getEditedEntityRecord,
|
|
@@ -93,10 +95,10 @@ export default function DocumentBar( props ) {
|
|
|
93
95
|
_postType,
|
|
94
96
|
_postId
|
|
95
97
|
),
|
|
96
|
-
isUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',
|
|
97
98
|
templateTitle: _templateInfo.title,
|
|
98
99
|
onNavigateToPreviousEntityRecord:
|
|
99
100
|
getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
101
|
+
isTemplatePreview: getRenderingMode() === 'template-locked',
|
|
100
102
|
};
|
|
101
103
|
}, [] );
|
|
102
104
|
|
|
@@ -104,12 +106,13 @@ export default function DocumentBar( props ) {
|
|
|
104
106
|
const isReducedMotion = useReducedMotion();
|
|
105
107
|
|
|
106
108
|
const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
|
|
107
|
-
const isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );
|
|
108
109
|
const hasBackButton = !! onNavigateToPreviousEntityRecord;
|
|
109
110
|
const entityTitle = isTemplate ? templateTitle : documentTitle;
|
|
110
111
|
const title = props.title || entityTitle;
|
|
111
112
|
const icon = props.icon;
|
|
112
113
|
|
|
114
|
+
const pageTypeBadge = usePageTypeBadge();
|
|
115
|
+
|
|
113
116
|
const mountedRef = useRef( false );
|
|
114
117
|
useEffect( () => {
|
|
115
118
|
mountedRef.current = true;
|
|
@@ -119,7 +122,6 @@ export default function DocumentBar( props ) {
|
|
|
119
122
|
<div
|
|
120
123
|
className={ clsx( 'editor-document-bar', {
|
|
121
124
|
'has-back-button': hasBackButton,
|
|
122
|
-
'is-global': isGlobalEntity && ! isUnsyncedPattern,
|
|
123
125
|
} ) }
|
|
124
126
|
>
|
|
125
127
|
<AnimatePresence>
|
|
@@ -147,6 +149,12 @@ export default function DocumentBar( props ) {
|
|
|
147
149
|
</MotionButton>
|
|
148
150
|
) }
|
|
149
151
|
</AnimatePresence>
|
|
152
|
+
{ ! isTemplate && isTemplatePreview && (
|
|
153
|
+
<BlockIcon
|
|
154
|
+
icon={ layout }
|
|
155
|
+
className="editor-document-bar__icon-layout"
|
|
156
|
+
/>
|
|
157
|
+
) }
|
|
150
158
|
{ isNotFound ? (
|
|
151
159
|
<Text>{ __( 'Document not found' ) }</Text>
|
|
152
160
|
) : (
|
|
@@ -184,11 +192,20 @@ export default function DocumentBar( props ) {
|
|
|
184
192
|
? decodeEntities( title )
|
|
185
193
|
: __( 'No title' ) }
|
|
186
194
|
</span>
|
|
187
|
-
{
|
|
195
|
+
{ pageTypeBadge && (
|
|
188
196
|
<span className="editor-document-bar__post-type-label">
|
|
189
|
-
{
|
|
197
|
+
{ `· ${ pageTypeBadge }` }
|
|
190
198
|
</span>
|
|
191
199
|
) }
|
|
200
|
+
{ postTypeLabel &&
|
|
201
|
+
! props.title &&
|
|
202
|
+
! pageTypeBadge && (
|
|
203
|
+
<span className="editor-document-bar__post-type-label">
|
|
204
|
+
{ `· ${ decodeEntities(
|
|
205
|
+
postTypeLabel
|
|
206
|
+
) }` }
|
|
207
|
+
</span>
|
|
208
|
+
) }
|
|
192
209
|
</Text>
|
|
193
210
|
</motion.div>
|
|
194
211
|
<span className="editor-document-bar__shortcut">
|
|
@@ -67,10 +67,6 @@
|
|
|
67
67
|
flex: 1;
|
|
68
68
|
overflow: hidden;
|
|
69
69
|
text-overflow: ellipsis;
|
|
70
|
-
|
|
71
|
-
.editor-document-bar.is-global & {
|
|
72
|
-
color: var(--wp-block-synced-color);
|
|
73
|
-
}
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
.editor-document-bar__post-type-label {
|
|
@@ -106,3 +102,16 @@
|
|
|
106
102
|
background-color: transparent;
|
|
107
103
|
}
|
|
108
104
|
}
|
|
105
|
+
|
|
106
|
+
.editor-document-bar__icon-layout.editor-document-bar__icon-layout {
|
|
107
|
+
position: absolute;
|
|
108
|
+
margin-left: $grid-unit-15;
|
|
109
|
+
display: none;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
svg {
|
|
112
|
+
fill: $gray-600;
|
|
113
|
+
}
|
|
114
|
+
@include break-small {
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -9,11 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { useViewportMatch } from '@wordpress/compose';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
11
|
import { __, _x } from '@wordpress/i18n';
|
|
12
|
-
import {
|
|
13
|
-
NavigableToolbar,
|
|
14
|
-
ToolSelector,
|
|
15
|
-
store as blockEditorStore,
|
|
16
|
-
} from '@wordpress/block-editor';
|
|
12
|
+
import { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';
|
|
17
13
|
import { Button, ToolbarItem } from '@wordpress/components';
|
|
18
14
|
import { listView, plus } from '@wordpress/icons';
|
|
19
15
|
import { useCallback } from '@wordpress/element';
|
|
@@ -39,6 +35,7 @@ function DocumentTools( { className, disableBlockTools = false } ) {
|
|
|
39
35
|
inserterSidebarToggleRef,
|
|
40
36
|
listViewToggleRef,
|
|
41
37
|
showIconLabels,
|
|
38
|
+
showTools,
|
|
42
39
|
} = useSelect( ( select ) => {
|
|
43
40
|
const { get } = select( preferencesStore );
|
|
44
41
|
const {
|
|
@@ -46,9 +43,10 @@ function DocumentTools( { className, disableBlockTools = false } ) {
|
|
|
46
43
|
getEditorMode,
|
|
47
44
|
getInserterSidebarToggleRef,
|
|
48
45
|
getListViewToggleRef,
|
|
46
|
+
getRenderingMode,
|
|
47
|
+
getCurrentPostType,
|
|
49
48
|
} = unlock( select( editorStore ) );
|
|
50
49
|
const { getShortcutRepresentation } = select( keyboardShortcutsStore );
|
|
51
|
-
const { __unstableGetEditorMode } = select( blockEditorStore );
|
|
52
50
|
|
|
53
51
|
return {
|
|
54
52
|
isInserterOpened: select( editorStore ).isInserterOpened(),
|
|
@@ -61,7 +59,9 @@ function DocumentTools( { className, disableBlockTools = false } ) {
|
|
|
61
59
|
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
62
60
|
isDistractionFree: get( 'core', 'distractionFree' ),
|
|
63
61
|
isVisualMode: getEditorMode() === 'visual',
|
|
64
|
-
|
|
62
|
+
showTools:
|
|
63
|
+
getRenderingMode() !== 'post-only' ||
|
|
64
|
+
getCurrentPostType() === 'wp_template',
|
|
65
65
|
};
|
|
66
66
|
}, [] );
|
|
67
67
|
|
|
@@ -134,7 +134,7 @@ function DocumentTools( { className, disableBlockTools = false } ) {
|
|
|
134
134
|
) }
|
|
135
135
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
136
136
|
<>
|
|
137
|
-
{ isLargeViewport && (
|
|
137
|
+
{ showTools && isLargeViewport && (
|
|
138
138
|
<ToolbarItem
|
|
139
139
|
as={ ToolSelector }
|
|
140
140
|
showTooltip={ ! showIconLabels }
|
|
@@ -83,10 +83,11 @@ export default function EditorInterface( {
|
|
|
83
83
|
isInserterOpened: select( editorStore ).isInserterOpened(),
|
|
84
84
|
isListViewOpened: select( editorStore ).isListViewOpened(),
|
|
85
85
|
isDistractionFree: get( 'core', 'distractionFree' ),
|
|
86
|
-
isPreviewMode: editorSettings.
|
|
86
|
+
isPreviewMode: editorSettings.isPreviewMode,
|
|
87
87
|
showBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
documentLabel:
|
|
89
|
+
// translators: Default label for the Document in the Block Breadcrumb.
|
|
90
|
+
postTypeLabel || _x( 'Document', 'noun, breadcrumb' ),
|
|
90
91
|
isZoomOut: _isZoomOut(),
|
|
91
92
|
};
|
|
92
93
|
}, [] );
|
|
@@ -130,7 +131,6 @@ export default function EditorInterface( {
|
|
|
130
131
|
customSaveButton={ customSaveButton }
|
|
131
132
|
forceDisableBlockTools={ forceDisableBlockTools }
|
|
132
133
|
title={ title }
|
|
133
|
-
isEditorIframed={ ! disableIframe }
|
|
134
134
|
/>
|
|
135
135
|
)
|
|
136
136
|
}
|
|
@@ -177,9 +177,9 @@ export function EntitiesSavedStatesExtensible( {
|
|
|
177
177
|
_n(
|
|
178
178
|
'There is <strong>%d site change</strong> waiting to be saved.',
|
|
179
179
|
'There are <strong>%d site changes</strong> waiting to be saved.',
|
|
180
|
-
|
|
180
|
+
dirtyEntityRecords.length
|
|
181
181
|
),
|
|
182
|
-
|
|
182
|
+
dirtyEntityRecords.length
|
|
183
183
|
),
|
|
184
184
|
{ strong: <strong /> }
|
|
185
185
|
)
|
|
@@ -72,7 +72,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
72
72
|
registerShortcut( {
|
|
73
73
|
name: 'core/editor/toggle-list-view',
|
|
74
74
|
category: 'global',
|
|
75
|
-
description: __( '
|
|
75
|
+
description: __( 'Show or hide the List View.' ),
|
|
76
76
|
keyCombination: {
|
|
77
77
|
modifier: 'access',
|
|
78
78
|
character: 'o',
|
|
@@ -82,7 +82,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
82
82
|
registerShortcut( {
|
|
83
83
|
name: 'core/editor/toggle-distraction-free',
|
|
84
84
|
category: 'global',
|
|
85
|
-
description: __( '
|
|
85
|
+
description: __( 'Enter or exit distraction free mode.' ),
|
|
86
86
|
keyCombination: {
|
|
87
87
|
modifier: 'primaryShift',
|
|
88
88
|
character: '\\',
|
|
@@ -92,7 +92,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
92
92
|
registerShortcut( {
|
|
93
93
|
name: 'core/editor/toggle-sidebar',
|
|
94
94
|
category: 'global',
|
|
95
|
-
description: __( 'Show or hide the Settings
|
|
95
|
+
description: __( 'Show or hide the Settings panel.' ),
|
|
96
96
|
keyCombination: {
|
|
97
97
|
modifier: 'primaryShift',
|
|
98
98
|
character: ',',
|
|
@@ -56,13 +56,39 @@ function useGlobalStylesUserConfig() {
|
|
|
56
56
|
select( coreStore ).__experimentalGetCurrentGlobalStylesId();
|
|
57
57
|
|
|
58
58
|
let record;
|
|
59
|
-
const userCanEditGlobalStyles = canUser( 'update', {
|
|
60
|
-
kind: 'root',
|
|
61
|
-
name: 'globalStyles',
|
|
62
|
-
id: _globalStylesId,
|
|
63
|
-
} );
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
/*
|
|
61
|
+
* Ensure that the global styles ID request is complete by testing `_globalStylesId`,
|
|
62
|
+
* before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will
|
|
63
|
+
* fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`.
|
|
64
|
+
* NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
|
|
65
|
+
* or set using the `block_editor_rest_api_preload_paths` filter, if this changes.
|
|
66
|
+
*/
|
|
67
|
+
const userCanEditGlobalStyles = _globalStylesId
|
|
68
|
+
? canUser( 'update', {
|
|
69
|
+
kind: 'root',
|
|
70
|
+
name: 'globalStyles',
|
|
71
|
+
id: _globalStylesId,
|
|
72
|
+
} )
|
|
73
|
+
: null;
|
|
74
|
+
|
|
75
|
+
if (
|
|
76
|
+
_globalStylesId &&
|
|
77
|
+
/*
|
|
78
|
+
* Test that the OPTIONS request for user capabilities is complete
|
|
79
|
+
* before fetching the global styles entity record.
|
|
80
|
+
* This is to avoid fetching the global styles entity unnecessarily.
|
|
81
|
+
*/
|
|
82
|
+
typeof userCanEditGlobalStyles === 'boolean'
|
|
83
|
+
) {
|
|
84
|
+
/*
|
|
85
|
+
* Fetch the global styles entity record based on the user's capabilities.
|
|
86
|
+
* The default context is `edit` for users who can edit global styles.
|
|
87
|
+
* Otherwise, the context is `view`.
|
|
88
|
+
* NOTE: There is an equivalent conditional check using `current_user_can()` in the backend
|
|
89
|
+
* to preload the global styles entity. Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,
|
|
90
|
+
* or set using `block_editor_rest_api_preload_paths` filter, if this changes.
|
|
91
|
+
*/
|
|
66
92
|
if ( userCanEditGlobalStyles ) {
|
|
67
93
|
record = getEditedEntityRecord(
|
|
68
94
|
'root',
|
|
@@ -12,6 +12,7 @@ import { PinnedItems } from '@wordpress/interface';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
+
import CollabSidebar from '../collab-sidebar';
|
|
15
16
|
import BackButton, { useHasBackButton } from './back-button';
|
|
16
17
|
import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
|
|
17
18
|
import DocumentBar from '../document-bar';
|
|
@@ -24,6 +25,11 @@ import PostViewLink from '../post-view-link';
|
|
|
24
25
|
import PreviewDropdown from '../preview-dropdown';
|
|
25
26
|
import ZoomOutToggle from '../zoom-out-toggle';
|
|
26
27
|
import { store as editorStore } from '../../store';
|
|
28
|
+
import {
|
|
29
|
+
TEMPLATE_PART_POST_TYPE,
|
|
30
|
+
PATTERN_POST_TYPE,
|
|
31
|
+
NAVIGATION_POST_TYPE,
|
|
32
|
+
} from '../../store/constants';
|
|
27
33
|
|
|
28
34
|
const toolbarVariations = {
|
|
29
35
|
distractionFreeDisabled: { y: '-50px' },
|
|
@@ -47,7 +53,6 @@ function Header( {
|
|
|
47
53
|
forceDisableBlockTools,
|
|
48
54
|
setEntitiesSavedStatesCallback,
|
|
49
55
|
title,
|
|
50
|
-
isEditorIframed,
|
|
51
56
|
} ) {
|
|
52
57
|
const isWideViewport = useViewportMatch( 'large' );
|
|
53
58
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
@@ -59,12 +64,10 @@ function Header( {
|
|
|
59
64
|
showIconLabels,
|
|
60
65
|
hasFixedToolbar,
|
|
61
66
|
hasBlockSelection,
|
|
62
|
-
isNestedEntity,
|
|
63
67
|
} = useSelect( ( select ) => {
|
|
64
68
|
const { get: getPreference } = select( preferencesStore );
|
|
65
69
|
const {
|
|
66
70
|
getEditorMode,
|
|
67
|
-
getEditorSettings,
|
|
68
71
|
getCurrentPostType,
|
|
69
72
|
isPublishSidebarOpened: _isPublishSidebarOpened,
|
|
70
73
|
} = select( editorStore );
|
|
@@ -77,8 +80,6 @@ function Header( {
|
|
|
77
80
|
hasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
|
|
78
81
|
hasBlockSelection:
|
|
79
82
|
!! select( blockEditorStore ).getBlockSelectionStart(),
|
|
80
|
-
isNestedEntity:
|
|
81
|
-
!! getEditorSettings().onNavigateToPreviousEntityRecord,
|
|
82
83
|
};
|
|
83
84
|
}, [] );
|
|
84
85
|
|
|
@@ -86,6 +87,12 @@ function Header( {
|
|
|
86
87
|
postType
|
|
87
88
|
);
|
|
88
89
|
|
|
90
|
+
const disablePreviewOption = [
|
|
91
|
+
NAVIGATION_POST_TYPE,
|
|
92
|
+
TEMPLATE_PART_POST_TYPE,
|
|
93
|
+
PATTERN_POST_TYPE,
|
|
94
|
+
].includes( postType );
|
|
95
|
+
|
|
89
96
|
const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
|
|
90
97
|
useState( true );
|
|
91
98
|
|
|
@@ -148,19 +155,21 @@ function Header( {
|
|
|
148
155
|
<PostSavedState forceIsDirty={ forceIsDirty } />
|
|
149
156
|
) }
|
|
150
157
|
|
|
151
|
-
|
|
152
|
-
<ZoomOutToggle />
|
|
153
|
-
) }
|
|
158
|
+
<PostViewLink />
|
|
154
159
|
|
|
155
160
|
<PreviewDropdown
|
|
156
161
|
forceIsAutosaveable={ forceIsDirty }
|
|
157
|
-
disabled={
|
|
162
|
+
disabled={ disablePreviewOption }
|
|
158
163
|
/>
|
|
164
|
+
|
|
159
165
|
<PostPreviewButton
|
|
160
166
|
className="editor-header__post-preview-button"
|
|
161
167
|
forceIsAutosaveable={ forceIsDirty }
|
|
162
168
|
/>
|
|
163
|
-
|
|
169
|
+
|
|
170
|
+
{ canBeZoomedOut && isWideViewport && (
|
|
171
|
+
<ZoomOutToggle disabled={ forceDisableBlockTools } />
|
|
172
|
+
) }
|
|
164
173
|
|
|
165
174
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
166
175
|
<PinnedItems.Slot scope="core" />
|
|
@@ -174,6 +183,7 @@ function Header( {
|
|
|
174
183
|
}
|
|
175
184
|
/>
|
|
176
185
|
) }
|
|
186
|
+
<CollabSidebar />
|
|
177
187
|
|
|
178
188
|
{ customSaveButton }
|
|
179
189
|
<MoreMenu />
|
|
@@ -33,15 +33,12 @@ export default function InserterSidebar() {
|
|
|
33
33
|
getInserter,
|
|
34
34
|
isPublishSidebarOpened,
|
|
35
35
|
} = unlock( select( editorStore ) );
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
__unstableGetEditorMode,
|
|
39
|
-
getSectionRootClientId,
|
|
40
|
-
} = unlock( select( blockEditorStore ) );
|
|
36
|
+
const { getBlockRootClientId, isZoomOut, getSectionRootClientId } =
|
|
37
|
+
unlock( select( blockEditorStore ) );
|
|
41
38
|
const { get } = select( preferencesStore );
|
|
42
39
|
const { getActiveComplementaryArea } = select( interfaceStore );
|
|
43
40
|
const getBlockSectionRootClientId = () => {
|
|
44
|
-
if (
|
|
41
|
+
if ( isZoomOut() ) {
|
|
45
42
|
const sectionRootClientId = getSectionRootClientId();
|
|
46
43
|
|
|
47
44
|
if ( sectionRootClientId ) {
|
|
@@ -35,6 +35,7 @@ export default function MoreMenu() {
|
|
|
35
35
|
select( preferencesStore ).get( 'core', 'showIconLabels' ),
|
|
36
36
|
[]
|
|
37
37
|
);
|
|
38
|
+
|
|
38
39
|
const turnOffDistractionFree = () => {
|
|
39
40
|
setPreference( 'core', 'distractionFree', false );
|
|
40
41
|
};
|
|
@@ -67,10 +68,10 @@ export default function MoreMenu() {
|
|
|
67
68
|
'Access all block and document tools in a single place'
|
|
68
69
|
) }
|
|
69
70
|
messageActivated={ __(
|
|
70
|
-
'Top toolbar activated'
|
|
71
|
+
'Top toolbar activated.'
|
|
71
72
|
) }
|
|
72
73
|
messageDeactivated={ __(
|
|
73
|
-
'Top toolbar deactivated'
|
|
74
|
+
'Top toolbar deactivated.'
|
|
74
75
|
) }
|
|
75
76
|
/>
|
|
76
77
|
<PreferenceToggleMenuItem
|
|
@@ -79,12 +80,16 @@ export default function MoreMenu() {
|
|
|
79
80
|
label={ __( 'Distraction free' ) }
|
|
80
81
|
info={ __( 'Write with calmness' ) }
|
|
81
82
|
handleToggling={ false }
|
|
82
|
-
onToggle={
|
|
83
|
+
onToggle={ () =>
|
|
84
|
+
toggleDistractionFree( {
|
|
85
|
+
createNotice: false,
|
|
86
|
+
} )
|
|
87
|
+
}
|
|
83
88
|
messageActivated={ __(
|
|
84
|
-
'Distraction free mode activated'
|
|
89
|
+
'Distraction free mode activated.'
|
|
85
90
|
) }
|
|
86
91
|
messageDeactivated={ __(
|
|
87
|
-
'Distraction free mode deactivated'
|
|
92
|
+
'Distraction free mode deactivated.'
|
|
88
93
|
) }
|
|
89
94
|
shortcut={ displayShortcut.primaryShift(
|
|
90
95
|
'\\'
|
|
@@ -96,10 +101,10 @@ export default function MoreMenu() {
|
|
|
96
101
|
label={ __( 'Spotlight mode' ) }
|
|
97
102
|
info={ __( 'Focus on one block at a time' ) }
|
|
98
103
|
messageActivated={ __(
|
|
99
|
-
'Spotlight mode activated'
|
|
104
|
+
'Spotlight mode activated.'
|
|
100
105
|
) }
|
|
101
106
|
messageDeactivated={ __(
|
|
102
|
-
'Spotlight mode deactivated'
|
|
107
|
+
'Spotlight mode deactivated.'
|
|
103
108
|
) }
|
|
104
109
|
/>
|
|
105
110
|
<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />
|
|
@@ -212,8 +212,10 @@ function PostParentToggle( { isOpen, onClick } ) {
|
|
|
212
212
|
className="editor-post-parent__panel-toggle"
|
|
213
213
|
variant="tertiary"
|
|
214
214
|
aria-expanded={ isOpen }
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
aria-label={
|
|
216
|
+
// translators: %s: Current post parent.
|
|
217
|
+
sprintf( __( 'Change parent: %s' ), parentTitle )
|
|
218
|
+
}
|
|
217
219
|
onClick={ onClick }
|
|
218
220
|
>
|
|
219
221
|
{ parentTitle }
|
|
@@ -261,9 +263,9 @@ export function ParentRow() {
|
|
|
261
263
|
<div>
|
|
262
264
|
{ createInterpolateElement(
|
|
263
265
|
sprintf(
|
|
264
|
-
/* translators: %
|
|
266
|
+
/* translators: %s: The home URL of the WordPress installation without the scheme. */
|
|
265
267
|
__(
|
|
266
|
-
'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %
|
|
268
|
+
'Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'
|
|
267
269
|
),
|
|
268
270
|
filterURLForDisplay( homeUrl ).replace(
|
|
269
271
|
/([/.])/g,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { compose } from '@wordpress/compose';
|
|
5
4
|
import { MenuItem } from '@wordpress/components';
|
|
6
|
-
import {
|
|
5
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
6
|
import { ActionItem } from '@wordpress/interface';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -62,12 +61,14 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
62
61
|
*
|
|
63
62
|
* @return {Component} The component to be rendered.
|
|
64
63
|
*/
|
|
65
|
-
export default
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
export default function PluginMoreMenuItem( props ) {
|
|
65
|
+
const context = usePluginContext();
|
|
66
|
+
return (
|
|
67
|
+
<ActionItem
|
|
68
|
+
name="core/plugin-more-menu"
|
|
69
|
+
as={ props.as ?? MenuItem }
|
|
70
|
+
icon={ props.icon || context.icon }
|
|
71
|
+
{ ...props }
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -10,7 +10,7 @@ exports[`PluginPostPublishPanel renders fill properly 1`] = `
|
|
|
10
10
|
>
|
|
11
11
|
<button
|
|
12
12
|
aria-expanded="true"
|
|
13
|
-
class="components-button components-panel__body-toggle"
|
|
13
|
+
class="components-button components-panel__body-toggle is-next-40px-default-size"
|
|
14
14
|
type="button"
|
|
15
15
|
>
|
|
16
16
|
<span
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { compose } from '@wordpress/compose';
|
|
5
4
|
import { MenuItem } from '@wordpress/components';
|
|
6
|
-
import {
|
|
5
|
+
import { usePluginContext } from '@wordpress/plugins';
|
|
7
6
|
import { ActionItem } from '@wordpress/interface';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -27,12 +26,12 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
27
26
|
* }
|
|
28
27
|
*
|
|
29
28
|
* const ExternalPreviewMenuItem = () => (
|
|
30
|
-
* <
|
|
29
|
+
* <PluginPreviewMenuItem
|
|
31
30
|
* icon={ external }
|
|
32
31
|
* onClick={ onPreviewClick }
|
|
33
32
|
* >
|
|
34
33
|
* { __( 'Preview in new tab' ) }
|
|
35
|
-
* </
|
|
34
|
+
* </PluginPreviewMenuItem>
|
|
36
35
|
* );
|
|
37
36
|
* registerPlugin( 'external-preview-menu-item', {
|
|
38
37
|
* render: ExternalPreviewMenuItem,
|
|
@@ -41,12 +40,14 @@ import { ActionItem } from '@wordpress/interface';
|
|
|
41
40
|
*
|
|
42
41
|
* @return {Component} The rendered menu item component.
|
|
43
42
|
*/
|
|
44
|
-
export default
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
export default function PluginPreviewMenuItem( props ) {
|
|
44
|
+
const context = usePluginContext();
|
|
45
|
+
return (
|
|
46
|
+
<ActionItem
|
|
47
|
+
name="core/plugin-preview-menu"
|
|
48
|
+
as={ props.as ?? MenuItem }
|
|
49
|
+
icon={ props.icon || context.icon }
|
|
50
|
+
{ ...props }
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
4
|
import { ComplementaryArea } from '@wordpress/interface';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { store as editorStore } from '../../store';
|
|
12
|
-
|
|
13
6
|
/**
|
|
14
7
|
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
15
8
|
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
@@ -76,16 +69,10 @@ import { store as editorStore } from '../../store';
|
|
|
76
69
|
* ```
|
|
77
70
|
*/
|
|
78
71
|
export default function PluginSidebar( { className, ...props } ) {
|
|
79
|
-
const { postTitle } = useSelect( ( select ) => {
|
|
80
|
-
return {
|
|
81
|
-
postTitle: select( editorStore ).getEditedPostAttribute( 'title' ),
|
|
82
|
-
};
|
|
83
|
-
}, [] );
|
|
84
72
|
return (
|
|
85
73
|
<ComplementaryArea
|
|
86
74
|
panelClassName={ className }
|
|
87
75
|
className="editor-sidebar"
|
|
88
|
-
smallScreenTitle={ postTitle || __( '(no title)' ) }
|
|
89
76
|
scope="core"
|
|
90
77
|
{ ...props }
|
|
91
78
|
/>
|