@wordpress/editor 13.33.0 → 13.35.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 +12 -4
- package/README.md +132 -20
- package/build/bindings/pattern-overrides.js +70 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/components/autosave-monitor/index.js +15 -12
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build/components/character-count/index.js +5 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/collapsible-block-toolbar/index.js +73 -0
- package/build/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +8 -0
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +11 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +2 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +15 -25
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +19 -8
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-history/redo.js +11 -0
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +11 -0
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-snackbars/index.js +6 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +7 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +130 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/index.js +147 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +56 -34
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +59 -0
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/more-menu/index.js +119 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/more-menu/tools-more-menu-group.js +23 -0
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build/components/more-menu/view-more-menu-group.js +24 -0
- package/build/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build/components/page-attributes/check.js +8 -0
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -0
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +14 -8
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +7 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +1 -1
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +1 -1
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -1
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/actions.js +219 -66
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +32 -16
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +9 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +6 -0
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +5 -0
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -66
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +28 -8
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +72 -0
- package/build/components/post-content-information/index.js.map +1 -0
- package/build/components/post-discussion/panel.js +104 -20
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +0 -19
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +52 -12
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +118 -7
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +2 -2
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/index.js +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/panel.js +27 -0
- package/build/components/post-format/panel.js.map +1 -0
- package/build/components/post-last-edited-panel/index.js +33 -0
- package/build/components/post-last-edited-panel/index.js.map +1 -0
- package/build/components/post-panel-row/index.js +2 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +28 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- package/build/components/post-pingbacks/index.js +5 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build/components/post-saved-state/index.js +2 -2
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/panel.js +27 -0
- package/build/components/post-slug/panel.js.map +1 -0
- package/build/components/post-status/index.js +13 -13
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +21 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- package/build/components/post-template/block-theme.js +2 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +2 -5
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-title/index.js +2 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +2 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/panel.js +18 -0
- package/build/components/post-trash/panel.js.map +1 -0
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/index.js +2 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +11 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +3 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +23 -16
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +21 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +89 -0
- package/build/components/save-publish-panels/index.js.map +1 -0
- package/build/components/sidebar/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +53 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +157 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +84 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- package/build/components/start-page-options/index.js +10 -8
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +192 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/template-content-panel/index.js +38 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- package/build/hooks/pattern-overrides.js +10 -5
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +19 -8
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +72 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/store/private-selectors.js +6 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +69 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +15 -13
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build-module/components/character-count/index.js +6 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +65 -0
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +9 -0
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +11 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +2 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +17 -27
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +19 -8
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +11 -0
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +11 -0
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +6 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +120 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/index.js +139 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +59 -37
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/more-menu/index.js +111 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build-module/components/more-menu/view-more-menu-group.js +17 -0
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build-module/components/page-attributes/check.js +9 -0
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -0
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +13 -6
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +7 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -1
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +223 -70
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +33 -17
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +10 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +6 -0
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +6 -0
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -67
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +30 -10
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +66 -0
- package/build-module/components/post-content-information/index.js.map +1 -0
- package/build-module/components/post-discussion/panel.js +105 -21
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +0 -19
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +52 -11
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +118 -8
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +2 -2
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +18 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- package/build-module/components/post-last-edited-panel/index.js +26 -0
- package/build-module/components/post-last-edited-panel/index.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +2 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +20 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- package/build-module/components/post-pingbacks/index.js +6 -3
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +2 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/panel.js +18 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- package/build-module/components/post-status/index.js +13 -13
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +12 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- package/build-module/components/post-template/block-theme.js +2 -2
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +3 -6
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-title/index.js +2 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +2 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- package/build-module/components/post-trash/panel.js +10 -0
- package/build-module/components/post-trash/panel.js.map +1 -0
- package/build-module/components/post-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/index.js +2 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +11 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +3 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +21 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +80 -0
- package/build-module/components/save-publish-panels/index.js.map +1 -0
- package/build-module/components/sidebar/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +46 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +149 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +77 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- package/build-module/components/start-page-options/index.js +10 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +185 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/template-content-panel/index.js +31 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +10 -5
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +19 -8
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +62 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +535 -48
- package/build-style/style.css +535 -48
- package/package.json +38 -36
- package/src/bindings/pattern-overrides.js +83 -1
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/autosave-monitor/index.js +15 -12
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/character-count/index.js +5 -0
- package/src/components/collapsible-block-toolbar/index.js +77 -0
- package/src/components/collapsible-block-toolbar/style.scss +80 -0
- package/src/components/document-bar/index.js +2 -2
- package/src/components/document-outline/check.js +8 -0
- package/src/components/document-outline/index.js +10 -0
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +19 -26
- package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/src/components/editor-canvas/index.js +18 -6
- package/src/components/editor-history/redo.js +10 -0
- package/src/components/editor-history/undo.js +10 -0
- package/src/components/editor-snackbars/index.js +5 -0
- package/src/components/entities-saved-states/style.scss +7 -0
- package/src/components/global-keyboard-shortcuts/index.js +7 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
- package/src/components/global-styles-provider/index.js +162 -0
- package/src/components/header/index.js +154 -0
- package/src/components/header/style.scss +231 -0
- package/src/components/inserter-sidebar/index.js +52 -32
- package/src/components/inserter-sidebar/style.scss +10 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/index.js +1 -1
- package/src/components/list-view-sidebar/style.scss +3 -2
- package/src/components/more-menu/copy-content-menu-item.js +51 -0
- package/src/components/more-menu/index.js +158 -0
- package/src/components/more-menu/tools-more-menu-group.js +11 -0
- package/src/components/more-menu/view-more-menu-group.js +13 -0
- package/src/components/page-attributes/check.js +8 -0
- package/src/components/page-attributes/order.js +6 -0
- package/src/components/page-attributes/panel.js +21 -17
- package/src/components/page-attributes/parent.js +6 -0
- package/src/components/page-attributes/test/order.js +5 -1
- package/src/components/plugin-post-publish-panel/index.js +1 -1
- package/src/components/plugin-pre-publish-panel/index.js +1 -1
- package/src/components/plugin-sidebar/index.js +1 -1
- package/src/components/post-actions/actions.js +373 -152
- package/src/components/post-actions/index.js +34 -33
- package/src/components/post-author/check.js +9 -0
- package/src/components/post-author/index.js +5 -0
- package/src/components/post-author/panel.js +5 -0
- package/src/components/post-card-panel/index.js +40 -141
- package/src/components/post-card-panel/style.scss +2 -6
- package/src/components/post-comments/index.js +47 -9
- package/src/components/post-content-information/index.js +83 -0
- package/src/components/post-content-information/style.scss +6 -0
- package/src/components/post-discussion/panel.js +108 -27
- package/src/components/post-discussion/style.scss +26 -0
- package/src/components/post-excerpt/check.js +0 -18
- package/src/components/post-excerpt/index.js +66 -15
- package/src/components/post-excerpt/panel.js +196 -19
- package/src/components/post-excerpt/plugin.js +2 -2
- package/src/components/post-excerpt/style.scss +24 -0
- package/src/components/post-featured-image/index.js +1 -1
- package/src/components/post-featured-image/style.scss +2 -8
- package/src/components/post-format/panel.js +22 -0
- package/src/components/post-format/style.scss +6 -0
- package/src/components/post-last-edited-panel/index.js +35 -0
- package/src/components/post-last-edited-panel/style.scss +6 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -0
- package/src/components/post-pingbacks/index.js +11 -2
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
- package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
- package/src/components/post-publish-panel/style.scss +48 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
- package/src/components/post-saved-state/index.js +2 -2
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-schedule/style.scss +2 -4
- package/src/components/post-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- package/src/components/post-status/index.js +88 -80
- package/src/components/post-status/style.scss +0 -1
- package/src/components/post-sticky/panel.js +18 -0
- package/src/components/post-template/block-theme.js +2 -2
- package/src/components/post-template/classic-theme.js +0 -1
- package/src/components/post-template/swap-template-button.js +3 -6
- package/src/components/post-text-editor/style.scss +1 -1
- package/src/components/post-title/index.js +2 -2
- package/src/components/post-title/post-title-raw.js +2 -2
- package/src/components/post-title/style.scss +1 -1
- package/src/components/post-transform-panel/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +99 -0
- package/src/components/post-trash/panel.js +13 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- package/src/components/post-url/index.js +1 -0
- package/src/components/post-url/panel.js +1 -1
- package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
- package/src/components/preferences-modal/index.js +17 -3
- package/src/components/preview-dropdown/index.js +3 -1
- package/src/components/provider/disable-non-page-content-blocks.js +23 -21
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +19 -4
- package/src/components/save-publish-panels/index.js +96 -0
- package/src/components/save-publish-panels/style.scss +36 -0
- package/src/components/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +200 -0
- package/src/components/sidebar/post-summary.js +104 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/start-page-options/index.js +12 -5
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +55 -0
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- package/src/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +22 -8
- package/src/private-apis.native.js +61 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +12 -0
- package/src/store/selectors.js +3 -1
- package/src/style.scss +11 -0
- package/src/components/post-slug/test/check.js +0 -17
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = PostSummary;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _components = require("@wordpress/components");
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
var _pluginPostStatusInfo = _interopRequireDefault(require("../plugin-post-status-info"));
|
|
12
|
+
var _postActions = _interopRequireDefault(require("../post-actions"));
|
|
13
|
+
var _panel = _interopRequireDefault(require("../post-author/panel"));
|
|
14
|
+
var _postCardPanel = _interopRequireDefault(require("../post-card-panel"));
|
|
15
|
+
var _postContentInformation = _interopRequireDefault(require("../post-content-information"));
|
|
16
|
+
var _panel2 = _interopRequireDefault(require("../post-discussion/panel"));
|
|
17
|
+
var _panel3 = require("../post-excerpt/panel");
|
|
18
|
+
var _panel4 = _interopRequireDefault(require("../post-featured-image/panel"));
|
|
19
|
+
var _panel5 = _interopRequireDefault(require("../post-format/panel"));
|
|
20
|
+
var _postLastEditedPanel = _interopRequireDefault(require("../post-last-edited-panel"));
|
|
21
|
+
var _postPanelSection = _interopRequireDefault(require("../post-panel-section"));
|
|
22
|
+
var _panel6 = _interopRequireDefault(require("../post-schedule/panel"));
|
|
23
|
+
var _postStatus = _interopRequireDefault(require("../post-status"));
|
|
24
|
+
var _postSticky = _interopRequireDefault(require("../post-sticky"));
|
|
25
|
+
var _postSyncStatus = _interopRequireDefault(require("../post-sync-status"));
|
|
26
|
+
var _panel7 = _interopRequireDefault(require("../post-template/panel"));
|
|
27
|
+
var _panel8 = _interopRequireDefault(require("../post-trash/panel"));
|
|
28
|
+
var _panel9 = _interopRequireDefault(require("../post-url/panel"));
|
|
29
|
+
var _store = require("../../store");
|
|
30
|
+
var _constants = require("../../store/constants");
|
|
31
|
+
var _templateAreas = _interopRequireDefault(require("../template-areas"));
|
|
32
|
+
/**
|
|
33
|
+
* WordPress dependencies
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Internal dependencies
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Module Constants
|
|
42
|
+
*/
|
|
43
|
+
const PANEL_NAME = 'post-status';
|
|
44
|
+
function PostSummary({
|
|
45
|
+
onActionPerformed
|
|
46
|
+
}) {
|
|
47
|
+
const {
|
|
48
|
+
isRemovedPostStatusPanel,
|
|
49
|
+
postType
|
|
50
|
+
} = (0, _data.useSelect)(select => {
|
|
51
|
+
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
52
|
+
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
53
|
+
const {
|
|
54
|
+
isEditorPanelRemoved,
|
|
55
|
+
getCurrentPostType
|
|
56
|
+
} = select(_store.store);
|
|
57
|
+
return {
|
|
58
|
+
isRemovedPostStatusPanel: isEditorPanelRemoved(PANEL_NAME),
|
|
59
|
+
postType: getCurrentPostType()
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
const isPattern = postType === _constants.PATTERN_POST_TYPE;
|
|
63
|
+
const isTemplate = postType === _constants.TEMPLATE_POST_TYPE;
|
|
64
|
+
const isTemplatePart = postType === _constants.TEMPLATE_PART_POST_TYPE;
|
|
65
|
+
const isNavigation = postType === _constants.NAVIGATION_POST_TYPE;
|
|
66
|
+
return (0, _react.createElement)(_postPanelSection.default, {
|
|
67
|
+
className: "editor-post-summary"
|
|
68
|
+
}, (0, _react.createElement)(_pluginPostStatusInfo.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
69
|
+
spacing: 4
|
|
70
|
+
}, (0, _react.createElement)(_postCardPanel.default, {
|
|
71
|
+
actions: (0, _react.createElement)(_postActions.default, {
|
|
72
|
+
onActionPerformed: onActionPerformed
|
|
73
|
+
})
|
|
74
|
+
}), (0, _react.createElement)(_panel4.default, {
|
|
75
|
+
withPanelBody: false
|
|
76
|
+
}), (0, _react.createElement)(_panel3.PrivatePostExcerptPanel, null), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
77
|
+
spacing: 1
|
|
78
|
+
}, (0, _react.createElement)(_postContentInformation.default, null), (0, _react.createElement)(_postLastEditedPanel.default, null)), !isRemovedPostStatusPanel && (0, _react.createElement)(_components.__experimentalVStack, {
|
|
79
|
+
spacing: 2
|
|
80
|
+
}, (0, _react.createElement)(_components.__experimentalVStack, {
|
|
81
|
+
spacing: 1
|
|
82
|
+
}, (0, _react.createElement)(_postStatus.default, null), (0, _react.createElement)(_panel6.default, null), (0, _react.createElement)(_panel7.default, null), (0, _react.createElement)(_panel9.default, null), (0, _react.createElement)(_panel2.default, null), (0, _react.createElement)(_postSyncStatus.default, null)), (0, _react.createElement)(_postSticky.default, null), (0, _react.createElement)(_panel5.default, null), (0, _react.createElement)(_panel.default, null), isTemplate && (0, _react.createElement)(_templateAreas.default, null), fills, !isPattern && !isTemplate && !isTemplatePart && !isNavigation && (0, _react.createElement)(_panel8.default, null))))));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=post-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_pluginPostStatusInfo","_interopRequireDefault","_postActions","_panel","_postCardPanel","_postContentInformation","_panel2","_panel3","_panel4","_panel5","_postLastEditedPanel","_postPanelSection","_panel6","_postStatus","_postSticky","_postSyncStatus","_panel7","_panel8","_panel9","_store","_constants","_templateAreas","PANEL_NAME","PostSummary","onActionPerformed","isRemovedPostStatusPanel","postType","useSelect","select","isEditorPanelRemoved","getCurrentPostType","editorStore","isPattern","PATTERN_POST_TYPE","isTemplate","TEMPLATE_POST_TYPE","isTemplatePart","TEMPLATE_PART_POST_TYPE","isNavigation","NAVIGATION_POST_TYPE","_react","createElement","default","className","Slot","fills","Fragment","__experimentalVStack","spacing","actions","withPanelBody","PrivatePostExcerptPanel"],"sources":["@wordpress/editor/src/components/sidebar/post-summary.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostActions from '../post-actions';\nimport PostAuthorPanel from '../post-author/panel';\nimport PostCardPanel from '../post-card-panel';\nimport PostContentInformation from '../post-content-information';\nimport PostDiscussionPanel from '../post-discussion/panel';\nimport { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';\nimport PostFeaturedImagePanel from '../post-featured-image/panel';\nimport PostFormatPanel from '../post-format/panel';\nimport PostLastEditedPanel from '../post-last-edited-panel';\nimport PostPanelSection from '../post-panel-section';\nimport PostSchedulePanel from '../post-schedule/panel';\nimport PostStatusPanel from '../post-status';\nimport PostStickyPanel from '../post-sticky';\nimport PostSyncStatus from '../post-sync-status';\nimport PostTemplatePanel from '../post-template/panel';\nimport PostTrashPanel from '../post-trash/panel';\nimport PostURLPanel from '../post-url/panel';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport TemplateAreas from '../template-areas';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostSummary( { onActionPerformed } ) {\n\tconst { isRemovedPostStatusPanel, postType } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst isPattern = postType === PATTERN_POST_TYPE;\n\tconst isTemplate = postType === TEMPLATE_POST_TYPE;\n\tconst isTemplatePart = postType === TEMPLATE_PART_POST_TYPE;\n\tconst isNavigation = postType === NAVIGATION_POST_TYPE;\n\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImagePanel withPanelBody={ false } />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<PostContentInformation />\n\t\t\t\t\t\t\t\t<PostLastEditedPanel />\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t\t\t<PostStatusPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t<PostStickyPanel />\n\t\t\t\t\t\t\t\t\t<PostFormatPanel />\n\t\t\t\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t\t\t\t{ isTemplate && <TemplateAreas /> }\n\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t{ ! isPattern &&\n\t\t\t\t\t\t\t\t\t\t! isTemplate &&\n\t\t\t\t\t\t\t\t\t\t! isTemplatePart &&\n\t\t\t\t\t\t\t\t\t\t! isNavigation && <PostTrashPanel /> }\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PostPanelSection>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,cAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,uBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,OAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAP,sBAAA,CAAAH,OAAA;AACA,IAAAW,OAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,oBAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa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AE,CAAC,EACrB,IAAAF,MAAA,CAAAC,aAAA,EAACvB,OAAA,CAAAwB,OAAY,MAAE,CAAC,EAChB,IAAAF,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAAoC,OAAmB,MAAE,CAAC,EACvB,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,eAAA,CAAA2B,OAAc,MAAE,CACV,CAAC,EACT,IAAAF,MAAA,CAAAC,aAAA,EAAC3B,WAAA,CAAA4B,OAAe,MAAE,CAAC,EACnB,IAAAF,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAAiC,OAAe,MAAE,CAAC,EACnB,IAAAF,MAAA,CAAAC,aAAA,EAACtC,MAAA,CAAAuC,OAAe,MAAE,CAAC,EACjBR,UAAU,IAAI,IAAAM,MAAA,CAAAC,aAAA,EAACpB,cAAA,CAAAqB,OAAa,MAAE,CAAC,EAC/BG,KAAK,EACL,CAAEb,SAAS,IACZ,CAAEE,UAAU,IACZ,CAAEE,cAAc,IAChB,CAAEE,YAAY,IAAI,IAAAE,MAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAyB,OAAc,MAAE,CAC7B,CAEF,CACP,CAEuB,CACV,CAAC;AAErB","ignoreList":[]}
|
|
@@ -12,7 +12,9 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
13
|
var _compose = require("@wordpress/compose");
|
|
14
14
|
var _coreData = require("@wordpress/core-data");
|
|
15
|
+
var _blocks = require("@wordpress/blocks");
|
|
15
16
|
var _store = require("../../store");
|
|
17
|
+
var _constants = require("../../store/constants");
|
|
16
18
|
/**
|
|
17
19
|
* WordPress dependencies
|
|
18
20
|
*/
|
|
@@ -77,7 +79,10 @@ function PatternSelection({
|
|
|
77
79
|
shownPatterns: shownBlockPatterns,
|
|
78
80
|
onClickPattern: (_pattern, blocks) => {
|
|
79
81
|
editEntityRecord('postType', postType, postId, {
|
|
80
|
-
blocks
|
|
82
|
+
blocks,
|
|
83
|
+
content: ({
|
|
84
|
+
blocks: blocksForSerialization = []
|
|
85
|
+
}) => (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization)
|
|
81
86
|
});
|
|
82
87
|
onChoosePattern();
|
|
83
88
|
}
|
|
@@ -113,15 +118,12 @@ function StartPageOptions() {
|
|
|
113
118
|
isEditedPostDirty,
|
|
114
119
|
isEditedPostEmpty,
|
|
115
120
|
getCurrentPostType,
|
|
116
|
-
getCurrentPostId
|
|
117
|
-
getEditorSettings
|
|
121
|
+
getCurrentPostId
|
|
118
122
|
} = select(_store.store);
|
|
119
|
-
const
|
|
120
|
-
__unstableIsPreviewMode: isPreviewMode
|
|
121
|
-
} = getEditorSettings();
|
|
123
|
+
const _postType = getCurrentPostType();
|
|
122
124
|
return {
|
|
123
|
-
shouldEnableModal: !
|
|
124
|
-
postType:
|
|
125
|
+
shouldEnableModal: !isEditedPostDirty() && isEditedPostEmpty() && _constants.TEMPLATE_POST_TYPE !== _postType,
|
|
126
|
+
postType: _postType,
|
|
125
127
|
postId: getCurrentPostId()
|
|
126
128
|
};
|
|
127
129
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_coreData","_store","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","getBlocksByName","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","rootClientId","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","editEntityRecord","useDispatch","coreStore","postId","getCurrentPostId","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","Modal","title","__","isFullScreen","onRequestClose","className","StartPageOptions","isClosed","setIsClosed","useState","shouldEnableModal","isEditedPostDirty","isEditedPostEmpty","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_coreData","_blocks","_store","_constants","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","getBlocksByName","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","rootClientId","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","editEntityRecord","useDispatch","coreStore","postId","getCurrentPostId","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","content","blocksForSerialization","__unstableSerializeAndClean","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","Modal","title","__","isFullScreen","onRequestClose","className","StartPageOptions","isClosed","setIsClosed","useState","shouldEnableModal","isEditedPostDirty","isEditedPostEmpty","_postType","TEMPLATE_POST_TYPE","useEffect"],"sources":["@wordpress/editor/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes, getBlocksByName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getCurrentPostType, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst rootClientId =\n\t\t\t\tgetRenderingMode() === 'post-only'\n\t\t\t\t\t? ''\n\t\t\t\t\t: getBlocksByName( 'core/post-content' )?.[ 0 ];\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType: getPatternsByBlockTypes(\n\t\t\t\t\t'core/post-content',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\t\t\tblocks,\n\t\t\t\t\tcontent: ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t\t\t__unstableSerializeAndClean( blocksForSerialization ),\n\t\t\t\t} );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<div className=\"editor-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ onClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { shouldEnableModal, postType, postId } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostEmpty,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t} = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\n\t\treturn {\n\t\t\tshouldEnableModal:\n\t\t\t\t! isEditedPostDirty() &&\n\t\t\t\tisEditedPostEmpty() &&\n\t\t\t\tTEMPLATE_POST_TYPE !== _postType,\n\t\t\tpostType: _postType,\n\t\t\tpostId: getCurrentPostId(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Should reset the modal state when navigating to a new page/post.\n\t\tsetIsClosed( false );\n\t}, [ postType, postId ] );\n\n\tif ( ! shouldEnableModal || isClosed ) {\n\t\treturn null;\n\t}\n\n\treturn <StartPageOptionsModal onClose={ () => setIsClosed( true ) } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GA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gBAAgB;IAChBC,aAAa,EAAGqB,aAAe;IAC/BpB,eAAe,EAAGmB;EAAS,CAC3B,CACG,CACC,CAAC;AAEV;AAEe,SAASU,gBAAgBA,CAAA,EAAG;EAC1C,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACnD,MAAM;IAAEC,iBAAiB;IAAEpD,QAAQ;IAAEyB;EAAO,CAAC,GAAG,IAAAxB,eAAS,EAAIC,MAAM,IAAM;IACxE,MAAM;MACLmD,iBAAiB;MACjBC,iBAAiB;MACjBhD,kBAAkB;MAClBoB;IACD,CAAC,GAAGxB,MAAM,CAAEM,YAAY,CAAC;IACzB,MAAM+C,SAAS,GAAGjD,kBAAkB,CAAC,CAAC;IAEtC,OAAO;MACN8C,iBAAiB,EAChB,CAAEC,iBAAiB,CAAC,CAAC,IACrBC,iBAAiB,CAAC,CAAC,IACnBE,6BAAkB,KAAKD,SAAS;MACjCvD,QAAQ,EAAEuD,SAAS;MACnB9B,MAAM,EAAEC,gBAAgB,CAAC;IAC1B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAA+B,kBAAS,EAAE,MAAM;IAChB;IACAP,WAAW,CAAE,KAAM,CAAC;EACrB,CAAC,EAAE,CAAElD,QAAQ,EAAEyB,MAAM,CAAG,CAAC;EAEzB,IAAK,CAAE2B,iBAAiB,IAAIH,QAAQ,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAtB,MAAA,CAAAC,aAAA,EAACS,qBAAqB;IAACC,OAAO,EAAGA,CAAA,KAAMY,WAAW,CAAE,IAAK;EAAG,CAAE,CAAC;AACvE","ignoreList":[]}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = StartTemplateOptions;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
9
|
+
var _i18n = require("@wordpress/i18n");
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
var _compose = require("@wordpress/compose");
|
|
14
|
+
var _blocks = require("@wordpress/blocks");
|
|
15
|
+
var _coreData = require("@wordpress/core-data");
|
|
16
|
+
var _store = require("../../store");
|
|
17
|
+
var _constants = require("../../store/constants");
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
function useFallbackTemplateContent(slug, isCustom = false) {
|
|
27
|
+
return (0, _data.useSelect)(select => {
|
|
28
|
+
const {
|
|
29
|
+
getEntityRecord,
|
|
30
|
+
getDefaultTemplateId
|
|
31
|
+
} = select(_coreData.store);
|
|
32
|
+
const templateId = getDefaultTemplateId({
|
|
33
|
+
slug,
|
|
34
|
+
is_custom: isCustom,
|
|
35
|
+
ignore_empty: true
|
|
36
|
+
});
|
|
37
|
+
return templateId ? getEntityRecord('postType', _constants.TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined;
|
|
38
|
+
}, [slug, isCustom]);
|
|
39
|
+
}
|
|
40
|
+
function useStartPatterns(fallbackContent) {
|
|
41
|
+
const {
|
|
42
|
+
slug,
|
|
43
|
+
patterns
|
|
44
|
+
} = (0, _data.useSelect)(select => {
|
|
45
|
+
const {
|
|
46
|
+
getCurrentPostType,
|
|
47
|
+
getCurrentPostId
|
|
48
|
+
} = select(_store.store);
|
|
49
|
+
const {
|
|
50
|
+
getEntityRecord,
|
|
51
|
+
getBlockPatterns
|
|
52
|
+
} = select(_coreData.store);
|
|
53
|
+
const postId = getCurrentPostId();
|
|
54
|
+
const postType = getCurrentPostType();
|
|
55
|
+
const record = getEntityRecord('postType', postType, postId);
|
|
56
|
+
return {
|
|
57
|
+
slug: record.slug,
|
|
58
|
+
patterns: getBlockPatterns()
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
61
|
+
const currentThemeStylesheet = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme().stylesheet);
|
|
62
|
+
|
|
63
|
+
// Duplicated from packages/block-library/src/pattern/edit.js.
|
|
64
|
+
function injectThemeAttributeInBlockTemplateContent(block) {
|
|
65
|
+
if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) {
|
|
66
|
+
block.innerBlocks = block.innerBlocks.map(innerBlock => {
|
|
67
|
+
if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) {
|
|
68
|
+
innerBlock.attributes.theme = currentThemeStylesheet;
|
|
69
|
+
}
|
|
70
|
+
return innerBlock;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
|
|
74
|
+
block.attributes.theme = currentThemeStylesheet;
|
|
75
|
+
}
|
|
76
|
+
return block;
|
|
77
|
+
}
|
|
78
|
+
return (0, _element.useMemo)(() => {
|
|
79
|
+
// filter patterns that are supposed to be used in the current template being edited.
|
|
80
|
+
return [{
|
|
81
|
+
name: 'fallback',
|
|
82
|
+
blocks: (0, _blocks.parse)(fallbackContent),
|
|
83
|
+
title: (0, _i18n.__)('Fallback content')
|
|
84
|
+
}, ...patterns.filter(pattern => {
|
|
85
|
+
return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType));
|
|
86
|
+
}).map(pattern => {
|
|
87
|
+
return {
|
|
88
|
+
...pattern,
|
|
89
|
+
blocks: (0, _blocks.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block))
|
|
90
|
+
};
|
|
91
|
+
})];
|
|
92
|
+
}, [fallbackContent, slug, patterns]);
|
|
93
|
+
}
|
|
94
|
+
function PatternSelection({
|
|
95
|
+
fallbackContent,
|
|
96
|
+
onChoosePattern,
|
|
97
|
+
postType
|
|
98
|
+
}) {
|
|
99
|
+
const [,, onChange] = (0, _coreData.useEntityBlockEditor)('postType', postType);
|
|
100
|
+
const blockPatterns = useStartPatterns(fallbackContent);
|
|
101
|
+
const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
|
|
102
|
+
return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
|
|
103
|
+
blockPatterns: blockPatterns,
|
|
104
|
+
shownPatterns: shownBlockPatterns,
|
|
105
|
+
onClickPattern: (pattern, blocks) => {
|
|
106
|
+
onChange(blocks, {
|
|
107
|
+
selection: undefined
|
|
108
|
+
});
|
|
109
|
+
onChoosePattern();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function StartModal({
|
|
114
|
+
slug,
|
|
115
|
+
isCustom,
|
|
116
|
+
onClose,
|
|
117
|
+
postType
|
|
118
|
+
}) {
|
|
119
|
+
const fallbackContent = useFallbackTemplateContent(slug, isCustom);
|
|
120
|
+
if (!fallbackContent) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
124
|
+
className: "editor-start-template-options__modal",
|
|
125
|
+
title: (0, _i18n.__)('Choose a pattern'),
|
|
126
|
+
closeLabel: (0, _i18n.__)('Cancel'),
|
|
127
|
+
focusOnMount: "firstElement",
|
|
128
|
+
onRequestClose: onClose,
|
|
129
|
+
isFullScreen: true
|
|
130
|
+
}, (0, _react.createElement)("div", {
|
|
131
|
+
className: "editor-start-template-options__modal-content"
|
|
132
|
+
}, (0, _react.createElement)(PatternSelection, {
|
|
133
|
+
fallbackContent: fallbackContent,
|
|
134
|
+
slug: slug,
|
|
135
|
+
isCustom: isCustom,
|
|
136
|
+
postType: postType,
|
|
137
|
+
onChoosePattern: () => {
|
|
138
|
+
onClose();
|
|
139
|
+
}
|
|
140
|
+
})), (0, _react.createElement)(_components.Flex, {
|
|
141
|
+
className: "editor-start-template-options__modal__actions",
|
|
142
|
+
justify: "flex-end",
|
|
143
|
+
expanded: false
|
|
144
|
+
}, (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_components.Button, {
|
|
145
|
+
variant: "tertiary",
|
|
146
|
+
onClick: onClose
|
|
147
|
+
}, (0, _i18n.__)('Skip')))));
|
|
148
|
+
}
|
|
149
|
+
function StartTemplateOptions() {
|
|
150
|
+
const [isClosed, setIsClosed] = (0, _element.useState)(false);
|
|
151
|
+
const {
|
|
152
|
+
shouldOpenModal,
|
|
153
|
+
slug,
|
|
154
|
+
isCustom,
|
|
155
|
+
postType,
|
|
156
|
+
postId
|
|
157
|
+
} = (0, _data.useSelect)(select => {
|
|
158
|
+
const {
|
|
159
|
+
getCurrentPostType,
|
|
160
|
+
getCurrentPostId
|
|
161
|
+
} = select(_store.store);
|
|
162
|
+
const _postType = getCurrentPostType();
|
|
163
|
+
const _postId = getCurrentPostId();
|
|
164
|
+
const {
|
|
165
|
+
getEditedEntityRecord,
|
|
166
|
+
hasEditsForEntityRecord
|
|
167
|
+
} = select(_coreData.store);
|
|
168
|
+
const templateRecord = getEditedEntityRecord('postType', _postType, _postId);
|
|
169
|
+
const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId);
|
|
170
|
+
return {
|
|
171
|
+
shouldOpenModal: !hasEdits && '' === templateRecord.content && _constants.TEMPLATE_POST_TYPE === _postType,
|
|
172
|
+
slug: templateRecord.slug,
|
|
173
|
+
isCustom: templateRecord.is_custom,
|
|
174
|
+
postType: _postType,
|
|
175
|
+
postId: _postId
|
|
176
|
+
};
|
|
177
|
+
}, []);
|
|
178
|
+
(0, _element.useEffect)(() => {
|
|
179
|
+
// Should reset the modal state when navigating to a new page/post.
|
|
180
|
+
setIsClosed(false);
|
|
181
|
+
}, [postType, postId]);
|
|
182
|
+
if (!shouldOpenModal || isClosed) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
return (0, _react.createElement)(StartModal, {
|
|
186
|
+
slug: slug,
|
|
187
|
+
isCustom: isCustom,
|
|
188
|
+
postType: postType,
|
|
189
|
+
onClose: () => setIsClosed(true)
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_blocks","_coreData","_store","_constants","useFallbackTemplateContent","slug","isCustom","useSelect","select","getEntityRecord","getDefaultTemplateId","coreStore","templateId","is_custom","ignore_empty","TEMPLATE_POST_TYPE","content","raw","undefined","useStartPatterns","fallbackContent","patterns","getCurrentPostType","getCurrentPostId","editorStore","getBlockPatterns","postId","postType","record","currentThemeStylesheet","getCurrentTheme","stylesheet","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","attributes","theme","useMemo","blocks","parse","title","__","filter","pattern","Array","isArray","templateTypes","some","templateType","startsWith","PatternSelection","onChoosePattern","onChange","useEntityBlockEditor","blockPatterns","shownBlockPatterns","useAsyncList","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","selection","StartModal","onClose","Modal","className","closeLabel","focusOnMount","onRequestClose","isFullScreen","Flex","justify","expanded","FlexItem","Button","variant","onClick","StartTemplateOptions","isClosed","setIsClosed","useState","shouldOpenModal","_postType","_postId","getEditedEntityRecord","hasEditsForEntityRecord","templateRecord","hasEdits","useEffect"],"sources":["@wordpress/editor/src/components/start-template-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal, Flex, FlexItem, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\n\nfunction useFallbackTemplateContent( slug, isCustom = false ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getDefaultTemplateId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateId = getDefaultTemplateId( {\n\t\t\t\tslug,\n\t\t\t\tis_custom: isCustom,\n\t\t\t\tignore_empty: true,\n\t\t\t} );\n\t\t\treturn templateId\n\t\t\t\t? getEntityRecord( 'postType', TEMPLATE_POST_TYPE, templateId )\n\t\t\t\t\t\t?.content?.raw\n\t\t\t\t: undefined;\n\t\t},\n\t\t[ slug, isCustom ]\n\t);\n}\n\nfunction useStartPatterns( fallbackContent ) {\n\tconst { slug, patterns } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEntityRecord, getBlockPatterns } = select( coreStore );\n\t\tconst postId = getCurrentPostId();\n\t\tconst postType = getCurrentPostType();\n\t\tconst record = getEntityRecord( 'postType', postType, postId );\n\t\treturn {\n\t\t\tslug: record.slug,\n\t\t\tpatterns: getBlockPatterns(),\n\t\t};\n\t}, [] );\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\t// Duplicated from packages/block-library/src/pattern/edit.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\treturn useMemo( () => {\n\t\t// filter patterns that are supposed to be used in the current template being edited.\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'fallback',\n\t\t\t\tblocks: parse( fallbackContent ),\n\t\t\t\ttitle: __( 'Fallback content' ),\n\t\t\t},\n\t\t\t...patterns\n\t\t\t\t.filter( ( pattern ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tArray.isArray( pattern.templateTypes ) &&\n\t\t\t\t\t\tpattern.templateTypes.some( ( templateType ) =>\n\t\t\t\t\t\t\tslug.startsWith( templateType )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t\t.map( ( pattern ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...pattern,\n\t\t\t\t\t\tblocks: parse( pattern.content ).map( ( block ) =>\n\t\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t];\n\t}, [ fallbackContent, slug, patterns ] );\n}\n\nfunction PatternSelection( { fallbackContent, onChoosePattern, postType } ) {\n\tconst [ , , onChange ] = useEntityBlockEditor( 'postType', postType );\n\tconst blockPatterns = useStartPatterns( fallbackContent );\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( pattern, blocks ) => {\n\t\t\t\tonChange( blocks, { selection: undefined } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartModal( { slug, isCustom, onClose, postType } ) {\n\tconst fallbackContent = useFallbackTemplateContent( slug, isCustom );\n\tif ( ! fallbackContent ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-start-template-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tfocusOnMount=\"firstElement\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tisFullScreen\n\t\t>\n\t\t\t<div className=\"editor-start-template-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tfallbackContent={ fallbackContent }\n\t\t\t\t\tslug={ slug }\n\t\t\t\t\tisCustom={ isCustom }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"editor-start-template-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartTemplateOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { shouldOpenModal, slug, isCustom, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType, getCurrentPostId } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst _postType = getCurrentPostType();\n\t\t\tconst _postId = getCurrentPostId();\n\t\t\tconst { getEditedEntityRecord, hasEditsForEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t);\n\t\t\tconst hasEdits = hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tshouldOpenModal:\n\t\t\t\t\t! hasEdits &&\n\t\t\t\t\t'' === templateRecord.content &&\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType,\n\t\t\t\tslug: templateRecord.slug,\n\t\t\t\tisCustom: templateRecord.is_custom,\n\t\t\t\tpostType: _postType,\n\t\t\t\tpostId: _postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\t// Should reset the modal state when navigating to a new page/post.\n\t\tsetIsClosed( false );\n\t}, [ postType, postId ] );\n\n\tif ( ! shouldOpenModal || isClosed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StartModal\n\t\t\tslug={ slug }\n\t\t\tisCustom={ isCustom }\n\t\t\tpostType={ postType }\n\t\t\tonClose={ () => setIsClosed( true ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,SAASU,0BAA0BA,CAAEC,IAAI,EAAEC,QAAQ,GAAG,KAAK,EAAG;EAC7D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEC,eAAe;MAAEC;IAAqB,CAAC,GAC9CF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,UAAU,GAAGF,oBAAoB,CAAE;MACxCL,IAAI;MACJQ,SAAS,EAAEP,QAAQ;MACnBQ,YAAY,EAAE;IACf,CAAE,CAAC;IACH,OAAOF,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D,MAAM,EAAE8D;IACT,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,IAAAK,kBAAS,EAAE,MAAM;IAChB;IACAT,WAAW,CAAE,KAAM,CAAC;EACrB,CAAC,EAAE,CAAEzD,QAAQ,EAAED,MAAM,CAAG,CAAC;EAEzB,IAAK,CAAE4D,eAAe,IAAIH,QAAQ,EAAG;IACpC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAtB,MAAA,CAAAC,aAAA,EAACK,UAAU;IACV9D,IAAI,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBqB,QAAQ,EAAGA,QAAU;IACrByC,OAAO,EAAGA,CAAA,KAAMgB,WAAW,CAAE,IAAK;EAAG,CACrC,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = TemplateContentPanel;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
var _i18n = require("@wordpress/i18n");
|
|
12
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
13
|
+
/**
|
|
14
|
+
* WordPress dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
BlockQuickNavigation
|
|
23
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
|
+
const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
|
|
25
|
+
function TemplateContentPanel() {
|
|
26
|
+
const clientIds = (0, _data.useSelect)(select => {
|
|
27
|
+
const {
|
|
28
|
+
getBlocksByName
|
|
29
|
+
} = select(_blockEditor.store);
|
|
30
|
+
return getBlocksByName(PAGE_CONTENT_BLOCKS);
|
|
31
|
+
}, []);
|
|
32
|
+
return (0, _react.createElement)(_components.PanelBody, {
|
|
33
|
+
title: (0, _i18n.__)('Content')
|
|
34
|
+
}, (0, _react.createElement)(BlockQuickNavigation, {
|
|
35
|
+
clientIds: clientIds
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_data","require","_blockEditor","_components","_i18n","_lockUnlock","BlockQuickNavigation","unlock","blockEditorPrivateApis","PAGE_CONTENT_BLOCKS","TemplateContentPanel","clientIds","useSelect","select","getBlocksByName","blockEditorStore","_react","createElement","PanelBody","title","__"],"sources":["@wordpress/editor/src/components/template-content-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nconst PAGE_CONTENT_BLOCKS = [\n\t'core/post-content',\n\t'core/post-featured-image',\n\t'core/post-title',\n];\n\nexport default function TemplateContentPanel() {\n\tconst clientIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\treturn getBlocksByName( PAGE_CONTENT_BLOCKS );\n\t}, [] );\n\n\treturn (\n\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t<BlockQuickNavigation clientIds={ clientIds } />\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,MAAMC,mBAAmB,GAAG,CAC3B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,CACjB;AAEc,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,SAAS,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IACtD,OAAOD,eAAe,CAAEL,mBAAoB,CAAC;EAC9C,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACd,WAAA,CAAAe,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU;EAAG,GACnC,IAAAJ,MAAA,CAAAC,aAAA,EAACX,oBAAoB;IAACK,SAAS,EAAGA;EAAW,CAAE,CACrC,CAAC;AAEd","ignoreList":[]}
|
|
@@ -21,7 +21,8 @@ const {
|
|
|
21
21
|
PatternOverridesControls,
|
|
22
22
|
ResetOverridesControl,
|
|
23
23
|
PATTERN_TYPES,
|
|
24
|
-
PARTIAL_SYNCING_SUPPORTED_BLOCKS
|
|
24
|
+
PARTIAL_SYNCING_SUPPORTED_BLOCKS,
|
|
25
|
+
PATTERN_SYNC_TYPES
|
|
25
26
|
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -48,21 +49,25 @@ function ControlsWithStoreSubscription(props) {
|
|
|
48
49
|
const blockEditingMode = (0, _blockEditor.useBlockEditingMode)();
|
|
49
50
|
const {
|
|
50
51
|
hasPatternOverridesSource,
|
|
51
|
-
|
|
52
|
+
isEditingSyncedPattern
|
|
52
53
|
} = (0, _data.useSelect)(select => {
|
|
53
54
|
const {
|
|
54
55
|
getBlockBindingsSource
|
|
55
56
|
} = (0, _lockUnlock.unlock)(select(_blocks.store));
|
|
57
|
+
const {
|
|
58
|
+
getCurrentPostType,
|
|
59
|
+
getEditedPostAttribute
|
|
60
|
+
} = select(_store.store);
|
|
56
61
|
return {
|
|
57
62
|
// For editing link to the site editor if the theme and user permissions support it.
|
|
58
63
|
hasPatternOverridesSource: !!getBlockBindingsSource('core/pattern-overrides'),
|
|
59
|
-
|
|
64
|
+
isEditingSyncedPattern: getCurrentPostType() === PATTERN_TYPES.user && getEditedPostAttribute('meta')?.wp_pattern_sync_status !== PATTERN_SYNC_TYPES.unsynced && getEditedPostAttribute('wp_pattern_sync_status') !== PATTERN_SYNC_TYPES.unsynced
|
|
60
65
|
};
|
|
61
66
|
}, []);
|
|
62
67
|
const bindings = props.attributes.metadata?.bindings;
|
|
63
68
|
const hasPatternBindings = !!bindings && Object.values(bindings).some(binding => binding.source === 'core/pattern-overrides');
|
|
64
|
-
const shouldShowPatternOverridesControls =
|
|
65
|
-
const shouldShowResetOverridesControl = !
|
|
69
|
+
const shouldShowPatternOverridesControls = isEditingSyncedPattern && blockEditingMode === 'default';
|
|
70
|
+
const shouldShowResetOverridesControl = !isEditingSyncedPattern && !!props.attributes.metadata?.name && blockEditingMode !== 'disabled' && hasPatternBindings;
|
|
66
71
|
if (!hasPatternOverridesSource) {
|
|
67
72
|
return null;
|
|
68
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hooks","require","_patterns","_compose","_blockEditor","_data","_blocks","_store","_lockUnlock","PatternOverridesControls","ResetOverridesControl","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","unlock","patternsPrivateApis","withPatternOverrideControls","createHigherOrderComponent","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","_react","createElement","Fragment","isSelected","ControlsWithStoreSubscription","blockEditingMode","useBlockEditingMode","hasPatternOverridesSource","
|
|
1
|
+
{"version":3,"names":["_hooks","require","_patterns","_compose","_blockEditor","_data","_blocks","_store","_lockUnlock","PatternOverridesControls","ResetOverridesControl","PATTERN_TYPES","PARTIAL_SYNCING_SUPPORTED_BLOCKS","PATTERN_SYNC_TYPES","unlock","patternsPrivateApis","withPatternOverrideControls","createHigherOrderComponent","BlockEdit","props","isSupportedBlock","Object","keys","includes","name","_react","createElement","Fragment","isSelected","ControlsWithStoreSubscription","blockEditingMode","useBlockEditingMode","hasPatternOverridesSource","isEditingSyncedPattern","useSelect","select","getBlockBindingsSource","blocksStore","getCurrentPostType","getEditedPostAttribute","editorStore","user","wp_pattern_sync_status","unsynced","bindings","attributes","metadata","hasPatternBindings","values","some","binding","source","shouldShowPatternOverridesControls","shouldShowResetOverridesControl","addFilter"],"sources":["@wordpress/editor/src/hooks/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useBlockEditingMode } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst {\n\tPatternOverridesControls,\n\tResetOverridesControl,\n\tPATTERN_TYPES,\n\tPARTIAL_SYNCING_SUPPORTED_BLOCKS,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternsPrivateApis );\n\n/**\n * Override the default edit UI to include a new block inspector control for\n * assigning a partial syncing controls to supported blocks in the pattern editor.\n * Currently, only the `core/paragraph` block is supported.\n *\n * @param {Component} BlockEdit Original component.\n *\n * @return {Component} Wrapped component.\n */\nconst withPatternOverrideControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isSupportedBlock = Object.keys(\n\t\t\tPARTIAL_SYNCING_SUPPORTED_BLOCKS\n\t\t).includes( props.name );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ props.isSelected && isSupportedBlock && (\n\t\t\t\t\t<ControlsWithStoreSubscription { ...props } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\n// Split into a separate component to avoid a store subscription\n// on every block.\nfunction ControlsWithStoreSubscription( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst { hasPatternOverridesSource, isEditingSyncedPattern } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst { getCurrentPostType, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\t// For editing link to the site editor if the theme and user permissions support it.\n\t\t\t\thasPatternOverridesSource: !! getBlockBindingsSource(\n\t\t\t\t\t'core/pattern-overrides'\n\t\t\t\t),\n\t\t\t\tisEditingSyncedPattern:\n\t\t\t\t\tgetCurrentPostType() === PATTERN_TYPES.user &&\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.wp_pattern_sync_status !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced &&\n\t\t\t\t\tgetEditedPostAttribute( 'wp_pattern_sync_status' ) !==\n\t\t\t\t\t\tPATTERN_SYNC_TYPES.unsynced,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst bindings = props.attributes.metadata?.bindings;\n\tconst hasPatternBindings =\n\t\t!! bindings &&\n\t\tObject.values( bindings ).some(\n\t\t\t( binding ) => binding.source === 'core/pattern-overrides'\n\t\t);\n\n\tconst shouldShowPatternOverridesControls =\n\t\tisEditingSyncedPattern && blockEditingMode === 'default';\n\tconst shouldShowResetOverridesControl =\n\t\t! isEditingSyncedPattern &&\n\t\t!! props.attributes.metadata?.name &&\n\t\tblockEditingMode !== 'disabled' &&\n\t\thasPatternBindings;\n\n\tif ( ! hasPatternOverridesSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ shouldShowPatternOverridesControls && (\n\t\t\t\t<PatternOverridesControls { ...props } />\n\t\t\t) }\n\t\t\t{ shouldShowResetOverridesControl && (\n\t\t\t\t<ResetOverridesControl { ...props } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/with-pattern-override-controls',\n\twithPatternOverrideControls\n);\n"],"mappings":";;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA,MAAM;EACLQ,wBAAwB;EACxBC,qBAAqB;EACrBC,aAAa;EACbC,gCAAgC;EAChCC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAoB,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,IAAAC,mCAA0B,EAC3DC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CACnCV,gCACD,CAAC,CAACW,QAAQ,CAAEJ,KAAK,CAACK,IAAK,CAAC;EAExB,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACR,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBA,KAAK,CAACS,UAAU,IAAIR,gBAAgB,IACrC,IAAAK,MAAA,CAAAC,aAAA,EAACG,6BAA6B;IAAA,GAAMV;EAAK,CAAI,CAE7C,CAAC;AAEL,CACD,CAAC;;AAED;AACA;AACA,SAASU,6BAA6BA,CAAEV,KAAK,EAAG;EAC/C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QAAA,QACGyB,kCAAkC,IACnC,IAAA3B,MAAA,CAAAC,aAAA,EAACjB,wBAAwB;IAAA,GAAMU;EAAK,CAAI,CACxC,EACCkC,+BAA+B,IAChC,IAAA5B,MAAA,CAAAC,aAAA,EAAChB,qBAAqB;IAAA,GAAMS;EAAK,CAAI,CAErC,CAAC;AAEL;AAEA,IAAAmC,gBAAS,EACR,kBAAkB,EAClB,4CAA4C,EAC5CtC,2BACD,CAAC","ignoreList":[]}
|
package/build/private-apis.js
CHANGED
|
@@ -12,20 +12,25 @@ var _lockUnlock = require("./lock-unlock");
|
|
|
12
12
|
var _entitiesSavedStates = require("./components/entities-saved-states");
|
|
13
13
|
var _useAutoSwitchEditorSidebars = _interopRequireDefault(require("./components/provider/use-auto-switch-editor-sidebars"));
|
|
14
14
|
var _useBlockEditorSettings = _interopRequireDefault(require("./components/provider/use-block-editor-settings"));
|
|
15
|
-
var
|
|
15
|
+
var _header = _interopRequireDefault(require("./components/header"));
|
|
16
16
|
var _inserterSidebar = _interopRequireDefault(require("./components/inserter-sidebar"));
|
|
17
17
|
var _listViewSidebar = _interopRequireDefault(require("./components/list-view-sidebar"));
|
|
18
|
-
var _modeSwitcher = _interopRequireDefault(require("./components/mode-switcher"));
|
|
19
18
|
var _patternOverridesPanel = _interopRequireDefault(require("./components/pattern-overrides-panel"));
|
|
20
19
|
var _plugin = _interopRequireDefault(require("./components/post-excerpt/plugin"));
|
|
21
20
|
var _postPanelRow = _interopRequireDefault(require("./components/post-panel-row"));
|
|
22
|
-
var _postViewLink = _interopRequireDefault(require("./components/post-view-link"));
|
|
23
|
-
var _previewDropdown = _interopRequireDefault(require("./components/preview-dropdown"));
|
|
24
21
|
var _preferencesModal = _interopRequireDefault(require("./components/preferences-modal"));
|
|
25
22
|
var _postActions = _interopRequireDefault(require("./components/post-actions"));
|
|
26
23
|
var _actions = require("./components/post-actions/actions");
|
|
27
24
|
var _postCardPanel = _interopRequireDefault(require("./components/post-card-panel"));
|
|
28
25
|
var _postStatus = _interopRequireDefault(require("./components/post-status"));
|
|
26
|
+
var _toolsMoreMenuGroup = _interopRequireDefault(require("./components/more-menu/tools-more-menu-group"));
|
|
27
|
+
var _viewMoreMenuGroup = _interopRequireDefault(require("./components/more-menu/view-more-menu-group"));
|
|
28
|
+
var _panel = require("./components/post-excerpt/panel");
|
|
29
|
+
var _savePublishPanels = _interopRequireDefault(require("./components/save-publish-panels"));
|
|
30
|
+
var _postContentInformation = _interopRequireDefault(require("./components/post-content-information"));
|
|
31
|
+
var _postLastEditedPanel = _interopRequireDefault(require("./components/post-last-edited-panel"));
|
|
32
|
+
var _sidebar = _interopRequireDefault(require("./components/sidebar"));
|
|
33
|
+
var _globalStylesProvider = require("./components/global-styles-provider");
|
|
29
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
30
35
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
31
36
|
/**
|
|
@@ -42,23 +47,29 @@ const {
|
|
|
42
47
|
} = interfaceApis;
|
|
43
48
|
const privateApis = exports.privateApis = {};
|
|
44
49
|
(0, _lockUnlock.lock)(privateApis, {
|
|
45
|
-
DocumentTools: _documentTools.default,
|
|
46
50
|
EditorCanvas: _editorCanvas.default,
|
|
47
51
|
ExperimentalEditorProvider: _provider.ExperimentalEditorProvider,
|
|
48
52
|
EntitiesSavedStatesExtensible: _entitiesSavedStates.EntitiesSavedStatesExtensible,
|
|
53
|
+
GlobalStylesProvider: _globalStylesProvider.GlobalStylesProvider,
|
|
54
|
+
Header: _header.default,
|
|
49
55
|
InserterSidebar: _inserterSidebar.default,
|
|
50
56
|
ListViewSidebar: _listViewSidebar.default,
|
|
51
|
-
|
|
57
|
+
mergeBaseAndUserConfigs: _globalStylesProvider.mergeBaseAndUserConfigs,
|
|
52
58
|
PatternOverridesPanel: _patternOverridesPanel.default,
|
|
53
59
|
PluginPostExcerpt: _plugin.default,
|
|
54
60
|
PostActions: _postActions.default,
|
|
55
61
|
PostPanelRow: _postPanelRow.default,
|
|
56
|
-
PostViewLink: _postViewLink.default,
|
|
57
|
-
PreviewDropdown: _previewDropdown.default,
|
|
58
62
|
PreferencesModal: _preferencesModal.default,
|
|
59
63
|
usePostActions: _actions.usePostActions,
|
|
60
64
|
PostCardPanel: _postCardPanel.default,
|
|
61
65
|
PostStatus: _postStatus.default,
|
|
66
|
+
ToolsMoreMenuGroup: _toolsMoreMenuGroup.default,
|
|
67
|
+
ViewMoreMenuGroup: _viewMoreMenuGroup.default,
|
|
68
|
+
PrivatePostExcerptPanel: _panel.PrivatePostExcerptPanel,
|
|
69
|
+
SavePublishPanels: _savePublishPanels.default,
|
|
70
|
+
PostContentInformation: _postContentInformation.default,
|
|
71
|
+
PostLastEditedPanel: _postLastEditedPanel.default,
|
|
72
|
+
Sidebar: _sidebar.default,
|
|
62
73
|
// This is a temporary private API while we're updating the site editor to use EditorProvider.
|
|
63
74
|
useAutoSwitchEditorSidebars: _useAutoSwitchEditorSidebars.default,
|
|
64
75
|
useBlockEditorSettings: _useBlockEditorSettings.default,
|