@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
|
@@ -17,7 +17,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
17
17
|
*/
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
import { usePostActions } from './actions';
|
|
20
|
-
import { store as editorStore } from '../../store';
|
|
21
20
|
|
|
22
21
|
const {
|
|
23
22
|
DropdownMenuV2: DropdownMenu,
|
|
@@ -27,28 +26,38 @@ const {
|
|
|
27
26
|
kebabCase,
|
|
28
27
|
} = unlock( componentsPrivateApis );
|
|
29
28
|
|
|
30
|
-
export default function PostActions( {
|
|
29
|
+
export default function PostActions( { postType, postId, onActionPerformed } ) {
|
|
31
30
|
const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
|
|
32
|
-
const { item,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const { item, permissions } = useSelect(
|
|
32
|
+
( select ) => {
|
|
33
|
+
const { getEditedEntityRecord, getEntityRecordPermissions } =
|
|
34
|
+
unlock( select( coreStore ) );
|
|
35
|
+
return {
|
|
36
|
+
item: getEditedEntityRecord( 'postType', postType, postId ),
|
|
37
|
+
permissions: getEntityRecordPermissions(
|
|
38
|
+
'postType',
|
|
39
|
+
postType,
|
|
40
|
+
postId
|
|
41
|
+
),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
[ postId, postType ]
|
|
45
|
+
);
|
|
46
|
+
const itemWithPermissions = useMemo( () => {
|
|
36
47
|
return {
|
|
37
|
-
item
|
|
38
|
-
|
|
39
|
-
_postType,
|
|
40
|
-
getCurrentPostId()
|
|
41
|
-
),
|
|
42
|
-
postType: _postType,
|
|
48
|
+
...item,
|
|
49
|
+
permissions,
|
|
43
50
|
};
|
|
44
|
-
}, [] );
|
|
51
|
+
}, [ item, permissions ] );
|
|
45
52
|
const allActions = usePostActions( { postType, onActionPerformed } );
|
|
46
53
|
|
|
47
54
|
const actions = useMemo( () => {
|
|
48
55
|
return allActions.filter( ( action ) => {
|
|
49
|
-
return
|
|
56
|
+
return (
|
|
57
|
+
! action.isEligible || action.isEligible( itemWithPermissions )
|
|
58
|
+
);
|
|
50
59
|
} );
|
|
51
|
-
}, [ allActions,
|
|
60
|
+
}, [ allActions, itemWithPermissions ] );
|
|
52
61
|
|
|
53
62
|
return (
|
|
54
63
|
<DropdownMenu
|
|
@@ -64,7 +73,6 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
|
|
|
64
73
|
onClick={ () =>
|
|
65
74
|
setIsActionsMenuOpen( ! isActionsMenuOpen )
|
|
66
75
|
}
|
|
67
|
-
{ ...buttonProps }
|
|
68
76
|
/>
|
|
69
77
|
}
|
|
70
78
|
onOpenChange={ setIsActionsMenuOpen }
|
|
@@ -72,7 +80,7 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
|
|
|
72
80
|
>
|
|
73
81
|
<ActionsDropdownMenuGroup
|
|
74
82
|
actions={ actions }
|
|
75
|
-
item={
|
|
83
|
+
item={ itemWithPermissions }
|
|
76
84
|
onClose={ () => {
|
|
77
85
|
setIsActionsMenuOpen( false );
|
|
78
86
|
} }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { useMemo } from '@wordpress/element';
|
|
5
6
|
import { useSelect } from '@wordpress/data';
|
|
6
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -46,17 +47,24 @@ export function useAuthorsQuery( search ) {
|
|
|
46
47
|
( { value } ) => postAuthor?.id === value
|
|
47
48
|
);
|
|
48
49
|
|
|
50
|
+
let currentAuthor = [];
|
|
49
51
|
if ( foundAuthor < 0 && postAuthor ) {
|
|
50
|
-
|
|
52
|
+
currentAuthor = [
|
|
51
53
|
{
|
|
52
54
|
value: postAuthor.id,
|
|
53
55
|
label: decodeEntities( postAuthor.name ),
|
|
54
56
|
},
|
|
55
|
-
|
|
57
|
+
];
|
|
58
|
+
} else if ( foundAuthor < 0 && ! postAuthor ) {
|
|
59
|
+
currentAuthor = [
|
|
60
|
+
{
|
|
61
|
+
value: 0,
|
|
62
|
+
label: __( '(No author)' ),
|
|
63
|
+
},
|
|
56
64
|
];
|
|
57
65
|
}
|
|
58
66
|
|
|
59
|
-
return fetchedAuthors;
|
|
67
|
+
return [ ...currentAuthor, ...fetchedAuthors ];
|
|
60
68
|
}, [ authors, postAuthor ] );
|
|
61
69
|
|
|
62
70
|
return { authorId, authorOptions, postAuthor };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { Button, Dropdown } from '@wordpress/components';
|
|
6
6
|
import { useState, useMemo } from '@wordpress/element';
|
|
7
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
7
8
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -16,7 +17,8 @@ import { useAuthorsQuery } from './hook';
|
|
|
16
17
|
|
|
17
18
|
function PostAuthorToggle( { isOpen, onClick } ) {
|
|
18
19
|
const { postAuthor } = useAuthorsQuery();
|
|
19
|
-
const authorName =
|
|
20
|
+
const authorName =
|
|
21
|
+
decodeEntities( postAuthor?.name ) || __( '(No author)' );
|
|
20
22
|
return (
|
|
21
23
|
<Button
|
|
22
24
|
size="compact"
|
|
@@ -26,59 +26,56 @@ import {
|
|
|
26
26
|
GLOBAL_POST_TYPES,
|
|
27
27
|
} from '../../store/constants';
|
|
28
28
|
import { unlock } from '../../lock-unlock';
|
|
29
|
+
import PostActions from '../post-actions';
|
|
29
30
|
|
|
30
|
-
export default function PostCardPanel( {
|
|
31
|
+
export default function PostCardPanel( {
|
|
32
|
+
postType,
|
|
33
|
+
postId,
|
|
34
|
+
onActionPerformed,
|
|
35
|
+
} ) {
|
|
31
36
|
const { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(
|
|
32
37
|
( select ) => {
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
getCurrentPostType,
|
|
36
|
-
getCurrentPostId,
|
|
37
|
-
__experimentalGetTemplateInfo,
|
|
38
|
-
} = select( editorStore );
|
|
39
|
-
const { canUser } = select( coreStore );
|
|
40
|
-
const { getEditedEntityRecord } = select( coreStore );
|
|
38
|
+
const { __experimentalGetTemplateInfo } = select( editorStore );
|
|
39
|
+
const { canUser, getEditedEntityRecord } = select( coreStore );
|
|
41
40
|
const siteSettings = canUser( 'read', {
|
|
42
41
|
kind: 'root',
|
|
43
42
|
name: 'site',
|
|
44
43
|
} )
|
|
45
44
|
? getEditedEntityRecord( 'root', 'site' )
|
|
46
45
|
: undefined;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const _record = getEditedEntityRecord(
|
|
47
|
+
'postType',
|
|
48
|
+
postType,
|
|
49
|
+
postId
|
|
50
|
+
);
|
|
50
51
|
const _templateInfo =
|
|
51
52
|
[ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
|
|
52
|
-
|
|
53
|
+
postType
|
|
53
54
|
) && __experimentalGetTemplateInfo( _record );
|
|
54
55
|
let _isSync = false;
|
|
55
|
-
if ( GLOBAL_POST_TYPES.includes(
|
|
56
|
-
if ( PATTERN_POST_TYPE ===
|
|
56
|
+
if ( GLOBAL_POST_TYPES.includes( postType ) ) {
|
|
57
|
+
if ( PATTERN_POST_TYPE === postType ) {
|
|
57
58
|
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
|
|
58
59
|
const currentSyncStatus =
|
|
59
|
-
|
|
60
|
-
?.wp_pattern_sync_status === 'unsynced'
|
|
60
|
+
_record?.meta?.wp_pattern_sync_status === 'unsynced'
|
|
61
61
|
? 'unsynced'
|
|
62
|
-
:
|
|
63
|
-
'wp_pattern_sync_status'
|
|
64
|
-
);
|
|
62
|
+
: _record?.wp_pattern_sync_status;
|
|
65
63
|
_isSync = currentSyncStatus !== 'unsynced';
|
|
66
64
|
} else {
|
|
67
65
|
_isSync = true;
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
return {
|
|
71
|
-
title:
|
|
72
|
-
|
|
73
|
-
icon: unlock( select( editorStore ) ).getPostIcon( _type, {
|
|
69
|
+
title: _templateInfo?.title || _record?.title,
|
|
70
|
+
icon: unlock( select( editorStore ) ).getPostIcon( postType, {
|
|
74
71
|
area: _record?.area,
|
|
75
72
|
} ),
|
|
76
73
|
isSync: _isSync,
|
|
77
|
-
isFrontPage: siteSettings?.page_on_front ===
|
|
78
|
-
isPostsPage: siteSettings?.page_for_posts ===
|
|
74
|
+
isFrontPage: siteSettings?.page_on_front === postId,
|
|
75
|
+
isPostsPage: siteSettings?.page_for_posts === postId,
|
|
79
76
|
};
|
|
80
77
|
},
|
|
81
|
-
[]
|
|
78
|
+
[ postId, postType ]
|
|
82
79
|
);
|
|
83
80
|
return (
|
|
84
81
|
<div className="editor-post-card-panel">
|
|
@@ -101,7 +98,7 @@ export default function PostCardPanel( { actions } ) {
|
|
|
101
98
|
as="h2"
|
|
102
99
|
lineHeight="20px"
|
|
103
100
|
>
|
|
104
|
-
{ title ? decodeEntities( title ) : __( 'No
|
|
101
|
+
{ title ? decodeEntities( title ) : __( 'No title' ) }
|
|
105
102
|
{ isFrontPage && (
|
|
106
103
|
<span className="editor-post-card-panel__title-badge">
|
|
107
104
|
{ __( 'Homepage' ) }
|
|
@@ -113,7 +110,11 @@ export default function PostCardPanel( { actions } ) {
|
|
|
113
110
|
</span>
|
|
114
111
|
) }
|
|
115
112
|
</Text>
|
|
116
|
-
|
|
113
|
+
<PostActions
|
|
114
|
+
postType={ postType }
|
|
115
|
+
postId={ postId }
|
|
116
|
+
onActionPerformed={ onActionPerformed }
|
|
117
|
+
/>
|
|
117
118
|
</HStack>
|
|
118
119
|
</div>
|
|
119
120
|
);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { __, _x } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
RadioControl,
|
|
7
|
-
__experimentalText as Text,
|
|
8
7
|
__experimentalVStack as VStack,
|
|
9
8
|
} from '@wordpress/components';
|
|
10
9
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
@@ -16,29 +15,17 @@ import { store as editorStore } from '../../store';
|
|
|
16
15
|
|
|
17
16
|
const COMMENT_OPTIONS = [
|
|
18
17
|
{
|
|
19
|
-
label: (
|
|
20
|
-
<>
|
|
21
|
-
{ _x( 'Open', 'Adjective: e.g. "Comments are open"' ) }
|
|
22
|
-
<Text variant="muted" size={ 12 }>
|
|
23
|
-
{ __( 'Visitors can add new comments and replies.' ) }
|
|
24
|
-
</Text>
|
|
25
|
-
</>
|
|
26
|
-
),
|
|
18
|
+
label: _x( 'Open', 'Adjective: e.g. "Comments are open"' ),
|
|
27
19
|
value: 'open',
|
|
20
|
+
description: __( 'Visitors can add new comments and replies.' ),
|
|
28
21
|
},
|
|
29
22
|
{
|
|
30
|
-
label: (
|
|
31
|
-
<>
|
|
32
|
-
{ __( 'Closed' ) }
|
|
33
|
-
<Text variant="muted" size={ 12 }>
|
|
34
|
-
{ __( 'Visitors cannot add new comments or replies.' ) }
|
|
35
|
-
</Text>
|
|
36
|
-
<Text variant="muted" size={ 12 }>
|
|
37
|
-
{ __( 'Existing comments remain visible.' ) }
|
|
38
|
-
</Text>
|
|
39
|
-
</>
|
|
40
|
-
),
|
|
23
|
+
label: __( 'Closed' ),
|
|
41
24
|
value: 'closed',
|
|
25
|
+
description: [
|
|
26
|
+
__( 'Visitors cannot add new comments or replies.' ),
|
|
27
|
+
__( 'Existing comments remain visible.' ),
|
|
28
|
+
].join( ' ' ),
|
|
42
29
|
},
|
|
43
30
|
];
|
|
44
31
|
|
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
// sidebar width - popover padding - form margin
|
|
3
3
|
min-width: $sidebar-width - $grid-unit-20 - $grid-unit-20;
|
|
4
4
|
margin: $grid-unit-10;
|
|
5
|
-
|
|
6
|
-
.components-radio-control__option {
|
|
7
|
-
align-items: flex-start;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.components-radio-control__label .components-text {
|
|
11
|
-
display: block;
|
|
12
|
-
margin-top: $grid-unit-05;
|
|
13
|
-
}
|
|
14
5
|
}
|
|
15
6
|
.editor-post-discussion__panel-toggle {
|
|
16
7
|
|
|
@@ -44,7 +44,7 @@ const getFuturePostUrl = ( post ) => {
|
|
|
44
44
|
function CopyButton( { text, onCopy, children } ) {
|
|
45
45
|
const ref = useCopyToClipboard( text, onCopy );
|
|
46
46
|
return (
|
|
47
|
-
<Button variant="secondary" ref={ ref }>
|
|
47
|
+
<Button __next40pxDefaultSize variant="secondary" ref={ ref }>
|
|
48
48
|
{ children }
|
|
49
49
|
</Button>
|
|
50
50
|
);
|
|
@@ -122,6 +122,7 @@ class PostPublishPanelPostpublish extends Component {
|
|
|
122
122
|
</p>
|
|
123
123
|
<div className="post-publish-panel__postpublish-post-address-container">
|
|
124
124
|
<TextControl
|
|
125
|
+
__next40pxDefaultSize
|
|
125
126
|
__nextHasNoMarginBottom
|
|
126
127
|
className="post-publish-panel__postpublish-post-address"
|
|
127
128
|
readOnly
|
|
@@ -145,12 +146,17 @@ class PostPublishPanelPostpublish extends Component {
|
|
|
145
146
|
|
|
146
147
|
<div className="post-publish-panel__postpublish-buttons">
|
|
147
148
|
{ ! isScheduled && (
|
|
148
|
-
<Button
|
|
149
|
+
<Button
|
|
150
|
+
variant="primary"
|
|
151
|
+
href={ link }
|
|
152
|
+
__next40pxDefaultSize
|
|
153
|
+
>
|
|
149
154
|
{ viewPostLabel }
|
|
150
155
|
</Button>
|
|
151
156
|
) }
|
|
152
157
|
<Button
|
|
153
158
|
variant={ isScheduled ? 'primary' : 'secondary' }
|
|
159
|
+
__next40pxDefaultSize
|
|
154
160
|
href={ addLink }
|
|
155
161
|
>
|
|
156
162
|
{ addNewPostLabel }
|
|
@@ -22,7 +22,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
22
22
|
font-weight: 500;
|
|
23
23
|
line-height: 1.4;
|
|
24
24
|
text-transform: uppercase;
|
|
25
|
-
display:
|
|
25
|
+
display: block;
|
|
26
26
|
margin-bottom: calc(4px * 2);
|
|
27
27
|
padding: 0;
|
|
28
28
|
}
|
|
@@ -120,7 +120,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
120
120
|
post address
|
|
121
121
|
</label>
|
|
122
122
|
<input
|
|
123
|
-
class="components-text-control__input"
|
|
123
|
+
class="components-text-control__input is-next-40px-default-size"
|
|
124
124
|
id="inspector-text-control-0"
|
|
125
125
|
readonly=""
|
|
126
126
|
type="text"
|
|
@@ -132,7 +132,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
132
132
|
class="post-publish-panel__postpublish-post-address__copy-button-wrap"
|
|
133
133
|
>
|
|
134
134
|
<button
|
|
135
|
-
class="components-button is-secondary"
|
|
135
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
136
136
|
type="button"
|
|
137
137
|
>
|
|
138
138
|
Copy
|
|
@@ -143,11 +143,11 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
143
143
|
class="post-publish-panel__postpublish-buttons"
|
|
144
144
|
>
|
|
145
145
|
<a
|
|
146
|
-
class="components-button is-primary"
|
|
146
|
+
class="components-button is-next-40px-default-size is-primary"
|
|
147
147
|
href="https://wordpress.local/sample-page/"
|
|
148
148
|
/>
|
|
149
149
|
<a
|
|
150
|
-
class="components-button is-secondary"
|
|
150
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
151
151
|
href="post-new.php?"
|
|
152
152
|
/>
|
|
153
153
|
</div>
|
|
@@ -214,7 +214,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
214
214
|
font-weight: 500;
|
|
215
215
|
line-height: 1.4;
|
|
216
216
|
text-transform: uppercase;
|
|
217
|
-
display:
|
|
217
|
+
display: block;
|
|
218
218
|
margin-bottom: calc(4px * 2);
|
|
219
219
|
padding: 0;
|
|
220
220
|
}
|
|
@@ -312,7 +312,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
312
312
|
post address
|
|
313
313
|
</label>
|
|
314
314
|
<input
|
|
315
|
-
class="components-text-control__input"
|
|
315
|
+
class="components-text-control__input is-next-40px-default-size"
|
|
316
316
|
id="inspector-text-control-1"
|
|
317
317
|
readonly=""
|
|
318
318
|
type="text"
|
|
@@ -324,7 +324,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
324
324
|
class="post-publish-panel__postpublish-post-address__copy-button-wrap"
|
|
325
325
|
>
|
|
326
326
|
<button
|
|
327
|
-
class="components-button is-secondary"
|
|
327
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
328
328
|
type="button"
|
|
329
329
|
>
|
|
330
330
|
Copy
|
|
@@ -335,11 +335,11 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
335
335
|
class="post-publish-panel__postpublish-buttons"
|
|
336
336
|
>
|
|
337
337
|
<a
|
|
338
|
-
class="components-button is-primary"
|
|
338
|
+
class="components-button is-next-40px-default-size is-primary"
|
|
339
339
|
href="https://wordpress.local/sample-page/"
|
|
340
340
|
/>
|
|
341
341
|
<a
|
|
342
|
-
class="components-button is-secondary"
|
|
342
|
+
class="components-button is-next-40px-default-size is-secondary"
|
|
343
343
|
href="post-new.php?"
|
|
344
344
|
/>
|
|
345
345
|
</div>
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
Button,
|
|
6
6
|
CheckboxControl,
|
|
7
7
|
Dropdown,
|
|
8
|
-
__experimentalText as Text,
|
|
9
8
|
__experimentalVStack as VStack,
|
|
10
9
|
TextControl,
|
|
11
10
|
RadioControl,
|
|
@@ -49,59 +48,29 @@ const postStatusesInfo = {
|
|
|
49
48
|
|
|
50
49
|
export const STATUS_OPTIONS = [
|
|
51
50
|
{
|
|
52
|
-
label: (
|
|
53
|
-
<>
|
|
54
|
-
{ __( 'Draft' ) }
|
|
55
|
-
<Text variant="muted" size={ 12 }>
|
|
56
|
-
{ __( 'Not ready to publish.' ) }
|
|
57
|
-
</Text>
|
|
58
|
-
</>
|
|
59
|
-
),
|
|
51
|
+
label: __( 'Draft' ),
|
|
60
52
|
value: 'draft',
|
|
53
|
+
description: __( 'Not ready to publish.' ),
|
|
61
54
|
},
|
|
62
55
|
{
|
|
63
|
-
label: (
|
|
64
|
-
<>
|
|
65
|
-
{ __( 'Pending' ) }
|
|
66
|
-
<Text variant="muted" size={ 12 }>
|
|
67
|
-
{ __( 'Waiting for review before publishing.' ) }
|
|
68
|
-
</Text>
|
|
69
|
-
</>
|
|
70
|
-
),
|
|
56
|
+
label: __( 'Pending' ),
|
|
71
57
|
value: 'pending',
|
|
58
|
+
description: __( 'Waiting for review before publishing.' ),
|
|
72
59
|
},
|
|
73
60
|
{
|
|
74
|
-
label: (
|
|
75
|
-
<>
|
|
76
|
-
{ __( 'Private' ) }
|
|
77
|
-
<Text variant="muted" size={ 12 }>
|
|
78
|
-
{ __( 'Only visible to site admins and editors.' ) }
|
|
79
|
-
</Text>
|
|
80
|
-
</>
|
|
81
|
-
),
|
|
61
|
+
label: __( 'Private' ),
|
|
82
62
|
value: 'private',
|
|
63
|
+
description: __( 'Only visible to site admins and editors.' ),
|
|
83
64
|
},
|
|
84
65
|
{
|
|
85
|
-
label: (
|
|
86
|
-
<>
|
|
87
|
-
{ __( 'Scheduled' ) }
|
|
88
|
-
<Text variant="muted" size={ 12 }>
|
|
89
|
-
{ __( 'Publish automatically on a chosen date.' ) }
|
|
90
|
-
</Text>
|
|
91
|
-
</>
|
|
92
|
-
),
|
|
66
|
+
label: __( 'Scheduled' ),
|
|
93
67
|
value: 'future',
|
|
68
|
+
description: __( 'Publish automatically on a chosen date.' ),
|
|
94
69
|
},
|
|
95
70
|
{
|
|
96
|
-
label: (
|
|
97
|
-
<>
|
|
98
|
-
{ __( 'Published' ) }
|
|
99
|
-
<Text variant="muted" size={ 12 }>
|
|
100
|
-
{ __( 'Visible to everyone.' ) }
|
|
101
|
-
</Text>
|
|
102
|
-
</>
|
|
103
|
-
),
|
|
71
|
+
label: __( 'Published' ),
|
|
104
72
|
value: 'publish',
|
|
73
|
+
description: __( 'Visible to everyone.' ),
|
|
105
74
|
},
|
|
106
75
|
];
|
|
107
76
|
|
|
@@ -285,6 +254,7 @@ export default function PostStatus() {
|
|
|
285
254
|
id={ passwordInputId }
|
|
286
255
|
__next40pxDefaultSize
|
|
287
256
|
__nextHasNoMarginBottom
|
|
257
|
+
maxLength={ 255 }
|
|
288
258
|
/>
|
|
289
259
|
</div>
|
|
290
260
|
) }
|
|
@@ -18,25 +18,6 @@
|
|
|
18
18
|
padding: $grid-unit-20;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.editor-change-status__options {
|
|
22
|
-
.components-base-control__field > .components-v-stack {
|
|
23
|
-
gap: $grid-unit-15;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// TODO: it's not great to override component styles.. This might be resolved
|
|
27
|
-
// by the new radio control component.
|
|
28
|
-
.components-radio-control__option {
|
|
29
|
-
align-items: flex-start;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
label {
|
|
33
|
-
.components-text {
|
|
34
|
-
display: block;
|
|
35
|
-
margin-top: $grid-unit-05;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
21
|
.editor-change-status__password-legend {
|
|
41
22
|
padding: 0;
|
|
42
23
|
margin-bottom: $grid-unit-10;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
withFilters,
|
|
13
13
|
Flex,
|
|
14
14
|
FlexItem,
|
|
15
|
+
SearchControl,
|
|
15
16
|
} from '@wordpress/components';
|
|
16
17
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
18
|
import { useDebounce } from '@wordpress/compose';
|
|
@@ -406,7 +407,8 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
406
407
|
return (
|
|
407
408
|
<Flex direction="column" gap="4">
|
|
408
409
|
{ showFilter && (
|
|
409
|
-
<
|
|
410
|
+
<SearchControl
|
|
411
|
+
__next40pxDefaultSize
|
|
410
412
|
__nextHasNoMarginBottom
|
|
411
413
|
label={ filterLabel }
|
|
412
414
|
value={ filterValue }
|
|
@@ -118,6 +118,7 @@ export default function CreateNewTemplateModal( { onClose } ) {
|
|
|
118
118
|
>
|
|
119
119
|
<VStack spacing="3">
|
|
120
120
|
<TextControl
|
|
121
|
+
__next40pxDefaultSize
|
|
121
122
|
__nextHasNoMarginBottom
|
|
122
123
|
label={ __( 'Name' ) }
|
|
123
124
|
value={ title }
|
|
@@ -129,11 +130,16 @@ export default function CreateNewTemplateModal( { onClose } ) {
|
|
|
129
130
|
) }
|
|
130
131
|
/>
|
|
131
132
|
<HStack justify="right">
|
|
132
|
-
<Button
|
|
133
|
+
<Button
|
|
134
|
+
__next40pxDefaultSize
|
|
135
|
+
variant="tertiary"
|
|
136
|
+
onClick={ cancel }
|
|
137
|
+
>
|
|
133
138
|
{ __( 'Cancel' ) }
|
|
134
139
|
</Button>
|
|
135
140
|
|
|
136
141
|
<Button
|
|
142
|
+
__next40pxDefaultSize
|
|
137
143
|
variant="primary"
|
|
138
144
|
type="submit"
|
|
139
145
|
isBusy={ isBusy }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';
|
|
6
|
-
import { useState } from '@wordpress/element';
|
|
6
|
+
import { useState, createInterpolateElement } from '@wordpress/element';
|
|
7
7
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
9
|
import {
|
|
@@ -83,14 +83,20 @@ export default function PostURL( { onClose } ) {
|
|
|
83
83
|
<VStack spacing={ 3 }>
|
|
84
84
|
{ isEditable && (
|
|
85
85
|
<div>
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
{ createInterpolateElement(
|
|
87
|
+
__(
|
|
88
|
+
'Customize the last part of the URL. <a>Learn more.</a>'
|
|
89
|
+
),
|
|
90
|
+
{
|
|
91
|
+
a: (
|
|
92
|
+
<ExternalLink
|
|
93
|
+
href={ __(
|
|
94
|
+
'https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink'
|
|
95
|
+
) }
|
|
96
|
+
/>
|
|
97
|
+
),
|
|
98
|
+
}
|
|
99
|
+
) }
|
|
94
100
|
</div>
|
|
95
101
|
) }
|
|
96
102
|
<div>
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo, useState } from '@wordpress/element';
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Dropdown,
|
|
8
|
+
Button,
|
|
9
|
+
__experimentalTruncate as Truncate,
|
|
10
|
+
} from '@wordpress/components';
|
|
7
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
8
12
|
import { safeDecodeURIComponent } from '@wordpress/url';
|
|
9
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -86,7 +90,9 @@ function PostURLToggle( { isOpen, onClick } ) {
|
|
|
86
90
|
aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }
|
|
87
91
|
onClick={ onClick }
|
|
88
92
|
>
|
|
89
|
-
|
|
93
|
+
<Truncate numberOfLines={ 1 }>
|
|
94
|
+
{ isFrontPage ? postLink : `/${ decodedSlug }` }
|
|
95
|
+
</Truncate>
|
|
90
96
|
</Button>
|
|
91
97
|
);
|
|
92
98
|
}
|