@wordpress/editor 14.6.0 → 14.7.1-next.1f6eadc42.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 +2 -0
- package/README.md +41 -0
- package/build/bindings/post-meta.js +11 -8
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/block-manager/index.js +1 -0
- 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/document-bar/index.js +4 -4
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/editor/index.js +2 -2
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-history/redo.js +1 -0
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +1 -0
- 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 +1 -0
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles-provider/index.js +3 -4
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +6 -4
- package/build/components/header/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 +5 -10
- 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 +4 -1
- 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/index.js +5 -8
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-featured-image/index.js +3 -0
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -0
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -0
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +6 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -0
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +156 -33
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +79 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -0
- 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 +4 -1
- 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-trash/check.js +2 -1
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +22 -8
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-url/index.js +4 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +28 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +11 -51
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +34 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +14 -10
- 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 +3 -0
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/start-page-options/index.js +16 -19
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +1 -0
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +1 -0
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/text-editor/index.js +1 -0
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.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/components/zoom-out-toggle/index.js +38 -0
- package/build/components/zoom-out-toggle/index.js.map +1 -0
- package/build/dataviews/actions/reset-post.js +2 -0
- package/build/dataviews/actions/reset-post.js.map +1 -1
- package/build/dataviews/actions/trash-post.js +2 -0
- package/build/dataviews/actions/trash-post.js.map +1 -1
- package/build/dataviews/store/private-actions.js +4 -10
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/private-apis.js +0 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +1 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +7 -3
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/post-meta.js +11 -8
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/block-manager/index.js +1 -0
- 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/document-bar/index.js +4 -4
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +1 -0
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +1 -0
- 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 +1 -0
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +3 -4
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -4
- package/build-module/components/header/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 +5 -10
- 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 +4 -1
- 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/index.js +5 -8
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +3 -0
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -0
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -0
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +6 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -0
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- 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 +155 -32
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +72 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -0
- 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 +4 -1
- 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-trash/check.js +2 -1
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +23 -11
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +4 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +28 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +11 -51
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +35 -9
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +15 -11
- 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 +3 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/start-page-options/index.js +17 -21
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -0
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +1 -0
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -0
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.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/components/zoom-out-toggle/index.js +31 -0
- package/build-module/components/zoom-out-toggle/index.js.map +1 -0
- package/build-module/dataviews/actions/reset-post.js +2 -0
- package/build-module/dataviews/actions/reset-post.js.map +1 -1
- package/build-module/dataviews/actions/trash-post.js +2 -0
- package/build-module/dataviews/actions/trash-post.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +2 -8
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/private-apis.js +0 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +1 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +6 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +14 -13
- package/build-style/style.css +14 -13
- 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/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/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/back-button.d.ts.map +1 -1
- package/build-types/components/header/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/more-menu/tools-more-menu-group.d.ts.map +1 -1
- package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
- package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
- package/build-types/components/plugin-pre-publish-panel/index.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/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/plugin.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 +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/media-util.d.ts +20 -0
- package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -0
- package/build-types/components/post-status/index.d.ts.map +1 -1
- 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-trash/check.d.ts.map +1 -1
- package/build-types/components/post-trash/index.d.ts +4 -1
- package/build-types/components/post-trash/index.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/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-page-options/index.d.ts +1 -0
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/start-template-options/index.d.ts.map +1 -1
- package/build-types/components/text-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
- package/build-types/components/zoom-out-toggle/index.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/store/private-actions.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +8 -8
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +37 -36
- package/src/bindings/post-meta.js +12 -6
- package/src/components/block-manager/index.js +1 -0
- package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
- 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/index.js +1 -1
- package/src/components/editor-history/redo.js +1 -0
- package/src/components/editor-history/undo.js +1 -0
- package/src/components/editor-interface/index.js +2 -4
- package/src/components/error-boundary/index.js +1 -1
- package/src/components/global-styles-provider/index.js +11 -7
- package/src/components/header/index.js +12 -3
- package/src/components/header/style.scss +6 -3
- package/src/components/index.js +1 -0
- package/src/components/inserter-sidebar/index.js +6 -8
- package/src/components/local-autosave-monitor/index.js +6 -6
- package/src/components/page-attributes/parent.js +5 -4
- package/src/components/plugin-preview-menu-item/index.js +52 -0
- package/src/components/post-actions/index.js +8 -14
- package/src/components/post-card-panel/style.scss +1 -1
- package/src/components/post-excerpt/panel.js +1 -1
- package/src/components/post-featured-image/index.js +3 -0
- package/src/components/post-featured-image/style.scss +2 -7
- package/src/components/post-format/index.js +1 -0
- package/src/components/post-last-revision/index.js +1 -0
- package/src/components/post-locked-modal/index.js +12 -2
- package/src/components/post-locked-modal/style.scss +1 -1
- package/src/components/post-publish-panel/index.js +1 -0
- package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -0
- package/src/components/post-publish-panel/maybe-upload-media.js +144 -36
- package/src/components/post-publish-panel/media-util.js +87 -0
- package/src/components/post-publish-panel/style.scss +3 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-publish-panel/test/media-util.js +118 -0
- package/src/components/post-status/index.js +3 -2
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -0
- 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-trash/check.js +5 -2
- package/src/components/post-trash/index.js +23 -12
- package/src/components/post-url/index.js +2 -0
- package/src/components/preferences-modal/index.js +227 -172
- package/src/components/preview-dropdown/index.js +22 -72
- package/src/components/provider/index.js +42 -10
- package/src/components/provider/use-block-editor-settings.js +16 -11
- package/src/components/resizable-editor/style.scss +2 -2
- package/src/components/save-publish-panels/index.js +4 -0
- package/src/components/sidebar/post-summary.js +4 -0
- package/src/components/start-page-options/index.js +28 -26
- package/src/components/start-template-options/index.js +5 -1
- package/src/components/table-of-contents/index.js +1 -0
- package/src/components/text-editor/index.js +1 -0
- package/src/components/text-editor/style.scss +1 -1
- package/src/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/src/components/visual-editor/index.js +2 -9
- package/src/components/zoom-out-toggle/index.js +34 -0
- package/src/dataviews/actions/reset-post.tsx +2 -0
- package/src/dataviews/actions/trash-post.tsx +2 -0
- package/src/dataviews/store/private-actions.ts +10 -8
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +3 -1
- package/src/store/selectors.js +9 -3
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/duplicate-pattern.js +0 -48
- package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.js +0 -146
- package/build/dataviews/actions/duplicate-post.js.map +0 -1
- package/build/dataviews/actions/duplicate-post.native.js +0 -9
- package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build/dataviews/actions/export-pattern.js +0 -55
- package/build/dataviews/actions/export-pattern.js.map +0 -1
- package/build/dataviews/actions/export-pattern.native.js +0 -9
- package/build/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build/dataviews/actions/permanently-delete-post.js +0 -107
- package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build/dataviews/actions/reorder-page.js +0 -116
- package/build/dataviews/actions/reorder-page.js.map +0 -1
- package/build/dataviews/actions/reorder-page.native.js +0 -9
- package/build/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build/dataviews/actions/view-post-revisions.js +0 -49
- package/build/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build/dataviews/actions/view-post.js +0 -36
- package/build/dataviews/actions/view-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
- package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.js +0 -139
- package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
- package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
- package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.js +0 -49
- package/build-module/dataviews/actions/export-pattern.js.map +0 -1
- package/build-module/dataviews/actions/export-pattern.native.js +0 -3
- package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
- package/build-module/dataviews/actions/permanently-delete-post.js +0 -99
- package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.js +0 -111
- package/build-module/dataviews/actions/reorder-page.js.map +0 -1
- package/build-module/dataviews/actions/reorder-page.native.js +0 -3
- package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
- package/build-module/dataviews/actions/view-post-revisions.js +0 -43
- package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
- package/build-module/dataviews/actions/view-post.js +0 -30
- package/build-module/dataviews/actions/view-post.js.map +0 -1
- package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
- package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
- package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
- package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
- package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
- package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
- package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
- package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
- package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
- package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
- package/build-types/dataviews/actions/view-post.d.ts +0 -8
- package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
- package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
- package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
- package/src/dataviews/actions/duplicate-post.tsx +0 -174
- package/src/dataviews/actions/export-pattern.native.tsx +0 -3
- package/src/dataviews/actions/export-pattern.tsx +0 -74
- package/src/dataviews/actions/permanently-delete-post.tsx +0 -116
- package/src/dataviews/actions/reorder-page.native.tsx +0 -3
- package/src/dataviews/actions/reorder-page.tsx +0 -125
- package/src/dataviews/actions/view-post-revisions.tsx +0 -47
- package/src/dataviews/actions/view-post.tsx +0 -30
|
@@ -19,9 +19,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
import { desktop, mobile, tablet, external } from '@wordpress/icons';
|
|
20
20
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
21
21
|
import { store as coreStore } from '@wordpress/core-data';
|
|
22
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
23
22
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
|
-
import {
|
|
23
|
+
import { ActionItem } from '@wordpress/interface';
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* Internal dependencies
|
|
@@ -30,49 +29,21 @@ import { store as editorStore } from '../../store';
|
|
|
30
29
|
import PostPreviewButton from '../post-preview-button';
|
|
31
30
|
|
|
32
31
|
export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
deviceType: getDeviceType(),
|
|
48
|
-
editorMode: __unstableGetEditorMode(),
|
|
49
|
-
homeUrl: getUnstableBase()?.home,
|
|
50
|
-
isTemplate: _currentPostType === 'wp_template',
|
|
51
|
-
isViewable: getPostType( _currentPostType )?.viewable ?? false,
|
|
52
|
-
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
53
|
-
};
|
|
54
|
-
}, [] );
|
|
32
|
+
const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =
|
|
33
|
+
useSelect( ( select ) => {
|
|
34
|
+
const { getDeviceType, getCurrentPostType } = select( editorStore );
|
|
35
|
+
const { getEntityRecord, getPostType } = select( coreStore );
|
|
36
|
+
const { get } = select( preferencesStore );
|
|
37
|
+
const _currentPostType = getCurrentPostType();
|
|
38
|
+
return {
|
|
39
|
+
deviceType: getDeviceType(),
|
|
40
|
+
homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
|
|
41
|
+
isTemplate: _currentPostType === 'wp_template',
|
|
42
|
+
isViewable: getPostType( _currentPostType )?.viewable ?? false,
|
|
43
|
+
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
44
|
+
};
|
|
45
|
+
}, [] );
|
|
55
46
|
const { setDeviceType } = useDispatch( editorStore );
|
|
56
|
-
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Save the original editing mode in a ref to restore it when we exit zoom out.
|
|
60
|
-
*/
|
|
61
|
-
const originalEditingMode = useRef( editorMode );
|
|
62
|
-
useEffect( () => {
|
|
63
|
-
if ( editorMode !== 'zoom-out' ) {
|
|
64
|
-
originalEditingMode.current = editorMode;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return () => {
|
|
68
|
-
if (
|
|
69
|
-
editorMode === 'zoom-out' &&
|
|
70
|
-
editorMode !== originalEditingMode.current
|
|
71
|
-
) {
|
|
72
|
-
__unstableSetEditorMode( originalEditingMode.current );
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}, [ editorMode, __unstableSetEditorMode ] );
|
|
76
47
|
|
|
77
48
|
const isMobile = useViewportMatch( 'medium', '<' );
|
|
78
49
|
if ( isMobile ) {
|
|
@@ -111,11 +82,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
111
82
|
label: __( 'Desktop' ),
|
|
112
83
|
icon: desktop,
|
|
113
84
|
},
|
|
114
|
-
{
|
|
115
|
-
value: 'ZoomOut',
|
|
116
|
-
label: __( 'Desktop (50%)' ),
|
|
117
|
-
icon: desktop,
|
|
118
|
-
},
|
|
119
85
|
{
|
|
120
86
|
value: 'Tablet',
|
|
121
87
|
label: __( 'Tablet' ),
|
|
@@ -128,26 +94,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
128
94
|
},
|
|
129
95
|
];
|
|
130
96
|
|
|
131
|
-
const previewValue = editorMode === 'zoom-out' ? 'ZoomOut' : deviceType;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Handles the selection of a device type.
|
|
135
|
-
*
|
|
136
|
-
* @param {string} value The device type.
|
|
137
|
-
*/
|
|
138
|
-
const onSelect = ( value ) => {
|
|
139
|
-
let newEditorMode = originalEditingMode.current;
|
|
140
|
-
|
|
141
|
-
if ( value === 'ZoomOut' ) {
|
|
142
|
-
newEditorMode = 'zoom-out';
|
|
143
|
-
setDeviceType( 'Desktop' );
|
|
144
|
-
} else {
|
|
145
|
-
setDeviceType( value );
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
__unstableSetEditorMode( newEditorMode );
|
|
149
|
-
};
|
|
150
|
-
|
|
151
97
|
return (
|
|
152
98
|
<DropdownMenu
|
|
153
99
|
className={ clsx(
|
|
@@ -158,7 +104,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
158
104
|
toggleProps={ toggleProps }
|
|
159
105
|
menuProps={ menuProps }
|
|
160
106
|
icon={ deviceIcons[ deviceType.toLowerCase() ] }
|
|
161
|
-
text={ editorMode === 'zoom-out' ? __( '50%' ) : undefined }
|
|
162
107
|
label={ __( 'View' ) }
|
|
163
108
|
disableOpenOnArrowDown={ disabled }
|
|
164
109
|
>
|
|
@@ -167,8 +112,8 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
167
112
|
<MenuGroup>
|
|
168
113
|
<MenuItemsChoice
|
|
169
114
|
choices={ choices }
|
|
170
|
-
value={
|
|
171
|
-
onSelect={
|
|
115
|
+
value={ deviceType }
|
|
116
|
+
onSelect={ setDeviceType }
|
|
172
117
|
/>
|
|
173
118
|
</MenuGroup>
|
|
174
119
|
{ isTemplate && (
|
|
@@ -206,6 +151,11 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
206
151
|
/>
|
|
207
152
|
</MenuGroup>
|
|
208
153
|
) }
|
|
154
|
+
<ActionItem.Slot
|
|
155
|
+
name="core/plugin-preview-menu"
|
|
156
|
+
as={ MenuGroup }
|
|
157
|
+
fillProps={ { onClick: onClose } }
|
|
158
|
+
/>
|
|
209
159
|
</>
|
|
210
160
|
) }
|
|
211
161
|
</DropdownMenu>
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
import { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';
|
|
5
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
EntityProvider,
|
|
9
|
+
useEntityBlockEditor,
|
|
10
|
+
store as coreStore,
|
|
11
|
+
} from '@wordpress/core-data';
|
|
8
12
|
import {
|
|
9
13
|
BlockEditorProvider,
|
|
10
14
|
BlockContextProvider,
|
|
@@ -48,7 +52,6 @@ const noop = () => {};
|
|
|
48
52
|
*/
|
|
49
53
|
const NON_CONTEXTUAL_POST_TYPES = [
|
|
50
54
|
'wp_block',
|
|
51
|
-
'wp_template',
|
|
52
55
|
'wp_navigation',
|
|
53
56
|
'wp_template_part',
|
|
54
57
|
];
|
|
@@ -161,31 +164,59 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
161
164
|
BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
|
|
162
165
|
__unstableTemplate: template,
|
|
163
166
|
} ) => {
|
|
164
|
-
const { editorSettings, selection, isReady, mode } =
|
|
165
|
-
( select ) => {
|
|
167
|
+
const { editorSettings, selection, isReady, mode, postTypes } =
|
|
168
|
+
useSelect( ( select ) => {
|
|
166
169
|
const {
|
|
167
170
|
getEditorSettings,
|
|
168
171
|
getEditorSelection,
|
|
169
172
|
getRenderingMode,
|
|
170
173
|
__unstableIsEditorReady,
|
|
171
174
|
} = select( editorStore );
|
|
175
|
+
const { getPostTypes } = select( coreStore );
|
|
176
|
+
|
|
172
177
|
return {
|
|
173
178
|
editorSettings: getEditorSettings(),
|
|
174
179
|
isReady: __unstableIsEditorReady(),
|
|
175
180
|
mode: getRenderingMode(),
|
|
176
181
|
selection: getEditorSelection(),
|
|
182
|
+
postTypes: getPostTypes( { per_page: -1 } ),
|
|
177
183
|
};
|
|
178
|
-
},
|
|
179
|
-
[]
|
|
180
|
-
);
|
|
184
|
+
}, [] );
|
|
181
185
|
const shouldRenderTemplate = !! template && mode !== 'post-only';
|
|
182
186
|
const rootLevelPost = shouldRenderTemplate ? template : post;
|
|
183
187
|
const defaultBlockContext = useMemo( () => {
|
|
184
|
-
const postContext =
|
|
188
|
+
const postContext = {};
|
|
189
|
+
// If it is a template, try to inherit the post type from the slug.
|
|
190
|
+
if ( post.type === 'wp_template' ) {
|
|
191
|
+
if ( ! post.is_custom ) {
|
|
192
|
+
const [ kind ] = post.slug.split( '-' );
|
|
193
|
+
switch ( kind ) {
|
|
194
|
+
case 'page':
|
|
195
|
+
postContext.postType = 'page';
|
|
196
|
+
break;
|
|
197
|
+
case 'single':
|
|
198
|
+
// Infer the post type from the slug.
|
|
199
|
+
const postTypesSlugs =
|
|
200
|
+
postTypes?.map( ( entity ) => entity.slug ) ||
|
|
201
|
+
[];
|
|
202
|
+
const match = post.slug.match(
|
|
203
|
+
`^single-(${ postTypesSlugs.join(
|
|
204
|
+
'|'
|
|
205
|
+
) })(?:-.+)?$`
|
|
206
|
+
);
|
|
207
|
+
if ( match ) {
|
|
208
|
+
postContext.postType = match[ 1 ];
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} else if (
|
|
185
214
|
! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||
|
|
186
215
|
shouldRenderTemplate
|
|
187
|
-
|
|
188
|
-
|
|
216
|
+
) {
|
|
217
|
+
postContext.postId = post.id;
|
|
218
|
+
postContext.postType = post.type;
|
|
219
|
+
}
|
|
189
220
|
|
|
190
221
|
return {
|
|
191
222
|
...postContext,
|
|
@@ -200,6 +231,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
200
231
|
post.type,
|
|
201
232
|
rootLevelPost.type,
|
|
202
233
|
rootLevelPost.slug,
|
|
234
|
+
postTypes,
|
|
203
235
|
] );
|
|
204
236
|
const { id, type } = rootLevelPost;
|
|
205
237
|
const blockEditorSettings = useBlockEditorSettings(
|
|
@@ -23,18 +23,23 @@ import {
|
|
|
23
23
|
import inserterMediaCategories from '../media-categories';
|
|
24
24
|
import { mediaUpload } from '../../utils';
|
|
25
25
|
import { store as editorStore } from '../../store';
|
|
26
|
-
import {
|
|
26
|
+
import { unlock } from '../../lock-unlock';
|
|
27
27
|
import { useGlobalStylesContext } from '../global-styles-provider';
|
|
28
28
|
|
|
29
|
-
const EMPTY_BLOCKS_LIST = [];
|
|
30
29
|
const EMPTY_OBJECT = {};
|
|
31
30
|
|
|
32
31
|
function __experimentalReusableBlocksSelect( select ) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const { getEntityRecords, hasFinishedResolution } = select( coreStore );
|
|
33
|
+
const reusableBlocks = getEntityRecords( 'postType', 'wp_block', {
|
|
34
|
+
per_page: -1,
|
|
35
|
+
} );
|
|
36
|
+
return hasFinishedResolution( 'getEntityRecords', [
|
|
37
|
+
'postType',
|
|
38
|
+
'wp_block',
|
|
39
|
+
{ per_page: -1 },
|
|
40
|
+
] )
|
|
41
|
+
? reusableBlocks
|
|
42
|
+
: undefined;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
const BLOCK_EDITOR_SETTINGS = [
|
|
@@ -47,6 +52,7 @@ const BLOCK_EDITOR_SETTINGS = [
|
|
|
47
52
|
'allowedMimeTypes',
|
|
48
53
|
'bodyPlaceholder',
|
|
49
54
|
'canLockBlocks',
|
|
55
|
+
'canUpdateBlockBindings',
|
|
50
56
|
'capabilities',
|
|
51
57
|
'clearBlockSelection',
|
|
52
58
|
'codeEditingEnabled',
|
|
@@ -74,7 +80,6 @@ const BLOCK_EDITOR_SETTINGS = [
|
|
|
74
80
|
'postContentAttributes',
|
|
75
81
|
'postsPerPage',
|
|
76
82
|
'readOnly',
|
|
77
|
-
'sectionRootClientId',
|
|
78
83
|
'styles',
|
|
79
84
|
'titlePlaceholder',
|
|
80
85
|
'supportsLayout',
|
|
@@ -90,6 +95,7 @@ const {
|
|
|
90
95
|
globalStylesLinksDataKey,
|
|
91
96
|
selectBlockPatternsKey,
|
|
92
97
|
reusableBlocksSelectKey,
|
|
98
|
+
sectionRootClientIdKey,
|
|
93
99
|
} = unlock( privateApis );
|
|
94
100
|
|
|
95
101
|
/**
|
|
@@ -325,10 +331,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
325
331
|
? [ [ 'core/navigation', {}, [] ] ]
|
|
326
332
|
: settings.template,
|
|
327
333
|
__experimentalSetIsInserterOpened: setIsInserterOpened,
|
|
334
|
+
[ sectionRootClientIdKey ]: sectionRootClientId,
|
|
328
335
|
};
|
|
329
|
-
|
|
330
|
-
sectionRootClientId,
|
|
331
|
-
} );
|
|
336
|
+
|
|
332
337
|
return blockEditorSettings;
|
|
333
338
|
}, [
|
|
334
339
|
allowedBlockTypes,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
cursor: ew-resize;
|
|
17
17
|
outline: none;
|
|
18
18
|
background: none;
|
|
19
|
-
border-radius: $radius-
|
|
19
|
+
border-radius: $radius-full;
|
|
20
20
|
border: 0;
|
|
21
21
|
height: 100px;
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
content: "";
|
|
30
30
|
width: $grid-unit-05;
|
|
31
31
|
background-color: rgba($gray-700, 0.4);
|
|
32
|
-
border-radius: $radius-
|
|
32
|
+
border-radius: $radius-full;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
&.is-left {
|
|
@@ -71,6 +71,8 @@ export default function SavePublishPanels( {
|
|
|
71
71
|
unmountableContent = (
|
|
72
72
|
<div className="editor-layout__toggle-publish-panel">
|
|
73
73
|
<Button
|
|
74
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
75
|
+
__next40pxDefaultSize={ false }
|
|
74
76
|
variant="secondary"
|
|
75
77
|
className="editor-layout__toggle-publish-panel-button"
|
|
76
78
|
onClick={ togglePublishSidebar }
|
|
@@ -84,6 +86,8 @@ export default function SavePublishPanels( {
|
|
|
84
86
|
unmountableContent = (
|
|
85
87
|
<div className="editor-layout__toggle-entities-saved-states-panel">
|
|
86
88
|
<Button
|
|
89
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
90
|
+
__next40pxDefaultSize={ false }
|
|
87
91
|
variant="secondary"
|
|
88
92
|
className="editor-layout__toggle-entities-saved-states-panel-button"
|
|
89
93
|
onClick={ openEntitiesSavedStates }
|
|
@@ -28,6 +28,7 @@ import PostsPerPage from '../posts-per-page';
|
|
|
28
28
|
import SiteDiscussion from '../site-discussion';
|
|
29
29
|
import { store as editorStore } from '../../store';
|
|
30
30
|
import { PrivatePostLastRevision } from '../post-last-revision';
|
|
31
|
+
import PostTrash from '../post-trash';
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Module Constants
|
|
@@ -87,6 +88,9 @@ export default function PostSummary( { onActionPerformed } ) {
|
|
|
87
88
|
<SiteDiscussion />
|
|
88
89
|
<PostFormatPanel />
|
|
89
90
|
</VStack>
|
|
91
|
+
<PostTrash
|
|
92
|
+
onActionPerformed={ onActionPerformed }
|
|
93
|
+
/>
|
|
90
94
|
{ fills }
|
|
91
95
|
</VStack>
|
|
92
96
|
) }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Modal } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { useState, useMemo
|
|
6
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
7
7
|
import {
|
|
8
8
|
store as blockEditorStore,
|
|
9
9
|
__experimentalBlockPatternsList as BlockPatternsList,
|
|
@@ -12,6 +12,8 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
12
12
|
import { useAsyncList } from '@wordpress/compose';
|
|
13
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
14
|
import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
15
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
16
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Internal dependencies
|
|
@@ -19,7 +21,7 @@ import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
|
19
21
|
import { store as editorStore } from '../../store';
|
|
20
22
|
import { TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
21
23
|
|
|
22
|
-
function useStartPatterns() {
|
|
24
|
+
export function useStartPatterns() {
|
|
23
25
|
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
|
|
24
26
|
// and it has no postTypes declared and the current post type is page or if
|
|
25
27
|
// the current post type is part of the postTypes declared.
|
|
@@ -45,8 +47,14 @@ function useStartPatterns() {
|
|
|
45
47
|
);
|
|
46
48
|
|
|
47
49
|
return useMemo( () => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
if ( ! blockPatternsWithPostContentBlockType?.length ) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
* Filter patterns without postTypes declared if the current postType is page
|
|
56
|
+
* or patterns that declare the current postType in its post type array.
|
|
57
|
+
*/
|
|
50
58
|
return blockPatternsWithPostContentBlockType.filter( ( pattern ) => {
|
|
51
59
|
return (
|
|
52
60
|
( postType === 'page' && ! pattern.postTypes ) ||
|
|
@@ -110,30 +118,24 @@ function StartPageOptionsModal( { onClose } ) {
|
|
|
110
118
|
|
|
111
119
|
export default function StartPageOptions() {
|
|
112
120
|
const [ isClosed, setIsClosed ] = useState( false );
|
|
113
|
-
const
|
|
114
|
-
const {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
121
|
+
const shouldEnableModal = useSelect( ( select ) => {
|
|
122
|
+
const { isEditedPostDirty, isEditedPostEmpty, getCurrentPostType } =
|
|
123
|
+
select( editorStore );
|
|
124
|
+
const preferencesModalActive =
|
|
125
|
+
select( interfaceStore ).isModalActive( 'editor/preferences' );
|
|
126
|
+
const choosePatternModalEnabled = select( preferencesStore ).get(
|
|
127
|
+
'core',
|
|
128
|
+
'enableChoosePatternModal'
|
|
129
|
+
);
|
|
130
|
+
return (
|
|
131
|
+
choosePatternModalEnabled &&
|
|
132
|
+
! preferencesModalActive &&
|
|
133
|
+
! isEditedPostDirty() &&
|
|
134
|
+
isEditedPostEmpty() &&
|
|
135
|
+
TEMPLATE_POST_TYPE !== getCurrentPostType()
|
|
136
|
+
);
|
|
130
137
|
}, [] );
|
|
131
138
|
|
|
132
|
-
useEffect( () => {
|
|
133
|
-
// Should reset the modal state when navigating to a new page/post.
|
|
134
|
-
setIsClosed( false );
|
|
135
|
-
}, [ postType, postId ] );
|
|
136
|
-
|
|
137
139
|
if ( ! shouldEnableModal || isClosed ) {
|
|
138
140
|
return null;
|
|
139
141
|
}
|
|
@@ -155,7 +155,11 @@ function StartModal( { slug, isCustom, onClose, postType } ) {
|
|
|
155
155
|
expanded={ false }
|
|
156
156
|
>
|
|
157
157
|
<FlexItem>
|
|
158
|
-
<Button
|
|
158
|
+
<Button
|
|
159
|
+
__next40pxDefaultSize
|
|
160
|
+
variant="tertiary"
|
|
161
|
+
onClick={ onClose }
|
|
162
|
+
>
|
|
159
163
|
{ __( 'Skip' ) }
|
|
160
164
|
</Button>
|
|
161
165
|
</FlexItem>
|
|
@@ -40,6 +40,7 @@ export default function TextEditor( { autoFocus = false } ) {
|
|
|
40
40
|
<div className="editor-text-editor__toolbar">
|
|
41
41
|
<h2>{ __( 'Editing code' ) }</h2>
|
|
42
42
|
<Button
|
|
43
|
+
__next40pxDefaultSize
|
|
43
44
|
variant="tertiary"
|
|
44
45
|
onClick={ () => switchEditorMode( 'visual' ) }
|
|
45
46
|
shortcut={ shortcut }
|
|
@@ -55,7 +55,10 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
! event.target.classList.contains( 'is-root-container' ) ||
|
|
60
|
+
event.target.dataset?.type === 'core/template-part'
|
|
61
|
+
) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
64
|
setIsDialogOpen( true );
|
|
@@ -128,8 +128,7 @@ function VisualEditor( {
|
|
|
128
128
|
getRenderingMode,
|
|
129
129
|
getDeviceType,
|
|
130
130
|
} = select( editorStore );
|
|
131
|
-
const { getPostType,
|
|
132
|
-
select( coreStore );
|
|
131
|
+
const { getPostType, getEditedEntityRecord } = select( coreStore );
|
|
133
132
|
const postTypeSlug = getCurrentPostType();
|
|
134
133
|
const _renderingMode = getRenderingMode();
|
|
135
134
|
let _wrapperBlockName;
|
|
@@ -143,10 +142,6 @@ function VisualEditor( {
|
|
|
143
142
|
const editorSettings = getEditorSettings();
|
|
144
143
|
const supportsTemplateMode = editorSettings.supportsTemplateMode;
|
|
145
144
|
const postTypeObject = getPostType( postTypeSlug );
|
|
146
|
-
const canEditTemplate = canUser( 'create', {
|
|
147
|
-
kind: 'postType',
|
|
148
|
-
name: 'wp_template',
|
|
149
|
-
} );
|
|
150
145
|
const currentTemplateId = getCurrentTemplateId();
|
|
151
146
|
const template = currentTemplateId
|
|
152
147
|
? getEditedEntityRecord(
|
|
@@ -163,9 +158,7 @@ function VisualEditor( {
|
|
|
163
158
|
// Post template fetch returns a 404 on classic themes, which
|
|
164
159
|
// messes with e2e tests, so check it's a block theme first.
|
|
165
160
|
editedPostTemplate:
|
|
166
|
-
postTypeObject?.viewable &&
|
|
167
|
-
supportsTemplateMode &&
|
|
168
|
-
canEditTemplate
|
|
161
|
+
postTypeObject?.viewable && supportsTemplateMode
|
|
169
162
|
? template
|
|
170
163
|
: undefined,
|
|
171
164
|
wrapperBlockName: _wrapperBlockName,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
+
import { square as zoomOutIcon } from '@wordpress/icons';
|
|
10
|
+
|
|
11
|
+
const ZoomOutToggle = () => {
|
|
12
|
+
const { isZoomOutMode } = useSelect( ( select ) => ( {
|
|
13
|
+
isZoomOutMode:
|
|
14
|
+
select( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',
|
|
15
|
+
} ) );
|
|
16
|
+
|
|
17
|
+
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
|
|
18
|
+
|
|
19
|
+
const handleZoomOut = () => {
|
|
20
|
+
__unstableSetEditorMode( isZoomOutMode ? 'edit' : 'zoom-out' );
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Button
|
|
25
|
+
onClick={ handleZoomOut }
|
|
26
|
+
icon={ zoomOutIcon }
|
|
27
|
+
label={ __( 'Toggle Zoom Out' ) }
|
|
28
|
+
isPressed={ isZoomOutMode }
|
|
29
|
+
size="compact"
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default ZoomOutToggle;
|
|
@@ -114,6 +114,7 @@ const resetPost: Action< Post > = {
|
|
|
114
114
|
</Text>
|
|
115
115
|
<HStack justify="right">
|
|
116
116
|
<Button
|
|
117
|
+
__next40pxDefaultSize
|
|
117
118
|
variant="tertiary"
|
|
118
119
|
onClick={ closeModal }
|
|
119
120
|
disabled={ isBusy }
|
|
@@ -122,6 +123,7 @@ const resetPost: Action< Post > = {
|
|
|
122
123
|
{ __( 'Cancel' ) }
|
|
123
124
|
</Button>
|
|
124
125
|
<Button
|
|
126
|
+
__next40pxDefaultSize
|
|
125
127
|
variant="primary"
|
|
126
128
|
onClick={ async () => {
|
|
127
129
|
setIsBusy( true );
|
|
@@ -67,6 +67,7 @@ const trashPost: Action< PostWithPermissions > = {
|
|
|
67
67
|
</Text>
|
|
68
68
|
<HStack justify="right">
|
|
69
69
|
<Button
|
|
70
|
+
__next40pxDefaultSize
|
|
70
71
|
variant="tertiary"
|
|
71
72
|
onClick={ closeModal }
|
|
72
73
|
disabled={ isBusy }
|
|
@@ -75,6 +76,7 @@ const trashPost: Action< PostWithPermissions > = {
|
|
|
75
76
|
{ __( 'Cancel' ) }
|
|
76
77
|
</Button>
|
|
77
78
|
<Button
|
|
79
|
+
__next40pxDefaultSize
|
|
78
80
|
variant="primary"
|
|
79
81
|
onClick={ async () => {
|
|
80
82
|
setIsBusy( true );
|
|
@@ -8,22 +8,24 @@ import { doAction } from '@wordpress/hooks';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import deletePost from '../actions/delete-post';
|
|
12
|
-
import duplicatePattern from '../actions/duplicate-pattern';
|
|
13
11
|
import duplicateTemplatePart from '../actions/duplicate-template-part';
|
|
14
|
-
import exportPattern from '../actions/export-pattern';
|
|
15
12
|
import resetPost from '../actions/reset-post';
|
|
16
13
|
import trashPost from '../actions/trash-post';
|
|
17
|
-
import permanentlyDeletePost from '../actions/permanently-delete-post';
|
|
18
14
|
import renamePost from '../actions/rename-post';
|
|
19
|
-
import reorderPage from '../actions/reorder-page';
|
|
20
15
|
import restorePost from '../actions/restore-post';
|
|
21
16
|
import type { PostType } from '../types';
|
|
22
17
|
import { store as editorStore } from '../../store';
|
|
23
18
|
import { unlock } from '../../lock-unlock';
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
import {
|
|
20
|
+
viewPost,
|
|
21
|
+
viewPostRevisions,
|
|
22
|
+
duplicatePost,
|
|
23
|
+
duplicatePattern,
|
|
24
|
+
reorderPage,
|
|
25
|
+
exportPattern,
|
|
26
|
+
permanentlyDeletePost,
|
|
27
|
+
} from '@wordpress/fields';
|
|
28
|
+
import deletePost from '../actions/delete-post';
|
|
27
29
|
|
|
28
30
|
export function registerEntityAction< Item >(
|
|
29
31
|
kind: string,
|
package/src/private-apis.js
CHANGED
|
@@ -9,7 +9,6 @@ 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';
|
|
@@ -51,7 +50,6 @@ lock( privateApis, {
|
|
|
51
50
|
bootstrapBlockBindingsSourcesFromServer,
|
|
52
51
|
|
|
53
52
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
54
|
-
useBlockEditorSettings,
|
|
55
53
|
interfaceStore,
|
|
56
54
|
...remainingInterfaceApis,
|
|
57
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 } ) => {
|