@wordpress/editor 14.5.0 → 14.7.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/README.md +37 -0
- package/build/bindings/post-meta.js +12 -10
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-manager/index.js +4 -1
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
- package/build/components/block-settings-menu/content-only-settings-menu.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 +4 -4
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor-history/redo.js +4 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +4 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/index.js +2 -3
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -1
- package/build/components/error-boundary/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/index.js +8 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +8 -7
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +5 -5
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +10 -6
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +57 -0
- package/build/components/plugin-preview-menu-item/index.js.map +1 -0
- package/build/components/post-actions/actions.js +4 -499
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +13 -25
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-card-panel/index.js +20 -20
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +4 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +14 -3
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +4 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +4 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +12 -3
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +4 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +4 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +14 -8
- package/build/components/post-publish-panel/maybe-upload-media.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 +4 -2
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +4 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/block-theme.js +13 -4
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +4 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-title/index.js +32 -46
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-url/index.js +10 -6
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +26 -14
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +5 -6
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +8 -2
- package/build/components/save-publish-panels/index.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/start-template-options/index.js +4 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +4 -1
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/template-content-panel/index.js +1 -1
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/text-editor/index.js +4 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.js +1 -6
- 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.js +2 -0
- package/build/dataviews/actions/export-pattern.js.map +1 -1
- package/build/dataviews/actions/permanently-delete-post.js +2 -0
- package/build/dataviews/actions/permanently-delete-post.js.map +1 -1
- 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 +9 -3
- package/build/dataviews/actions/reset-post.js.map +1 -1
- package/build/dataviews/actions/trash-post.js +8 -2
- package/build/dataviews/actions/trash-post.js.map +1 -1
- 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 +16 -2
- package/build/dataviews/store/private-actions.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/private-actions.js +2 -2
- package/build/store/private-actions.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 -10
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-manager/index.js +4 -1
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
- package/build-module/components/block-settings-menu/content-only-settings-menu.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 +4 -4
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +4 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +4 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/index.js +2 -3
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +4 -1
- package/build-module/components/error-boundary/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/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +8 -7
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +5 -5
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +10 -6
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +52 -0
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +5 -501
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +13 -25
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +20 -20
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +4 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +14 -3
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +4 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +4 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +12 -3
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +14 -8
- package/build-module/components/post-publish-panel/maybe-upload-media.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 +4 -2
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +13 -4
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +4 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-title/index.js +33 -47
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-url/index.js +11 -7
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +26 -14
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +6 -7
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +8 -2
- package/build-module/components/save-publish-panels/index.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/start-template-options/index.js +4 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +4 -1
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +1 -1
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +4 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +1 -6
- 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.js +2 -0
- package/build-module/dataviews/actions/export-pattern.js.map +1 -1
- package/build-module/dataviews/actions/permanently-delete-post.js +3 -0
- package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -1
- 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 +9 -3
- package/build-module/dataviews/actions/reset-post.js.map +1 -1
- package/build-module/dataviews/actions/trash-post.js +8 -2
- package/build-module/dataviews/actions/trash-post.js.map +1 -1
- 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 +16 -2
- package/build-module/dataviews/store/private-actions.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/private-actions.js +2 -2
- package/build-module/store/private-actions.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 +14 -38
- package/build-style/style.css +14 -38
- package/build-types/bindings/post-meta.d.ts +0 -3
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
- package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
- package/build-types/components/editor-history/redo.d.ts.map +1 -1
- package/build-types/components/editor-history/undo.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/error-boundary/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/index.d.ts +1 -0
- package/build-types/components/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/plugin-preview-menu-item/index.d.ts +3 -0
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
- 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-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-format/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.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.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-taxonomies/most-used-terms.d.ts.map +1 -1
- package/build-types/components/post-template/block-theme.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.d.ts.map +1 -1
- package/build-types/components/template-content-panel/index.d.ts.map +1 -1
- package/build-types/components/text-editor/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.d.ts.map +1 -1
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -1
- 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/trash-post.d.ts.map +1 -1
- 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.map +1 -1
- package/build-types/dataviews/types.d.ts +57 -8
- package/build-types/dataviews/types.d.ts.map +1 -1
- package/build-types/store/private-actions.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 +14 -8
- package/src/components/block-manager/index.js +2 -0
- package/src/components/block-manager/style.scss +2 -2
- package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
- package/src/components/create-template-part-modal/index.js +1 -0
- package/src/components/create-template-part-modal/style.scss +1 -1
- package/src/components/document-bar/index.js +4 -4
- package/src/components/document-outline/style.scss +1 -1
- package/src/components/editor-history/redo.js +2 -0
- package/src/components/editor-history/undo.js +2 -0
- package/src/components/editor-interface/index.js +2 -4
- package/src/components/error-boundary/index.js +6 -1
- 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/style.scss +6 -3
- package/src/components/index.js +1 -0
- package/src/components/inserter-sidebar/index.js +12 -5
- package/src/components/local-autosave-monitor/index.js +6 -6
- package/src/components/page-attributes/parent.js +18 -13
- package/src/components/plugin-preview-menu-item/index.js +52 -0
- package/src/components/post-actions/actions.js +5 -616
- package/src/components/post-actions/index.js +24 -34
- package/src/components/post-card-panel/index.js +28 -27
- package/src/components/post-card-panel/style.scss +1 -1
- package/src/components/post-discussion/style.scss +0 -9
- package/src/components/post-excerpt/panel.js +2 -0
- package/src/components/post-featured-image/index.js +8 -0
- package/src/components/post-featured-image/style.scss +1 -2
- package/src/components/post-format/index.js +2 -0
- package/src/components/post-format/style.scss +0 -6
- package/src/components/post-last-revision/index.js +2 -0
- package/src/components/post-locked-modal/index.js +14 -2
- package/src/components/post-locked-modal/style.scss +1 -1
- package/src/components/post-publish-panel/index.js +2 -0
- package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -0
- package/src/components/post-publish-panel/maybe-upload-media.js +37 -29
- package/src/components/post-publish-panel/postpublish.js +8 -2
- package/src/components/post-publish-panel/style.scss +3 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -8
- package/src/components/post-slug/index.js +1 -0
- package/src/components/post-status/index.js +3 -2
- package/src/components/post-status/style.scss +0 -19
- package/src/components/post-taxonomies/hierarchical-term-selector.js +5 -1
- package/src/components/post-taxonomies/most-used-terms.js +2 -0
- package/src/components/post-template/block-theme.js +15 -9
- package/src/components/post-template/classic-theme.js +2 -0
- package/src/components/post-title/index.js +30 -41
- package/src/components/post-url/index.js +17 -9
- package/src/components/preview-dropdown/index.js +28 -20
- package/src/components/provider/use-block-editor-settings.js +5 -5
- package/src/components/resizable-editor/style.scss +2 -2
- package/src/components/save-publish-panels/index.js +4 -0
- package/src/components/save-publish-panels/style.scss +3 -3
- package/src/components/sidebar/post-summary.js +20 -16
- package/src/components/site-discussion/style.scss +0 -14
- package/src/components/start-template-options/index.js +6 -1
- package/src/components/table-of-contents/index.js +2 -0
- package/src/components/template-content-panel/index.js +4 -1
- package/src/components/text-editor/index.js +2 -0
- package/src/components/visual-editor/index.js +2 -9
- 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.tsx +2 -0
- package/src/dataviews/actions/permanently-delete-post.tsx +2 -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 +6 -1
- package/src/dataviews/actions/trash-post.tsx +4 -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 +42 -1
- package/src/dataviews/types.ts +47 -6
- package/src/private-apis.js +2 -2
- package/src/store/private-actions.js +4 -2
- package/src/store/utils/is-template-revertable.js +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
5
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import type { Action } from '@wordpress/dataviews';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import type { Post } from '../types';
|
|
12
|
+
|
|
13
|
+
const viewPostRevisions: Action< Post > = {
|
|
14
|
+
id: 'view-post-revisions',
|
|
15
|
+
context: 'list',
|
|
16
|
+
label( items ) {
|
|
17
|
+
const revisionsCount =
|
|
18
|
+
items[ 0 ]._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;
|
|
19
|
+
return sprintf(
|
|
20
|
+
/* translators: %s: number of revisions */
|
|
21
|
+
__( 'View revisions (%s)' ),
|
|
22
|
+
revisionsCount
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
isEligible( post ) {
|
|
26
|
+
if ( post.status === 'trash' ) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const lastRevisionId =
|
|
30
|
+
post?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;
|
|
31
|
+
const revisionsCount =
|
|
32
|
+
post?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;
|
|
33
|
+
return !! lastRevisionId && revisionsCount > 1;
|
|
34
|
+
},
|
|
35
|
+
callback( posts, { onActionPerformed } ) {
|
|
36
|
+
const post = posts[ 0 ];
|
|
37
|
+
const href = addQueryArgs( 'revision.php', {
|
|
38
|
+
revision: post?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id,
|
|
39
|
+
} );
|
|
40
|
+
document.location.href = href;
|
|
41
|
+
if ( onActionPerformed ) {
|
|
42
|
+
onActionPerformed( posts );
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default viewPostRevisions;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { external } from '@wordpress/icons';
|
|
5
|
+
import { _x } from '@wordpress/i18n';
|
|
6
|
+
import type { Action } from '@wordpress/dataviews';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import type { BasePost } from '../types';
|
|
12
|
+
|
|
13
|
+
const viewPost: Action< BasePost > = {
|
|
14
|
+
id: 'view-post',
|
|
15
|
+
label: _x( 'View', 'verb' ),
|
|
16
|
+
isPrimary: true,
|
|
17
|
+
icon: external,
|
|
18
|
+
isEligible( post ) {
|
|
19
|
+
return post.status !== 'trash';
|
|
20
|
+
},
|
|
21
|
+
callback( posts, { onActionPerformed } ) {
|
|
22
|
+
const post = posts[ 0 ];
|
|
23
|
+
window.open( post?.link, '_blank' );
|
|
24
|
+
if ( onActionPerformed ) {
|
|
25
|
+
onActionPerformed( posts );
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default viewPost;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import type { Field } from '@wordpress/dataviews';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import type { BasePost } from '../types';
|
|
11
|
+
import { getItemTitle } from '../actions/utils';
|
|
12
|
+
|
|
13
|
+
export const titleField: Field< BasePost > = {
|
|
14
|
+
type: 'text',
|
|
15
|
+
id: 'title',
|
|
16
|
+
label: __( 'Title' ),
|
|
17
|
+
placeholder: __( 'No title' ),
|
|
18
|
+
getValue: ( { item } ) => getItemTitle( item ),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const orderField: Field< BasePost > = {
|
|
22
|
+
type: 'integer',
|
|
23
|
+
id: 'menu_order',
|
|
24
|
+
label: __( 'Order' ),
|
|
25
|
+
description: __( 'Determines the order of pages.' ),
|
|
26
|
+
};
|
|
@@ -9,14 +9,21 @@ import { doAction } from '@wordpress/hooks';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import deletePost from '../actions/delete-post';
|
|
12
|
+
import duplicatePattern from '../actions/duplicate-pattern';
|
|
13
|
+
import duplicateTemplatePart from '../actions/duplicate-template-part';
|
|
12
14
|
import exportPattern from '../actions/export-pattern';
|
|
13
15
|
import resetPost from '../actions/reset-post';
|
|
14
16
|
import trashPost from '../actions/trash-post';
|
|
15
17
|
import permanentlyDeletePost from '../actions/permanently-delete-post';
|
|
18
|
+
import renamePost from '../actions/rename-post';
|
|
19
|
+
import reorderPage from '../actions/reorder-page';
|
|
16
20
|
import restorePost from '../actions/restore-post';
|
|
17
21
|
import type { PostType } from '../types';
|
|
18
22
|
import { store as editorStore } from '../../store';
|
|
19
23
|
import { unlock } from '../../lock-unlock';
|
|
24
|
+
import duplicatePost from '../actions/duplicate-post';
|
|
25
|
+
import viewPostRevisions from '../actions/view-post-revisions';
|
|
26
|
+
import viewPost from '../actions/view-post';
|
|
20
27
|
|
|
21
28
|
export function registerEntityAction< Item >(
|
|
22
29
|
kind: string,
|
|
@@ -72,7 +79,41 @@ export const registerPostTypeActions =
|
|
|
72
79
|
.resolveSelect( coreStore )
|
|
73
80
|
.getPostType( postType ) ) as PostType;
|
|
74
81
|
|
|
82
|
+
const canCreate = await registry
|
|
83
|
+
.resolveSelect( coreStore )
|
|
84
|
+
.canUser( 'create', {
|
|
85
|
+
kind: 'postType',
|
|
86
|
+
name: postType,
|
|
87
|
+
} );
|
|
88
|
+
const currentTheme = await registry
|
|
89
|
+
.resolveSelect( coreStore )
|
|
90
|
+
.getCurrentTheme();
|
|
91
|
+
|
|
75
92
|
const actions = [
|
|
93
|
+
postTypeConfig.viewable ? viewPost : undefined,
|
|
94
|
+
!! postTypeConfig?.supports?.revisions
|
|
95
|
+
? viewPostRevisions
|
|
96
|
+
: undefined,
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
globalThis.IS_GUTENBERG_PLUGIN
|
|
99
|
+
? ! [ 'wp_template', 'wp_block', 'wp_template_part' ].includes(
|
|
100
|
+
postTypeConfig.slug
|
|
101
|
+
) &&
|
|
102
|
+
canCreate &&
|
|
103
|
+
duplicatePost
|
|
104
|
+
: undefined,
|
|
105
|
+
postTypeConfig.slug === 'wp_template_part' &&
|
|
106
|
+
canCreate &&
|
|
107
|
+
currentTheme?.is_block_theme
|
|
108
|
+
? duplicateTemplatePart
|
|
109
|
+
: undefined,
|
|
110
|
+
canCreate && postTypeConfig.slug === 'wp_block'
|
|
111
|
+
? duplicatePattern
|
|
112
|
+
: undefined,
|
|
113
|
+
postTypeConfig.supports?.title ? renamePost : undefined,
|
|
114
|
+
postTypeConfig?.supports?.[ 'page-attributes' ]
|
|
115
|
+
? reorderPage
|
|
116
|
+
: undefined,
|
|
76
117
|
postTypeConfig.slug === 'wp_block' ? exportPattern : undefined,
|
|
77
118
|
resetPost,
|
|
78
119
|
restorePost,
|
|
@@ -83,7 +124,7 @@ export const registerPostTypeActions =
|
|
|
83
124
|
|
|
84
125
|
registry.batch( () => {
|
|
85
126
|
actions.forEach( ( action ) => {
|
|
86
|
-
if ( action
|
|
127
|
+
if ( ! action ) {
|
|
87
128
|
return;
|
|
88
129
|
}
|
|
89
130
|
unlock( registry.dispatch( editorStore ) ).registerEntityAction(
|
package/src/dataviews/types.ts
CHANGED
|
@@ -7,27 +7,62 @@ type PostStatus =
|
|
|
7
7
|
| 'auto-draft'
|
|
8
8
|
| 'trash';
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface CommonPost {
|
|
11
11
|
status?: PostStatus;
|
|
12
12
|
title: string | { rendered: string } | { raw: string };
|
|
13
|
+
content: string | { raw: string; rendered: string };
|
|
13
14
|
type: string;
|
|
14
15
|
id: string | number;
|
|
16
|
+
blocks?: Object[];
|
|
17
|
+
_links?: Links;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
|
|
20
|
+
interface Links {
|
|
21
|
+
'predecessor-version'?: { href: string; id: number }[];
|
|
22
|
+
'version-history'?: { href: string; count: number }[];
|
|
23
|
+
[ key: string ]: { href: string }[] | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface BasePost extends CommonPost {
|
|
27
|
+
comment_status?: 'open' | 'closed';
|
|
28
|
+
excerpt?: string | { raw: string; rendered: string };
|
|
29
|
+
meta?: Record< string, any >;
|
|
30
|
+
parent?: number;
|
|
31
|
+
password?: string;
|
|
32
|
+
template?: string;
|
|
33
|
+
format?: string;
|
|
34
|
+
featured_media?: number;
|
|
35
|
+
menu_order?: number;
|
|
36
|
+
ping_status?: 'open' | 'closed';
|
|
37
|
+
link?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Template extends CommonPost {
|
|
41
|
+
type: 'wp_template';
|
|
42
|
+
is_custom: boolean;
|
|
18
43
|
source: string;
|
|
44
|
+
origin: string;
|
|
45
|
+
plugin?: string;
|
|
19
46
|
has_theme_file: boolean;
|
|
20
47
|
id: string;
|
|
21
48
|
}
|
|
22
49
|
|
|
23
|
-
export interface
|
|
50
|
+
export interface TemplatePart extends CommonPost {
|
|
51
|
+
type: 'wp_template_part';
|
|
52
|
+
source: string;
|
|
53
|
+
origin: string;
|
|
54
|
+
has_theme_file: boolean;
|
|
55
|
+
id: string;
|
|
56
|
+
area: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Pattern extends CommonPost {
|
|
24
60
|
slug: string;
|
|
25
61
|
title: { raw: string };
|
|
26
|
-
content: { raw: string } | string;
|
|
27
62
|
wp_pattern_sync_status: string;
|
|
28
63
|
}
|
|
29
64
|
|
|
30
|
-
export type Post =
|
|
65
|
+
export type Post = Template | TemplatePart | Pattern | BasePost;
|
|
31
66
|
|
|
32
67
|
export type PostWithPermissions = Post & {
|
|
33
68
|
permissions: {
|
|
@@ -38,6 +73,12 @@ export type PostWithPermissions = Post & {
|
|
|
38
73
|
|
|
39
74
|
export interface PostType {
|
|
40
75
|
slug: string;
|
|
76
|
+
viewable: boolean;
|
|
77
|
+
supports?: {
|
|
78
|
+
'page-attributes'?: boolean;
|
|
79
|
+
title?: boolean;
|
|
80
|
+
revisions?: boolean;
|
|
81
|
+
};
|
|
41
82
|
}
|
|
42
83
|
|
|
43
84
|
// Will be unnecessary after typescript 5.0 upgrade.
|
package/src/private-apis.js
CHANGED
|
@@ -9,11 +9,11 @@ import * as interfaceApis from '@wordpress/interface';
|
|
|
9
9
|
import { lock } from './lock-unlock';
|
|
10
10
|
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
|
|
11
11
|
import EditorContentSlotFill from './components/editor-interface/content-slot-fill';
|
|
12
|
-
import useBlockEditorSettings from './components/provider/use-block-editor-settings';
|
|
13
12
|
import BackButton from './components/header/back-button';
|
|
14
13
|
import CreateTemplatePartModal from './components/create-template-part-modal';
|
|
15
14
|
import Editor from './components/editor';
|
|
16
15
|
import PluginPostExcerpt from './components/post-excerpt/plugin';
|
|
16
|
+
import PostCardPanel from './components/post-card-panel';
|
|
17
17
|
import PreferencesModal from './components/preferences-modal';
|
|
18
18
|
import { usePostActions } from './components/post-actions/actions';
|
|
19
19
|
import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
|
|
@@ -40,6 +40,7 @@ lock( privateApis, {
|
|
|
40
40
|
GlobalStylesProvider,
|
|
41
41
|
mergeBaseAndUserConfigs,
|
|
42
42
|
PluginPostExcerpt,
|
|
43
|
+
PostCardPanel,
|
|
43
44
|
PreferencesModal,
|
|
44
45
|
usePostActions,
|
|
45
46
|
ToolsMoreMenuGroup,
|
|
@@ -49,7 +50,6 @@ lock( privateApis, {
|
|
|
49
50
|
bootstrapBlockBindingsSourcesFromServer,
|
|
50
51
|
|
|
51
52
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
52
|
-
useBlockEditorSettings,
|
|
53
53
|
interfaceStore,
|
|
54
54
|
...remainingInterfaceApis,
|
|
55
55
|
} );
|
|
@@ -137,7 +137,9 @@ export const saveDirtyEntities =
|
|
|
137
137
|
{ kind: 'postType', name: 'wp_navigation' },
|
|
138
138
|
];
|
|
139
139
|
const saveNoticeId = 'site-editor-save-success';
|
|
140
|
-
const homeUrl = registry
|
|
140
|
+
const homeUrl = registry
|
|
141
|
+
.select( coreStore )
|
|
142
|
+
.getEntityRecord( 'root', '__unstableBase' )?.home;
|
|
141
143
|
registry.dispatch( noticesStore ).removeNotice( saveNoticeId );
|
|
142
144
|
const entitiesToSave = dirtyEntityRecords.filter(
|
|
143
145
|
( { kind, name, key, property } ) => {
|
|
@@ -269,7 +271,7 @@ export const revertTemplate =
|
|
|
269
271
|
|
|
270
272
|
const fileTemplatePath = addQueryArgs(
|
|
271
273
|
`${ templateEntityConfig.baseURL }/${ template.id }`,
|
|
272
|
-
{ context: 'edit', source:
|
|
274
|
+
{ context: 'edit', source: template.origin }
|
|
273
275
|
);
|
|
274
276
|
|
|
275
277
|
const fileTemplate = await apiFetch( { path: fileTemplatePath } );
|
|
@@ -18,6 +18,7 @@ export default function isTemplateRevertable( templateOrTemplatePart ) {
|
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom &&
|
|
21
|
-
templateOrTemplatePart
|
|
21
|
+
( Boolean( templateOrTemplatePart?.plugin ) ||
|
|
22
|
+
templateOrTemplatePart?.has_theme_file )
|
|
22
23
|
);
|
|
23
24
|
}
|