@wordpress/edit-site 5.25.1-next.79a6196f.0 → 5.27.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 +139 -36
- package/build/components/actions/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/font-families.js +3 -2
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +3 -4
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +80 -41
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +49 -22
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/fonts-grid.js +4 -1
- package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +4 -4
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +16 -8
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +1 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +13 -4
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +49 -20
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +103 -17
- 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 +4 -3
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/layout/hooks.js +6 -5
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +19 -28
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +135 -0
- package/build/components/layout/router.js.map +1 -0
- package/build/components/page-pages/index.js +92 -69
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +11 -6
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/index.js +295 -15
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +51 -23
- package/build/components/page-templates-template-parts/actions.js.map +1 -0
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +395 -0
- package/build/components/page-templates-template-parts/index.js.map +1 -0
- package/build/components/preferences-modal/index.js +9 -134
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-button/index.js +4 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-panel/index.js +6 -5
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +3 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +4 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +2 -2
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +8 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +2 -10
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +26 -3
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +76 -0
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +3 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -12
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +33 -5
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +13 -6
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +7 -6
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +11 -29
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +85 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +2 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/use-actual-current-theme.js +32 -0
- package/build/utils/use-actual-current-theme.js.map +1 -0
- package/build-module/components/actions/index.js +139 -36
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +3 -2
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +4 -5
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +82 -42
- 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 +49 -22
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js +4 -1
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +4 -4
- 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 +16 -8
- 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-card.js +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- 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/local-fonts.js +13 -4
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +45 -18
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +17 -2
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +99 -16
- 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 +4 -3
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +4 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/layout/hooks.js +6 -5
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +19 -28
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +127 -0
- package/build-module/components/layout/router.js.map +1 -0
- package/build-module/components/page-pages/index.js +91 -70
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -6
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/index.js +296 -16
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +52 -24
- package/build-module/components/page-templates-template-parts/actions.js.map +1 -0
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +385 -0
- package/build-module/components/page-templates-template-parts/index.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +12 -136
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-button/index.js +4 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +7 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +3 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +4 -2
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +8 -7
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -10
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +27 -4
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +68 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +9 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +3 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +47 -11
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +25 -2
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +33 -5
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +13 -6
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +7 -6
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +13 -30
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +83 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/use-actual-current-theme.js +24 -0
- package/build-module/utils/use-actual-current-theme.js.map +1 -0
- package/build-style/style-rtl.css +293 -188
- package/build-style/style.css +293 -188
- package/package.json +42 -42
- package/src/components/actions/index.js +236 -84
- package/src/components/editor-canvas-container/index.js +1 -1
- package/src/components/global-styles/font-families.js +14 -8
- package/src/components/global-styles/font-family-item.js +7 -4
- package/src/components/global-styles/font-library-modal/context.js +156 -50
- package/src/components/global-styles/font-library-modal/font-collection.js +56 -21
- package/src/components/global-styles/font-library-modal/fonts-grid.js +6 -2
- package/src/components/global-styles/font-library-modal/index.js +4 -4
- package/src/components/global-styles/font-library-modal/installed-fonts.js +18 -8
- package/src/components/global-styles/font-library-modal/library-font-card.js +2 -1
- package/src/components/global-styles/font-library-modal/library-font-variant.js +10 -9
- package/src/components/global-styles/font-library-modal/local-fonts.js +14 -4
- package/src/components/global-styles/font-library-modal/resolvers.js +50 -17
- package/src/components/global-styles/font-library-modal/style.scss +1 -0
- package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +19 -2
- package/src/components/global-styles/font-library-modal/utils/index.js +136 -29
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +7 -3
- package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +40 -10
- package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +5 -5
- package/src/components/global-styles/screen-typography.js +9 -3
- package/src/components/global-styles/style.scss +4 -0
- package/src/components/header-edit-mode/style.scss +15 -5
- package/src/components/layout/hooks.js +6 -5
- package/src/components/layout/index.js +80 -96
- package/src/components/layout/router.js +121 -0
- package/src/components/layout/style.scss +13 -16
- package/src/components/page/style.scss +1 -8
- package/src/components/page-pages/index.js +142 -148
- package/src/components/page-pages/style.scss +41 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +11 -6
- package/src/components/page-patterns/index.js +392 -14
- package/src/components/page-patterns/style.scss +36 -2
- package/src/components/{page-templates/template-actions.js → page-templates-template-parts/actions.js} +90 -37
- package/src/components/{page-templates → page-templates-template-parts}/index.js +198 -169
- package/src/components/page-templates-template-parts/style.scss +44 -0
- package/src/components/preferences-modal/index.js +8 -211
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-button/index.js +7 -4
- package/src/components/save-panel/index.js +13 -12
- package/src/components/sidebar/index.js +4 -5
- package/src/components/sidebar-dataviews/dataview-item.js +2 -1
- package/src/components/sidebar-dataviews/default-views.js +4 -2
- package/src/components/sidebar-dataviews/index.js +8 -6
- package/src/components/sidebar-navigation-item/style.scss +1 -1
- package/src/components/sidebar-navigation-screen/index.js +19 -10
- package/src/components/sidebar-navigation-screen-pages/index.js +2 -10
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +32 -6
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +73 -0
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -1
- package/src/components/site-hub/index.js +4 -1
- package/src/components/site-hub/style.scss +1 -12
- package/src/components/site-icon/style.scss +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +40 -10
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +32 -0
- package/src/hooks/commands/use-edit-mode-commands.js +50 -3
- package/src/hooks/push-changes-to-global-styles/index.js +29 -23
- package/src/hooks/template-part-edit.js +12 -12
- package/src/index.js +1 -1
- package/src/store/actions.js +17 -51
- package/src/store/private-actions.js +133 -0
- package/src/store/selectors.js +2 -4
- package/src/style.scss +1 -1
- package/src/utils/get-is-list-page.js +3 -2
- package/src/utils/use-actual-current-theme.js +27 -0
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -71
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
- package/build/components/page-main/index.js +0 -44
- package/build/components/page-main/index.js.map +0 -1
- package/build/components/page-patterns/dataviews-patterns.js +0 -307
- package/build/components/page-patterns/dataviews-patterns.js.map +0 -1
- package/build/components/page-template-parts/add-new-template-part.js.map +0 -1
- package/build/components/page-template-parts/index.js +0 -81
- package/build/components/page-template-parts/index.js.map +0 -1
- package/build/components/page-templates/index.js +0 -352
- package/build/components/page-templates/index.js.map +0 -1
- package/build/components/page-templates/template-actions.js.map +0 -1
- package/build/components/post-preview/index.js +0 -29
- package/build/components/post-preview/index.js.map +0 -1
- package/build/components/preferences-modal/enable-feature.js +0 -36
- package/build/components/preferences-modal/enable-feature.js.map +0 -1
- package/build/components/preferences-modal/enable-panel-option.js +0 -33
- package/build/components/preferences-modal/enable-panel-option.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -52
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -63
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +0 -1
- package/build-module/components/page-main/index.js +0 -36
- package/build-module/components/page-main/index.js.map +0 -1
- package/build-module/components/page-patterns/dataviews-patterns.js +0 -299
- package/build-module/components/page-patterns/dataviews-patterns.js.map +0 -1
- package/build-module/components/page-template-parts/add-new-template-part.js.map +0 -1
- package/build-module/components/page-template-parts/index.js +0 -73
- package/build-module/components/page-template-parts/index.js.map +0 -1
- package/build-module/components/page-templates/index.js +0 -344
- package/build-module/components/page-templates/index.js.map +0 -1
- package/build-module/components/page-templates/template-actions.js.map +0 -1
- package/build-module/components/post-preview/index.js +0 -21
- package/build-module/components/post-preview/index.js.map +0 -1
- package/build-module/components/preferences-modal/enable-feature.js +0 -29
- package/build-module/components/preferences-modal/enable-feature.js.map +0 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +0 -26
- package/build-module/components/preferences-modal/enable-panel-option.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +0 -58
- package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +0 -271
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +0 -58
- package/src/components/page-main/index.js +0 -38
- package/src/components/page-patterns/dataviews-patterns.js +0 -380
- package/src/components/page-template-parts/index.js +0 -99
- package/src/components/page-templates/style.scss +0 -13
- package/src/components/post-preview/index.js +0 -16
- package/src/components/preferences-modal/enable-feature.js +0 -31
- package/src/components/preferences-modal/enable-panel-option.js +0 -23
- /package/build/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
- /package/build-module/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
- /package/src/components/{page-template-parts → page-templates-template-parts}/add-new-template-part.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_element","_router","_lockUnlock","_constants","useLocation","useHistory","unlock","routerPrivateApis","getPathFromURL","urlParams","_urlParams$path","path","postType","postId","PATTERN_TYPES","user","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","encodeURIComponent","isSubset","subset","superset","Object","entries","every","key","value","useSyncPathWithURL","history","params","location","navigatorLocation","navigatorParams","goTo","useNavigator","isMounting","useRef","useEffect","current","updateUrlParams","newUrlParams","updatedParams","push","undefined","startsWith","canvas","categoryType","categoryId"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function getPathFromURL( urlParams ) {\n\tlet path = urlParams?.path ?? '/';\n\n\t// Compute the navigator path based on the URL params.\n\tif ( urlParams?.postType && urlParams?.postId ) {\n\t\tswitch ( urlParams.postType ) {\n\t\t\tcase PATTERN_TYPES.user:\n\t\t\tcase TEMPLATE_POST_TYPE:\n\t\t\tcase TEMPLATE_PART_POST_TYPE:\n\t\t\tcase 'page':\n\t\t\t\tpath = `/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpath = `/navigation/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t}\n\t}\n\n\treturn path;\n}\n\nfunction isSubset( subset, superset ) {\n\treturn Object.entries( subset ).every( ( [ key, value ] ) => {\n\t\treturn superset[ key ] === value;\n\t} );\n}\n\nexport default function useSyncPathWithURL() {\n\tconst history = useHistory();\n\tconst { params: urlParams } = useLocation();\n\tconst {\n\t\tlocation: navigatorLocation,\n\t\tparams: navigatorParams,\n\t\tgoTo,\n\t} = useNavigator();\n\tconst isMounting = useRef( true );\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// The navigatorParams are only initially filled properly when the\n\t\t\t// navigator screens mount. so we ignore the first synchronisation.\n\t\t\tif ( isMounting.current ) {\n\t\t\t\tisMounting.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction updateUrlParams( newUrlParams ) {\n\t\t\t\tif ( isSubset( newUrlParams, urlParams ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst updatedParams = {\n\t\t\t\t\t...urlParams,\n\t\t\t\t\t...newUrlParams,\n\t\t\t\t};\n\t\t\t\thistory.push( updatedParams );\n\t\t\t}\n\n\t\t\tif ( navigatorParams?.postType && navigatorParams?.postId ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tnavigatorLocation.path.startsWith( '/page/' ) &&\n\t\t\t\tnavigatorParams?.postId\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t} );\n\t\t\t} else if ( navigatorLocation.path === '/patterns' ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcanvas: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tpath:\n\t\t\t\t\t\tnavigatorLocation.path === '/'\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when navigator changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ navigatorLocation?.path, navigatorParams ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst path = getPathFromURL( urlParams );\n\t\t\tif ( navigatorLocation.path !== path ) {\n\t\t\t\tgoTo( path );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when URL changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ urlParams ]\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAM;EAAEK,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAExD,SAASC,cAAcA,CAAEC,SAAS,EAAG;EAAA,IAAAC,eAAA;EAC3C,IAAIC,IAAI,IAAAD,eAAA,GAAGD,SAAS,EAAEE,IAAI,cAAAD,eAAA,cAAAA,eAAA,GAAI,GAAG;;EAEjC;EACA,IAAKD,SAAS,EAAE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AAE/B,SAAU,CAAC,EAAG;QAC1C;MACD;MACA,MAAMgC,aAAa,GAAG;QACrB,GAAGhC,SAAS;QACZ,GAAG+B;MACJ,CAAC;MACDZ,OAAO,CAACc,IAAI,CAAED,aAAc,CAAC;IAC9B;IAEA,IAAKT,eAAe,EAAEpB,QAAQ,IAAIoB,eAAe,EAAEnB,MAAM,EAAG;MAC3D0B,eAAe,CAAE;QAChB3B,QAAQ,EAAEoB,eAAe,EAAEpB,QAAQ;QACnCC,MAAM,EAAEmB,eAAe,EAAEnB,MAAM;QAC/BF,IAAI,EAAEgC;
|
|
1
|
+
{"version":3,"names":["_components","require","_element","_router","_lockUnlock","_constants","useLocation","useHistory","unlock","routerPrivateApis","getPathFromURL","urlParams","_urlParams$path","path","postType","postId","PATTERN_TYPES","user","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","encodeURIComponent","isSubset","subset","superset","Object","entries","every","key","value","useSyncPathWithURL","history","params","location","navigatorLocation","navigatorParams","goTo","useNavigator","isMounting","useRef","useEffect","current","updateUrlParams","newUrlParams","updatedParams","push","undefined","layout","startsWith","canvas","window","__experimentalAdminViews","categoryType","categoryId"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function getPathFromURL( urlParams ) {\n\tlet path = urlParams?.path ?? '/';\n\n\t// Compute the navigator path based on the URL params.\n\tif ( urlParams?.postType && urlParams?.postId ) {\n\t\tswitch ( urlParams.postType ) {\n\t\t\tcase PATTERN_TYPES.user:\n\t\t\tcase TEMPLATE_POST_TYPE:\n\t\t\tcase TEMPLATE_PART_POST_TYPE:\n\t\t\tcase 'page':\n\t\t\t\tpath = `/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpath = `/navigation/${ encodeURIComponent(\n\t\t\t\t\turlParams.postType\n\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t}\n\t}\n\n\treturn path;\n}\n\nfunction isSubset( subset, superset ) {\n\treturn Object.entries( subset ).every( ( [ key, value ] ) => {\n\t\treturn superset[ key ] === value;\n\t} );\n}\n\nexport default function useSyncPathWithURL() {\n\tconst history = useHistory();\n\tconst { params: urlParams } = useLocation();\n\tconst {\n\t\tlocation: navigatorLocation,\n\t\tparams: navigatorParams,\n\t\tgoTo,\n\t} = useNavigator();\n\tconst isMounting = useRef( true );\n\n\tuseEffect(\n\t\t() => {\n\t\t\t// The navigatorParams are only initially filled properly when the\n\t\t\t// navigator screens mount. so we ignore the first synchronisation.\n\t\t\tif ( isMounting.current ) {\n\t\t\t\tisMounting.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction updateUrlParams( newUrlParams ) {\n\t\t\t\tif ( isSubset( newUrlParams, urlParams ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst updatedParams = {\n\t\t\t\t\t...urlParams,\n\t\t\t\t\t...newUrlParams,\n\t\t\t\t};\n\t\t\t\thistory.push( updatedParams );\n\t\t\t}\n\n\t\t\tif ( navigatorParams?.postType && navigatorParams?.postId ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tnavigatorLocation.path.startsWith( '/page/' ) &&\n\t\t\t\tnavigatorParams?.postId\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: 'page',\n\t\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\t\tpath: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if ( navigatorLocation.path === '/patterns' ) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcanvas: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tnavigatorLocation.path === '/wp_template/all' &&\n\t\t\t\t! window?.__experimentalAdminViews\n\t\t\t) {\n\t\t\t\t// When the experiment is disabled, we only support table layout.\n\t\t\t\t// Clear it out from the URL, so layouts other than table cannot be accessed.\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\t// These sidebar paths are special in the sense that the url in these pages may or may not have a postId and we need to retain it if it has.\n\t\t\t\t// The \"type\" property should be kept as well.\n\t\t\t\t( navigatorLocation.path === '/pages' &&\n\t\t\t\t\twindow?.__experimentalAdminViews ) ||\n\t\t\t\t( navigatorLocation.path === '/wp_template/all' &&\n\t\t\t\t\twindow?.__experimentalAdminViews ) ||\n\t\t\t\t( navigatorLocation.path === '/wp_template_part/all' &&\n\t\t\t\t\twindow?.__experimentalAdminViews )\n\t\t\t) {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tupdateUrlParams( {\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tcategoryType: undefined,\n\t\t\t\t\tcategoryId: undefined,\n\t\t\t\t\tlayout: undefined,\n\t\t\t\t\tpath:\n\t\t\t\t\t\tnavigatorLocation.path === '/'\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: navigatorLocation.path,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when navigator changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ navigatorLocation?.path, navigatorParams ]\n\t);\n\n\tuseEffect(\n\t\t() => {\n\t\t\tconst path = getPathFromURL( urlParams );\n\t\t\tif ( navigatorLocation.path !== path ) {\n\t\t\t\tgoTo( path );\n\t\t\t}\n\t\t},\n\t\t// Trigger only when URL changes to prevent infinite loops.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ urlParams ]\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAQA,MAAM;EAAEK,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAExD,SAASC,cAAcA,CAAEC,SAAS,EAAG;EAAA,IAAAC,eAAA;EAC3C,IAAIC,IAAI,IAAAD,eAAA,GAAGD,SAAS,EAAEE,IAAI,cAAAD,eAAA,cAAAA,eAAA,GAAI,GAAG;;EAEjC;EACA,IAAKD,SAAS,EAAEG,QAAQ,IAAIH,SAAS,EAAEI,MAAM,EAAG;IAC/C,QAASJ,SAAS,CAACG,QAAQ;MAC1B,KAAKE,wBAAa,CAACC,IAAI;MACvB,KAAKC,6BAAkB;MACvB,KA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B,IACjCjB,iBAAiB,CAACpB,IAAI,KAAK,uBAAuB,IACnDoC,MAAM,EAAEC,wBAA0B,EAClC;MACDT,eAAe,CAAE;QAChB3B,QAAQ,EAAE+B,SAAS;QACnBM,YAAY,EAAEN,SAAS;QACvBO,UAAU,EAAEP,SAAS;QACrBhC,IAAI,EAAEoB,iBAAiB,CAACpB;MACzB,CAAE,CAAC;IACJ,CAAC,MAAM;MACN4B,eAAe,CAAE;QAChB3B,QAAQ,EAAE+B,SAAS;QACnB9B,MAAM,EAAE8B,SAAS;QACjBM,YAAY,EAAEN,SAAS;QACvBO,UAAU,EAAEP,SAAS;QACrBC,MAAM,EAAED,SAAS;QACjBhC,IAAI,EACHoB,iBAAiB,CAACpB,IAAI,KAAK,GAAG,GAC3BgC,SAAS,GACTZ,iBAAiB,CAACpB;MACvB,CAAE,CAAC;IACJ;EACD,CAAC;EACD;EACA;EACA,CAAEoB,iBAAiB,EAAEpB,IAAI,EAAEqB,eAAe,CAC3C,CAAC;EAED,IAAAK,kBAAS,EACR,MAAM;IACL,MAAM1B,IAAI,GAAGH,cAAc,CAAEC,SAAU,CAAC;IACxC,IAAKsB,iBAAiB,CAACpB,IAAI,KAAKA,IAAI,EAAG;MACtCsB,IAAI,CAAEtB,IAAK,CAAC;IACb;EACD,CAAC;EACD;EACA;EACA,CAAEF,SAAS,CACZ,CAAC;AACF"}
|
|
@@ -208,7 +208,9 @@ function useEditUICommands() {
|
|
|
208
208
|
activeSidebar,
|
|
209
209
|
showBlockBreadcrumbs,
|
|
210
210
|
isListViewOpen,
|
|
211
|
-
isDistractionFree
|
|
211
|
+
isDistractionFree,
|
|
212
|
+
isTopToolbar,
|
|
213
|
+
isFocusMode
|
|
212
214
|
} = (0, _data.useSelect)(select => {
|
|
213
215
|
const {
|
|
214
216
|
get
|
|
@@ -225,7 +227,9 @@ function useEditUICommands() {
|
|
|
225
227
|
activeSidebar: select(_interface.store).getActiveComplementaryArea(_store.store.name),
|
|
226
228
|
showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
|
|
227
229
|
isListViewOpen: isListViewOpened(),
|
|
228
|
-
isDistractionFree: get('core', 'distractionFree')
|
|
230
|
+
isDistractionFree: get('core', 'distractionFree'),
|
|
231
|
+
isFocusMode: get('core', 'focusMode'),
|
|
232
|
+
isTopToolbar: get('core', 'fixedToolbar')
|
|
229
233
|
};
|
|
230
234
|
}, []);
|
|
231
235
|
const {
|
|
@@ -276,17 +280,27 @@ function useEditUICommands() {
|
|
|
276
280
|
});
|
|
277
281
|
commands.push({
|
|
278
282
|
name: 'core/toggle-spotlight-mode',
|
|
279
|
-
label: (0, _i18n.__)('Toggle spotlight
|
|
283
|
+
label: (0, _i18n.__)('Toggle spotlight'),
|
|
280
284
|
callback: ({
|
|
281
285
|
close
|
|
282
286
|
}) => {
|
|
283
287
|
toggle('core', 'focusMode');
|
|
284
288
|
close();
|
|
289
|
+
createInfoNotice(isFocusMode ? (0, _i18n.__)('Spotlight off.') : (0, _i18n.__)('Spotlight on.'), {
|
|
290
|
+
id: 'core/edit-site/toggle-spotlight-mode/notice',
|
|
291
|
+
type: 'snackbar',
|
|
292
|
+
actions: [{
|
|
293
|
+
label: (0, _i18n.__)('Undo'),
|
|
294
|
+
onClick: () => {
|
|
295
|
+
toggle('core', 'focusMode');
|
|
296
|
+
}
|
|
297
|
+
}]
|
|
298
|
+
});
|
|
285
299
|
}
|
|
286
300
|
});
|
|
287
301
|
commands.push({
|
|
288
302
|
name: 'core/toggle-distraction-free',
|
|
289
|
-
label: (0, _i18n.__)('
|
|
303
|
+
label: isDistractionFree ? (0, _i18n.__)('Exit Distraction Free') : (0, _i18n.__)('Enter Distraction Free '),
|
|
290
304
|
callback: ({
|
|
291
305
|
close
|
|
292
306
|
}) => {
|
|
@@ -305,6 +319,16 @@ function useEditUICommands() {
|
|
|
305
319
|
toggleDistractionFree();
|
|
306
320
|
}
|
|
307
321
|
close();
|
|
322
|
+
createInfoNotice(isTopToolbar ? (0, _i18n.__)('Top toolbar off.') : (0, _i18n.__)('Top toolbar on.'), {
|
|
323
|
+
id: 'core/edit-site/toggle-top-toolbar/notice',
|
|
324
|
+
type: 'snackbar',
|
|
325
|
+
actions: [{
|
|
326
|
+
label: (0, _i18n.__)('Undo'),
|
|
327
|
+
onClick: () => {
|
|
328
|
+
toggle('core', 'fixedToolbar');
|
|
329
|
+
}
|
|
330
|
+
}]
|
|
331
|
+
});
|
|
308
332
|
}
|
|
309
333
|
});
|
|
310
334
|
if (editorMode === 'visual') {
|
|
@@ -351,13 +375,17 @@ function useEditUICommands() {
|
|
|
351
375
|
});
|
|
352
376
|
commands.push({
|
|
353
377
|
name: 'core/toggle-list-view',
|
|
354
|
-
label: (0, _i18n.__)('
|
|
378
|
+
label: isListViewOpen ? (0, _i18n.__)('Close List View') : (0, _i18n.__)('Open List View'),
|
|
355
379
|
icon: _icons.listView,
|
|
356
380
|
callback: ({
|
|
357
381
|
close
|
|
358
382
|
}) => {
|
|
359
383
|
setIsListViewOpened(!isListViewOpen);
|
|
360
384
|
close();
|
|
385
|
+
createInfoNotice(isListViewOpen ? (0, _i18n.__)('List View off.') : (0, _i18n.__)('List View on.'), {
|
|
386
|
+
id: 'core/edit-site/toggle-list-view/notice',
|
|
387
|
+
type: 'snackbar'
|
|
388
|
+
});
|
|
361
389
|
}
|
|
362
390
|
});
|
|
363
391
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_htmlEntities","_router","_preferences","_interface","_notices","_editor","_store","_useEditedEntityRecord","_interopRequireDefault","_isTemplateRemovable","_isTemplateRevertable","_keyboardShortcutHelpModal","_preferencesModal","_patternModal","_lockUnlock","_constants","useHistory","unlock","routerPrivateApis","usePageContentFocusCommands","record","template","useEditedEntityRecord","isPage","canvasMode","renderingMode","useSelect","select","_isPage","getCanvasMode","editSiteStore","getRenderingMode","editorStore","setRenderingMode","useDispatch","isLoading","commands","push","name","label","sprintf","decodeEntities","title","icon","layout","callback","close","__","page","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","code","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","isTemplateRevertable","type","TEMPLATE_POST_TYPE","isRTL","rotateRight","rotateLeft","isTemplateRemovable","path","trash","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","get","preferencesStore","isListViewOpened","interfaceStore","getActiveComplementaryArea","openModal","toggle","createInfoNotice","noticesStore","drawerLeft","drawerRight","blockDefault","PREFERENCES_MODAL_NAME","keyboard","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","id","listView","usePatternCommands","pattern","edit","PATTERN_MODALS","rename","symbol","duplicate","useEditModeCommands","useCommandLoader","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, renderingMode } = useSelect( ( select ) => {\n\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\treturn {\n\t\t\tisPage: _isPage(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t};\n\t}, [] );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( renderingMode !== 'template-only' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t/* translators: %1$s: template title */\n\t\t\tlabel: sprintf(\n\t\t\t\t'Edit template: %s',\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-only' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editSiteStore );\n\t\tconst { isListViewOpened } = select( editorStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,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AAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,mCAAmC;IACzCkE,IAAI,EAAErF,2BAA2B;IACjCsF,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,oCAAoC;IAC1CkE,IAAI,EAAElD;EACP,CAAE,CAAC;EAEH,IAAAiD,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,yBAAyB;IAC/BkE,IAAI,EAAET,kBAAkB;IACxBU,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,wBAAwB;IAC9BkE,IAAI,EAAEnC;EACP,CAAE,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_htmlEntities","_router","_preferences","_interface","_notices","_editor","_store","_useEditedEntityRecord","_interopRequireDefault","_isTemplateRemovable","_isTemplateRevertable","_keyboardShortcutHelpModal","_preferencesModal","_patternModal","_lockUnlock","_constants","useHistory","unlock","routerPrivateApis","usePageContentFocusCommands","record","template","useEditedEntityRecord","isPage","canvasMode","renderingMode","useSelect","select","_isPage","getCanvasMode","editSiteStore","getRenderingMode","editorStore","setRenderingMode","useDispatch","isLoading","commands","push","name","label","sprintf","decodeEntities","title","icon","layout","callback","close","__","page","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","code","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","isTemplateRevertable","type","TEMPLATE_POST_TYPE","isRTL","rotateRight","rotateLeft","isTemplateRemovable","path","trash","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","isTopToolbar","isFocusMode","get","preferencesStore","isListViewOpened","interfaceStore","getActiveComplementaryArea","openModal","toggle","createInfoNotice","noticesStore","drawerLeft","drawerRight","blockDefault","id","actions","onClick","PREFERENCES_MODAL_NAME","keyboard","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","listView","usePatternCommands","pattern","edit","PATTERN_MODALS","rename","symbol","duplicate","useEditModeCommands","useCommandLoader","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, renderingMode } = useSelect( ( select ) => {\n\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\treturn {\n\t\t\tisPage: _isPage(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t};\n\t}, [] );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( renderingMode !== 'template-only' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t/* translators: %1$s: template title */\n\t\t\tlabel: sprintf(\n\t\t\t\t'Edit template: %s',\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-only' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tisTopToolbar,\n\t\tisFocusMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editSiteStore );\n\t\tconst { isListViewOpened } = select( editorStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\tisTopToolbar: get( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFocusMode ? __( 'Spotlight off.' ) : __( 'Spotlight on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'focusMode' );\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\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: isDistractionFree\n\t\t\t? __( 'Exit Distraction Free' )\n\t\t\t: __( 'Enter Distraction Free ' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar off.' )\n\t\t\t\t\t: __( 'Top toolbar on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'fixedToolbar' );\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\t);\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: isListViewOpen\n\t\t\t? __( 'Close List View' )\n\t\t\t: __( 'Open List View' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisListViewOpen ? __( 'List View off.' ) : __( 'List View on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-list-view/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAeA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,oBAAA,GAAAD,sBAAA,CAAAZ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
|
|
340
340
|
onClick: pushChanges
|
|
341
341
|
}, (0, _i18n.__)('Apply globally')));
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
function PushChangesToGlobalStyles(props) {
|
|
344
344
|
const blockEditingMode = (0, _blockEditor.useBlockEditingMode)();
|
|
345
345
|
const isBlockBasedTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme()?.is_block_theme, []);
|
|
346
346
|
const supportsStyles = SUPPORTED_STYLES.some(feature => (0, _blocks.hasBlockSupport)(props.name, feature));
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
const isDisplayed = blockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;
|
|
348
|
+
if (!isDisplayed) {
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
return (0, _react.createElement)(_blockEditor.InspectorAdvancedControls, null, (0, _react.createElement)(PushChangesToGlobalStylesControl, {
|
|
350
352
|
...props
|
|
351
|
-
}))
|
|
352
|
-
}
|
|
353
|
+
}));
|
|
354
|
+
}
|
|
355
|
+
const withPushChangesToGlobalStyles = (0, _compose.createHigherOrderComponent)(BlockEdit => props => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
356
|
+
...props
|
|
357
|
+
}), props.isSelected && (0, _react.createElement)(PushChangesToGlobalStyles, {
|
|
358
|
+
...props
|
|
359
|
+
})));
|
|
353
360
|
(0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-site/push-changes-to-global-styles', withPushChangesToGlobalStyles);
|
|
354
361
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hooks","require","_compose","_blockEditor","_components","_i18n","_blocks","_element","_data","_notices","_coreData","_hooks2","_lockUnlock","cleanEmptyObject","GlobalStylesContext","unlock","blockEditorPrivateApis","STYLE_PROPERTY","__EXPERIMENTAL_STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","useSupportedStyles","blockUserConfig","styles","blocks","useMemo","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","setNestedValue","reduce","acc","idx","undefined","Number","isInteger","length","cloneDeep","JSON","parse","stringify","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","useContext","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","pushChanges","useCallback","blockStyles","newBlockStyles","newUserConfig","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","sprintf","__","getBlockType","title","type","actions","label","onClick","_react","createElement","BaseControl","className","help","VisualLabel","Button","variant","disabled","withPushChangesToGlobalStyles","createHigherOrderComponent","BlockEdit","props","blockEditingMode","useBlockEditingMode","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","supportsStyles","some","feature","hasBlockSupport","Fragment","InspectorAdvancedControls","addFilter"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\n/**\n * Sets the value at path of object.\n * If a portion of path doesn’t exist, it’s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nfunction setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n\nfunction cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\tconst isBlockBasedTheme = useSelect(\n\t\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t\t[]\n\t\t);\n\t\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\t\thasBlockSupport( props.name, feature )\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ blockEditingMode === 'default' &&\n\t\t\t\t\tsupportsStyles &&\n\t\t\t\t\tisBlockBasedTheme && (\n\t\t\t\t\t\t<InspectorAdvancedControls>\n\t\t\t\t\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t\t\t\t\t</InspectorAdvancedControls>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IA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AAC;EACD,MAAMC,cAAc,GAAG7G,gBAAgB,CAAC8G,IAAI,CAAIC,OAAO,IACtD,IAAAC,uBAAe,EAAEZ,KAAK,CAAC7E,IAAI,EAAEwF,OAAQ,CACtC,CAAC;EAED,OACC,IAAAvB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAyB,QAAA,QACC,IAAAzB,MAAA,CAAAC,aAAA,EAACU,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBC,gBAAgB,KAAK,SAAS,IAC/BQ,cAAc,IACdN,iBAAiB,IAChB,IAAAf,MAAA,CAAAC,aAAA,EAAC7G,YAAA,CAAAsI,yBAAyB,QACzB,IAAA1B,MAAA,CAAAC,aAAA,EAAC/B,gCAAgC;IAAA,GAAM0C;EAAK,CAAI,CACtB,CAE5B,CAAC;AAEL,CACD,CAAC;AAED,IAAAe,gBAAS,EACR,kBAAkB,EAClB,8CAA8C,EAC9ClB,6BACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_hooks","require","_compose","_blockEditor","_components","_i18n","_blocks","_element","_data","_notices","_coreData","_hooks2","_lockUnlock","cleanEmptyObject","GlobalStylesContext","unlock","blockEditorPrivateApis","STYLE_PROPERTY","__EXPERIMENTAL_STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","useSupportedStyles","blockUserConfig","styles","blocks","useMemo","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","setNestedValue","reduce","acc","idx","undefined","Number","isInteger","length","cloneDeep","JSON","parse","stringify","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","useContext","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","pushChanges","useCallback","blockStyles","newBlockStyles","newUserConfig","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","sprintf","__","getBlockType","title","type","actions","label","onClick","_react","createElement","BaseControl","className","help","VisualLabel","Button","variant","disabled","PushChangesToGlobalStyles","props","blockEditingMode","useBlockEditingMode","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","supportsStyles","some","feature","hasBlockSupport","isDisplayed","InspectorAdvancedControls","withPushChangesToGlobalStyles","createHigherOrderComponent","BlockEdit","Fragment","isSelected","addFilter"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\n/**\n * Sets the value at path of object.\n * If a portion of path doesn’t exist, it’s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nfunction setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n\nfunction cloneDeep( object ) {\n\treturn ! object ? {} : JSON.parse( JSON.stringify( object ) );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = cloneDeep( blockStyles );\n\t\t\tconst newUserConfig = cloneDeep( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( () => newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( () => userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AA3BA;AACA;AACA;;AAqBA;AACA;AACA;;AAIA,MAAM;EAAEY,gBAAgB;EAAEC;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EACvDC,wBACD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,GAAG;EACtB,GAAGC,qCAA6B;EAChCC,QAAQ,EAAE;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gC;IAAA,GAAMwC;EAAK,CAAI,CACtB,CAAC;AAE9B;AAEA,MAAMe,6BAA6B,GAAG,IAAAC,mCAA0B,EAC7DC,SAAS,IAAQjB,KAAK,IACvB,IAAAV,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAA4B,QAAA,QACC,IAAA5B,MAAA,CAAAC,aAAA,EAAC0B,SAAS;EAAA,GAAMjB;AAAK,CAAI,CAAC,EACxBA,KAAK,CAACmB,UAAU,IAAI,IAAA7B,MAAA,CAAAC,aAAA,EAACQ,yBAAyB;EAAA,GAAMC;AAAK,CAAI,CAC9D,CAEJ,CAAC;AAED,IAAAoB,gBAAS,EACR,kBAAkB,EAClB,8CAA8C,EAC9CL,6BACD,CAAC"}
|
|
@@ -56,14 +56,12 @@ function EditTemplatePartMenuItem({
|
|
|
56
56
|
if (!templatePart) {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
|
-
return (0, _react.createElement)(
|
|
60
|
-
group: "other"
|
|
61
|
-
}, (0, _react.createElement)(_components.ToolbarButton, {
|
|
59
|
+
return (0, _react.createElement)(_components.ToolbarButton, {
|
|
62
60
|
...linkProps,
|
|
63
61
|
onClick: event => {
|
|
64
62
|
linkProps.onClick(event);
|
|
65
63
|
}
|
|
66
|
-
}, (0, _i18n.__)('Edit'))
|
|
64
|
+
}, (0, _i18n.__)('Edit'));
|
|
67
65
|
}
|
|
68
66
|
const withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
69
67
|
const {
|
|
@@ -72,10 +70,13 @@ const withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
72
70
|
} = props;
|
|
73
71
|
const isDisplayed = name === 'core/template-part' && attributes.slug;
|
|
74
72
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
73
|
+
key: "edit",
|
|
75
74
|
...props
|
|
76
|
-
}), isDisplayed && (0, _react.createElement)(
|
|
75
|
+
}), isDisplayed && (0, _react.createElement)(_blockEditor.BlockControls, {
|
|
76
|
+
group: "other"
|
|
77
|
+
}, (0, _react.createElement)(EditTemplatePartMenuItem, {
|
|
77
78
|
attributes: attributes
|
|
78
|
-
}));
|
|
79
|
+
})));
|
|
79
80
|
}, 'withEditBlockControls');
|
|
80
81
|
exports.withEditBlockControls = withEditBlockControls;
|
|
81
82
|
(0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-site/template-part-edit-button', withEditBlockControls);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_blockEditor","_coreData","_components","_hooks","_compose","_router","_link","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","useSelect","select","getCurrentTheme","getEntityRecord","coreStore","TEMPLATE_PART_POST_TYPE","stylesheet","linkProps","useLink","postId","id","postType","type","canvas","fromTemplateId","_react","createElement","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_blockEditor","_coreData","_components","_hooks","_compose","_router","_link","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","useSelect","select","getCurrentTheme","getEntityRecord","coreStore","TEMPLATE_PART_POST_TYPE","stylesheet","linkProps","useLink","postId","id","postType","type","canvas","fromTemplateId","_react","createElement","ToolbarButton","onClick","event","__","withEditBlockControls","createHigherOrderComponent","BlockEdit","props","name","isDisplayed","Fragment","key","BlockControls","group","exports","addFilter"],"sources":["@wordpress/edit-site/src/hooks/template-part-edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../components/routes/link';\nimport { unlock } from '../lock-unlock';\nimport { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction EditTemplatePartMenuItem( { attributes } ) {\n\tconst { theme, slug } = attributes;\n\tconst { params } = useLocation();\n\tconst templatePart = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentTheme, getEntityRecord } = select( coreStore );\n\n\t\t\treturn getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\t`${ theme || getCurrentTheme()?.stylesheet }//${ slug }`\n\t\t\t);\n\t\t},\n\t\t[ theme, slug ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: templatePart?.id,\n\t\t\tpostType: templatePart?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\tfromTemplateId: params.postId || templatePart?.id,\n\t\t}\n\t);\n\n\tif ( ! templatePart ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\t{ ...linkProps }\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tlinkProps.onClick( event );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Edit' ) }\n\t\t</ToolbarButton>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/template-part' && attributes.slug;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<EditTemplatePartMenuItem attributes={ attributes } />\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',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AChD,CACD,CAAC;EAED,IAAK,CAAEX,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAiC,aAAa;IAAA,GACRV,SAAS;IACdW,OAAO,EAAKC,KAAK,IAAM;MACtBZ,SAAS,CAACW,OAAO,CAAEC,KAAM,CAAC;IAC3B;EAAG,GAED,IAAAC,QAAE,EAAE,MAAO,CACC,CAAC;AAElB;AAEO,MAAMC,qBAAqB,GAAG,IAAAC,mCAA0B,EAC5DC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAE7B,UAAU;IAAE8B;EAAK,CAAC,GAAGD,KAAK;EAClC,MAAME,WAAW,GAAGD,IAAI,KAAK,oBAAoB,IAAI9B,UAAU,CAACE,IAAI;EAEpE,OACC,IAAAkB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAY,QAAA,QACC,IAAAZ,MAAA,CAAAC,aAAA,EAACO,SAAS;IAACK,GAAG,EAAC,MAAM;IAAA,GAAMJ;EAAK,CAAI,CAAC,EACnCE,WAAW,IACZ,IAAAX,MAAA,CAAAC,aAAA,EAAClC,YAAA,CAAA+C,aAAa;IAACC,KAAK,EAAC;EAAO,GAC3B,IAAAf,MAAA,CAAAC,aAAA,EAACtB,wBAAwB;IAACC,UAAU,EAAGA;EAAY,CAAE,CACvC,CAEf,CAAC;AAEL,CAAC,EACD,uBACD,CAAC;AAACoC,OAAA,CAAAV,qBAAA,GAAAA,qBAAA;AAEF,IAAAW,gBAAS,EACR,kBAAkB,EAClB,0CAA0C,EAC1CX,qBACD,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -91,7 +91,6 @@ function initializeEditor(id, settings) {
|
|
|
91
91
|
// We dispatch actions and update the store synchronously before rendering
|
|
92
92
|
// so that we won't trigger unnecessary re-renders with useEffect.
|
|
93
93
|
(0, _data.dispatch)(_preferences.store).setDefaults('core/edit-site', {
|
|
94
|
-
editorMode: 'visual',
|
|
95
94
|
welcomeGuide: true,
|
|
96
95
|
welcomeGuideStyles: true,
|
|
97
96
|
welcomeGuidePage: true,
|
|
@@ -100,6 +99,7 @@ function initializeEditor(id, settings) {
|
|
|
100
99
|
(0, _data.dispatch)(_preferences.store).setDefaults('core', {
|
|
101
100
|
allowRightClickOverrides: true,
|
|
102
101
|
distractionFree: false,
|
|
102
|
+
editorMode: 'visual',
|
|
103
103
|
fixedToolbar: false,
|
|
104
104
|
focusMode: false,
|
|
105
105
|
inactivePanels: [],
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockLibrary","_data","_deprecated","_interopRequireDefault","_element","_editor","_interface","_preferences","_widgets","_store","_app","_pluginSidebar","_pluginSidebarMoreMenuItem","_pluginMoreMenuItem","_pluginTemplateSettingPanel","initializeEditor","id","settings","target","document","getElementById","root","createRoot","dispatch","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","name","registerCoreBlocks","setFreeformFallbackBlockName","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","preferencesStore","setDefaults","
|
|
1
|
+
{"version":3,"names":["_blocks","require","_blockLibrary","_data","_deprecated","_interopRequireDefault","_element","_editor","_interface","_preferences","_widgets","_store","_app","_pluginSidebar","_pluginSidebarMoreMenuItem","_pluginMoreMenuItem","_pluginTemplateSettingPanel","initializeEditor","id","settings","target","document","getElementById","root","createRoot","dispatch","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","name","registerCoreBlocks","setFreeformFallbackBlockName","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","preferencesStore","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/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