@wordpress/edit-site 5.28.5 → 5.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/actions/index.js +1 -1
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +10 -11
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +2 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/code-editor/index.js +3 -2
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/editor/index.js +5 -19
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +9 -0
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +11 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +5 -16
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +2 -2
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +27 -0
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +50 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +131 -0
- package/build/components/global-styles/preview-iframe.js.map +1 -0
- package/build/components/global-styles/preview-styles.js +163 -0
- package/build/components/global-styles/preview-styles.js.map +1 -0
- package/build/components/global-styles/preview-typography.js +65 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +10 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +12 -84
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -0
- package/build/components/global-styles/utils.js +22 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +90 -0
- package/build/components/global-styles/variations/variation.js.map +1 -0
- package/build/components/global-styles/variations/variations-color.js +36 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -0
- package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build/components/global-styles/variations/variations-typography.js +64 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/document-tools/index.js +1 -2
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -13
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +17 -6
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -18
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +4 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +0 -1
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
- package/build/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +14 -6
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-panel/index.js +18 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +48 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +3 -171
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +4 -5
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +156 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build/store/actions.js +19 -50
- package/build/store/actions.js.map +1 -1
- package/build/utils/clone-deep.js +15 -0
- package/build/utils/clone-deep.js.map +1 -0
- package/build-module/components/actions/index.js +1 -1
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +10 -11
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +2 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/code-editor/index.js +3 -2
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +6 -20
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +2 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -0
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +12 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -18
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -2
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +26 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +43 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +54 -0
- package/build-module/components/global-styles/preview-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-iframe.js +124 -0
- package/build-module/components/global-styles/preview-iframe.js.map +1 -0
- package/build-module/components/global-styles/preview-styles.js +155 -0
- package/build-module/components/global-styles/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/preview-typography.js +58 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +10 -2
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +10 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +13 -85
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- package/build-module/components/global-styles/utils.js +21 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +82 -0
- package/build-module/components/global-styles/variations/variation.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-color.js +28 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
- package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js +56 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/document-tools/index.js +1 -2
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +17 -14
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +19 -8
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -18
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +5 -3
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +0 -1
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +13 -5
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +18 -3
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +50 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -172
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +144 -0
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build-module/store/actions.js +19 -50
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/clone-deep.js +9 -0
- package/build-module/utils/clone-deep.js.map +1 -0
- package/build-style/style-rtl.css +152 -472
- package/build-style/style.css +152 -472
- package/package.json +43 -42
- package/src/components/actions/index.js +1 -1
- package/src/components/block-editor/editor-canvas.js +13 -12
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/block-editor/use-site-editor-settings.js +1 -0
- package/src/components/code-editor/index.js +3 -2
- package/src/components/editor/index.js +10 -27
- package/src/components/editor-canvas-container/index.js +2 -5
- package/src/components/{test → error-boundary/test}/error-boundary.js +7 -5
- package/src/components/global-styles/color-palette-panel.js +11 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +24 -0
- package/src/components/global-styles/font-library-modal/font-collection.js +7 -24
- package/src/components/global-styles/font-library-modal/index.js +2 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/library-font-variant.js +1 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/utils/index.js +34 -0
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +2 -1
- package/src/components/global-styles/gradients-palette-panel.js +2 -2
- package/src/components/global-styles/header.js +1 -1
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +153 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/preview-typography.js +62 -0
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +4 -1
- package/src/components/global-styles/screen-colors.js +13 -1
- package/src/components/global-styles/screen-revisions/style.scss +2 -2
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography.js +19 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +1 -35
- package/src/components/global-styles/utils.js +37 -0
- package/src/components/global-styles/variations/style.scss +44 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +30 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +85 -0
- package/src/components/header-edit-mode/document-tools/index.js +1 -2
- package/src/components/header-edit-mode/index.js +22 -31
- package/src/components/header-edit-mode/more-menu/index.js +25 -11
- package/src/components/header-edit-mode/style.scss +4 -0
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -11
- package/src/components/keyboard-shortcuts/register.js +0 -19
- package/src/components/layout/index.js +5 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +41 -10
- package/src/components/page-patterns/header.js +1 -0
- package/src/components/page-patterns/index.js +1 -2
- package/src/components/page-patterns/style.scss +0 -182
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +20 -3
- package/src/components/page-templates-template-parts/style.scss +48 -0
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-button/index.js +2 -1
- package/src/components/save-hub/style.scss +1 -1
- package/src/components/save-panel/index.js +34 -12
- package/src/components/sidebar/index.js +1 -1
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +5 -7
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/style.scss +4 -0
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +37 -24
- package/src/components/sidebar-edit-mode/template-panel/index.js +76 -18
- package/src/components/sidebar-edit-mode/template-panel/style.scss +5 -14
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +1 -12
- package/src/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/start-template-options/index.js +1 -1
- package/src/hooks/commands/use-edit-mode-commands.js +3 -184
- package/src/hooks/index.js +0 -1
- package/src/hooks/push-changes-to-global-styles/index.js +1 -4
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1137 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +159 -0
- package/src/store/actions.js +21 -85
- package/src/store/test/actions.js +0 -75
- package/src/style.scss +3 -8
- package/src/utils/clone-deep.js +8 -0
- package/build/components/global-styles/preview.js +0 -271
- package/build/components/global-styles/preview.js.map +0 -1
- package/build/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build/components/global-styles/variations-panel.js.map +0 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -62
- package/build/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build/components/list/added-by.js.map +0 -1
- package/build/components/list/header.js +0 -55
- package/build/components/list/header.js.map +0 -1
- package/build/components/list/index.js +0 -80
- package/build/components/list/index.js.map +0 -1
- package/build/components/list/table.js +0 -94
- package/build/components/list/table.js.map +0 -1
- package/build/components/list/use-register-shortcuts.js +0 -51
- package/build/components/list/use-register-shortcuts.js.map +0 -1
- package/build/components/page-patterns/duplicate-menu-item.js +0 -93
- package/build/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build/components/page-patterns/grid-item.js +0 -223
- package/build/components/page-patterns/grid-item.js.map +0 -1
- package/build/components/page-patterns/grid.js +0 -31
- package/build/components/page-patterns/grid.js.map +0 -1
- package/build/components/page-patterns/no-patterns.js +0 -18
- package/build/components/page-patterns/no-patterns.js.map +0 -1
- package/build/components/page-patterns/patterns-list.js +0 -168
- package/build/components/page-patterns/patterns-list.js.map +0 -1
- package/build/components/page-patterns/rename-menu-item.js +0 -105
- package/build/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -83
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +0 -36
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build/hooks/navigation-menu-edit.js +0 -82
- package/build/hooks/navigation-menu-edit.js.map +0 -1
- package/build-module/components/global-styles/preview.js +0 -264
- package/build-module/components/global-styles/preview.js.map +0 -1
- package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build-module/components/global-styles/variations-panel.js.map +0 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -56
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build-module/components/list/added-by.js.map +0 -1
- package/build-module/components/list/header.js +0 -47
- package/build-module/components/list/header.js.map +0 -1
- package/build-module/components/list/index.js +0 -72
- package/build-module/components/list/index.js.map +0 -1
- package/build-module/components/list/table.js +0 -86
- package/build-module/components/list/table.js.map +0 -1
- package/build-module/components/list/use-register-shortcuts.js +0 -45
- package/build-module/components/list/use-register-shortcuts.js.map +0 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +0 -85
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build-module/components/page-patterns/grid-item.js +0 -215
- package/build-module/components/page-patterns/grid-item.js.map +0 -1
- package/build-module/components/page-patterns/grid.js +0 -23
- package/build-module/components/page-patterns/grid.js.map +0 -1
- package/build-module/components/page-patterns/no-patterns.js +0 -11
- package/build-module/components/page-patterns/no-patterns.js.map +0 -1
- package/build-module/components/page-patterns/patterns-list.js +0 -160
- package/build-module/components/page-patterns/patterns-list.js.map +0 -1
- package/build-module/components/page-patterns/rename-menu-item.js +0 -98
- package/build-module/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -76
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -29
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build-module/hooks/navigation-menu-edit.js +0 -75
- package/build-module/hooks/navigation-menu-edit.js.map +0 -1
- package/src/components/global-styles/preview.js +0 -327
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -60
- package/src/components/list/header.js +0 -48
- package/src/components/list/index.js +0 -87
- package/src/components/list/style.scss +0 -188
- package/src/components/list/table.js +0 -140
- package/src/components/list/use-register-shortcuts.js +0 -49
- package/src/components/page-patterns/duplicate-menu-item.js +0 -105
- package/src/components/page-patterns/grid-item.js +0 -331
- package/src/components/page-patterns/grid.js +0 -22
- package/src/components/page-patterns/no-patterns.js +0 -12
- package/src/components/page-patterns/patterns-list.js +0 -229
- package/src/components/page-patterns/rename-menu-item.js +0 -132
- package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -89
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
- package/src/hooks/navigation-menu-edit.js +0 -92
- /package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +0 -0
package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","map","variation","result","title","description"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif ( typeof object !== 'object' || ! Object.keys( object ).length ) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.map( ( variation ) => {\n\t\t\tlet result = {\n\t\t\t\t...filterObjectByProperty( cloneDeep( variation ), property ),\n\t\t\t\ttitle: variation?.title,\n\t\t\t\tdescription: variation?.description,\n\t\t\t};\n\n\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t/*\n\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t */\n\t\t\t\tresult = mergeBaseAndUserConfigs( clonedBaseVariation, result );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,uDAAuD;AAC/F,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAoB,CAAC,GAAGD,MAAM,CAAEH,sBAAuB,CAAC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,wBAAwBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EAC5D,IAAK,CAAEA,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAG;IACjD,OAAOD,MAAM;EACd;EAEA,IAAK,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAAEE,MAAM,CAACC,IAAI,CAAEH,MAAO,CAAC,CAACI,M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E,CAAC;IAEH,IAAK,UAAU,KAAK,OAAOf,MAAM,EAAG;MACnCY,wBAAwB,GACvBA,wBAAwB,CAACZ,MAAM,CAAEA,MAAO,CAAC;IAC3C;IAEA,OAAOY,wBAAwB;EAChC,CAAC,EAAE,CAAEX,UAAU,EAAEP,QAAQ,EAAEW,aAAa,EAAEL,MAAM,CAAG,CAAC;AACrD"}
|
|
@@ -11,7 +11,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
11
11
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
12
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
13
|
import { store as editorStore } from '@wordpress/editor';
|
|
14
|
-
import { speak } from '@wordpress/a11y';
|
|
15
14
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
16
15
|
|
|
17
16
|
/**
|
|
@@ -413,13 +412,8 @@ export const revertTemplate = (template, {
|
|
|
413
412
|
* @param {?string} name Sidebar name to be opened.
|
|
414
413
|
*/
|
|
415
414
|
export const openGeneralSidebar = name => ({
|
|
416
|
-
dispatch,
|
|
417
415
|
registry
|
|
418
416
|
}) => {
|
|
419
|
-
const isDistractionFree = registry.select(preferencesStore).get('core', 'distractionFree');
|
|
420
|
-
if (isDistractionFree) {
|
|
421
|
-
dispatch.toggleDistractionFree();
|
|
422
|
-
}
|
|
423
417
|
registry.dispatch(interfaceStore).enableComplementaryArea(editSiteStoreName, name);
|
|
424
418
|
};
|
|
425
419
|
|
|
@@ -431,25 +425,22 @@ export const closeGeneralSidebar = () => ({
|
|
|
431
425
|
}) => {
|
|
432
426
|
registry.dispatch(interfaceStore).disableComplementaryArea(editSiteStoreName);
|
|
433
427
|
};
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Triggers an action used to switch editor mode.
|
|
431
|
+
*
|
|
432
|
+
* @deprecated
|
|
433
|
+
*
|
|
434
|
+
* @param {string} mode The editor mode.
|
|
435
|
+
*/
|
|
434
436
|
export const switchEditorMode = mode => ({
|
|
435
|
-
dispatch,
|
|
436
437
|
registry
|
|
437
438
|
}) => {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
if (mode === 'visual') {
|
|
445
|
-
speak(__('Visual editor selected'), 'assertive');
|
|
446
|
-
} else if (mode === 'text') {
|
|
447
|
-
const isDistractionFree = registry.select(preferencesStore).get('core', 'distractionFree');
|
|
448
|
-
if (isDistractionFree) {
|
|
449
|
-
dispatch.toggleDistractionFree();
|
|
450
|
-
}
|
|
451
|
-
speak(__('Code editor selected'), 'assertive');
|
|
452
|
-
}
|
|
439
|
+
deprecated("dispatch( 'core/edit-site' ).switchEditorMode", {
|
|
440
|
+
since: '6.6',
|
|
441
|
+
alternative: "dispatch( 'core/editor').switchEditorMode"
|
|
442
|
+
});
|
|
443
|
+
registry.dispatch(editorStore).switchEditorMode(mode);
|
|
453
444
|
};
|
|
454
445
|
|
|
455
446
|
/**
|
|
@@ -479,38 +470,16 @@ export const setHasPageContentFocus = hasPageContentFocus => ({
|
|
|
479
470
|
* Action that toggles Distraction free mode.
|
|
480
471
|
* Distraction free mode expects there are no sidebars, as due to the
|
|
481
472
|
* z-index values set, you can't close sidebars.
|
|
473
|
+
*
|
|
474
|
+
* @deprecated
|
|
482
475
|
*/
|
|
483
476
|
export const toggleDistractionFree = () => ({
|
|
484
|
-
dispatch,
|
|
485
477
|
registry
|
|
486
478
|
}) => {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
if (!isDistractionFree) {
|
|
492
|
-
registry.batch(() => {
|
|
493
|
-
registry.dispatch(preferencesStore).set('core', 'fixedToolbar', true);
|
|
494
|
-
registry.dispatch(editorStore).setIsInserterOpened(false);
|
|
495
|
-
registry.dispatch(editorStore).setIsListViewOpened(false);
|
|
496
|
-
dispatch.closeGeneralSidebar();
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
registry.batch(() => {
|
|
500
|
-
registry.dispatch(preferencesStore).set('core', 'distractionFree', !isDistractionFree);
|
|
501
|
-
registry.dispatch(noticesStore).createInfoNotice(isDistractionFree ? __('Distraction free off.') : __('Distraction free on.'), {
|
|
502
|
-
id: 'core/edit-site/distraction-free-mode/notice',
|
|
503
|
-
type: 'snackbar',
|
|
504
|
-
actions: [{
|
|
505
|
-
label: __('Undo'),
|
|
506
|
-
onClick: () => {
|
|
507
|
-
registry.batch(() => {
|
|
508
|
-
registry.dispatch(preferencesStore).set('core', 'fixedToolbar', isDistractionFree ? true : false);
|
|
509
|
-
registry.dispatch(preferencesStore).toggle('core', 'distractionFree');
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
}]
|
|
513
|
-
});
|
|
479
|
+
deprecated("dispatch( 'core/edit-site' ).toggleDistractionFree", {
|
|
480
|
+
since: '6.6',
|
|
481
|
+
alternative: "dispatch( 'core/editor').toggleDistractionFree"
|
|
514
482
|
});
|
|
483
|
+
registry.dispatch(editorStore).toggleDistractionFree();
|
|
515
484
|
};
|
|
516
485
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","speak","preferencesStore","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","removeTemplates","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","createErrorNotice","templateEntityConfig","select","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","createSuccessNotice","actions","label","onClick","error","errorMessage","message","code","openGeneralSidebar","name","isDistractionFree","get","toggleDistractionFree","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { removeTemplates } from './private-actions';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate = ( template ) => {\n\treturn removeTemplates( [ template ] );\n};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'fixedToolbar', false );\n\t\t}\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core', 'fixedToolbar', true );\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( 'core', 'distractionFree', ! isDistractionFree );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t.set(\n\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\t\t\tisDistractionFree ? true : false\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t\t\t'distractionFree'\n\t\t\t\t\t\t\t\t\t\t\t);\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],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B,S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ACH,CAAE,CAAC;QACJ;MACD,CAAC;IAEH,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","preferencesStore","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","removeTemplates","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","createErrorNotice","templateEntityConfig","select","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","createSuccessNotice","actions","label","onClick","error","errorMessage","message","code","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","setHasPageContentFocus","hasPageContentFocus","clearSelectedBlock","toggleDistractionFree"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { removeTemplates } from './private-actions';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate = ( template ) => {\n\treturn removeTemplates( [ template ] );\n};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC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EAAE;IAClEoB,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,IAAK6E,mBAAmB,EAAG;IAC1B9E,QAAQ,CAACG,QAAQ,CAAEf,gBAAiB,CAAC,CAAC2F,kBAAkB,CAAC,CAAC;EAC3D;EACA5E,QAAQ,CAAE;IACTQ,IAAI,EAAE,4BAA4B;IAClCmE;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAEhF;AAAS,CAAC,KAAM;EACnBnB,UAAU,CAAE,oDAAoD,EAAE;IACjEoB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAAC2F,qBAAqB,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes a copy of an object without storing any references to the original object.
|
|
3
|
+
* @param {Object} object
|
|
4
|
+
* @return {Object} The cloned object.
|
|
5
|
+
*/
|
|
6
|
+
export default function cloneDeep(object) {
|
|
7
|
+
return !object ? {} : JSON.parse(JSON.stringify(object));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=clone-deep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cloneDeep","object","JSON","parse","stringify"],"sources":["@wordpress/edit-site/src/utils/clone-deep.js"],"sourcesContent":["/**\n * Makes a copy of an object without storing any references to the original object.\n * @param {Object} object\n * @return {Object} The cloned object.\n */\nexport default function cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,SAASA,CAAEC,MAAM,EAAG;EAC3C,OAAO,CAAEA,MAAM,GAAG,CAAC,CAAC,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEH,MAAO,CAAE,CAAC;AAC9D"}
|