@wordpress/editor 14.4.0 → 14.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/bindings/post-meta.js +12 -0
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/blog-title/index.js +1 -1
- package/build/components/blog-title/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/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 +1 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +17 -4
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +2 -3
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +5 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +11 -6
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +10 -811
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +20 -19
- 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 +21 -21
- 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-featured-image/index.js +2 -0
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +4 -0
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-slug/index.js +1 -0
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +17 -41
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.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-url/index.js +6 -5
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +3 -2
- package/build/components/post-url/panel.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/sidebar/post-summary.js +10 -7
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/site-discussion/index.js +6 -20
- package/build/components/site-discussion/index.js.map +1 -1
- package/build/components/template-content-panel/index.js +15 -13
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/visual-editor/index.js +2 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-pattern.js +48 -0
- package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
- package/build/dataviews/actions/duplicate-post.js +146 -0
- package/build/dataviews/actions/duplicate-post.js.map +1 -0
- package/build/dataviews/actions/duplicate-post.native.js +9 -0
- package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
- package/build/dataviews/actions/duplicate-template-part.js +67 -0
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
- 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/rename-post.js +125 -0
- package/build/dataviews/actions/rename-post.js.map +1 -0
- package/build/dataviews/actions/reorder-page.js +116 -0
- package/build/dataviews/actions/reorder-page.js.map +1 -0
- package/build/dataviews/actions/reorder-page.native.js +9 -0
- package/build/dataviews/actions/reorder-page.native.js.map +1 -0
- package/build/dataviews/actions/reset-post.js +1 -1
- package/build/dataviews/actions/reset-post.js.map +1 -1
- 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/actions/utils.js +9 -1
- package/build/dataviews/actions/utils.js.map +1 -1
- package/build/dataviews/actions/view-post-revisions.js +49 -0
- package/build/dataviews/actions/view-post-revisions.js.map +1 -0
- package/build/dataviews/actions/view-post.js +36 -0
- package/build/dataviews/actions/view-post.js.map +1 -0
- package/build/dataviews/fields/index.js +32 -0
- package/build/dataviews/fields/index.js.map +1 -0
- package/build/dataviews/store/private-actions.js +59 -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/private-apis.js +2 -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 +9 -2
- 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/store/utils/is-template-revertable.js +1 -1
- package/build/store/utils/is-template-revertable.js.map +1 -1
- package/build-module/bindings/post-meta.js +12 -0
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -1
- package/build-module/components/blog-title/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/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 +1 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +17 -4
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +2 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +5 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +12 -7
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +12 -814
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +20 -19
- 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 +21 -21
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +7 -23
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +2 -0
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +4 -0
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -0
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +19 -43
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.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-url/index.js +7 -6
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +4 -5
- package/build-module/components/post-url/panel.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/sidebar/post-summary.js +10 -7
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +7 -21
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +16 -14
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +2 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
- package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
- package/build-module/dataviews/actions/duplicate-post.js +139 -0
- package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
- package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
- package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
- package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
- 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/rename-post.js +118 -0
- package/build-module/dataviews/actions/rename-post.js.map +1 -0
- package/build-module/dataviews/actions/reorder-page.js +111 -0
- package/build-module/dataviews/actions/reorder-page.js.map +1 -0
- package/build-module/dataviews/actions/reorder-page.native.js +3 -0
- package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
- package/build-module/dataviews/actions/reset-post.js +1 -1
- package/build-module/dataviews/actions/reset-post.js.map +1 -1
- 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/actions/utils.js +7 -1
- package/build-module/dataviews/actions/utils.js.map +1 -1
- package/build-module/dataviews/actions/view-post-revisions.js +43 -0
- package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
- package/build-module/dataviews/actions/view-post.js +30 -0
- package/build-module/dataviews/actions/view-post.js.map +1 -0
- package/build-module/dataviews/fields/index.js +26 -0
- package/build-module/dataviews/fields/index.js.map +1 -0
- package/build-module/dataviews/store/private-actions.js +54 -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/private-apis.js +2 -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 +9 -2
- 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/store/utils/is-template-revertable.js +1 -1
- package/build-module/store/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +21 -34
- package/build-style/style.css +21 -34
- package/build-types/bindings/post-meta.d.ts +6 -0
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- 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/global-styles-provider/index.d.ts.map +1 -1
- 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/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.d.ts +1 -26
- package/build-types/components/post-actions/actions.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts +3 -2
- package/build-types/components/post-actions/index.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/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts +4 -2
- 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-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-taxonomies/hierarchical-term-selector.d.ts +1 -17
- package/build-types/components/post-taxonomies/hierarchical-term-selector.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-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/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/sidebar/post-summary.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.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
- package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
- package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
- package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
- package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
- package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
- package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
- 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/rename-post.d.ts +5 -0
- package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
- package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
- package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
- package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
- package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
- package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
- 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/actions/utils.d.ts +5 -3
- package/build-types/dataviews/actions/utils.d.ts.map +1 -1
- package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
- package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
- package/build-types/dataviews/actions/view-post.d.ts +8 -0
- package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
- package/build-types/dataviews/fields/index.d.ts +8 -0
- package/build-types/dataviews/fields/index.d.ts.map +1 -0
- 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 -1
- 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 +66 -8
- package/build-types/dataviews/types.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/utils/is-template-revertable.d.ts.map +1 -1
- package/package.json +36 -36
- package/src/bindings/post-meta.js +20 -0
- package/src/components/block-manager/style.scss +2 -2
- package/src/components/blog-title/index.js +1 -1
- package/src/components/commands/index.js +4 -2
- package/src/components/create-template-part-modal/index.js +1 -0
- package/src/components/document-bar/index.js +1 -1
- package/src/components/document-bar/style.scss +1 -1
- package/src/components/editor-interface/style.scss +5 -0
- package/src/components/error-boundary/style.native.scss +1 -1
- package/src/components/error-boundary/style.scss +1 -1
- package/src/components/global-styles-provider/index.js +16 -3
- package/src/components/header/index.js +1 -2
- package/src/components/inserter-sidebar/index.js +10 -4
- package/src/components/list-view-sidebar/style.scss +4 -0
- package/src/components/page-attributes/parent.js +38 -16
- package/src/components/post-actions/actions.js +10 -1044
- package/src/components/post-actions/index.js +25 -17
- 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 +29 -28
- package/src/components/post-comments/index.js +7 -20
- package/src/components/post-discussion/style.scss +0 -9
- package/src/components/post-featured-image/index.js +2 -0
- package/src/components/post-format/style.scss +0 -6
- package/src/components/post-publish-panel/postpublish.js +8 -2
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +10 -10
- package/src/components/post-slug/index.js +1 -0
- package/src/components/post-status/index.js +11 -41
- package/src/components/post-status/style.scss +0 -19
- package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -1
- package/src/components/post-template/create-new-template-modal.js +7 -1
- package/src/components/post-url/index.js +15 -9
- package/src/components/post-url/panel.js +8 -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/save-publish-panels/style.scss +3 -3
- package/src/components/sidebar/post-summary.js +20 -16
- package/src/components/site-discussion/index.js +7 -19
- package/src/components/site-discussion/style.scss +0 -14
- package/src/components/template-content-panel/index.js +40 -22
- package/src/components/visual-editor/index.js +8 -6
- package/src/components/visual-editor/style.scss +1 -3
- package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
- package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
- package/src/dataviews/actions/duplicate-post.tsx +174 -0
- package/src/dataviews/actions/duplicate-template-part.tsx +70 -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/rename-post.tsx +146 -0
- package/src/dataviews/actions/reorder-page.native.tsx +3 -0
- package/src/dataviews/actions/reorder-page.tsx +125 -0
- package/src/dataviews/actions/reset-post.tsx +2 -1
- package/src/dataviews/actions/restore-post.tsx +134 -0
- package/src/dataviews/actions/trash-post.tsx +196 -0
- package/src/dataviews/actions/utils.ts +14 -4
- package/src/dataviews/actions/view-post-revisions.tsx +47 -0
- package/src/dataviews/actions/view-post.tsx +30 -0
- package/src/dataviews/fields/index.ts +26 -0
- package/src/dataviews/store/private-actions.ts +109 -0
- package/src/dataviews/store/private-selectors.ts +9 -17
- package/src/dataviews/store/reducer.ts +20 -1
- package/src/dataviews/types.ts +58 -6
- package/src/private-apis.js +2 -2
- package/src/store/actions.js +36 -13
- package/src/store/private-actions.js +9 -5
- package/src/store/private-selectors.js +45 -2
- package/src/store/test/private-selectors.js +78 -0
- package/src/store/utils/is-template-revertable.js +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/index.js +0 -32
- package/build/dataviews/actions/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-types/dataviews/actions/index.d.ts +0 -2
- package/build-types/dataviews/actions/index.d.ts.map +0 -1
- 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
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -6,14 +11,17 @@ import {
|
|
|
6
11
|
DropdownMenu,
|
|
7
12
|
MenuGroup,
|
|
8
13
|
MenuItem,
|
|
14
|
+
MenuItemsChoice,
|
|
9
15
|
VisuallyHidden,
|
|
10
16
|
Icon,
|
|
11
17
|
} from '@wordpress/components';
|
|
12
18
|
import { __ } from '@wordpress/i18n';
|
|
13
|
-
import {
|
|
19
|
+
import { desktop, mobile, tablet, external } from '@wordpress/icons';
|
|
14
20
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
15
21
|
import { store as coreStore } from '@wordpress/core-data';
|
|
22
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
16
23
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
17
25
|
|
|
18
26
|
/**
|
|
19
27
|
* Internal dependencies
|
|
@@ -22,21 +30,50 @@ import { store as editorStore } from '../../store';
|
|
|
22
30
|
import PostPreviewButton from '../post-preview-button';
|
|
23
31
|
|
|
24
32
|
export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const {
|
|
34
|
+
deviceType,
|
|
35
|
+
editorMode,
|
|
36
|
+
homeUrl,
|
|
37
|
+
isTemplate,
|
|
38
|
+
isViewable,
|
|
39
|
+
showIconLabels,
|
|
40
|
+
} = useSelect( ( select ) => {
|
|
41
|
+
const { getDeviceType, getCurrentPostType } = select( editorStore );
|
|
42
|
+
const { getUnstableBase, getPostType } = select( coreStore );
|
|
43
|
+
const { get } = select( preferencesStore );
|
|
44
|
+
const { __unstableGetEditorMode } = select( blockEditorStore );
|
|
45
|
+
const _currentPostType = getCurrentPostType();
|
|
46
|
+
return {
|
|
47
|
+
deviceType: getDeviceType(),
|
|
48
|
+
editorMode: __unstableGetEditorMode(),
|
|
49
|
+
homeUrl: getUnstableBase()?.home,
|
|
50
|
+
isTemplate: _currentPostType === 'wp_template',
|
|
51
|
+
isViewable: getPostType( _currentPostType )?.viewable ?? false,
|
|
52
|
+
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
53
|
+
};
|
|
54
|
+
}, [] );
|
|
39
55
|
const { setDeviceType } = useDispatch( editorStore );
|
|
56
|
+
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Save the original editing mode in a ref to restore it when we exit zoom out.
|
|
60
|
+
*/
|
|
61
|
+
const originalEditingMode = useRef( editorMode );
|
|
62
|
+
useEffect( () => {
|
|
63
|
+
if ( editorMode !== 'zoom-out' ) {
|
|
64
|
+
originalEditingMode.current = editorMode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return () => {
|
|
68
|
+
if (
|
|
69
|
+
editorMode === 'zoom-out' &&
|
|
70
|
+
editorMode !== originalEditingMode.current
|
|
71
|
+
) {
|
|
72
|
+
__unstableSetEditorMode( originalEditingMode.current );
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}, [ editorMode, __unstableSetEditorMode ] );
|
|
76
|
+
|
|
40
77
|
const isMobile = useViewportMatch( 'medium', '<' );
|
|
41
78
|
if ( isMobile ) {
|
|
42
79
|
return null;
|
|
@@ -47,6 +84,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
47
84
|
};
|
|
48
85
|
const toggleProps = {
|
|
49
86
|
className: 'editor-preview-dropdown__toggle',
|
|
87
|
+
iconPosition: 'right',
|
|
50
88
|
size: 'compact',
|
|
51
89
|
showTooltip: ! showIconLabels,
|
|
52
90
|
disabled,
|
|
@@ -57,42 +95,81 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
57
95
|
};
|
|
58
96
|
|
|
59
97
|
const deviceIcons = {
|
|
98
|
+
desktop,
|
|
60
99
|
mobile,
|
|
61
100
|
tablet,
|
|
62
|
-
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The choices for the device type.
|
|
105
|
+
*
|
|
106
|
+
* @type {Array}
|
|
107
|
+
*/
|
|
108
|
+
const choices = [
|
|
109
|
+
{
|
|
110
|
+
value: 'Desktop',
|
|
111
|
+
label: __( 'Desktop' ),
|
|
112
|
+
icon: desktop,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
value: 'ZoomOut',
|
|
116
|
+
label: __( 'Desktop (50%)' ),
|
|
117
|
+
icon: desktop,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
value: 'Tablet',
|
|
121
|
+
label: __( 'Tablet' ),
|
|
122
|
+
icon: tablet,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
value: 'Mobile',
|
|
126
|
+
label: __( 'Mobile' ),
|
|
127
|
+
icon: mobile,
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
const previewValue = editorMode === 'zoom-out' ? 'ZoomOut' : deviceType;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Handles the selection of a device type.
|
|
135
|
+
*
|
|
136
|
+
* @param {string} value The device type.
|
|
137
|
+
*/
|
|
138
|
+
const onSelect = ( value ) => {
|
|
139
|
+
let newEditorMode = originalEditingMode.current;
|
|
140
|
+
|
|
141
|
+
if ( value === 'ZoomOut' ) {
|
|
142
|
+
newEditorMode = 'zoom-out';
|
|
143
|
+
setDeviceType( 'Desktop' );
|
|
144
|
+
} else {
|
|
145
|
+
setDeviceType( value );
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
__unstableSetEditorMode( newEditorMode );
|
|
63
149
|
};
|
|
64
150
|
|
|
65
151
|
return (
|
|
66
152
|
<DropdownMenu
|
|
67
|
-
className=
|
|
153
|
+
className={ clsx(
|
|
154
|
+
'editor-preview-dropdown',
|
|
155
|
+
`editor-preview-dropdown--${ deviceType.toLowerCase() }`
|
|
156
|
+
) }
|
|
68
157
|
popoverProps={ popoverProps }
|
|
69
158
|
toggleProps={ toggleProps }
|
|
70
159
|
menuProps={ menuProps }
|
|
71
160
|
icon={ deviceIcons[ deviceType.toLowerCase() ] }
|
|
161
|
+
text={ editorMode === 'zoom-out' ? __( '50%' ) : undefined }
|
|
72
162
|
label={ __( 'View' ) }
|
|
73
163
|
disableOpenOnArrowDown={ disabled }
|
|
74
164
|
>
|
|
75
165
|
{ ( { onClose } ) => (
|
|
76
166
|
<>
|
|
77
167
|
<MenuGroup>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</MenuItem>
|
|
84
|
-
<MenuItem
|
|
85
|
-
onClick={ () => setDeviceType( 'Tablet' ) }
|
|
86
|
-
icon={ deviceType === 'Tablet' && check }
|
|
87
|
-
>
|
|
88
|
-
{ __( 'Tablet' ) }
|
|
89
|
-
</MenuItem>
|
|
90
|
-
<MenuItem
|
|
91
|
-
onClick={ () => setDeviceType( 'Mobile' ) }
|
|
92
|
-
icon={ deviceType === 'Mobile' && check }
|
|
93
|
-
>
|
|
94
|
-
{ __( 'Mobile' ) }
|
|
95
|
-
</MenuItem>
|
|
168
|
+
<MenuItemsChoice
|
|
169
|
+
choices={ choices }
|
|
170
|
+
value={ previewValue }
|
|
171
|
+
onSelect={ onSelect }
|
|
172
|
+
/>
|
|
96
173
|
</MenuGroup>
|
|
97
174
|
{ isTemplate && (
|
|
98
175
|
<MenuGroup>
|
|
@@ -118,6 +195,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
118
195
|
className="editor-preview-dropdown__button-external"
|
|
119
196
|
role="menuitem"
|
|
120
197
|
forceIsAutosaveable={ forceIsAutosaveable }
|
|
198
|
+
aria-label={ __( 'Preview in new tab' ) }
|
|
121
199
|
textContent={
|
|
122
200
|
<>
|
|
123
201
|
{ __( 'Preview in new tab' ) }
|
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useRegistry } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { useEffect } from '@wordpress/element';
|
|
6
|
+
import { useEffect, useMemo } from '@wordpress/element';
|
|
7
7
|
import { applyFilters } from '@wordpress/hooks';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { store as editorStore } from '../../store';
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
|
|
15
|
+
const POST_CONTENT_BLOCK_TYPES = [
|
|
10
16
|
'core/post-title',
|
|
11
17
|
'core/post-featured-image',
|
|
12
18
|
'core/post-content',
|
|
13
|
-
'core/template-part',
|
|
14
19
|
];
|
|
15
20
|
|
|
16
21
|
/**
|
|
@@ -18,32 +23,30 @@ const DEFAULT_CONTENT_ONLY_BLOCKS = [
|
|
|
18
23
|
* page content to be edited.
|
|
19
24
|
*/
|
|
20
25
|
export default function DisableNonPageContentBlocks() {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
const contentOnlyBlockTypes = useMemo(
|
|
27
|
+
() => [
|
|
28
|
+
...applyFilters(
|
|
29
|
+
'editor.postContentBlockTypes',
|
|
30
|
+
POST_CONTENT_BLOCK_TYPES
|
|
31
|
+
),
|
|
32
|
+
'core/template-part',
|
|
33
|
+
],
|
|
34
|
+
[]
|
|
24
35
|
);
|
|
25
36
|
|
|
26
|
-
// Note that there are two separate
|
|
37
|
+
// Note that there are two separate subscriptions because the result for each
|
|
27
38
|
// returns a new array.
|
|
28
|
-
const contentOnlyIds = useSelect(
|
|
29
|
-
|
|
30
|
-
select(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// Ignore descendents of the query block.
|
|
36
|
-
parentBlockName !== 'core/query' &&
|
|
37
|
-
// Enable only the top-most block.
|
|
38
|
-
! contentOnlyBlocks.includes( parentBlockName )
|
|
39
|
-
);
|
|
40
|
-
} )
|
|
41
|
-
);
|
|
42
|
-
}, [] );
|
|
39
|
+
const contentOnlyIds = useSelect(
|
|
40
|
+
( select ) => {
|
|
41
|
+
const { getPostBlocksByName } = unlock( select( editorStore ) );
|
|
42
|
+
return getPostBlocksByName( contentOnlyBlockTypes );
|
|
43
|
+
},
|
|
44
|
+
[ contentOnlyBlockTypes ]
|
|
45
|
+
);
|
|
43
46
|
const disabledIds = useSelect( ( select ) => {
|
|
44
47
|
const { getBlocksByName, getBlockOrder } = select( blockEditorStore );
|
|
45
|
-
return getBlocksByName(
|
|
46
|
-
|
|
48
|
+
return getBlocksByName( 'core/template-part' ).flatMap( ( clientId ) =>
|
|
49
|
+
getBlockOrder( clientId )
|
|
47
50
|
);
|
|
48
51
|
}, [] );
|
|
49
52
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.editor-layout__toggle-sidebar-panel,
|
|
4
4
|
.editor-layout__toggle-entities-saved-states-panel {
|
|
5
5
|
z-index: z-index(".editor-layout__toggle-sidebar-panel");
|
|
6
|
-
position: fixed !important; //
|
|
6
|
+
position: fixed !important; // Necessary to override the default relative positioning.
|
|
7
7
|
top: -9999em;
|
|
8
8
|
bottom: auto;
|
|
9
9
|
left: auto;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
width: $sidebar-width;
|
|
13
13
|
background-color: $white;
|
|
14
|
-
border:
|
|
15
|
-
height: auto !important; //
|
|
14
|
+
border: $border-width dotted $gray-300;
|
|
15
|
+
height: auto !important; // Necessary to override the default sidebar positioning.
|
|
16
16
|
padding: $grid-unit-30;
|
|
17
17
|
display: flex;
|
|
18
18
|
justify-content: center;
|
|
@@ -8,7 +8,6 @@ import { useSelect } from '@wordpress/data';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import PluginPostStatusInfo from '../plugin-post-status-info';
|
|
11
|
-
import PostActions from '../post-actions';
|
|
12
11
|
import PostAuthorPanel from '../post-author/panel';
|
|
13
12
|
import PostCardPanel from '../post-card-panel';
|
|
14
13
|
import PostContentInformation from '../post-content-information';
|
|
@@ -36,16 +35,23 @@ import { PrivatePostLastRevision } from '../post-last-revision';
|
|
|
36
35
|
const PANEL_NAME = 'post-status';
|
|
37
36
|
|
|
38
37
|
export default function PostSummary( { onActionPerformed } ) {
|
|
39
|
-
const { isRemovedPostStatusPanel } = useSelect(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
const { isRemovedPostStatusPanel, postType, postId } = useSelect(
|
|
39
|
+
( select ) => {
|
|
40
|
+
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
41
|
+
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
42
|
+
const {
|
|
43
|
+
isEditorPanelRemoved,
|
|
44
|
+
getCurrentPostType,
|
|
45
|
+
getCurrentPostId,
|
|
46
|
+
} = select( editorStore );
|
|
47
|
+
return {
|
|
48
|
+
isRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),
|
|
49
|
+
postType: getCurrentPostType(),
|
|
50
|
+
postId: getCurrentPostId(),
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
[]
|
|
54
|
+
);
|
|
49
55
|
|
|
50
56
|
return (
|
|
51
57
|
<PostPanelSection className="editor-post-summary">
|
|
@@ -54,11 +60,9 @@ export default function PostSummary( { onActionPerformed } ) {
|
|
|
54
60
|
<>
|
|
55
61
|
<VStack spacing={ 4 }>
|
|
56
62
|
<PostCardPanel
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/>
|
|
61
|
-
}
|
|
63
|
+
postType={ postType }
|
|
64
|
+
postId={ postId }
|
|
65
|
+
onActionPerformed={ onActionPerformed }
|
|
62
66
|
/>
|
|
63
67
|
<PostFeaturedImagePanel withPanelBody={ false } />
|
|
64
68
|
<PostExcerptPanel />
|
|
@@ -23,29 +23,17 @@ import { store as editorStore } from '../../store';
|
|
|
23
23
|
|
|
24
24
|
const COMMENT_OPTIONS = [
|
|
25
25
|
{
|
|
26
|
-
label: (
|
|
27
|
-
<>
|
|
28
|
-
{ _x( 'Open', 'Adjective: e.g. "Comments are open"' ) }
|
|
29
|
-
<Text variant="muted" size={ 12 }>
|
|
30
|
-
{ __( 'Visitors can add new comments and replies.' ) }
|
|
31
|
-
</Text>
|
|
32
|
-
</>
|
|
33
|
-
),
|
|
26
|
+
label: _x( 'Open', 'Adjective: e.g. "Comments are open"' ),
|
|
34
27
|
value: 'open',
|
|
28
|
+
description: __( 'Visitors can add new comments and replies.' ),
|
|
35
29
|
},
|
|
36
30
|
{
|
|
37
|
-
label: (
|
|
38
|
-
<>
|
|
39
|
-
{ __( 'Closed' ) }
|
|
40
|
-
<Text variant="muted" size={ 12 }>
|
|
41
|
-
{ __( 'Visitors cannot add new comments or replies.' ) }
|
|
42
|
-
</Text>
|
|
43
|
-
<Text variant="muted" size={ 12 }>
|
|
44
|
-
{ __( 'Existing comments remain visible.' ) }
|
|
45
|
-
</Text>
|
|
46
|
-
</>
|
|
47
|
-
),
|
|
31
|
+
label: __( 'Closed' ),
|
|
48
32
|
value: '',
|
|
33
|
+
description: [
|
|
34
|
+
__( 'Visitors cannot add new comments or replies.' ),
|
|
35
|
+
__( 'Existing comments remain visible.' ),
|
|
36
|
+
].join( ' ' ),
|
|
49
37
|
},
|
|
50
38
|
];
|
|
51
39
|
|
|
@@ -3,17 +3,3 @@
|
|
|
3
3
|
padding: $grid-unit-20;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.editor-site-discussion__options {
|
|
7
|
-
// TODO: it's not great to override component styles.. This might be resolved
|
|
8
|
-
// by the new radio control component.
|
|
9
|
-
.components-radio-control__option {
|
|
10
|
-
align-items: flex-start;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
label {
|
|
14
|
-
.components-text {
|
|
15
|
-
display: block;
|
|
16
|
-
margin-top: $grid-unit-05;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
-
import {
|
|
6
|
-
store as blockEditorStore,
|
|
7
|
-
privateApis as blockEditorPrivateApis,
|
|
8
|
-
} from '@wordpress/block-editor';
|
|
5
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
9
6
|
import { PanelBody } from '@wordpress/components';
|
|
10
7
|
import { __ } from '@wordpress/i18n';
|
|
11
8
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
9
|
+
import { applyFilters } from '@wordpress/hooks';
|
|
10
|
+
import { useMemo } from '@wordpress/element';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Internal dependencies
|
|
@@ -19,32 +18,51 @@ import { store as editorStore } from '../../store';
|
|
|
19
18
|
|
|
20
19
|
const { BlockQuickNavigation } = unlock( blockEditorPrivateApis );
|
|
21
20
|
|
|
22
|
-
const
|
|
23
|
-
'core/post-content',
|
|
24
|
-
'core/post-featured-image',
|
|
21
|
+
const POST_CONTENT_BLOCK_TYPES = [
|
|
25
22
|
'core/post-title',
|
|
23
|
+
'core/post-featured-image',
|
|
24
|
+
'core/post-content',
|
|
26
25
|
];
|
|
27
26
|
|
|
28
27
|
const TEMPLATE_PART_BLOCK = 'core/template-part';
|
|
29
28
|
|
|
30
29
|
export default function TemplateContentPanel() {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
postType: _postType,
|
|
38
|
-
clientIds: getBlocksByName(
|
|
39
|
-
TEMPLATE_POST_TYPE === _postType
|
|
40
|
-
? TEMPLATE_PART_BLOCK
|
|
41
|
-
: PAGE_CONTENT_BLOCKS
|
|
30
|
+
const postContentBlockTypes = useMemo(
|
|
31
|
+
() =>
|
|
32
|
+
applyFilters(
|
|
33
|
+
'editor.postContentBlockTypes',
|
|
34
|
+
POST_CONTENT_BLOCK_TYPES
|
|
42
35
|
),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
[]
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const { clientIds, postType, renderingMode } = useSelect(
|
|
40
|
+
( select ) => {
|
|
41
|
+
const {
|
|
42
|
+
getCurrentPostType,
|
|
43
|
+
getPostBlocksByName,
|
|
44
|
+
getRenderingMode,
|
|
45
|
+
} = unlock( select( editorStore ) );
|
|
46
|
+
const _postType = getCurrentPostType();
|
|
47
|
+
return {
|
|
48
|
+
postType: _postType,
|
|
49
|
+
clientIds: getPostBlocksByName(
|
|
50
|
+
TEMPLATE_POST_TYPE === _postType
|
|
51
|
+
? TEMPLATE_PART_BLOCK
|
|
52
|
+
: postContentBlockTypes
|
|
53
|
+
),
|
|
54
|
+
renderingMode: getRenderingMode(),
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
[ postContentBlockTypes ]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
46
61
|
|
|
47
|
-
if (
|
|
62
|
+
if (
|
|
63
|
+
( renderingMode === 'post-only' && postType !== TEMPLATE_POST_TYPE ) ||
|
|
64
|
+
clientIds.length === 0
|
|
65
|
+
) {
|
|
48
66
|
return null;
|
|
49
67
|
}
|
|
50
68
|
|
|
@@ -107,6 +107,7 @@ function VisualEditor( {
|
|
|
107
107
|
} ) {
|
|
108
108
|
const [ resizeObserver, sizes ] = useResizeObserver();
|
|
109
109
|
const isMobileViewport = useViewportMatch( 'small', '<' );
|
|
110
|
+
const isTabletViewport = useViewportMatch( 'medium', '<' );
|
|
110
111
|
const {
|
|
111
112
|
renderingMode,
|
|
112
113
|
postContentAttributes,
|
|
@@ -341,12 +342,13 @@ function VisualEditor( {
|
|
|
341
342
|
} ),
|
|
342
343
|
] );
|
|
343
344
|
|
|
344
|
-
const zoomOutProps =
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
345
|
+
const zoomOutProps =
|
|
346
|
+
isZoomOutMode && ! isTabletViewport
|
|
347
|
+
? {
|
|
348
|
+
scale: 'default',
|
|
349
|
+
frameSize: '48px',
|
|
350
|
+
}
|
|
351
|
+
: {};
|
|
350
352
|
|
|
351
353
|
const forceFullHeight = postType === NAVIGATION_POST_TYPE;
|
|
352
354
|
const enableResizing =
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
.editor-visual-editor {
|
|
2
2
|
position: relative;
|
|
3
|
-
display:
|
|
3
|
+
display: flex;
|
|
4
4
|
background-color: $gray-300;
|
|
5
|
-
// Make this a stacking context to contain the z-index of children elements.
|
|
6
|
-
isolation: isolate;
|
|
7
5
|
|
|
8
6
|
// Centralize the editor horizontally (flex-direction is column).
|
|
9
7
|
align-items: center;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
7
|
+
import type { Action } from '@wordpress/dataviews';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import type { Pattern } from '../types';
|
|
14
|
+
|
|
15
|
+
// Patterns.
|
|
16
|
+
const { CreatePatternModalContents, useDuplicatePatternProps } =
|
|
17
|
+
unlock( patternsPrivateApis );
|
|
18
|
+
|
|
19
|
+
const duplicatePattern: Action< Pattern > = {
|
|
20
|
+
id: 'duplicate-pattern',
|
|
21
|
+
label: _x( 'Duplicate', 'action label' ),
|
|
22
|
+
isEligible: ( item ) => item.type !== 'wp_template_part',
|
|
23
|
+
modalHeader: _x( 'Duplicate pattern', 'action label' ),
|
|
24
|
+
RenderModal: ( { items, closeModal } ) => {
|
|
25
|
+
const [ item ] = items;
|
|
26
|
+
const duplicatedProps = useDuplicatePatternProps( {
|
|
27
|
+
pattern: item,
|
|
28
|
+
onSuccess: () => closeModal?.(),
|
|
29
|
+
} );
|
|
30
|
+
return (
|
|
31
|
+
<CreatePatternModalContents
|
|
32
|
+
onClose={ closeModal }
|
|
33
|
+
confirmLabel={ _x( 'Duplicate', 'action label' ) }
|
|
34
|
+
{ ...duplicatedProps }
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default duplicatePattern;
|