@wordpress/edit-site 5.35.0 → 6.0.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 +7 -0
- package/build/components/add-new-page/index.js +33 -27
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +95 -78
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +35 -30
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +119 -95
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +87 -71
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +36 -17
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +10 -4
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +5 -4
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +88 -0
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -0
- package/build/components/canvas-loader/index.js +13 -12
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/dataviews-actions/index.js +7 -4
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +59 -148
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +27 -29
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -2
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +13 -11
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/background-panel.js +6 -5
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +19 -17
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +30 -29
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +55 -39
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +17 -13
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +25 -22
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +7 -30
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +24 -16
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +195 -152
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +14 -12
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +29 -20
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +41 -36
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +153 -109
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +16 -14
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +25 -22
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +40 -34
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +3 -3
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +41 -37
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +37 -28
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +3 -4
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -23
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +15 -11
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +39 -32
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +3 -4
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +22 -20
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js +34 -29
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +95 -90
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +28 -21
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +6 -4
- package/build/components/global-styles/screen-background.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +33 -27
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +62 -53
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +29 -19
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +18 -14
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -14
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +9 -4
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -42
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +81 -70
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +76 -42
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-shadows.js +22 -0
- package/build/components/global-styles/screen-shadows.js.map +1 -0
- package/build/components/global-styles/screen-style-variations.js +14 -9
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +50 -45
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +15 -11
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js +230 -0
- package/build/components/global-styles/shadow-utils.js.map +1 -0
- package/build/components/global-styles/shadows-edit-panel.js +458 -0
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -0
- package/build/components/global-styles/shadows-panel.js +128 -0
- package/build/components/global-styles/shadows-panel.js.map +1 -0
- package/build/components/global-styles/style-variations-container.js +67 -18
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +5 -4
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +53 -45
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-example.js +11 -8
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +5 -4
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +124 -92
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +28 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +27 -22
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +18 -13
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +27 -17
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +37 -31
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +5 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +22 -18
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +34 -26
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +112 -95
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +83 -103
- package/build/components/layout/router.js.map +1 -1
- package/build/components/media/index.js +2 -2
- package/build/components/media/index.js.map +1 -1
- package/build/components/{header-edit-mode/more-menu → more-menu}/index.js +7 -3
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
- package/build/components/more-menu/site-export.js.map +1 -0
- package/build/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/page/header.js +24 -20
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +12 -10
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +133 -52
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +23 -20
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/header.js +47 -32
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +114 -108
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js +14 -11
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +7 -6
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +78 -59
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +50 -41
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +4 -2
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +38 -32
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +26 -20
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +5 -4
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +5 -4
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +12 -11
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +34 -28
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +14 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +56 -48
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +106 -89
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +12 -10
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +48 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +21 -22
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +27 -25
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +51 -39
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +24 -17
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +9 -7
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +5 -5
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +54 -45
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +45 -22
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +11 -10
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +53 -42
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +42 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -13
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -23
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +50 -35
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -9
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +58 -63
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +17 -17
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -4
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +81 -72
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +8 -7
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +115 -99
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/table/index.js +23 -15
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +5 -4
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +23 -17
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +12 -10
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +20 -15
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +18 -13
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +45 -28
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +18 -13
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +4 -4
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +2 -116
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +25 -16
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/store/private-actions.js +7 -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/template-part-create.js +0 -62
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js +4 -5
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js +34 -27
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +98 -78
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +36 -30
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +121 -95
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +89 -71
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +36 -17
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +11 -4
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +5 -4
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +80 -0
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -0
- package/build-module/components/canvas-loader/index.js +14 -13
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +7 -4
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +65 -152
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +29 -30
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -2
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +13 -11
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +6 -5
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +19 -17
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +31 -29
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +2 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +58 -40
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +18 -13
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -22
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -30
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +25 -16
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +198 -153
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +14 -12
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +30 -20
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +42 -36
- 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 +157 -111
- 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-details.js +18 -14
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +26 -22
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +42 -35
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +3 -3
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +42 -37
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +38 -28
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +3 -4
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -23
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +2 -2
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +16 -11
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +42 -34
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +3 -4
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +22 -20
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +36 -29
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +96 -90
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +31 -22
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +8 -4
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +35 -27
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +64 -53
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +31 -19
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +20 -14
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +22 -14
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +11 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +54 -42
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +82 -70
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +78 -42
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-shadows.js +13 -0
- package/build-module/components/global-styles/screen-shadows.js.map +1 -0
- package/build-module/components/global-styles/screen-style-variations.js +16 -9
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +52 -45
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +17 -11
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js +221 -0
- package/build-module/components/global-styles/shadow-utils.js.map +1 -0
- package/build-module/components/global-styles/shadows-edit-panel.js +452 -0
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -0
- package/build-module/components/global-styles/shadows-panel.js +121 -0
- package/build-module/components/global-styles/shadows-panel.js.map +1 -0
- package/build-module/components/global-styles/style-variations-container.js +68 -19
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +5 -4
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +54 -45
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +12 -8
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +2 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +5 -4
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +126 -92
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +27 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +27 -22
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +19 -13
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +28 -18
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +38 -31
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +5 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +24 -18
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +35 -26
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +115 -96
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +83 -103
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/media/index.js +2 -2
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/index.js +9 -3
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
- package/build-module/components/more-menu/site-export.js.map +1 -0
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/page/header.js +25 -19
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +14 -11
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +138 -55
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +25 -20
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +48 -32
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +115 -108
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +16 -11
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +7 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +80 -59
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +51 -41
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +4 -2
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +40 -32
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +27 -20
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -4
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +5 -4
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +12 -11
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +35 -28
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -2
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +58 -48
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +108 -89
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +13 -10
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +49 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +23 -22
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +28 -25
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +53 -39
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +25 -17
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +10 -7
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +5 -5
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +56 -45
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +47 -22
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +11 -10
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +55 -42
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +43 -36
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +17 -13
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +27 -23
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +52 -35
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +60 -63
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +18 -17
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -4
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +83 -73
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +8 -7
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +116 -99
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/table/index.js +24 -15
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +5 -4
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +25 -16
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +12 -10
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +22 -15
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +6 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +20 -13
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +47 -28
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +20 -13
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +4 -4
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +12 -23
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -118
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +27 -16
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +3 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-actions.js +7 -1
- 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/template-part-create.js +0 -52
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +4 -5
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +289 -554
- package/build-style/style.css +289 -554
- package/package.json +43 -44
- package/src/components/add-new-pattern/index.js +46 -37
- package/src/components/add-new-template/index.js +2 -0
- package/src/components/add-new-template/utils.js +77 -39
- package/src/components/block-editor/style.scss +4 -139
- package/src/components/block-editor/use-editor-iframe-props.js +79 -0
- package/src/components/canvas-loader/index.js +5 -2
- package/src/components/dataviews-actions/index.js +7 -2
- package/src/components/editor/index.js +65 -211
- package/src/components/editor/style.scss +2 -13
- package/src/components/editor-canvas-container/index.js +30 -35
- package/src/components/editor-canvas-container/style.scss +16 -0
- package/src/components/global-styles/background-panel.js +3 -2
- package/src/components/global-styles/color-palette-panel.js +1 -1
- package/src/components/global-styles/font-families.js +25 -18
- package/src/components/global-styles/font-family-item.js +2 -2
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +2 -1
- package/src/components/global-styles/font-library-modal/context.js +6 -44
- package/src/components/global-styles/font-library-modal/font-collection.js +3 -5
- package/src/components/global-styles/font-library-modal/installed-fonts.js +42 -12
- package/src/components/global-styles/font-library-modal/library-font-variant.js +2 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -4
- package/src/components/global-styles/font-library-modal/utils/index.js +1 -1
- package/src/components/global-styles/hooks.js +10 -37
- package/src/components/global-styles/palette.js +9 -18
- package/src/components/global-styles/root-menu.js +16 -12
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-layout.js +9 -2
- package/src/components/global-styles/screen-revisions/index.js +6 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/src/components/global-styles/screen-shadows.js +13 -0
- package/src/components/global-styles/screen-typography.js +1 -1
- package/src/components/global-styles/shadow-utils.js +158 -0
- package/src/components/global-styles/shadows-edit-panel.js +555 -0
- package/src/components/global-styles/shadows-panel.js +147 -0
- package/src/components/global-styles/style-variations-container.js +73 -10
- package/src/components/global-styles/style.scss +54 -5
- package/src/components/global-styles/test/shadow-utils.spec.js +251 -0
- package/src/components/global-styles/test/utils.spec.js +59 -0
- package/src/components/global-styles/ui.js +10 -6
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/global-styles/variations/style.scss +7 -4
- package/src/components/global-styles/variations/variation.js +2 -0
- package/src/components/global-styles/variations/variations-color.js +2 -1
- package/src/components/global-styles/variations/variations-panel.js +16 -5
- package/src/components/global-styles/variations/variations-typography.js +2 -1
- package/src/components/global-styles-renderer/index.js +7 -1
- package/src/components/layout/index.js +7 -2
- package/src/components/layout/router.js +64 -79
- package/src/components/layout/style.scss +11 -8
- package/src/components/{header-edit-mode/more-menu → more-menu}/index.js +1 -1
- package/src/components/page/header.js +17 -13
- package/src/components/page/index.js +1 -5
- package/src/components/page/style.scss +21 -7
- package/src/components/page-pages/index.js +154 -30
- package/src/components/page-pages/style.scss +15 -0
- package/src/components/page-patterns/delete-category-menu-item.js +1 -2
- package/src/components/page-patterns/header.js +45 -33
- package/src/components/page-patterns/index.js +14 -51
- package/src/components/page-patterns/style.scss +21 -14
- package/src/components/page-patterns/use-patterns.js +13 -6
- package/src/components/resizable-frame/index.js +1 -1
- package/src/components/save-panel/index.js +2 -4
- package/src/components/sidebar-dataviews/add-new-view.js +5 -5
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +61 -1
- package/src/components/sidebar-dataviews/index.js +4 -9
- package/src/components/sidebar-navigation-item/index.js +7 -7
- package/src/components/sidebar-navigation-screen-global-styles/index.js +8 -2
- package/src/components/sidebar-navigation-screen-main/index.js +14 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -3
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -61
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +6 -16
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
- package/src/components/site-hub/index.js +11 -12
- package/src/components/site-hub/style.scss +46 -9
- package/src/components/style-book/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +18 -23
- package/src/components/template-part-converter/convert-to-template-part.js +4 -1
- package/src/hooks/commands/use-common-commands.js +12 -23
- package/src/hooks/commands/use-edit-mode-commands.js +4 -118
- package/src/hooks/index.js +0 -1
- package/src/hooks/push-changes-to-global-styles/index.js +2 -1
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
- package/src/index.js +1 -1
- package/src/store/private-actions.js +9 -1
- package/src/store/selectors.js +2 -2
- package/src/style.scss +0 -6
- package/src/utils/template-part-create.js +0 -67
- package/src/utils/use-activate-theme.js +2 -2
- package/build/components/block-editor/editor-canvas.js +0 -139
- package/build/components/block-editor/editor-canvas.js.map +0 -1
- package/build/components/block-editor/resizable-editor.js +0 -86
- package/build/components/block-editor/resizable-editor.js.map +0 -1
- package/build/components/block-editor/resize-handle.js +0 -57
- package/build/components/block-editor/resize-handle.js.map +0 -1
- package/build/components/block-editor/site-editor-canvas.js +0 -95
- package/build/components/block-editor/site-editor-canvas.js.map +0 -1
- package/build/components/code-editor/index.js +0 -111
- package/build/components/code-editor/index.js.map +0 -1
- package/build/components/create-template-part-modal/index.js +0 -151
- package/build/components/create-template-part-modal/index.js.map +0 -1
- package/build/components/header-edit-mode/index.js +0 -50
- package/build/components/header-edit-mode/index.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/index.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/site-export.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +0 -311
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
- package/build/components/pattern-modal/duplicate.js +0 -70
- package/build/components/pattern-modal/duplicate.js.map +0 -1
- package/build/components/pattern-modal/index.js +0 -23
- package/build/components/pattern-modal/index.js.map +0 -1
- package/build/components/pattern-modal/rename.js +0 -45
- package/build/components/pattern-modal/rename.js.map +0 -1
- package/build/components/rename-post-menu-item/index.js +0 -109
- package/build/components/rename-post-menu-item/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/index.js +0 -163
- package/build/components/sidebar-navigation-screen-page/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +0 -127
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +0 -65
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +0 -67
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -38
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -29
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -37
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -45
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -88
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -29
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -138
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +0 -110
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/index.js +0 -121
- package/build/components/sidebar-navigation-screen-template/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js +0 -117
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
- package/build/components/template-actions/index.js +0 -131
- package/build/components/template-actions/index.js.map +0 -1
- package/build/hooks/components.js +0 -10
- package/build/hooks/components.js.map +0 -1
- package/build/utils/get-is-list-page.js +0 -28
- package/build/utils/get-is-list-page.js.map +0 -1
- package/build-module/components/block-editor/editor-canvas.js +0 -131
- package/build-module/components/block-editor/editor-canvas.js.map +0 -1
- package/build-module/components/block-editor/resizable-editor.js +0 -79
- package/build-module/components/block-editor/resizable-editor.js.map +0 -1
- package/build-module/components/block-editor/resize-handle.js +0 -50
- package/build-module/components/block-editor/resize-handle.js.map +0 -1
- package/build-module/components/block-editor/site-editor-canvas.js +0 -86
- package/build-module/components/block-editor/site-editor-canvas.js.map +0 -1
- package/build-module/components/code-editor/index.js +0 -103
- package/build-module/components/code-editor/index.js.map +0 -1
- package/build-module/components/create-template-part-modal/index.js +0 -143
- package/build-module/components/create-template-part-modal/index.js.map +0 -1
- package/build-module/components/header-edit-mode/index.js +0 -42
- package/build-module/components/header-edit-mode/index.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/index.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +0 -304
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
- package/build-module/components/pattern-modal/duplicate.js +0 -62
- package/build-module/components/pattern-modal/duplicate.js.map +0 -1
- package/build-module/components/pattern-modal/index.js +0 -14
- package/build-module/components/pattern-modal/index.js.map +0 -1
- package/build-module/components/pattern-modal/rename.js +0 -37
- package/build-module/components/pattern-modal/rename.js.map +0 -1
- package/build-module/components/rename-post-menu-item/index.js +0 -102
- package/build-module/components/rename-post-menu-item/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +0 -155
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +0 -120
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +0 -57
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +0 -59
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -30
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -20
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -29
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -80
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -22
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -130
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +0 -103
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +0 -113
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js +0 -109
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
- package/build-module/components/template-actions/index.js +0 -123
- package/build-module/components/template-actions/index.js.map +0 -1
- package/build-module/hooks/components.js +0 -7
- package/build-module/hooks/components.js.map +0 -1
- package/build-module/utils/get-is-list-page.js +0 -22
- package/build-module/utils/get-is-list-page.js.map +0 -1
- package/src/components/block-editor/editor-canvas.js +0 -158
- package/src/components/block-editor/resizable-editor.js +0 -82
- package/src/components/block-editor/resize-handle.js +0 -66
- package/src/components/block-editor/site-editor-canvas.js +0 -107
- package/src/components/code-editor/index.js +0 -94
- package/src/components/code-editor/style.scss +0 -95
- package/src/components/create-template-part-modal/index.js +0 -199
- package/src/components/create-template-part-modal/style.scss +0 -69
- package/src/components/header-edit-mode/index.js +0 -51
- package/src/components/header-edit-mode/style.scss +0 -3
- package/src/components/page-patterns/dataviews-pattern-actions.js +0 -350
- package/src/components/pattern-modal/duplicate.js +0 -55
- package/src/components/pattern-modal/index.js +0 -19
- package/src/components/pattern-modal/rename.js +0 -30
- package/src/components/rename-post-menu-item/index.js +0 -138
- package/src/components/sidebar-navigation-screen-page/index.js +0 -204
- package/src/components/sidebar-navigation-screen-page/page-details.js +0 -161
- package/src/components/sidebar-navigation-screen-page/status-label.js +0 -71
- package/src/components/sidebar-navigation-screen-page/style.scss +0 -69
- package/src/components/sidebar-navigation-screen-pattern/index.js +0 -57
- package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -26
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -31
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -21
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -33
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -98
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -32
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -205
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +0 -144
- package/src/components/sidebar-navigation-screen-template/index.js +0 -134
- package/src/components/sidebar-navigation-screen-template/style.scss +0 -53
- package/src/components/sidebar-navigation-screen-template/template-areas.js +0 -135
- package/src/components/template-actions/index.js +0 -165
- package/src/hooks/components.js +0 -11
- package/src/utils/get-is-list-page.js +0 -23
- package/src/utils/test/template-part-create.js +0 -63
- /package/src/components/{header-edit-mode/more-menu → more-menu}/site-export.js +0 -0
- /package/src/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
|
@@ -10,14 +10,12 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
10
10
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
11
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
17
16
|
*/
|
|
18
17
|
import { unlock } from '../../lock-unlock';
|
|
19
18
|
import { store as editSiteStore } from '../../store';
|
|
20
|
-
import getIsListPage from '../../utils/get-is-list-page';
|
|
21
19
|
const {
|
|
22
20
|
useGlobalStylesReset
|
|
23
21
|
} = unlock(blockEditorPrivateApis);
|
|
@@ -33,8 +31,6 @@ function useGlobalStylesOpenStylesCommands() {
|
|
|
33
31
|
const {
|
|
34
32
|
params
|
|
35
33
|
} = useLocation();
|
|
36
|
-
const isMobileViewport = useViewportMatch('medium', '<');
|
|
37
|
-
const isEditorPage = !getIsListPage(params, isMobileViewport);
|
|
38
34
|
const {
|
|
39
35
|
getCanvasMode
|
|
40
36
|
} = unlock(useSelect(editSiteStore));
|
|
@@ -53,20 +49,20 @@ function useGlobalStylesOpenStylesCommands() {
|
|
|
53
49
|
close
|
|
54
50
|
}) => {
|
|
55
51
|
close();
|
|
56
|
-
if (!
|
|
52
|
+
if (!params.postId) {
|
|
57
53
|
history.push({
|
|
58
54
|
path: '/wp_global_styles',
|
|
59
55
|
canvas: 'edit'
|
|
60
56
|
});
|
|
61
57
|
}
|
|
62
|
-
if (
|
|
58
|
+
if (params.postId && getCanvasMode() !== 'edit') {
|
|
63
59
|
setCanvasMode('edit');
|
|
64
60
|
}
|
|
65
61
|
openGeneralSidebar('edit-site/global-styles');
|
|
66
62
|
},
|
|
67
63
|
icon: styles
|
|
68
64
|
}];
|
|
69
|
-
}, [history, openGeneralSidebar, setCanvasMode,
|
|
65
|
+
}, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, params.postId]);
|
|
70
66
|
return {
|
|
71
67
|
isLoading: false,
|
|
72
68
|
commands
|
|
@@ -80,8 +76,6 @@ function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
|
80
76
|
const {
|
|
81
77
|
params
|
|
82
78
|
} = useLocation();
|
|
83
|
-
const isMobileViewport = useViewportMatch('medium', '<');
|
|
84
|
-
const isEditorPage = !getIsListPage(params, isMobileViewport);
|
|
85
79
|
const {
|
|
86
80
|
getCanvasMode
|
|
87
81
|
} = unlock(useSelect(editSiteStore));
|
|
@@ -103,13 +97,13 @@ function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
|
103
97
|
close
|
|
104
98
|
}) => {
|
|
105
99
|
close();
|
|
106
|
-
if (!
|
|
100
|
+
if (!params.postId) {
|
|
107
101
|
history.push({
|
|
108
102
|
path: '/wp_global_styles',
|
|
109
103
|
canvas: 'edit'
|
|
110
104
|
});
|
|
111
105
|
}
|
|
112
|
-
if (
|
|
106
|
+
if (params.postId && getCanvasMode() !== 'edit') {
|
|
113
107
|
setCanvasMode('edit');
|
|
114
108
|
}
|
|
115
109
|
openGeneralSidebar('edit-site/global-styles');
|
|
@@ -122,7 +116,7 @@ function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
|
122
116
|
},
|
|
123
117
|
icon: help
|
|
124
118
|
}];
|
|
125
|
-
}, [history, openGeneralSidebar, setCanvasMode,
|
|
119
|
+
}, [history, openGeneralSidebar, setCanvasMode, getCanvasMode, isBlockBasedTheme, set, params.postId]);
|
|
126
120
|
return {
|
|
127
121
|
isLoading: false,
|
|
128
122
|
commands
|
|
@@ -160,9 +154,6 @@ function useGlobalStylesOpenCssCommands() {
|
|
|
160
154
|
const {
|
|
161
155
|
params
|
|
162
156
|
} = useLocation();
|
|
163
|
-
const isMobileViewport = useViewportMatch('medium', '<');
|
|
164
|
-
const isListPage = getIsListPage(params, isMobileViewport);
|
|
165
|
-
const isEditorPage = !isListPage;
|
|
166
157
|
const history = useHistory();
|
|
167
158
|
const {
|
|
168
159
|
canEditCSS
|
|
@@ -192,20 +183,20 @@ function useGlobalStylesOpenCssCommands() {
|
|
|
192
183
|
close
|
|
193
184
|
}) => {
|
|
194
185
|
close();
|
|
195
|
-
if (!
|
|
186
|
+
if (!params.postId) {
|
|
196
187
|
history.push({
|
|
197
188
|
path: '/wp_global_styles',
|
|
198
189
|
canvas: 'edit'
|
|
199
190
|
});
|
|
200
191
|
}
|
|
201
|
-
if (
|
|
192
|
+
if (params.postId && getCanvasMode() !== 'edit') {
|
|
202
193
|
setCanvasMode('edit');
|
|
203
194
|
}
|
|
204
195
|
openGeneralSidebar('edit-site/global-styles');
|
|
205
196
|
setEditorCanvasContainerView('global-styles-css');
|
|
206
197
|
}
|
|
207
198
|
}];
|
|
208
|
-
}, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS,
|
|
199
|
+
}, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, getCanvasMode, setCanvasMode, params.postId]);
|
|
209
200
|
return {
|
|
210
201
|
isLoading: false,
|
|
211
202
|
commands
|
|
@@ -223,8 +214,6 @@ function useGlobalStylesOpenRevisionsCommands() {
|
|
|
223
214
|
const {
|
|
224
215
|
params
|
|
225
216
|
} = useLocation();
|
|
226
|
-
const isMobileViewport = useViewportMatch('medium', '<');
|
|
227
|
-
const isEditorPage = !getIsListPage(params, isMobileViewport);
|
|
228
217
|
const history = useHistory();
|
|
229
218
|
const hasRevisions = useSelect(select => {
|
|
230
219
|
const {
|
|
@@ -247,20 +236,20 @@ function useGlobalStylesOpenRevisionsCommands() {
|
|
|
247
236
|
close
|
|
248
237
|
}) => {
|
|
249
238
|
close();
|
|
250
|
-
if (!
|
|
239
|
+
if (!params.postId) {
|
|
251
240
|
history.push({
|
|
252
241
|
path: '/wp_global_styles',
|
|
253
242
|
canvas: 'edit'
|
|
254
243
|
});
|
|
255
244
|
}
|
|
256
|
-
if (
|
|
245
|
+
if (params.postId && getCanvasMode() !== 'edit') {
|
|
257
246
|
setCanvasMode('edit');
|
|
258
247
|
}
|
|
259
248
|
openGeneralSidebar('edit-site/global-styles');
|
|
260
249
|
setEditorCanvasContainerView('global-styles-revisions');
|
|
261
250
|
}
|
|
262
251
|
}];
|
|
263
|
-
}, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView,
|
|
252
|
+
}, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, getCanvasMode, setCanvasMode, params.postId]);
|
|
264
253
|
return {
|
|
265
254
|
isLoading: false,
|
|
266
255
|
commands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","useViewportMatch","unlock","editSiteStore","getIsListPage","useGlobalStylesReset","useHistory","useLocation","useGlobalStylesOpenStylesCommands","openGeneralSidebar","setCanvasMode","params","isMobileViewport","isEditorPage","getCanvasMode","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","push","path","canvas","icon","isLoading","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","useGlobalStylesResetCommands","canReset","onReset","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","isListPage","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","useCommonCommands","homeUrl","getUnstableBase","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesOpenStylesCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst history = useHistory();\n\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t},\n\t\t\t\ticon: styles,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t}, 500 );\n\t\t\t\t},\n\t\t\t\ticon: help,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t\tset,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\ticon: brush,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenRevisionsCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isEditorPage = ! getIsListPage( params, isMobileViewport );\n\tconst history = useHistory();\n\tconst hasRevisions = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! hasRevisions ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\ticon: backup,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! isEditorPage ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( isEditorPage && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thasRevisions,\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tisEditorPage,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn getUnstableBase()?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: useGlobalStylesOpenStylesCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: useGlobalStylesToggleWelcomeGuideCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: useGlobalStylesOpenRevisionsCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO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AEzB;EACP,CAAE,CAAC;EAEHrC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,oCAAoC;IAC1CkC,IAAI,EAAEtB;EACP,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,gCAAgC;IACtCkC,IAAI,EAAEnB;EACP,CAAE,CAAC;EAEH3C,gBAAgB,CAAE;IACjB4B,IAAI,EAAE,sCAAsC;IAC5CkC,IAAI,EAAET;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","unlock","editSiteStore","useGlobalStylesReset","useHistory","useLocation","useGlobalStylesOpenStylesCommands","openGeneralSidebar","setCanvasMode","params","getCanvasMode","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","postId","push","path","canvas","icon","isLoading","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","useGlobalStylesResetCommands","canReset","onReset","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","useCommonCommands","homeUrl","getUnstableBase","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesOpenStylesCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst history = useHistory();\n\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t},\n\t\t\t\ticon: styles,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t\tparams.postId,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\tconst { openGeneralSidebar, setCanvasMode } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t}, 500 );\n\t\t\t\t},\n\t\t\t\ticon: help,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetCanvasMode,\n\t\tgetCanvasMode,\n\t\tisBlockBasedTheme,\n\t\tset,\n\t\tparams.postId,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\ticon: brush,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t\tparams.postId,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenRevisionsCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView, setCanvasMode } =\n\t\tunlock( useDispatch( editSiteStore ) );\n\tconst { getCanvasMode } = unlock( useSelect( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst hasRevisions = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! hasRevisions ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\ticon: backup,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && getCanvasMode() !== 'edit' ) {\n\t\t\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thasRevisions,\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tgetCanvasMode,\n\t\tsetCanvasMode,\n\t\tparams.postId,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\n\t\treturn getUnstableBase()?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: useGlobalStylesOpenStylesCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: useGlobalStylesToggleWelcomeGuideCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: useGlobalStylesOpenRevisionsCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ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B,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAG/D,SAAS,CAAI8B,MAAM,IAAM;IACxC,MAAM;MACLkC,eAAe,CAAE;IAClB,CAAC,GAAGlC,MAAM,CAAEb,SAAU,CAAC;IAEvB,OAAO+C,eAAe,CAAC,CAAC,EAAEC,IAAI;EAC/B,CAAC,EAAE,EAAG,CAAC;EAEPtD,UAAU,CAAE;IACXuB,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAElC,EAAE,CAAE,WAAY,CAAC;IACxBmC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACP6B,MAAM,CAACC,IAAI,CAAEJ,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDrB,IAAI,EAAElC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4BAA4B;IAClCkC,IAAI,EAAE7C;EACP,CAAE,CAAC;EAEHb,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4CAA4C;IAClDkC,IAAI,EAAExB;EACP,CAAE,CAAC;EAEHlC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,oCAAoC;IAC1CkC,IAAI,EAAErB;EACP,CAAE,CAAC;EAEHrC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,gCAAgC;IACtCkC,IAAI,EAAElB;EACP,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,sCAAsC;IAC5CkC,IAAI,EAAET;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __, sprintf, isRTL } from '@wordpress/i18n';
|
|
6
|
-
import {
|
|
6
|
+
import { trash, rotateLeft, rotateRight, layout, page } from '@wordpress/icons';
|
|
7
7
|
import { useCommandLoader } from '@wordpress/commands';
|
|
8
8
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
9
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
|
-
import { store as editorStore
|
|
10
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
@@ -16,13 +16,9 @@ import { store as editSiteStore } from '../../store';
|
|
|
16
16
|
import useEditedEntityRecord from '../../components/use-edited-entity-record';
|
|
17
17
|
import isTemplateRemovable from '../../utils/is-template-removable';
|
|
18
18
|
import isTemplateRevertable from '../../utils/is-template-revertable';
|
|
19
|
-
import { PATTERN_MODALS } from '../../components/pattern-modal';
|
|
20
19
|
import { unlock } from '../../lock-unlock';
|
|
21
20
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
22
21
|
import { useLink } from '../../components/routes/link';
|
|
23
|
-
const {
|
|
24
|
-
interfaceStore
|
|
25
|
-
} = unlock(editorPrivateApis);
|
|
26
22
|
const {
|
|
27
23
|
useHistory
|
|
28
24
|
} = unlock(routerPrivateApis);
|
|
@@ -136,7 +132,6 @@ function useManipulateDocumentCommands() {
|
|
|
136
132
|
const label = template.type === TEMPLATE_POST_TYPE ? sprintf( /* translators: %s: template title */
|
|
137
133
|
__('Delete template: %s'), decodeEntities(template.title)) : sprintf( /* translators: %s: template part title */
|
|
138
134
|
__('Delete template part: %s'), decodeEntities(template.title));
|
|
139
|
-
const path = template.type === TEMPLATE_POST_TYPE ? '/wp_template' : '/patterns';
|
|
140
135
|
commands.push({
|
|
141
136
|
name: 'core/remove-template',
|
|
142
137
|
label,
|
|
@@ -147,7 +142,7 @@ function useManipulateDocumentCommands() {
|
|
|
147
142
|
removeTemplate(template);
|
|
148
143
|
// Navigate to the template list
|
|
149
144
|
history.push({
|
|
150
|
-
|
|
145
|
+
postType: template.type
|
|
151
146
|
});
|
|
152
147
|
close();
|
|
153
148
|
}
|
|
@@ -158,124 +153,15 @@ function useManipulateDocumentCommands() {
|
|
|
158
153
|
commands
|
|
159
154
|
};
|
|
160
155
|
}
|
|
161
|
-
function useEditUICommands() {
|
|
162
|
-
const {
|
|
163
|
-
openGeneralSidebar,
|
|
164
|
-
closeGeneralSidebar
|
|
165
|
-
} = useDispatch(editSiteStore);
|
|
166
|
-
const {
|
|
167
|
-
canvasMode,
|
|
168
|
-
activeSidebar
|
|
169
|
-
} = useSelect(select => {
|
|
170
|
-
return {
|
|
171
|
-
canvasMode: unlock(select(editSiteStore)).getCanvasMode(),
|
|
172
|
-
activeSidebar: select(interfaceStore).getActiveComplementaryArea('core')
|
|
173
|
-
};
|
|
174
|
-
}, []);
|
|
175
|
-
if (canvasMode !== 'edit') {
|
|
176
|
-
return {
|
|
177
|
-
isLoading: false,
|
|
178
|
-
commands: []
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
const commands = [];
|
|
182
|
-
commands.push({
|
|
183
|
-
name: 'core/open-settings-sidebar',
|
|
184
|
-
label: __('Toggle settings sidebar'),
|
|
185
|
-
icon: isRTL() ? drawerLeft : drawerRight,
|
|
186
|
-
callback: ({
|
|
187
|
-
close
|
|
188
|
-
}) => {
|
|
189
|
-
close();
|
|
190
|
-
if (activeSidebar === 'edit-post/document') {
|
|
191
|
-
closeGeneralSidebar();
|
|
192
|
-
} else {
|
|
193
|
-
openGeneralSidebar('edit-post/document');
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
commands.push({
|
|
198
|
-
name: 'core/open-block-inspector',
|
|
199
|
-
label: __('Toggle block inspector'),
|
|
200
|
-
icon: blockDefault,
|
|
201
|
-
callback: ({
|
|
202
|
-
close
|
|
203
|
-
}) => {
|
|
204
|
-
close();
|
|
205
|
-
if (activeSidebar === 'edit-site/block') {
|
|
206
|
-
closeGeneralSidebar();
|
|
207
|
-
} else {
|
|
208
|
-
openGeneralSidebar('edit-site/block');
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
return {
|
|
213
|
-
isLoading: false,
|
|
214
|
-
commands
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function usePatternCommands() {
|
|
218
|
-
const {
|
|
219
|
-
isLoaded,
|
|
220
|
-
record: pattern
|
|
221
|
-
} = useEditedEntityRecord();
|
|
222
|
-
const {
|
|
223
|
-
openModal
|
|
224
|
-
} = useDispatch(interfaceStore);
|
|
225
|
-
if (!isLoaded) {
|
|
226
|
-
return {
|
|
227
|
-
isLoading: true,
|
|
228
|
-
commands: []
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
const commands = [];
|
|
232
|
-
if (pattern?.type === 'wp_block') {
|
|
233
|
-
commands.push({
|
|
234
|
-
name: 'core/rename-pattern',
|
|
235
|
-
label: __('Rename pattern'),
|
|
236
|
-
icon: edit,
|
|
237
|
-
callback: ({
|
|
238
|
-
close
|
|
239
|
-
}) => {
|
|
240
|
-
openModal(PATTERN_MODALS.rename);
|
|
241
|
-
close();
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
commands.push({
|
|
245
|
-
name: 'core/duplicate-pattern',
|
|
246
|
-
label: __('Duplicate pattern'),
|
|
247
|
-
icon: symbol,
|
|
248
|
-
callback: ({
|
|
249
|
-
close
|
|
250
|
-
}) => {
|
|
251
|
-
openModal(PATTERN_MODALS.duplicate);
|
|
252
|
-
close();
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
isLoading: false,
|
|
258
|
-
commands
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
156
|
export function useEditModeCommands() {
|
|
262
157
|
useCommandLoader({
|
|
263
158
|
name: 'core/edit-site/page-content-focus',
|
|
264
159
|
hook: usePageContentFocusCommands,
|
|
265
|
-
context: '
|
|
160
|
+
context: 'entity-edit'
|
|
266
161
|
});
|
|
267
162
|
useCommandLoader({
|
|
268
163
|
name: 'core/edit-site/manipulate-document',
|
|
269
164
|
hook: useManipulateDocumentCommands
|
|
270
165
|
});
|
|
271
|
-
useCommandLoader({
|
|
272
|
-
name: 'core/edit-site/patterns',
|
|
273
|
-
hook: usePatternCommands,
|
|
274
|
-
context: 'site-editor-edit'
|
|
275
|
-
});
|
|
276
|
-
useCommandLoader({
|
|
277
|
-
name: 'core/edit-site/edit-ui',
|
|
278
|
-
hook: useEditUICommands
|
|
279
|
-
});
|
|
280
166
|
}
|
|
281
167
|
//# sourceMappingURL=use-edit-mode-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","edit","trash","rotateLeft","rotateRight","layout","page","drawerLeft","drawerRight","blockDefault","symbol","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","editorStore","editorPrivateApis","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","PATTERN_MODALS","unlock","TEMPLATE_POST_TYPE","useLink","interfaceStore","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","activeSidebar","getActiveComplementaryArea","usePatternCommands","pattern","openModal","rename","duplicate","useEditModeCommands","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\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} 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 { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\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 ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: sprintf(\n\t\t\t\t/* translators: %s: template title */\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\teditTemplate();\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 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 ).getCurrentPostType() !== 'wp_template',\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? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\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: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\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? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\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: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\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 ? '/wp_template' : '/patterns';\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 { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editSiteStore );\n\tconst { canvasMode, activeSidebar } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\tactiveSidebar:\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ),\n\t\t};\n\t}, [] );\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-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\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' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block' );\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/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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yBAAyB;IAC/ByB,IAAI,EAAEN,kBAAkB;IACxBO,OAAO,EAAE;EACV,CAAE,CAAC;EAEH/D,gBAAgB,CAAE;IACjBqC,IAAI,EAAE,wBAAwB;IAC9ByB,IAAI,EAAEX;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","trash","rotateLeft","rotateRight","layout","page","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","editorStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","unlock","TEMPLATE_POST_TYPE","useLink","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","useEditModeCommands","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 { trash, rotateLeft, rotateRight, layout, page } from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\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 { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\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 ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: sprintf(\n\t\t\t\t/* translators: %s: template title */\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\teditTemplate();\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 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 ).getCurrentPostType() !== 'wp_template',\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? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\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: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\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? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\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: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\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\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\tpostType: template.type,\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\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SAASC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC/E,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,2CAA2C;AAC7E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,OAAO,QAAQ,8BAA8B;AAEtD,MAAM;EAAEC;AAAW,CAAC,GAAGH,MAAM,CAAEP,iBAAkB,CAAC;AAElD,SAASW,2BAA2BA,CAAA,EAAG;EACtC,MAAM;IAAEC,MAAM,EAAEC;EAAS,CAAC,GAAGT,qBAAqB,CAAC,CAAC;EACpD,MAAM;IAAEU,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAgB,CAAC,GAAG9B,SAAS,CAClE+B,MAAM,IAAM;IACb,MAAM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ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/edit-site/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/edit-site/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './push-changes-to-global-styles';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,iCAAiC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -20,6 +19,9 @@ import { useSupportedStyles } from '../../components/global-styles/hooks';
|
|
|
20
19
|
import { unlock } from '../../lock-unlock';
|
|
21
20
|
import cloneDeep from '../../utils/clone-deep';
|
|
22
21
|
import setNestedValue from '../../utils/set-nested-value';
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
25
|
const {
|
|
24
26
|
cleanEmptyObject,
|
|
25
27
|
GlobalStylesContext
|
|
@@ -287,16 +289,21 @@ function PushChangesToGlobalStylesControl({
|
|
|
287
289
|
});
|
|
288
290
|
}
|
|
289
291
|
}, [__unstableMarkNextChangeAsNotPersistent, attributes, changes, createSuccessNotice, name, setAttributes, setUserConfig, userConfig]);
|
|
290
|
-
return
|
|
292
|
+
return /*#__PURE__*/_jsxs(BaseControl, {
|
|
291
293
|
className: "edit-site-push-changes-to-global-styles-control",
|
|
292
294
|
help: sprintf(
|
|
293
295
|
// translators: %s: Title of the block e.g. 'Heading'.
|
|
294
|
-
__('Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'), getBlockType(name).title)
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
__('Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'), getBlockType(name).title),
|
|
297
|
+
children: [/*#__PURE__*/_jsx(BaseControl.VisualLabel, {
|
|
298
|
+
children: __('Styles')
|
|
299
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
300
|
+
__next40pxDefaultSize: true,
|
|
301
|
+
variant: "secondary",
|
|
302
|
+
disabled: changes.length === 0,
|
|
303
|
+
onClick: pushChanges,
|
|
304
|
+
children: __('Apply globally')
|
|
305
|
+
})]
|
|
306
|
+
});
|
|
300
307
|
}
|
|
301
308
|
function PushChangesToGlobalStyles(props) {
|
|
302
309
|
const blockEditingMode = useBlockEditingMode();
|
|
@@ -306,14 +313,18 @@ function PushChangesToGlobalStyles(props) {
|
|
|
306
313
|
if (!isDisplayed) {
|
|
307
314
|
return null;
|
|
308
315
|
}
|
|
309
|
-
return
|
|
310
|
-
|
|
311
|
-
|
|
316
|
+
return /*#__PURE__*/_jsx(InspectorAdvancedControls, {
|
|
317
|
+
children: /*#__PURE__*/_jsx(PushChangesToGlobalStylesControl, {
|
|
318
|
+
...props
|
|
319
|
+
})
|
|
320
|
+
});
|
|
312
321
|
}
|
|
313
|
-
const withPushChangesToGlobalStyles = createHigherOrderComponent(BlockEdit => props =>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
const withPushChangesToGlobalStyles = createHigherOrderComponent(BlockEdit => props => /*#__PURE__*/_jsxs(_Fragment, {
|
|
323
|
+
children: [/*#__PURE__*/_jsx(BlockEdit, {
|
|
324
|
+
...props
|
|
325
|
+
}), props.isSelected && /*#__PURE__*/_jsx(PushChangesToGlobalStyles, {
|
|
326
|
+
...props
|
|
327
|
+
})]
|
|
328
|
+
}));
|
|
318
329
|
addFilter('editor.BlockEdit', 'core/edit-site/push-changes-to-global-styles', withPushChangesToGlobalStyles);
|
|
319
330
|
//# sourceMappingURL=index.js.map
|