@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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -22,14 +21,17 @@ import ScreenTypography from './screen-typography';
|
|
|
22
21
|
import ScreenTypographyElement from './screen-typography-element';
|
|
23
22
|
import ScreenColors from './screen-colors';
|
|
24
23
|
import ScreenColorPalette from './screen-color-palette';
|
|
24
|
+
import { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';
|
|
25
25
|
import ScreenLayout from './screen-layout';
|
|
26
26
|
import ScreenStyleVariations from './screen-style-variations';
|
|
27
27
|
import StyleBook from '../style-book';
|
|
28
28
|
import ScreenCSS from './screen-css';
|
|
29
29
|
import ScreenRevisions from './screen-revisions';
|
|
30
|
-
import ScreenBackground from './screen-background';
|
|
31
30
|
import { unlock } from '../../lock-unlock';
|
|
32
31
|
import { store as editSiteStore } from '../../store';
|
|
32
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
35
|
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
34
36
|
const {
|
|
35
37
|
useGlobalStylesReset
|
|
@@ -66,34 +68,46 @@ function GlobalStylesActionMenu() {
|
|
|
66
68
|
setEditorCanvasContainerView('global-styles-css');
|
|
67
69
|
goTo('/css');
|
|
68
70
|
};
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
return /*#__PURE__*/_jsx(GlobalStylesMenuFill, {
|
|
72
|
+
children: /*#__PURE__*/_jsx(DropdownMenu, {
|
|
73
|
+
icon: moreVertical,
|
|
74
|
+
label: __('More'),
|
|
75
|
+
toggleProps: {
|
|
76
|
+
size: 'compact'
|
|
77
|
+
},
|
|
78
|
+
children: ({
|
|
79
|
+
onClose
|
|
80
|
+
}) => /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/_jsxs(MenuGroup, {
|
|
82
|
+
children: [canEditCSS && /*#__PURE__*/_jsx(MenuItem, {
|
|
83
|
+
onClick: loadCustomCSS,
|
|
84
|
+
children: __('Additional CSS')
|
|
85
|
+
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
86
|
+
onClick: () => {
|
|
87
|
+
toggle('core/edit-site', 'welcomeGuideStyles');
|
|
88
|
+
onClose();
|
|
89
|
+
},
|
|
90
|
+
children: __('Welcome Guide')
|
|
91
|
+
})]
|
|
92
|
+
}), /*#__PURE__*/_jsx(MenuGroup, {
|
|
93
|
+
children: /*#__PURE__*/_jsx(MenuItem, {
|
|
94
|
+
onClick: () => {
|
|
95
|
+
onReset();
|
|
96
|
+
onClose();
|
|
97
|
+
},
|
|
98
|
+
disabled: !canReset,
|
|
99
|
+
children: __('Reset styles')
|
|
100
|
+
})
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
91
105
|
}
|
|
92
106
|
function GlobalStylesNavigationScreen({
|
|
93
107
|
className,
|
|
94
108
|
...props
|
|
95
109
|
}) {
|
|
96
|
-
return
|
|
110
|
+
return /*#__PURE__*/_jsx(NavigatorScreen, {
|
|
97
111
|
className: ['edit-site-global-styles-sidebar__navigator-screen', className].filter(Boolean).join(' '),
|
|
98
112
|
...props
|
|
99
113
|
});
|
|
@@ -103,13 +117,13 @@ function BlockStylesNavigationScreens({
|
|
|
103
117
|
blockStyles,
|
|
104
118
|
blockName
|
|
105
119
|
}) {
|
|
106
|
-
return blockStyles.map((style, index) =>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}))
|
|
120
|
+
return blockStyles.map((style, index) => /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
121
|
+
path: parentMenu + '/variations/' + style.name,
|
|
122
|
+
children: /*#__PURE__*/_jsx(ScreenBlock, {
|
|
123
|
+
name: blockName,
|
|
124
|
+
variation: style.name
|
|
125
|
+
})
|
|
126
|
+
}, index));
|
|
113
127
|
}
|
|
114
128
|
function ContextScreens({
|
|
115
129
|
name,
|
|
@@ -121,22 +135,25 @@ function ContextScreens({
|
|
|
121
135
|
} = select(blocksStore);
|
|
122
136
|
return getBlockStyles(name);
|
|
123
137
|
}, [name]);
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
139
|
+
children: [/*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
140
|
+
path: parentMenu + '/colors/palette',
|
|
141
|
+
children: /*#__PURE__*/_jsx(ScreenColorPalette, {
|
|
142
|
+
name: name
|
|
143
|
+
})
|
|
144
|
+
}), !!blockStyleVariations?.length && /*#__PURE__*/_jsx(BlockStylesNavigationScreens, {
|
|
145
|
+
parentMenu: parentMenu,
|
|
146
|
+
blockStyles: blockStyleVariations,
|
|
147
|
+
blockName: name
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
133
150
|
}
|
|
134
151
|
function GlobalStylesStyleBook() {
|
|
135
152
|
const navigator = useNavigator();
|
|
136
153
|
const {
|
|
137
154
|
path
|
|
138
155
|
} = navigator.location;
|
|
139
|
-
return
|
|
156
|
+
return /*#__PURE__*/_jsx(StyleBook, {
|
|
140
157
|
isSelected: blockName =>
|
|
141
158
|
// Match '/blocks/core%2Fbutton' and
|
|
142
159
|
// '/blocks/core%2Fbutton/typography', but not
|
|
@@ -236,57 +253,74 @@ function GlobalStylesEditorCanvasContainerLink() {
|
|
|
236
253
|
function GlobalStylesUI() {
|
|
237
254
|
const blocks = getBlockTypes();
|
|
238
255
|
const editorCanvasContainerView = useSelect(select => unlock(select(editSiteStore)).getEditorCanvasContainerView(), []);
|
|
239
|
-
return
|
|
256
|
+
return /*#__PURE__*/_jsxs(NavigatorProvider, {
|
|
240
257
|
className: "edit-site-global-styles-sidebar__navigator-provider",
|
|
241
|
-
initialPath: "/"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
258
|
+
initialPath: "/",
|
|
259
|
+
children: [/*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
260
|
+
path: "/",
|
|
261
|
+
children: /*#__PURE__*/_jsx(ScreenRoot, {})
|
|
262
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
263
|
+
path: "/variations",
|
|
264
|
+
children: /*#__PURE__*/_jsx(ScreenStyleVariations, {})
|
|
265
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
266
|
+
path: "/blocks",
|
|
267
|
+
children: /*#__PURE__*/_jsx(ScreenBlockList, {})
|
|
268
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
269
|
+
path: "/typography",
|
|
270
|
+
children: /*#__PURE__*/_jsx(ScreenTypography, {})
|
|
271
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
272
|
+
path: "/typography/text",
|
|
273
|
+
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
274
|
+
element: "text"
|
|
275
|
+
})
|
|
276
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
277
|
+
path: "/typography/link",
|
|
278
|
+
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
279
|
+
element: "link"
|
|
280
|
+
})
|
|
281
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
282
|
+
path: "/typography/heading",
|
|
283
|
+
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
284
|
+
element: "heading"
|
|
285
|
+
})
|
|
286
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
287
|
+
path: "/typography/caption",
|
|
288
|
+
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
289
|
+
element: "caption"
|
|
290
|
+
})
|
|
291
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
292
|
+
path: "/typography/button",
|
|
293
|
+
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
294
|
+
element: "button"
|
|
295
|
+
})
|
|
296
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
297
|
+
path: "/colors",
|
|
298
|
+
children: /*#__PURE__*/_jsx(ScreenColors, {})
|
|
299
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
300
|
+
path: "/shadows",
|
|
301
|
+
children: /*#__PURE__*/_jsx(ScreenShadows, {})
|
|
302
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
303
|
+
path: "/shadows/edit/:category/:slug",
|
|
304
|
+
children: /*#__PURE__*/_jsx(ScreenShadowsEdit, {})
|
|
305
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
306
|
+
path: "/layout",
|
|
307
|
+
children: /*#__PURE__*/_jsx(ScreenLayout, {})
|
|
308
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
309
|
+
path: "/css",
|
|
310
|
+
children: /*#__PURE__*/_jsx(ScreenCSS, {})
|
|
311
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
312
|
+
path: "/revisions",
|
|
313
|
+
children: /*#__PURE__*/_jsx(ScreenRevisions, {})
|
|
314
|
+
}), blocks.map(block => /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
315
|
+
path: '/blocks/' + encodeURIComponent(block.name),
|
|
316
|
+
children: /*#__PURE__*/_jsx(ScreenBlock, {
|
|
317
|
+
name: block.name
|
|
318
|
+
})
|
|
319
|
+
}, 'menu-block-' + block.name)), /*#__PURE__*/_jsx(ContextScreens, {}), blocks.map(block => /*#__PURE__*/_jsx(ContextScreens, {
|
|
320
|
+
name: block.name,
|
|
321
|
+
parentMenu: '/blocks/' + encodeURIComponent(block.name)
|
|
322
|
+
}, 'screens-block-' + block.name)), 'style-book' === editorCanvasContainerView && /*#__PURE__*/_jsx(GlobalStylesStyleBook, {}), /*#__PURE__*/_jsx(GlobalStylesActionMenu, {}), /*#__PURE__*/_jsx(GlobalStylesBlockLink, {}), /*#__PURE__*/_jsx(GlobalStylesEditorCanvasContainerLink, {})]
|
|
323
|
+
});
|
|
290
324
|
}
|
|
291
325
|
export { GlobalStylesMenuSlot };
|
|
292
326
|
export default GlobalStylesUI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","ScreenBackground","unlock","editSiteStore","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","goTo","loadCustomCSS","createElement","icon","label","toggleProps","size","onClose","Fragment","onClick","disabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","key","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport ScreenBackground from './screen-background';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\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 { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/background' }>\n\t\t\t\t<ScreenBackground />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,IAAIC,sBAAsB,EACrCL,KAAK,IAAIM,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,SACCC,uBAAuB,EACvBC,OAAO,IAAIC,eAAe,QACpB,qBAAqB;AAC5B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,uBAAuB,MAAM,6BAA6B;AACjE,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,YAAY,MAAM,iBAAiB;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vider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","ScreenColors","ScreenColorPalette","ScreenShadows","ScreenShadowsEdit","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","goTo","loadCustomCSS","children","icon","label","toggleProps","size","onClose","onClick","disabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\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 { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,EACdC,YAAY,EACZC,SAAS,EAC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B,IAAE,CACxB,eAEDtD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAAC6D,qBAAqB,IAAE,CAAC,eACzB7D,IAAA,CAACuE,qCAAqC,IAAE,CAAC;EAAA,CACvB,CAAC;AAEtB;AACA,SAAS/D,oBAAoB;AAC7B,eAAemE,cAAc","ignoreList":[]}
|
|
@@ -10,6 +10,33 @@ export function getVariationClassName(variation) {
|
|
|
10
10
|
}
|
|
11
11
|
return `is-style-${variation}`;
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Iterates through the presets array and searches for slugs that start with the specified
|
|
16
|
+
* slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found
|
|
17
|
+
* and returns one greater than the highest found suffix, ensuring that the new index is unique.
|
|
18
|
+
*
|
|
19
|
+
* @param {Array} presets The array of preset objects, each potentially containing a slug property.
|
|
20
|
+
* @param {string} slugPrefix The prefix to look for in the preset slugs.
|
|
21
|
+
*
|
|
22
|
+
* @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.
|
|
23
|
+
*/
|
|
24
|
+
export function getNewIndexFromPresets(presets, slugPrefix) {
|
|
25
|
+
const nameRegex = new RegExp(`^${slugPrefix}([\\d]+)$`);
|
|
26
|
+
const highestPresetValue = presets.reduce((currentHighest, preset) => {
|
|
27
|
+
if (typeof preset?.slug === 'string') {
|
|
28
|
+
const matches = preset?.slug.match(nameRegex);
|
|
29
|
+
if (matches) {
|
|
30
|
+
const id = parseInt(matches[1], 10);
|
|
31
|
+
if (id > currentHighest) {
|
|
32
|
+
return id;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return currentHighest;
|
|
37
|
+
}, 0);
|
|
38
|
+
return highestPresetValue + 1;
|
|
39
|
+
}
|
|
13
40
|
function getFontFamilyFromSetting(fontFamilies, setting) {
|
|
14
41
|
if (!Array.isArray(fontFamilies) || !setting) {
|
|
15
42
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getVariationClassName","variation","getFontFamilyFromSetting","fontFamilies","setting","Array","isArray","fontFamilyVariable","replace","fontFamilySlug","split","slice","find","fontFamily","
|
|
1
|
+
{"version":3,"names":["getVariationClassName","variation","getNewIndexFromPresets","presets","slugPrefix","nameRegex","RegExp","highestPresetValue","reduce","currentHighest","preset","slug","matches","match","id","parseInt","getFontFamilyFromSetting","fontFamilies","setting","Array","isArray","fontFamilyVariable","replace","fontFamilySlug","split","slice","find","fontFamily","getFontFamilies","themeJson","settings","typography","theme","bodyFontFamilySetting","styles","bodyFontFamily","headingFontFamilySetting","elements","heading","headingFontFamily"],"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"sourcesContent":["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param {Array} presets The array of preset objects, each potentially containing a slug property.\n * @param {string} slugPrefix The prefix to look for in the preset slugs.\n *\n * @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\nexport function getNewIndexFromPresets( presets, slugPrefix ) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\nfunction getFontFamilyFromSetting( fontFamilies, setting ) {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\nexport function getFontFamilies( themeJson ) {\n\tconst fontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; // TODO this could not be under theme.\n\tconst bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;\n\tconst bodyFontFamily = getFontFamilyFromSetting(\n\t\tfontFamilies,\n\t\tbodyFontFamilySetting\n\t);\n\n\tconst headingFontFamilySetting =\n\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily;\n\n\tlet headingFontFamily;\n\tif ( ! headingFontFamilySetting ) {\n\t\theadingFontFamily = bodyFontFamily;\n\t} else {\n\t\theadingFontFamily = getFontFamilyFromSetting(\n\t\t\tfontFamilies,\n\t\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily\n\t\t);\n\t}\n\n\treturn [ bodyFontFamily, headingFontFamily ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAqBA,CAAEC,SAAS,EAAG;EAClD,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,EAAE;EACV;EACA,OAAQ,YAAYA,SAAW,EAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,OAAO,EAAEC,UAAU,EAAG;EAC7D,MAAMC,SAAS,GAAG,IAAIC,MAAM,CAAG,IAAIF,UAAY,WAAW,CAAC;EAC3D,MAAMG,kBAAkB,GAAGJ,OAAO,CAACK,MAAM,CAAE,CAAEC,cAAc,EAAEC,MAAM,KAAM;IACxE,IAAK,OAAOA,MAAM,EAAE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C,OAAO,EAAEP,UAAU,EAAEJ,UAAU;EAE7D,IAAIY,iBAAiB;EACrB,IAAK,CAAEH,wBAAwB,EAAG;IACjCG,iBAAiB,GAAGJ,cAAc;EACnC,CAAC,MAAM;IACNI,iBAAiB,GAAGvB,wBAAwB,CAC3CC,YAAY,EACZY,SAAS,EAAEK,MAAM,EAAEG,QAAQ,EAAEC,OAAO,EAAEP,UAAU,EAAEJ,UACnD,CAAC;EACF;EAEA,OAAO,CAAEQ,cAAc,EAAEI,iBAAiB,CAAE;AAC7C","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -17,6 +16,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
|
17
16
|
* Internal dependencies
|
|
18
17
|
*/
|
|
19
18
|
import { unlock } from '../../../lock-unlock';
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
const {
|
|
21
21
|
mergeBaseAndUserConfigs
|
|
22
22
|
} = unlock(editorPrivateApis);
|
|
@@ -36,11 +36,12 @@ export default function Variation({
|
|
|
36
36
|
setUserConfig
|
|
37
37
|
} = useContext(GlobalStylesContext);
|
|
38
38
|
const context = useMemo(() => {
|
|
39
|
-
var _variation$settings, _variation$styles;
|
|
39
|
+
var _variation$settings, _variation$styles, _variation$_links;
|
|
40
40
|
return {
|
|
41
41
|
user: {
|
|
42
42
|
settings: (_variation$settings = variation.settings) !== null && _variation$settings !== void 0 ? _variation$settings : {},
|
|
43
|
-
styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {}
|
|
43
|
+
styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {},
|
|
44
|
+
_links: (_variation$_links = variation._links) !== null && _variation$_links !== void 0 ? _variation$_links : {}
|
|
44
45
|
},
|
|
45
46
|
base,
|
|
46
47
|
merged: mergeBaseAndUserConfigs(base, variation),
|
|
@@ -50,7 +51,8 @@ export default function Variation({
|
|
|
50
51
|
const selectVariation = () => {
|
|
51
52
|
setUserConfig(() => ({
|
|
52
53
|
settings: variation.settings,
|
|
53
|
-
styles: variation.styles
|
|
54
|
+
styles: variation.styles,
|
|
55
|
+
_links: variation._links
|
|
54
56
|
}));
|
|
55
57
|
};
|
|
56
58
|
const selectOnEnter = event => {
|
|
@@ -65,24 +67,27 @@ export default function Variation({
|
|
|
65
67
|
label = sprintf( /* translators: %1$s: variation title. %2$s variation description. */
|
|
66
68
|
__('%1$s (%2$s)'), variation?.title, variation?.description);
|
|
67
69
|
}
|
|
68
|
-
return
|
|
69
|
-
value: context
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
return /*#__PURE__*/_jsx(GlobalStylesContext.Provider, {
|
|
71
|
+
value: context,
|
|
72
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: clsx('edit-site-global-styles-variations_item', {
|
|
74
|
+
'is-active': isActive
|
|
75
|
+
}),
|
|
76
|
+
role: "button",
|
|
77
|
+
onClick: selectVariation,
|
|
78
|
+
onKeyDown: selectOnEnter,
|
|
79
|
+
tabIndex: "0",
|
|
80
|
+
"aria-label": label,
|
|
81
|
+
"aria-current": isActive,
|
|
82
|
+
onFocus: () => setIsFocused(true),
|
|
83
|
+
onBlur: () => setIsFocused(false),
|
|
84
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
85
|
+
className: clsx('edit-site-global-styles-variations_item-preview', {
|
|
86
|
+
'is-pill': isPill
|
|
87
|
+
}),
|
|
88
|
+
children: children(isFocused)
|
|
89
|
+
})
|
|
85
90
|
})
|
|
86
|
-
}
|
|
91
|
+
});
|
|
87
92
|
}
|
|
88
93
|
//# sourceMappingURL=variation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useMemo","useContext","useState","ENTER","__","sprintf","privateApis","blockEditorPrivateApis","editorPrivateApis","unlock","mergeBaseAndUserConfigs","GlobalStylesContext","areGlobalStyleConfigsEqual","Variation","variation","children","isPill","isFocused","setIsFocused","base","user","setUserConfig","context","_variation$settings","_variation$styles","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","preventDefault","isActive","label","title","description","
|
|
1
|
+
{"version":3,"names":["clsx","useMemo","useContext","useState","ENTER","__","sprintf","privateApis","blockEditorPrivateApis","editorPrivateApis","unlock","jsx","_jsx","mergeBaseAndUserConfigs","GlobalStylesContext","areGlobalStyleConfigsEqual","Variation","variation","children","isPill","isFocused","setIsFocused","base","user","setUserConfig","context","_variation$settings","_variation$styles","_variation$_links","settings","styles","_links","merged","selectVariation","selectOnEnter","event","keyCode","preventDefault","isActive","label","title","description","Provider","value","className","role","onClick","onKeyDown","tabIndex","onFocus","onBlur"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variation.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function Variation( { variation, children, isPill } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo(\n\t\t() => ( {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t\t_links: variation._links ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t} ),\n\t\t[ variation, base ]\n\t);\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => ( {\n\t\t\tsettings: variation.settings,\n\t\t\tstyles: variation.styles,\n\t\t\t_links: variation._links,\n\t\t} ) );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo(\n\t\t() => areGlobalStyleConfigsEqual( user, variation ),\n\t\t[ user, variation ]\n\t);\n\n\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: %1$s: variation title. %2$s variation description. */\n\t\t\t__( '%1$s (%2$s)' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-global-styles-variations_item', {\n\t\t\t\t\t'is-active': isActive,\n\t\t\t\t} ) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ label }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'edit-site-global-styles-variations_item-preview',\n\t\t\t\t\t\t{ 'is-pill': isPill }\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ children( isFocused ) }\n\t\t\t\t</div>\n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Gb,aAAe;MAC3Bc,QAAQ,EAAC,GAAG;MACZ,cAAaT,KAAO;MACpB,gBAAeD,QAAU;MACzBW,OAAO,EAAGA,CAAA,KAAM5B,YAAY,CAAE,IAAK,CAAG;MACtC6B,MAAM,EAAGA,CAAA,KAAM7B,YAAY,CAAE,KAAM,CAAG;MAAAH,QAAA,eAEtCN,IAAA;QACCgC,SAAS,EAAG5C,IAAI,CACf,iDAAiD,EACjD;UAAE,SAAS,EAAEmB;QAAO,CACrB,CAAG;QAAAD,QAAA,EAEDA,QAAQ,CAAEE,SAAU;MAAC,CACnB;IAAC,CACF;EAAC,CACuB,CAAC;AAEjC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -11,24 +10,31 @@ import StylesPreviewColors from '../preview-colors';
|
|
|
11
10
|
import { useColorVariations } from '../hooks';
|
|
12
11
|
import Subtitle from '../subtitle';
|
|
13
12
|
import Variation from './variation';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
export default function ColorVariations({
|
|
15
16
|
title,
|
|
16
17
|
gap = 2
|
|
17
18
|
}) {
|
|
18
19
|
const colorVariations = useColorVariations();
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
// Return null if there is only one variation (the default).
|
|
22
|
+
if (colorVariations?.length <= 1) {
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
22
|
-
return
|
|
23
|
-
spacing: 3
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
26
|
+
spacing: 3,
|
|
27
|
+
children: [title && /*#__PURE__*/_jsx(Subtitle, {
|
|
28
|
+
level: 3,
|
|
29
|
+
children: title
|
|
30
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
31
|
+
spacing: gap,
|
|
32
|
+
children: colorVariations.map((variation, index) => /*#__PURE__*/_jsx(Variation, {
|
|
33
|
+
variation: variation,
|
|
34
|
+
isPill: true,
|
|
35
|
+
children: () => /*#__PURE__*/_jsx(StylesPreviewColors, {})
|
|
36
|
+
}, index))
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
33
39
|
}
|
|
34
40
|
//# sourceMappingURL=variations-color.js.map
|