@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
|
@@ -3,25 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.duplicateTemplatePartAction = exports.duplicatePatternAction = void 0;
|
|
7
6
|
exports.usePostActions = usePostActions;
|
|
8
|
-
var _icons = require("@wordpress/icons");
|
|
9
|
-
var _url = require("@wordpress/url");
|
|
10
7
|
var _data = require("@wordpress/data");
|
|
11
|
-
var _htmlEntities = require("@wordpress/html-entities");
|
|
12
|
-
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
var _notices = require("@wordpress/notices");
|
|
15
8
|
var _element = require("@wordpress/element");
|
|
16
|
-
var _patterns = require("@wordpress/patterns");
|
|
17
|
-
var _blocks = require("@wordpress/blocks");
|
|
18
|
-
var _dataviews = require("@wordpress/dataviews");
|
|
19
|
-
var _components = require("@wordpress/components");
|
|
20
|
-
var _constants = require("../../store/constants");
|
|
21
9
|
var _store = require("../../store");
|
|
22
10
|
var _lockUnlock = require("../../lock-unlock");
|
|
23
|
-
var _createTemplatePartModal = require("../create-template-part-modal");
|
|
24
|
-
var _utils = require("../../dataviews/actions/utils");
|
|
25
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
12
|
/**
|
|
27
13
|
* WordPress dependencies
|
|
@@ -31,819 +17,35 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
31
17
|
* Internal dependencies
|
|
32
18
|
*/
|
|
33
19
|
|
|
34
|
-
// Patterns.
|
|
35
|
-
const {
|
|
36
|
-
PATTERN_TYPES,
|
|
37
|
-
CreatePatternModalContents,
|
|
38
|
-
useDuplicatePatternProps
|
|
39
|
-
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
40
|
-
|
|
41
|
-
// TODO: this should be shared with other components (page-pages).
|
|
42
|
-
const fields = [{
|
|
43
|
-
type: 'text',
|
|
44
|
-
header: (0, _i18n.__)('Title'),
|
|
45
|
-
id: 'title',
|
|
46
|
-
placeholder: (0, _i18n.__)('No title'),
|
|
47
|
-
getValue: ({
|
|
48
|
-
item
|
|
49
|
-
}) => item.title
|
|
50
|
-
}];
|
|
51
|
-
const form = {
|
|
52
|
-
visibleFields: ['title']
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Check if a template is removable.
|
|
57
|
-
*
|
|
58
|
-
* @param {Object} template The template entity to check.
|
|
59
|
-
* @return {boolean} Whether the template is removable.
|
|
60
|
-
*/
|
|
61
|
-
function isTemplateRemovable(template) {
|
|
62
|
-
if (!template) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
// In patterns list page we map the templates parts to a different object
|
|
66
|
-
// than the one returned from the endpoint. This is why we need to check for
|
|
67
|
-
// two props whether is custom or has a theme file.
|
|
68
|
-
return template?.source === _constants.TEMPLATE_ORIGINS.custom && !template?.has_theme_file;
|
|
69
|
-
}
|
|
70
|
-
const trashPostAction = {
|
|
71
|
-
id: 'move-to-trash',
|
|
72
|
-
label: (0, _i18n.__)('Move to Trash'),
|
|
73
|
-
isPrimary: true,
|
|
74
|
-
icon: _icons.trash,
|
|
75
|
-
isEligible(item) {
|
|
76
|
-
return !['auto-draft', 'trash'].includes(item.status);
|
|
77
|
-
},
|
|
78
|
-
supportsBulk: true,
|
|
79
|
-
hideModalHeader: true,
|
|
80
|
-
RenderModal: ({
|
|
81
|
-
items,
|
|
82
|
-
closeModal,
|
|
83
|
-
onActionPerformed
|
|
84
|
-
}) => {
|
|
85
|
-
const [isBusy, setIsBusy] = (0, _element.useState)(false);
|
|
86
|
-
const {
|
|
87
|
-
createSuccessNotice,
|
|
88
|
-
createErrorNotice
|
|
89
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
90
|
-
const {
|
|
91
|
-
deleteEntityRecord
|
|
92
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
93
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
94
|
-
spacing: "5",
|
|
95
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
|
|
96
|
-
children: items.length === 1 ? (0, _i18n.sprintf)(
|
|
97
|
-
// translators: %s: The item's title.
|
|
98
|
-
(0, _i18n.__)('Are you sure you want to move to trash "%s"?'), (0, _utils.getItemTitle)(items[0])) : (0, _i18n.sprintf)(
|
|
99
|
-
// translators: %d: The number of items (2 or more).
|
|
100
|
-
(0, _i18n._n)('Are you sure you want to move to trash %d item?', 'Are you sure you want to move to trash %d items?', items.length), items.length)
|
|
101
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
102
|
-
justify: "right",
|
|
103
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
104
|
-
variant: "tertiary",
|
|
105
|
-
onClick: closeModal,
|
|
106
|
-
disabled: isBusy,
|
|
107
|
-
accessibleWhenDisabled: true,
|
|
108
|
-
children: (0, _i18n.__)('Cancel')
|
|
109
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
110
|
-
variant: "primary",
|
|
111
|
-
onClick: async () => {
|
|
112
|
-
setIsBusy(true);
|
|
113
|
-
const promiseResult = await Promise.allSettled(items.map(item => deleteEntityRecord('postType', item.type, item.id, {}, {
|
|
114
|
-
throwOnError: true
|
|
115
|
-
})));
|
|
116
|
-
// If all the promises were fulfilled with success.
|
|
117
|
-
if (promiseResult.every(({
|
|
118
|
-
status
|
|
119
|
-
}) => status === 'fulfilled')) {
|
|
120
|
-
let successMessage;
|
|
121
|
-
if (promiseResult.length === 1) {
|
|
122
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The item's title. */
|
|
123
|
-
(0, _i18n.__)('"%s" moved to trash.'), (0, _utils.getItemTitle)(items[0]));
|
|
124
|
-
} else {
|
|
125
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The number of items. */
|
|
126
|
-
(0, _i18n._n)('%s item moved to trash.', '%s items moved to trash.', items.length), items.length);
|
|
127
|
-
}
|
|
128
|
-
createSuccessNotice(successMessage, {
|
|
129
|
-
type: 'snackbar',
|
|
130
|
-
id: 'move-to-trash-action'
|
|
131
|
-
});
|
|
132
|
-
} else {
|
|
133
|
-
// If there was at least one failure.
|
|
134
|
-
let errorMessage;
|
|
135
|
-
// If we were trying to delete a single item.
|
|
136
|
-
if (promiseResult.length === 1) {
|
|
137
|
-
if (promiseResult[0].reason?.message) {
|
|
138
|
-
errorMessage = promiseResult[0].reason.message;
|
|
139
|
-
} else {
|
|
140
|
-
errorMessage = (0, _i18n.__)('An error occurred while moving to trash the item.');
|
|
141
|
-
}
|
|
142
|
-
// If we were trying to delete multiple items.
|
|
143
|
-
} else {
|
|
144
|
-
const errorMessages = new Set();
|
|
145
|
-
const failedPromises = promiseResult.filter(({
|
|
146
|
-
status
|
|
147
|
-
}) => status === 'rejected');
|
|
148
|
-
for (const failedPromise of failedPromises) {
|
|
149
|
-
if (failedPromise.reason?.message) {
|
|
150
|
-
errorMessages.add(failedPromise.reason.message);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (errorMessages.size === 0) {
|
|
154
|
-
errorMessage = (0, _i18n.__)('An error occurred while moving to trash the items.');
|
|
155
|
-
} else if (errorMessages.size === 1) {
|
|
156
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: an error message */
|
|
157
|
-
(0, _i18n.__)('An error occurred while moving to trash the item: %s'), [...errorMessages][0]);
|
|
158
|
-
} else {
|
|
159
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: a list of comma separated error messages */
|
|
160
|
-
(0, _i18n.__)('Some errors occurred while moving to trash the items: %s'), [...errorMessages].join(','));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
createErrorNotice(errorMessage, {
|
|
164
|
-
type: 'snackbar'
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
if (onActionPerformed) {
|
|
168
|
-
onActionPerformed(items);
|
|
169
|
-
}
|
|
170
|
-
setIsBusy(false);
|
|
171
|
-
closeModal();
|
|
172
|
-
},
|
|
173
|
-
isBusy: isBusy,
|
|
174
|
-
disabled: isBusy,
|
|
175
|
-
accessibleWhenDisabled: true,
|
|
176
|
-
children: (0, _i18n.__)('Trash')
|
|
177
|
-
})]
|
|
178
|
-
})]
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
function useCanUserEligibilityCheckPostType(capability, postType, action) {
|
|
183
|
-
const registry = (0, _data.useRegistry)();
|
|
184
|
-
return (0, _element.useMemo)(() => ({
|
|
185
|
-
...action,
|
|
186
|
-
isEligible(item) {
|
|
187
|
-
return action.isEligible(item) && registry.select(_coreData.store).canUser(capability, {
|
|
188
|
-
kind: 'postType',
|
|
189
|
-
name: postType,
|
|
190
|
-
id: item.id
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}), [action, registry, capability, postType]);
|
|
194
|
-
}
|
|
195
|
-
function useTrashPostAction(postType) {
|
|
196
|
-
return useCanUserEligibilityCheckPostType('delete', postType, trashPostAction);
|
|
197
|
-
}
|
|
198
|
-
const permanentlyDeletePostAction = {
|
|
199
|
-
id: 'permanently-delete',
|
|
200
|
-
label: (0, _i18n.__)('Permanently delete'),
|
|
201
|
-
supportsBulk: true,
|
|
202
|
-
isEligible({
|
|
203
|
-
status
|
|
204
|
-
}) {
|
|
205
|
-
return status === 'trash';
|
|
206
|
-
},
|
|
207
|
-
async callback(posts, {
|
|
208
|
-
registry,
|
|
209
|
-
onActionPerformed
|
|
210
|
-
}) {
|
|
211
|
-
const {
|
|
212
|
-
createSuccessNotice,
|
|
213
|
-
createErrorNotice
|
|
214
|
-
} = registry.dispatch(_notices.store);
|
|
215
|
-
const {
|
|
216
|
-
deleteEntityRecord
|
|
217
|
-
} = registry.dispatch(_coreData.store);
|
|
218
|
-
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
219
|
-
return deleteEntityRecord('postType', post.type, post.id, {
|
|
220
|
-
force: true
|
|
221
|
-
}, {
|
|
222
|
-
throwOnError: true
|
|
223
|
-
});
|
|
224
|
-
}));
|
|
225
|
-
// If all the promises were fulfilled with success.
|
|
226
|
-
if (promiseResult.every(({
|
|
227
|
-
status
|
|
228
|
-
}) => status === 'fulfilled')) {
|
|
229
|
-
let successMessage;
|
|
230
|
-
if (promiseResult.length === 1) {
|
|
231
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The posts's title. */
|
|
232
|
-
(0, _i18n.__)('"%s" permanently deleted.'), (0, _utils.getItemTitle)(posts[0]));
|
|
233
|
-
} else {
|
|
234
|
-
successMessage = (0, _i18n.__)('The posts were permanently deleted.');
|
|
235
|
-
}
|
|
236
|
-
createSuccessNotice(successMessage, {
|
|
237
|
-
type: 'snackbar',
|
|
238
|
-
id: 'permanently-delete-post-action'
|
|
239
|
-
});
|
|
240
|
-
onActionPerformed?.(posts);
|
|
241
|
-
} else {
|
|
242
|
-
// If there was at lease one failure.
|
|
243
|
-
let errorMessage;
|
|
244
|
-
// If we were trying to permanently delete a single post.
|
|
245
|
-
if (promiseResult.length === 1) {
|
|
246
|
-
if (promiseResult[0].reason?.message) {
|
|
247
|
-
errorMessage = promiseResult[0].reason.message;
|
|
248
|
-
} else {
|
|
249
|
-
errorMessage = (0, _i18n.__)('An error occurred while permanently deleting the post.');
|
|
250
|
-
}
|
|
251
|
-
// If we were trying to permanently delete multiple posts
|
|
252
|
-
} else {
|
|
253
|
-
const errorMessages = new Set();
|
|
254
|
-
const failedPromises = promiseResult.filter(({
|
|
255
|
-
status
|
|
256
|
-
}) => status === 'rejected');
|
|
257
|
-
for (const failedPromise of failedPromises) {
|
|
258
|
-
if (failedPromise.reason?.message) {
|
|
259
|
-
errorMessages.add(failedPromise.reason.message);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
if (errorMessages.size === 0) {
|
|
263
|
-
errorMessage = (0, _i18n.__)('An error occurred while permanently deleting the posts.');
|
|
264
|
-
} else if (errorMessages.size === 1) {
|
|
265
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: an error message */
|
|
266
|
-
(0, _i18n.__)('An error occurred while permanently deleting the posts: %s'), [...errorMessages][0]);
|
|
267
|
-
} else {
|
|
268
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: a list of comma separated error messages */
|
|
269
|
-
(0, _i18n.__)('Some errors occurred while permanently deleting the posts: %s'), [...errorMessages].join(','));
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
createErrorNotice(errorMessage, {
|
|
273
|
-
type: 'snackbar'
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
function usePermanentlyDeletePostAction(postType) {
|
|
279
|
-
return useCanUserEligibilityCheckPostType('delete', postType, permanentlyDeletePostAction);
|
|
280
|
-
}
|
|
281
|
-
const restorePostAction = {
|
|
282
|
-
id: 'restore',
|
|
283
|
-
label: (0, _i18n.__)('Restore'),
|
|
284
|
-
isPrimary: true,
|
|
285
|
-
icon: _icons.backup,
|
|
286
|
-
supportsBulk: true,
|
|
287
|
-
isEligible({
|
|
288
|
-
status
|
|
289
|
-
}) {
|
|
290
|
-
return status === 'trash';
|
|
291
|
-
},
|
|
292
|
-
async callback(posts, {
|
|
293
|
-
registry,
|
|
294
|
-
onActionPerformed
|
|
295
|
-
}) {
|
|
296
|
-
const {
|
|
297
|
-
createSuccessNotice,
|
|
298
|
-
createErrorNotice
|
|
299
|
-
} = registry.dispatch(_notices.store);
|
|
300
|
-
const {
|
|
301
|
-
editEntityRecord,
|
|
302
|
-
saveEditedEntityRecord
|
|
303
|
-
} = registry.dispatch(_coreData.store);
|
|
304
|
-
await Promise.allSettled(posts.map(post => {
|
|
305
|
-
return editEntityRecord('postType', post.type, post.id, {
|
|
306
|
-
status: 'draft'
|
|
307
|
-
});
|
|
308
|
-
}));
|
|
309
|
-
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
310
|
-
return saveEditedEntityRecord('postType', post.type, post.id, {
|
|
311
|
-
throwOnError: true
|
|
312
|
-
});
|
|
313
|
-
}));
|
|
314
|
-
if (promiseResult.every(({
|
|
315
|
-
status
|
|
316
|
-
}) => status === 'fulfilled')) {
|
|
317
|
-
let successMessage;
|
|
318
|
-
if (posts.length === 1) {
|
|
319
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The number of posts. */
|
|
320
|
-
(0, _i18n.__)('"%s" has been restored.'), (0, _utils.getItemTitle)(posts[0]));
|
|
321
|
-
} else if (posts[0].type === 'page') {
|
|
322
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The number of posts. */
|
|
323
|
-
(0, _i18n.__)('%d pages have been restored.'), posts.length);
|
|
324
|
-
} else {
|
|
325
|
-
successMessage = (0, _i18n.sprintf)( /* translators: The number of posts. */
|
|
326
|
-
(0, _i18n.__)('%d posts have been restored.'), posts.length);
|
|
327
|
-
}
|
|
328
|
-
createSuccessNotice(successMessage, {
|
|
329
|
-
type: 'snackbar',
|
|
330
|
-
id: 'restore-post-action'
|
|
331
|
-
});
|
|
332
|
-
if (onActionPerformed) {
|
|
333
|
-
onActionPerformed(posts);
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
// If there was at lease one failure.
|
|
337
|
-
let errorMessage;
|
|
338
|
-
// If we were trying to move a single post to the trash.
|
|
339
|
-
if (promiseResult.length === 1) {
|
|
340
|
-
if (promiseResult[0].reason?.message) {
|
|
341
|
-
errorMessage = promiseResult[0].reason.message;
|
|
342
|
-
} else {
|
|
343
|
-
errorMessage = (0, _i18n.__)('An error occurred while restoring the post.');
|
|
344
|
-
}
|
|
345
|
-
// If we were trying to move multiple posts to the trash
|
|
346
|
-
} else {
|
|
347
|
-
const errorMessages = new Set();
|
|
348
|
-
const failedPromises = promiseResult.filter(({
|
|
349
|
-
status
|
|
350
|
-
}) => status === 'rejected');
|
|
351
|
-
for (const failedPromise of failedPromises) {
|
|
352
|
-
if (failedPromise.reason?.message) {
|
|
353
|
-
errorMessages.add(failedPromise.reason.message);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
if (errorMessages.size === 0) {
|
|
357
|
-
errorMessage = (0, _i18n.__)('An error occurred while restoring the posts.');
|
|
358
|
-
} else if (errorMessages.size === 1) {
|
|
359
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: an error message */
|
|
360
|
-
(0, _i18n.__)('An error occurred while restoring the posts: %s'), [...errorMessages][0]);
|
|
361
|
-
} else {
|
|
362
|
-
errorMessage = (0, _i18n.sprintf)( /* translators: %s: a list of comma separated error messages */
|
|
363
|
-
(0, _i18n.__)('Some errors occurred while restoring the posts: %s'), [...errorMessages].join(','));
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
createErrorNotice(errorMessage, {
|
|
367
|
-
type: 'snackbar'
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
function useRestorePostAction(postType) {
|
|
373
|
-
return useCanUserEligibilityCheckPostType('update', postType, restorePostAction);
|
|
374
|
-
}
|
|
375
|
-
const viewPostAction = {
|
|
376
|
-
id: 'view-post',
|
|
377
|
-
label: (0, _i18n.__)('View'),
|
|
378
|
-
isPrimary: true,
|
|
379
|
-
icon: _icons.external,
|
|
380
|
-
isEligible(post) {
|
|
381
|
-
return post.status !== 'trash';
|
|
382
|
-
},
|
|
383
|
-
callback(posts, {
|
|
384
|
-
onActionPerformed
|
|
385
|
-
}) {
|
|
386
|
-
const post = posts[0];
|
|
387
|
-
window.open(post.link, '_blank');
|
|
388
|
-
if (onActionPerformed) {
|
|
389
|
-
onActionPerformed(posts);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
const postRevisionsAction = {
|
|
394
|
-
id: 'view-post-revisions',
|
|
395
|
-
context: 'list',
|
|
396
|
-
label(items) {
|
|
397
|
-
var _items$0$_links$versi;
|
|
398
|
-
const revisionsCount = (_items$0$_links$versi = items[0]._links?.['version-history']?.[0]?.count) !== null && _items$0$_links$versi !== void 0 ? _items$0$_links$versi : 0;
|
|
399
|
-
return (0, _i18n.sprintf)( /* translators: %s: number of revisions */
|
|
400
|
-
(0, _i18n.__)('View revisions (%s)'), revisionsCount);
|
|
401
|
-
},
|
|
402
|
-
isEligible: post => {
|
|
403
|
-
var _post$_links$predeces, _post$_links$version;
|
|
404
|
-
if (post.status === 'trash') {
|
|
405
|
-
return false;
|
|
406
|
-
}
|
|
407
|
-
const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null;
|
|
408
|
-
const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0;
|
|
409
|
-
return lastRevisionId && revisionsCount > 1;
|
|
410
|
-
},
|
|
411
|
-
callback(posts, {
|
|
412
|
-
onActionPerformed
|
|
413
|
-
}) {
|
|
414
|
-
const post = posts[0];
|
|
415
|
-
const href = (0, _url.addQueryArgs)('revision.php', {
|
|
416
|
-
revision: post?._links?.['predecessor-version']?.[0]?.id
|
|
417
|
-
});
|
|
418
|
-
document.location.href = href;
|
|
419
|
-
if (onActionPerformed) {
|
|
420
|
-
onActionPerformed(posts);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
};
|
|
424
|
-
const renamePostAction = {
|
|
425
|
-
id: 'rename-post',
|
|
426
|
-
label: (0, _i18n.__)('Rename'),
|
|
427
|
-
isEligible(post) {
|
|
428
|
-
if (post.status === 'trash') {
|
|
429
|
-
return false;
|
|
430
|
-
}
|
|
431
|
-
// Templates, template parts and patterns have special checks for renaming.
|
|
432
|
-
if (![_constants.TEMPLATE_POST_TYPE, _constants.TEMPLATE_PART_POST_TYPE, ...Object.values(PATTERN_TYPES)].includes(post.type)) {
|
|
433
|
-
return true;
|
|
434
|
-
}
|
|
435
|
-
// In the case of templates, we can only rename custom templates.
|
|
436
|
-
if (post.type === _constants.TEMPLATE_POST_TYPE) {
|
|
437
|
-
return isTemplateRemovable(post) && post.is_custom;
|
|
438
|
-
}
|
|
439
|
-
// Make necessary checks for template parts and patterns.
|
|
440
|
-
const isTemplatePart = post.type === _constants.TEMPLATE_PART_POST_TYPE;
|
|
441
|
-
const isUserPattern = post.type === PATTERN_TYPES.user;
|
|
442
|
-
// In patterns list page we map the templates parts to a different object
|
|
443
|
-
// than the one returned from the endpoint. This is why we need to check for
|
|
444
|
-
// two props whether is custom or has a theme file.
|
|
445
|
-
const isCustomPattern = isUserPattern || isTemplatePart && post.source === _constants.TEMPLATE_ORIGINS.custom;
|
|
446
|
-
const hasThemeFile = post?.has_theme_file;
|
|
447
|
-
return isCustomPattern && !hasThemeFile;
|
|
448
|
-
},
|
|
449
|
-
RenderModal: ({
|
|
450
|
-
items,
|
|
451
|
-
closeModal,
|
|
452
|
-
onActionPerformed
|
|
453
|
-
}) => {
|
|
454
|
-
const [item] = items;
|
|
455
|
-
const [title, setTitle] = (0, _element.useState)(() => (0, _utils.getItemTitle)(item));
|
|
456
|
-
const {
|
|
457
|
-
editEntityRecord,
|
|
458
|
-
saveEditedEntityRecord
|
|
459
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
460
|
-
const {
|
|
461
|
-
createSuccessNotice,
|
|
462
|
-
createErrorNotice
|
|
463
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
464
|
-
async function onRename(event) {
|
|
465
|
-
event.preventDefault();
|
|
466
|
-
try {
|
|
467
|
-
await editEntityRecord('postType', item.type, item.id, {
|
|
468
|
-
title
|
|
469
|
-
});
|
|
470
|
-
// Update state before saving rerenders the list.
|
|
471
|
-
setTitle('');
|
|
472
|
-
closeModal();
|
|
473
|
-
// Persist edited entity.
|
|
474
|
-
await saveEditedEntityRecord('postType', item.type, item.id, {
|
|
475
|
-
throwOnError: true
|
|
476
|
-
});
|
|
477
|
-
createSuccessNotice((0, _i18n.__)('Name updated'), {
|
|
478
|
-
type: 'snackbar'
|
|
479
|
-
});
|
|
480
|
-
onActionPerformed?.(items);
|
|
481
|
-
} catch (error) {
|
|
482
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while updating the name');
|
|
483
|
-
createErrorNotice(errorMessage, {
|
|
484
|
-
type: 'snackbar'
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
489
|
-
onSubmit: onRename,
|
|
490
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
491
|
-
spacing: "5",
|
|
492
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
493
|
-
__nextHasNoMarginBottom: true,
|
|
494
|
-
__next40pxDefaultSize: true,
|
|
495
|
-
label: (0, _i18n.__)('Name'),
|
|
496
|
-
value: title,
|
|
497
|
-
onChange: setTitle,
|
|
498
|
-
required: true
|
|
499
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
500
|
-
justify: "right",
|
|
501
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
502
|
-
__next40pxDefaultSize: true,
|
|
503
|
-
variant: "tertiary",
|
|
504
|
-
onClick: () => {
|
|
505
|
-
closeModal();
|
|
506
|
-
},
|
|
507
|
-
children: (0, _i18n.__)('Cancel')
|
|
508
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
509
|
-
__next40pxDefaultSize: true,
|
|
510
|
-
variant: "primary",
|
|
511
|
-
type: "submit",
|
|
512
|
-
children: (0, _i18n.__)('Save')
|
|
513
|
-
})]
|
|
514
|
-
})]
|
|
515
|
-
})
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
function useRenamePostAction(postType) {
|
|
520
|
-
return useCanUserEligibilityCheckPostType('update', postType, renamePostAction);
|
|
521
|
-
}
|
|
522
|
-
function ReorderModal({
|
|
523
|
-
items,
|
|
524
|
-
closeModal,
|
|
525
|
-
onActionPerformed
|
|
526
|
-
}) {
|
|
527
|
-
const [item] = items;
|
|
528
|
-
const {
|
|
529
|
-
editEntityRecord,
|
|
530
|
-
saveEditedEntityRecord
|
|
531
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
532
|
-
const {
|
|
533
|
-
createSuccessNotice,
|
|
534
|
-
createErrorNotice
|
|
535
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
536
|
-
const [orderInput, setOrderInput] = (0, _element.useState)(item.menu_order);
|
|
537
|
-
async function onOrder(event) {
|
|
538
|
-
event.preventDefault();
|
|
539
|
-
if (!Number.isInteger(Number(orderInput)) || orderInput?.trim?.() === '') {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
try {
|
|
543
|
-
await editEntityRecord('postType', item.type, item.id, {
|
|
544
|
-
menu_order: orderInput
|
|
545
|
-
});
|
|
546
|
-
closeModal();
|
|
547
|
-
// Persist edited entity.
|
|
548
|
-
await saveEditedEntityRecord('postType', item.type, item.id, {
|
|
549
|
-
throwOnError: true
|
|
550
|
-
});
|
|
551
|
-
createSuccessNotice((0, _i18n.__)('Order updated'), {
|
|
552
|
-
type: 'snackbar'
|
|
553
|
-
});
|
|
554
|
-
onActionPerformed?.(items);
|
|
555
|
-
} catch (error) {
|
|
556
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while updating the order');
|
|
557
|
-
createErrorNotice(errorMessage, {
|
|
558
|
-
type: 'snackbar'
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
const saveIsDisabled = !Number.isInteger(Number(orderInput)) || orderInput?.trim?.() === '';
|
|
563
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
564
|
-
onSubmit: onOrder,
|
|
565
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
566
|
-
spacing: "5",
|
|
567
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
568
|
-
children: (0, _i18n.__)('Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.')
|
|
569
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
|
|
570
|
-
__next40pxDefaultSize: true,
|
|
571
|
-
label: (0, _i18n.__)('Order'),
|
|
572
|
-
help: (0, _i18n.__)('Set the page order.'),
|
|
573
|
-
value: orderInput,
|
|
574
|
-
onChange: setOrderInput
|
|
575
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
576
|
-
justify: "right",
|
|
577
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
578
|
-
__next40pxDefaultSize: true,
|
|
579
|
-
variant: "tertiary",
|
|
580
|
-
onClick: () => {
|
|
581
|
-
closeModal();
|
|
582
|
-
},
|
|
583
|
-
children: (0, _i18n.__)('Cancel')
|
|
584
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
585
|
-
__next40pxDefaultSize: true,
|
|
586
|
-
variant: "primary",
|
|
587
|
-
type: "submit",
|
|
588
|
-
accessibleWhenDisabled: true,
|
|
589
|
-
disabled: saveIsDisabled,
|
|
590
|
-
__experimentalIsFocusable: true,
|
|
591
|
-
children: (0, _i18n.__)('Save')
|
|
592
|
-
})]
|
|
593
|
-
})]
|
|
594
|
-
})
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
function useReorderPagesAction(postType) {
|
|
598
|
-
const supportsPageAttributes = (0, _data.useSelect)(select => {
|
|
599
|
-
const {
|
|
600
|
-
getPostType
|
|
601
|
-
} = select(_coreData.store);
|
|
602
|
-
const postTypeObject = getPostType(postType);
|
|
603
|
-
return !!postTypeObject?.supports?.['page-attributes'];
|
|
604
|
-
}, [postType]);
|
|
605
|
-
return (0, _element.useMemo)(() => supportsPageAttributes && {
|
|
606
|
-
id: 'order-pages',
|
|
607
|
-
label: (0, _i18n.__)('Order'),
|
|
608
|
-
isEligible({
|
|
609
|
-
status
|
|
610
|
-
}) {
|
|
611
|
-
return status !== 'trash';
|
|
612
|
-
},
|
|
613
|
-
RenderModal: ReorderModal
|
|
614
|
-
}, [supportsPageAttributes]);
|
|
615
|
-
}
|
|
616
|
-
const useDuplicatePostAction = postType => {
|
|
617
|
-
const userCanCreatePost = (0, _data.useSelect)(select => {
|
|
618
|
-
return select(_coreData.store).canUser('create', {
|
|
619
|
-
kind: 'postType',
|
|
620
|
-
name: postType
|
|
621
|
-
});
|
|
622
|
-
}, [postType]);
|
|
623
|
-
return (0, _element.useMemo)(() => userCanCreatePost && {
|
|
624
|
-
id: 'duplicate-post',
|
|
625
|
-
label: (0, _i18n._x)('Duplicate', 'action label'),
|
|
626
|
-
isEligible({
|
|
627
|
-
status
|
|
628
|
-
}) {
|
|
629
|
-
return status !== 'trash';
|
|
630
|
-
},
|
|
631
|
-
RenderModal: ({
|
|
632
|
-
items,
|
|
633
|
-
closeModal,
|
|
634
|
-
onActionPerformed
|
|
635
|
-
}) => {
|
|
636
|
-
const [item, setItem] = (0, _element.useState)({
|
|
637
|
-
...items[0],
|
|
638
|
-
title: (0, _i18n.sprintf)( /* translators: %s: Existing template title */
|
|
639
|
-
(0, _i18n.__)('%s (Copy)'), (0, _utils.getItemTitle)(items[0]))
|
|
640
|
-
});
|
|
641
|
-
const [isCreatingPage, setIsCreatingPage] = (0, _element.useState)(false);
|
|
642
|
-
const {
|
|
643
|
-
saveEntityRecord
|
|
644
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
645
|
-
const {
|
|
646
|
-
createSuccessNotice,
|
|
647
|
-
createErrorNotice
|
|
648
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
649
|
-
async function createPage(event) {
|
|
650
|
-
event.preventDefault();
|
|
651
|
-
if (isCreatingPage) {
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
const newItemOject = {
|
|
655
|
-
status: 'draft',
|
|
656
|
-
title: item.title,
|
|
657
|
-
slug: item.title || (0, _i18n.__)('No title'),
|
|
658
|
-
comment_status: item.comment_status,
|
|
659
|
-
content: typeof item.content === 'string' ? item.content : item.content.raw,
|
|
660
|
-
excerpt: item.excerpt.raw,
|
|
661
|
-
meta: item.meta,
|
|
662
|
-
parent: item.parent,
|
|
663
|
-
password: item.password,
|
|
664
|
-
template: item.template,
|
|
665
|
-
format: item.format,
|
|
666
|
-
featured_media: item.featured_media,
|
|
667
|
-
menu_order: item.menu_order,
|
|
668
|
-
ping_status: item.ping_status
|
|
669
|
-
};
|
|
670
|
-
const assignablePropertiesPrefix = 'wp:action-assign-';
|
|
671
|
-
// Get all the properties that the current user is able to assign normally author, categories, tags,
|
|
672
|
-
// and custom taxonomies.
|
|
673
|
-
const assignableProperties = Object.keys(item?._links || {}).filter(property => property.startsWith(assignablePropertiesPrefix)).map(property => property.slice(assignablePropertiesPrefix.length));
|
|
674
|
-
assignableProperties.forEach(property => {
|
|
675
|
-
if (item[property]) {
|
|
676
|
-
newItemOject[property] = item[property];
|
|
677
|
-
}
|
|
678
|
-
});
|
|
679
|
-
setIsCreatingPage(true);
|
|
680
|
-
try {
|
|
681
|
-
const newItem = await saveEntityRecord('postType', item.type, newItemOject, {
|
|
682
|
-
throwOnError: true
|
|
683
|
-
});
|
|
684
|
-
createSuccessNotice((0, _i18n.sprintf)(
|
|
685
|
-
// translators: %s: Title of the created template e.g: "Category".
|
|
686
|
-
(0, _i18n.__)('"%s" successfully created.'), (0, _htmlEntities.decodeEntities)(newItem.title?.rendered || item.title)), {
|
|
687
|
-
id: 'duplicate-post-action',
|
|
688
|
-
type: 'snackbar'
|
|
689
|
-
});
|
|
690
|
-
if (onActionPerformed) {
|
|
691
|
-
onActionPerformed([newItem]);
|
|
692
|
-
}
|
|
693
|
-
} catch (error) {
|
|
694
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while duplicating the page.');
|
|
695
|
-
createErrorNotice(errorMessage, {
|
|
696
|
-
type: 'snackbar'
|
|
697
|
-
});
|
|
698
|
-
} finally {
|
|
699
|
-
setIsCreatingPage(false);
|
|
700
|
-
closeModal();
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
704
|
-
onSubmit: createPage,
|
|
705
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
706
|
-
spacing: 3,
|
|
707
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_dataviews.DataForm, {
|
|
708
|
-
data: item,
|
|
709
|
-
fields: fields,
|
|
710
|
-
form: form,
|
|
711
|
-
onChange: setItem
|
|
712
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
713
|
-
spacing: 2,
|
|
714
|
-
justify: "end",
|
|
715
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
716
|
-
variant: "tertiary",
|
|
717
|
-
onClick: closeModal,
|
|
718
|
-
__next40pxDefaultSize: true,
|
|
719
|
-
children: (0, _i18n.__)('Cancel')
|
|
720
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
721
|
-
variant: "primary",
|
|
722
|
-
type: "submit",
|
|
723
|
-
isBusy: isCreatingPage,
|
|
724
|
-
"aria-disabled": isCreatingPage,
|
|
725
|
-
__next40pxDefaultSize: true,
|
|
726
|
-
children: (0, _i18n._x)('Duplicate', 'action label')
|
|
727
|
-
})]
|
|
728
|
-
})]
|
|
729
|
-
})
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
}, [userCanCreatePost]);
|
|
733
|
-
};
|
|
734
|
-
const duplicatePatternAction = exports.duplicatePatternAction = {
|
|
735
|
-
id: 'duplicate-pattern',
|
|
736
|
-
label: (0, _i18n._x)('Duplicate', 'action label'),
|
|
737
|
-
isEligible: item => item.type !== _constants.TEMPLATE_PART_POST_TYPE,
|
|
738
|
-
modalHeader: (0, _i18n._x)('Duplicate pattern', 'action label'),
|
|
739
|
-
RenderModal: ({
|
|
740
|
-
items,
|
|
741
|
-
closeModal
|
|
742
|
-
}) => {
|
|
743
|
-
const [item] = items;
|
|
744
|
-
const duplicatedProps = useDuplicatePatternProps({
|
|
745
|
-
pattern: item,
|
|
746
|
-
onSuccess: () => closeModal()
|
|
747
|
-
});
|
|
748
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CreatePatternModalContents, {
|
|
749
|
-
onClose: closeModal,
|
|
750
|
-
confirmLabel: (0, _i18n._x)('Duplicate', 'action label'),
|
|
751
|
-
...duplicatedProps
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
const duplicateTemplatePartAction = exports.duplicateTemplatePartAction = {
|
|
756
|
-
id: 'duplicate-template-part',
|
|
757
|
-
label: (0, _i18n._x)('Duplicate', 'action label'),
|
|
758
|
-
isEligible: item => item.type === _constants.TEMPLATE_PART_POST_TYPE,
|
|
759
|
-
modalHeader: (0, _i18n._x)('Duplicate template part', 'action label'),
|
|
760
|
-
RenderModal: ({
|
|
761
|
-
items,
|
|
762
|
-
closeModal
|
|
763
|
-
}) => {
|
|
764
|
-
const [item] = items;
|
|
765
|
-
const blocks = (0, _element.useMemo)(() => {
|
|
766
|
-
var _item$blocks;
|
|
767
|
-
return (_item$blocks = item.blocks) !== null && _item$blocks !== void 0 ? _item$blocks : (0, _blocks.parse)(typeof item.content === 'string' ? item.content : item.content.raw, {
|
|
768
|
-
__unstableSkipMigrationLogs: true
|
|
769
|
-
});
|
|
770
|
-
}, [item.content, item.blocks]);
|
|
771
|
-
const {
|
|
772
|
-
createSuccessNotice
|
|
773
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
774
|
-
function onTemplatePartSuccess() {
|
|
775
|
-
createSuccessNotice((0, _i18n.sprintf)(
|
|
776
|
-
// translators: %s: The new template part's title e.g. 'Call to action (copy)'.
|
|
777
|
-
(0, _i18n.__)('"%s" duplicated.'), (0, _utils.getItemTitle)(item)), {
|
|
778
|
-
type: 'snackbar',
|
|
779
|
-
id: 'edit-site-patterns-success'
|
|
780
|
-
});
|
|
781
|
-
closeModal();
|
|
782
|
-
}
|
|
783
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_createTemplatePartModal.CreateTemplatePartModalContents, {
|
|
784
|
-
blocks: blocks,
|
|
785
|
-
defaultArea: item.area,
|
|
786
|
-
defaultTitle: (0, _i18n.sprintf)( /* translators: %s: Existing template part title */
|
|
787
|
-
(0, _i18n.__)('%s (Copy)'), (0, _utils.getItemTitle)(item)),
|
|
788
|
-
onCreate: onTemplatePartSuccess,
|
|
789
|
-
onError: closeModal,
|
|
790
|
-
confirmLabel: (0, _i18n._x)('Duplicate', 'action label')
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
20
|
function usePostActions({
|
|
795
21
|
postType,
|
|
796
22
|
onActionPerformed,
|
|
797
23
|
context
|
|
798
24
|
}) {
|
|
799
25
|
const {
|
|
800
|
-
defaultActions
|
|
801
|
-
postTypeObject,
|
|
802
|
-
userCanCreatePostType,
|
|
803
|
-
cachedCanUserResolvers
|
|
26
|
+
defaultActions
|
|
804
27
|
} = (0, _data.useSelect)(select => {
|
|
805
|
-
const {
|
|
806
|
-
getPostType,
|
|
807
|
-
canUser,
|
|
808
|
-
getCachedResolvers
|
|
809
|
-
} = select(_coreData.store);
|
|
810
28
|
const {
|
|
811
29
|
getEntityActions
|
|
812
30
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
813
|
-
const _postTypeObject = getPostType(postType);
|
|
814
31
|
return {
|
|
815
|
-
|
|
816
|
-
defaultActions: getEntityActions('postType', postType),
|
|
817
|
-
userCanCreatePostType: canUser('create', {
|
|
818
|
-
kind: 'postType',
|
|
819
|
-
name: postType
|
|
820
|
-
}),
|
|
821
|
-
cachedCanUserResolvers: getCachedResolvers()?.canUser
|
|
32
|
+
defaultActions: getEntityActions('postType', postType)
|
|
822
33
|
};
|
|
823
34
|
}, [postType]);
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
const isTemplateOrTemplatePart = [_constants.TEMPLATE_POST_TYPE, _constants.TEMPLATE_PART_POST_TYPE].includes(postType);
|
|
831
|
-
const isPattern = postType === _constants.PATTERN_POST_TYPE;
|
|
832
|
-
const isLoaded = !!postTypeObject;
|
|
833
|
-
const supportsRevisions = !!postTypeObject?.supports?.revisions;
|
|
834
|
-
const supportsTitle = !!postTypeObject?.supports?.title;
|
|
35
|
+
const {
|
|
36
|
+
registerPostTypeActions
|
|
37
|
+
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
38
|
+
(0, _element.useEffect)(() => {
|
|
39
|
+
registerPostTypeActions(postType);
|
|
40
|
+
}, [registerPostTypeActions, postType]);
|
|
835
41
|
return (0, _element.useMemo)(() => {
|
|
836
|
-
if (!isLoaded) {
|
|
837
|
-
return [];
|
|
838
|
-
}
|
|
839
|
-
let actions = [postTypeObject?.viewable && viewPostAction, supportsRevisions && postRevisionsAction, globalThis.IS_GUTENBERG_PLUGIN ? !isTemplateOrTemplatePart && !isPattern && duplicatePostAction : false, isTemplateOrTemplatePart && userCanCreatePostType && duplicateTemplatePartAction, isPattern && userCanCreatePostType && duplicatePatternAction, supportsTitle && renamePostActionForPostType, reorderPagesAction, !isTemplateOrTemplatePart && restorePostActionForPostType, !isTemplateOrTemplatePart && !isPattern && trashPostActionForPostType, !isTemplateOrTemplatePart && permanentlyDeletePostActionForPostType, ...defaultActions].filter(Boolean);
|
|
840
42
|
// Filter actions based on provided context. If not provided
|
|
841
43
|
// all actions are returned. We'll have a single entry for getting the actions
|
|
842
44
|
// and the consumer should provide the context to filter the actions, if needed.
|
|
843
45
|
// Actions should also provide the `context` they support, if it's specific, to
|
|
844
46
|
// compare with the provided context to get all the actions.
|
|
845
47
|
// Right now the only supported context is `list`.
|
|
846
|
-
actions =
|
|
48
|
+
const actions = defaultActions.filter(action => {
|
|
847
49
|
if (!action.context) {
|
|
848
50
|
return true;
|
|
849
51
|
}
|
|
@@ -888,9 +90,6 @@ function usePostActions({
|
|
|
888
90
|
}
|
|
889
91
|
}
|
|
890
92
|
return actions;
|
|
891
|
-
|
|
892
|
-
// when user capabilities are resolved. This makes sure the isEligible functions of actions dependent on capabilities are re-evaluated.
|
|
893
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
894
|
-
}, [defaultActions, userCanCreatePostType, isTemplateOrTemplatePart, isPattern, postTypeObject?.viewable, duplicatePostAction, reorderPagesAction, trashPostActionForPostType, restorePostActionForPostType, renamePostActionForPostType, permanentlyDeletePostActionForPostType, onActionPerformed, isLoaded, supportsRevisions, supportsTitle, context, cachedCanUserResolvers]);
|
|
93
|
+
}, [defaultActions, onActionPerformed, context]);
|
|
895
94
|
}
|
|
896
95
|
//# sourceMappingURL=actions.js.map
|