@wordpress/edit-site 5.2.0 → 5.3.1
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 +6 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js +8 -10
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal.js +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +9 -32
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +5 -4
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +1 -9
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -7
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +13 -2
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +16 -14
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +237 -0
- package/build/components/block-editor/inserter-media-categories.js.map +1 -0
- package/build/components/canvas-spinner/index.js +20 -0
- package/build/components/canvas-spinner/index.js.map +1 -0
- package/build/components/create-template-part-modal/index.js +4 -2
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +9 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -12
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +5 -28
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +2 -2
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +17 -9
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +13 -7
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +39 -4
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +65 -14
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +49 -31
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +13 -3
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +17 -11
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +21 -142
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +0 -28
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -4
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +18 -15
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +27 -13
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-border.js +10 -4
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +16 -9
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +43 -34
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -8
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +23 -16
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +3 -3
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +18 -11
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +25 -9
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +8 -4
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +14 -7
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +18 -12
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +196 -0
- package/build/components/global-styles/shadow-panel.js.map +1 -0
- package/build/components/global-styles/typography-panel.js +43 -29
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +19 -9
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +104 -34
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +5 -334
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +7 -5
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +2 -2
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/layout/index.js +11 -11
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +8 -11
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
- package/build/components/navigation-inspector/index.js.map +1 -0
- package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -14
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -0
- package/build/components/sidebar/index.js +3 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +3 -18
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -14
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +3 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +23 -1
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +52 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +3 -8
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +11 -10
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +1 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +7 -4
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +6 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +5 -9
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/experiments.js +19 -0
- package/build/experiments.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +65 -6
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/index.js +53 -60
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -27
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +8 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +40 -0
- package/build/store/private-actions.js.map +1 -0
- package/build/store/private-selectors.js +18 -0
- package/build/store/private-selectors.js.map +1 -0
- package/build/store/selectors.js +7 -40
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +77 -0
- package/build/store/utils.js.map +1 -0
- package/build/utils/template-part-create.js +71 -0
- package/build/utils/template-part-create.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js +9 -11
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +8 -31
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +4 -4
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +0 -5
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -7
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +13 -3
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +17 -15
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +225 -0
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -0
- package/build-module/components/canvas-spinner/index.js +12 -0
- package/build-module/components/canvas-spinner/index.js.map +1 -0
- package/build-module/components/create-template-part-modal/index.js +5 -3
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +7 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -12
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +5 -28
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +2 -2
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +17 -11
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +11 -7
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +40 -8
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +61 -15
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +49 -32
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +7 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +15 -11
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +23 -134
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +0 -2
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +10 -5
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +18 -14
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +26 -15
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +10 -5
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +16 -11
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +43 -37
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +21 -9
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +23 -18
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +18 -13
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +23 -9
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +5 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +14 -9
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +16 -12
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +177 -0
- package/build-module/components/global-styles/shadow-panel.js.map +1 -0
- package/build-module/components/global-styles/typography-panel.js +43 -31
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +17 -9
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +98 -35
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +4 -319
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +5 -5
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +2 -2
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/layout/index.js +10 -11
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +9 -12
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +9 -6
- package/build-module/components/navigation-inspector/index.js.map +1 -0
- package/build-module/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +14 -15
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -0
- package/build-module/components/sidebar/index.js +2 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +6 -21
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -13
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +22 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -9
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +10 -10
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +1 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +8 -5
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -4
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +5 -9
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/experiments.js +9 -0
- package/build-module/experiments.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +62 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/index.js +52 -60
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +0 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +5 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +29 -0
- package/build-module/store/private-actions.js.map +1 -0
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -0
- package/build-module/store/selectors.js +6 -37
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +66 -0
- package/build-module/store/utils.js.map +1 -0
- package/build-module/utils/template-part-create.js +53 -0
- package/build-module/utils/template-part-create.js.map +1 -0
- package/build-style/style-rtl.css +314 -216
- package/build-style/style.css +314 -216
- package/package.json +32 -30
- package/src/components/add-new-template/add-custom-generic-template-modal.js +20 -28
- package/src/components/add-new-template/add-custom-template-modal.js +0 -1
- package/src/components/add-new-template/new-template-part.js +14 -34
- package/src/components/add-new-template/new-template.js +5 -3
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/add-new-template/utils.js +0 -14
- package/src/components/app/index.js +2 -2
- package/src/components/block-editor/editor-canvas.js +12 -2
- package/src/components/block-editor/index.js +16 -28
- package/src/components/block-editor/inserter-media-categories.js +247 -0
- package/src/components/block-editor/style.scss +20 -7
- package/src/components/canvas-spinner/index.js +12 -0
- package/src/components/canvas-spinner/style.scss +7 -0
- package/src/components/create-template-part-modal/index.js +75 -67
- package/src/components/create-template-part-modal/style.scss +0 -10
- package/src/components/editor/index.js +8 -5
- package/src/components/error-boundary/index.js +2 -10
- package/src/components/error-boundary/warning.js +6 -35
- package/src/components/global-styles/README.md +1 -75
- package/src/components/global-styles/block-preview-panel.js +2 -2
- package/src/components/global-styles/border-panel.js +19 -17
- package/src/components/global-styles/color-palette-panel.js +10 -7
- package/src/components/global-styles/context-menu.js +114 -44
- package/src/components/global-styles/custom-css.js +76 -19
- package/src/components/global-styles/dimensions-panel.js +46 -36
- package/src/components/global-styles/global-styles-provider.js +6 -2
- package/src/components/global-styles/gradients-palette-panel.js +17 -11
- package/src/components/global-styles/hooks.js +31 -155
- package/src/components/global-styles/index.js +0 -2
- package/src/components/global-styles/palette.js +9 -5
- package/src/components/global-styles/preview.js +19 -13
- package/src/components/global-styles/screen-background-color.js +37 -21
- package/src/components/global-styles/screen-border.js +10 -5
- package/src/components/global-styles/screen-button-color.js +21 -19
- package/src/components/global-styles/screen-colors.js +48 -65
- package/src/components/global-styles/screen-css.js +30 -14
- package/src/components/global-styles/screen-heading-color.js +32 -27
- package/src/components/global-styles/screen-layout.js +4 -7
- package/src/components/global-styles/screen-link-color.js +26 -26
- package/src/components/global-styles/screen-root.js +24 -9
- package/src/components/global-styles/screen-style-variations.js +7 -2
- package/src/components/global-styles/screen-text-color.js +15 -19
- package/src/components/global-styles/screen-typography.js +27 -12
- package/src/components/global-styles/shadow-panel.js +174 -0
- package/src/components/global-styles/style.scss +85 -1
- package/src/components/global-styles/typography-panel.js +60 -48
- package/src/components/global-styles/typography-preview.js +28 -9
- package/src/components/global-styles/ui.js +97 -53
- package/src/components/global-styles/utils.js +4 -371
- package/src/components/global-styles-renderer/index.js +3 -4
- package/src/components/header-edit-mode/document-actions/index.js +1 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/src/components/layout/index.js +12 -4
- package/src/components/layout/style.scss +4 -5
- package/src/components/list/actions/rename-menu-item.js +14 -23
- package/src/components/list/style.scss +0 -4
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js → navigation-inspector/index.js} +2 -2
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +10 -12
- package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss +0 -17
- package/src/components/sidebar/index.js +2 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +8 -32
- package/src/components/sidebar-edit-mode/index.js +0 -11
- package/src/components/sidebar-edit-mode/settings-header/style.scss +8 -0
- package/src/components/sidebar-navigation-item/style.scss +28 -3
- package/src/components/sidebar-navigation-screen/index.js +4 -3
- package/src/components/sidebar-navigation-screen/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-main/index.js +23 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +45 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +12 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +12 -19
- package/src/components/site-hub/index.js +8 -10
- package/src/components/site-hub/style.scss +7 -1
- package/src/components/site-icon/index.js +1 -1
- package/src/components/site-icon/style.scss +2 -2
- package/src/components/style-book/index.js +10 -5
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -3
- package/src/components/template-part-converter/convert-to-template-part.js +12 -10
- package/src/experiments.js +10 -0
- package/src/hooks/push-changes-to-global-styles/index.js +63 -5
- package/src/index.js +51 -59
- package/src/store/actions.js +0 -24
- package/src/store/index.js +5 -0
- package/src/store/private-actions.js +29 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/selectors.js +6 -37
- package/src/store/test/utils.js +181 -0
- package/src/store/utils.js +69 -0
- package/src/style.scss +4 -2
- package/src/utils/template-part-create.js +62 -0
- package/src/utils/test/template-part-create.js +63 -0
- package/build/components/global-styles/context.js +0 -22
- package/build/components/global-styles/context.js.map +0 -1
- package/build/components/global-styles/typography-utils.js +0 -92
- package/build/components/global-styles/typography-utils.js.map +0 -1
- package/build/components/global-styles/use-global-styles-output.js +0 -943
- package/build/components/global-styles/use-global-styles-output.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -42
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
- package/build/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
- package/build-module/components/global-styles/context.js +0 -12
- package/build-module/components/global-styles/context.js.map +0 -1
- package/build-module/components/global-styles/typography-utils.js +0 -84
- package/build-module/components/global-styles/typography-utils.js.map +0 -1
- package/build-module/components/global-styles/use-global-styles-output.js +0 -901
- package/build-module/components/global-styles/use-global-styles-output.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -28
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-inspector.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/navigation-menu-sidebar/navigation-menu.js.map +0 -1
- package/src/components/global-styles/context.js +0 -15
- package/src/components/global-styles/test/typography-utils.js +0 -393
- package/src/components/global-styles/test/use-global-styles-output.js +0 -814
- package/src/components/global-styles/test/utils.js +0 -206
- package/src/components/global-styles/typography-utils.js +0 -87
- package/src/components/global-styles/use-global-styles-output.js +0 -1059
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
__experimentalLetterSpacingControl as LetterSpacingControl,
|
|
9
9
|
__experimentalTextTransformControl as TextTransformControl,
|
|
10
10
|
__experimentalTextDecorationControl as TextDecorationControl,
|
|
11
|
+
experiments as blockEditorExperiments,
|
|
11
12
|
} from '@wordpress/block-editor';
|
|
12
13
|
import {
|
|
13
14
|
FontSizePicker,
|
|
@@ -19,7 +20,10 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
20
|
/**
|
|
20
21
|
* Internal dependencies
|
|
21
22
|
*/
|
|
22
|
-
import { getSupportedGlobalStylesPanels
|
|
23
|
+
import { getSupportedGlobalStylesPanels } from './hooks';
|
|
24
|
+
import { unlock } from '../../experiments';
|
|
25
|
+
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
23
27
|
|
|
24
28
|
export function useHasTypographyPanel( name ) {
|
|
25
29
|
const hasFontFamily = useHasFontFamilyControl( name );
|
|
@@ -38,14 +42,21 @@ export function useHasTypographyPanel( name ) {
|
|
|
38
42
|
|
|
39
43
|
function useHasFontFamilyControl( name ) {
|
|
40
44
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
41
|
-
const [
|
|
45
|
+
const [ fontFamiliesPerOrigin ] = useGlobalSetting(
|
|
46
|
+
'typography.fontFamilies',
|
|
47
|
+
name
|
|
48
|
+
);
|
|
49
|
+
const fontFamilies =
|
|
50
|
+
fontFamiliesPerOrigin?.custom ||
|
|
51
|
+
fontFamiliesPerOrigin?.theme ||
|
|
52
|
+
fontFamiliesPerOrigin?.default;
|
|
42
53
|
return supports.includes( 'fontFamily' ) && !! fontFamilies?.length;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
function useHasLineHeightControl( name ) {
|
|
46
57
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
47
58
|
return (
|
|
48
|
-
|
|
59
|
+
useGlobalSetting( 'typography.lineHeight', name )[ 0 ] &&
|
|
49
60
|
supports.includes( 'lineHeight' )
|
|
50
61
|
);
|
|
51
62
|
}
|
|
@@ -53,10 +64,10 @@ function useHasLineHeightControl( name ) {
|
|
|
53
64
|
function useHasAppearanceControl( name ) {
|
|
54
65
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
55
66
|
const hasFontStyles =
|
|
56
|
-
|
|
67
|
+
useGlobalSetting( 'typography.fontStyle', name )[ 0 ] &&
|
|
57
68
|
supports.includes( 'fontStyle' );
|
|
58
69
|
const hasFontWeights =
|
|
59
|
-
|
|
70
|
+
useGlobalSetting( 'typography.fontWeight', name )[ 0 ] &&
|
|
60
71
|
supports.includes( 'fontWeight' );
|
|
61
72
|
return hasFontStyles || hasFontWeights;
|
|
62
73
|
}
|
|
@@ -64,10 +75,10 @@ function useHasAppearanceControl( name ) {
|
|
|
64
75
|
function useAppearanceControlLabel( name ) {
|
|
65
76
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
66
77
|
const hasFontStyles =
|
|
67
|
-
|
|
78
|
+
useGlobalSetting( 'typography.fontStyle', name )[ 0 ] &&
|
|
68
79
|
supports.includes( 'fontStyle' );
|
|
69
80
|
const hasFontWeights =
|
|
70
|
-
|
|
81
|
+
useGlobalSetting( 'typography.fontWeight', name )[ 0 ] &&
|
|
71
82
|
supports.includes( 'fontWeight' );
|
|
72
83
|
if ( ! hasFontStyles ) {
|
|
73
84
|
return __( 'Font weight' );
|
|
@@ -79,7 +90,7 @@ function useAppearanceControlLabel( name ) {
|
|
|
79
90
|
}
|
|
80
91
|
|
|
81
92
|
function useHasLetterSpacingControl( name, element ) {
|
|
82
|
-
const setting =
|
|
93
|
+
const setting = useGlobalSetting( 'typography.letterSpacing', name )[ 0 ];
|
|
83
94
|
if ( ! setting ) {
|
|
84
95
|
return false;
|
|
85
96
|
}
|
|
@@ -91,7 +102,7 @@ function useHasLetterSpacingControl( name, element ) {
|
|
|
91
102
|
}
|
|
92
103
|
|
|
93
104
|
function useHasTextTransformControl( name, element ) {
|
|
94
|
-
const setting =
|
|
105
|
+
const setting = useGlobalSetting( 'typography.textTransform', name )[ 0 ];
|
|
95
106
|
if ( ! setting ) {
|
|
96
107
|
return false;
|
|
97
108
|
}
|
|
@@ -110,16 +121,16 @@ function useHasTextDecorationControl( name, element ) {
|
|
|
110
121
|
}
|
|
111
122
|
|
|
112
123
|
function useStyleWithReset( path, blockName ) {
|
|
113
|
-
const [ style, setStyle ] =
|
|
114
|
-
const [ userStyle ] =
|
|
124
|
+
const [ style, setStyle ] = useGlobalStyle( path, blockName );
|
|
125
|
+
const [ userStyle ] = useGlobalStyle( path, blockName, 'user' );
|
|
115
126
|
const hasStyle = () => !! userStyle;
|
|
116
127
|
const resetStyle = () => setStyle( undefined );
|
|
117
128
|
return [ style, setStyle, hasStyle, resetStyle ];
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
function useFontSizeWithReset( path, blockName ) {
|
|
121
|
-
const [ fontSize, setStyleCallback ] =
|
|
122
|
-
const [ userStyle ] =
|
|
132
|
+
const [ fontSize, setStyleCallback ] = useGlobalStyle( path, blockName );
|
|
133
|
+
const [ userStyle ] = useGlobalStyle( path, blockName, 'user' );
|
|
123
134
|
const hasFontSize = () => !! userStyle;
|
|
124
135
|
const resetFontSize = () => setStyleCallback( undefined );
|
|
125
136
|
const setFontSize = ( newValue, metadata ) => {
|
|
@@ -138,20 +149,20 @@ function useFontSizeWithReset( path, blockName ) {
|
|
|
138
149
|
}
|
|
139
150
|
|
|
140
151
|
function useFontAppearance( prefix, name ) {
|
|
141
|
-
const [ fontStyle, setFontStyle ] =
|
|
152
|
+
const [ fontStyle, setFontStyle ] = useGlobalStyle(
|
|
142
153
|
prefix + 'typography.fontStyle',
|
|
143
154
|
name
|
|
144
155
|
);
|
|
145
|
-
const [ userFontStyle ] =
|
|
156
|
+
const [ userFontStyle ] = useGlobalStyle(
|
|
146
157
|
prefix + 'typography.fontStyle',
|
|
147
158
|
name,
|
|
148
159
|
'user'
|
|
149
160
|
);
|
|
150
|
-
const [ fontWeight, setFontWeight ] =
|
|
161
|
+
const [ fontWeight, setFontWeight ] = useGlobalStyle(
|
|
151
162
|
prefix + 'typography.fontWeight',
|
|
152
163
|
name
|
|
153
164
|
);
|
|
154
|
-
const [ userFontWeight ] =
|
|
165
|
+
const [ userFontWeight ] = useGlobalStyle(
|
|
155
166
|
prefix + 'typography.fontWeight',
|
|
156
167
|
name,
|
|
157
168
|
'user'
|
|
@@ -175,7 +186,7 @@ export default function TypographyPanel( {
|
|
|
175
186
|
name,
|
|
176
187
|
element,
|
|
177
188
|
headingLevel,
|
|
178
|
-
|
|
189
|
+
variation = '',
|
|
179
190
|
} ) {
|
|
180
191
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
181
192
|
let prefix = '';
|
|
@@ -184,18 +195,37 @@ export default function TypographyPanel( {
|
|
|
184
195
|
} else if ( element && element !== 'text' ) {
|
|
185
196
|
prefix = `elements.${ element }.`;
|
|
186
197
|
}
|
|
187
|
-
|
|
198
|
+
if ( variation ) {
|
|
199
|
+
prefix = prefix
|
|
200
|
+
? `variations.${ variation }.${ prefix }`
|
|
201
|
+
: `variations.${ variation }`;
|
|
202
|
+
}
|
|
203
|
+
const [ fontSizesPerOrigin ] = useGlobalSetting(
|
|
204
|
+
'typography.fontSizes',
|
|
205
|
+
name
|
|
206
|
+
);
|
|
207
|
+
const fontSizes =
|
|
208
|
+
fontSizesPerOrigin?.custom ||
|
|
209
|
+
fontSizesPerOrigin?.theme ||
|
|
210
|
+
fontSizesPerOrigin?.default;
|
|
188
211
|
|
|
189
|
-
const disableCustomFontSizes = !
|
|
212
|
+
const disableCustomFontSizes = ! useGlobalSetting(
|
|
190
213
|
'typography.customFontSize',
|
|
191
214
|
name
|
|
192
215
|
)[ 0 ];
|
|
193
|
-
const [
|
|
216
|
+
const [ fontFamiliesPerOrigin ] = useGlobalSetting(
|
|
217
|
+
'typography.fontFamilies',
|
|
218
|
+
name
|
|
219
|
+
);
|
|
220
|
+
const fontFamilies =
|
|
221
|
+
fontFamiliesPerOrigin?.custom ||
|
|
222
|
+
fontFamiliesPerOrigin?.theme ||
|
|
223
|
+
fontFamiliesPerOrigin?.default;
|
|
194
224
|
const hasFontStyles =
|
|
195
|
-
|
|
225
|
+
useGlobalSetting( 'typography.fontStyle', name )[ 0 ] &&
|
|
196
226
|
supports.includes( 'fontStyle' );
|
|
197
227
|
const hasFontWeights =
|
|
198
|
-
|
|
228
|
+
useGlobalSetting( 'typography.fontWeight', name )[ 0 ] &&
|
|
199
229
|
supports.includes( 'fontWeight' );
|
|
200
230
|
const hasFontFamilyEnabled = useHasFontFamilyControl( name );
|
|
201
231
|
const hasLineHeightEnabled = useHasLineHeightControl( name );
|
|
@@ -215,15 +245,9 @@ export default function TypographyPanel( {
|
|
|
215
245
|
}
|
|
216
246
|
|
|
217
247
|
const [ fontFamily, setFontFamily, hasFontFamily, resetFontFamily ] =
|
|
218
|
-
useStyleWithReset(
|
|
219
|
-
variationPath + prefix + 'typography.fontFamily',
|
|
220
|
-
name
|
|
221
|
-
);
|
|
248
|
+
useStyleWithReset( prefix + 'typography.fontFamily', name );
|
|
222
249
|
const { fontSize, setFontSize, hasFontSize, resetFontSize } =
|
|
223
|
-
useFontSizeWithReset(
|
|
224
|
-
variationPath + prefix + 'typography.fontSize',
|
|
225
|
-
name
|
|
226
|
-
);
|
|
250
|
+
useFontSizeWithReset( prefix + 'typography.fontSize', name );
|
|
227
251
|
const {
|
|
228
252
|
fontStyle,
|
|
229
253
|
setFontStyle,
|
|
@@ -231,39 +255,27 @@ export default function TypographyPanel( {
|
|
|
231
255
|
setFontWeight,
|
|
232
256
|
hasFontAppearance,
|
|
233
257
|
resetFontAppearance,
|
|
234
|
-
} = useFontAppearance(
|
|
258
|
+
} = useFontAppearance( prefix, name );
|
|
235
259
|
const [ lineHeight, setLineHeight, hasLineHeight, resetLineHeight ] =
|
|
236
|
-
useStyleWithReset(
|
|
237
|
-
variationPath + prefix + 'typography.lineHeight',
|
|
238
|
-
name
|
|
239
|
-
);
|
|
260
|
+
useStyleWithReset( prefix + 'typography.lineHeight', name );
|
|
240
261
|
const [
|
|
241
262
|
letterSpacing,
|
|
242
263
|
setLetterSpacing,
|
|
243
264
|
hasLetterSpacing,
|
|
244
265
|
resetLetterSpacing,
|
|
245
|
-
] = useStyleWithReset(
|
|
246
|
-
variationPath + prefix + 'typography.letterSpacing',
|
|
247
|
-
name
|
|
248
|
-
);
|
|
266
|
+
] = useStyleWithReset( prefix + 'typography.letterSpacing', name );
|
|
249
267
|
const [
|
|
250
268
|
textTransform,
|
|
251
269
|
setTextTransform,
|
|
252
270
|
hasTextTransform,
|
|
253
271
|
resetTextTransform,
|
|
254
|
-
] = useStyleWithReset(
|
|
255
|
-
variationPath + prefix + 'typography.textTransform',
|
|
256
|
-
name
|
|
257
|
-
);
|
|
272
|
+
] = useStyleWithReset( prefix + 'typography.textTransform', name );
|
|
258
273
|
const [
|
|
259
274
|
textDecoration,
|
|
260
275
|
setTextDecoration,
|
|
261
276
|
hasTextDecoration,
|
|
262
277
|
resetTextDecoration,
|
|
263
|
-
] = useStyleWithReset(
|
|
264
|
-
variationPath + prefix + 'typography.textDecoration',
|
|
265
|
-
name
|
|
266
|
-
);
|
|
278
|
+
] = useStyleWithReset( prefix + 'typography.textDecoration', name );
|
|
267
279
|
|
|
268
280
|
const resetAll = () => {
|
|
269
281
|
resetFontFamily();
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Internal dependencies
|
|
3
8
|
*/
|
|
4
|
-
import {
|
|
9
|
+
import { unlock } from '../../experiments';
|
|
10
|
+
|
|
11
|
+
const { useGlobalStyle } = unlock( blockEditorExperiments );
|
|
5
12
|
|
|
6
13
|
export default function TypographyPreview( { name, element, headingLevel } ) {
|
|
7
14
|
let prefix = '';
|
|
@@ -11,14 +18,26 @@ export default function TypographyPreview( { name, element, headingLevel } ) {
|
|
|
11
18
|
prefix = `elements.${ element }.`;
|
|
12
19
|
}
|
|
13
20
|
|
|
14
|
-
const [ fontFamily ] =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const [
|
|
19
|
-
const [
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const [ fontFamily ] = useGlobalStyle(
|
|
22
|
+
prefix + 'typography.fontFamily',
|
|
23
|
+
name
|
|
24
|
+
);
|
|
25
|
+
const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );
|
|
26
|
+
const [ backgroundColor ] = useGlobalStyle(
|
|
27
|
+
prefix + 'color.background',
|
|
28
|
+
name
|
|
29
|
+
);
|
|
30
|
+
const [ color ] = useGlobalStyle( prefix + 'color.text', name );
|
|
31
|
+
const [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );
|
|
32
|
+
const [ fontStyle ] = useGlobalStyle(
|
|
33
|
+
prefix + 'typography.fontStyle',
|
|
34
|
+
name
|
|
35
|
+
);
|
|
36
|
+
const [ fontWeight ] = useGlobalStyle(
|
|
37
|
+
prefix + 'typography.fontWeight',
|
|
38
|
+
name
|
|
39
|
+
);
|
|
40
|
+
const [ letterSpacing ] = useGlobalStyle(
|
|
22
41
|
prefix + 'typography.letterSpacing',
|
|
23
42
|
name
|
|
24
43
|
);
|
|
@@ -5,10 +5,16 @@ import {
|
|
|
5
5
|
__experimentalNavigatorProvider as NavigatorProvider,
|
|
6
6
|
__experimentalNavigatorScreen as NavigatorScreen,
|
|
7
7
|
__experimentalUseNavigator as useNavigator,
|
|
8
|
+
createSlotFill,
|
|
9
|
+
DropdownMenu,
|
|
8
10
|
} from '@wordpress/components';
|
|
9
11
|
import { getBlockTypes, store as blocksStore } from '@wordpress/blocks';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
+
import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
|
|
14
|
+
import { __ } from '@wordpress/i18n';
|
|
15
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
16
|
+
import { moreVertical } from '@wordpress/icons';
|
|
17
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* Internal dependencies
|
|
@@ -31,6 +37,61 @@ import { ScreenVariation } from './screen-variations';
|
|
|
31
37
|
import ScreenBorder from './screen-border';
|
|
32
38
|
import StyleBook from '../style-book';
|
|
33
39
|
import ScreenCSS from './screen-css';
|
|
40
|
+
import { unlock } from '../../experiments';
|
|
41
|
+
|
|
42
|
+
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
43
|
+
const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =
|
|
44
|
+
createSlotFill( SLOT_FILL_NAME );
|
|
45
|
+
|
|
46
|
+
function GlobalStylesActionMenu() {
|
|
47
|
+
const { toggle } = useDispatch( preferencesStore );
|
|
48
|
+
const { canEditCSS } = useSelect( ( select ) => {
|
|
49
|
+
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
|
|
50
|
+
select( coreStore );
|
|
51
|
+
|
|
52
|
+
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
53
|
+
const globalStyles = globalStylesId
|
|
54
|
+
? getEntityRecord( 'root', 'globalStyles', globalStylesId )
|
|
55
|
+
: undefined;
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
canEditCSS:
|
|
59
|
+
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
|
|
60
|
+
};
|
|
61
|
+
}, [] );
|
|
62
|
+
const { useGlobalStylesReset } = unlock( blockEditorExperiments );
|
|
63
|
+
const [ canReset, onReset ] = useGlobalStylesReset();
|
|
64
|
+
const { goTo } = useNavigator();
|
|
65
|
+
const loadCustomCSS = () => goTo( '/css' );
|
|
66
|
+
return (
|
|
67
|
+
<GlobalStylesMenuFill>
|
|
68
|
+
<DropdownMenu
|
|
69
|
+
icon={ moreVertical }
|
|
70
|
+
label={ __( 'More Styles actions' ) }
|
|
71
|
+
controls={ [
|
|
72
|
+
{
|
|
73
|
+
title: __( 'Reset to defaults' ),
|
|
74
|
+
onClick: onReset,
|
|
75
|
+
isDisabled: ! canReset,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: __( 'Welcome Guide' ),
|
|
79
|
+
onClick: () =>
|
|
80
|
+
toggle( 'core/edit-site', 'welcomeGuideStyles' ),
|
|
81
|
+
},
|
|
82
|
+
...( canEditCSS
|
|
83
|
+
? [
|
|
84
|
+
{
|
|
85
|
+
title: __( 'Additional CSS' ),
|
|
86
|
+
onClick: loadCustomCSS,
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
: [] ),
|
|
90
|
+
] }
|
|
91
|
+
/>
|
|
92
|
+
</GlobalStylesMenuFill>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
34
95
|
|
|
35
96
|
function GlobalStylesNavigationScreen( { className, ...props } ) {
|
|
36
97
|
return (
|
|
@@ -68,19 +129,27 @@ function BlockStyleVariationsScreens( { name } ) {
|
|
|
68
129
|
'/variations/' +
|
|
69
130
|
encodeURIComponent( variation.name )
|
|
70
131
|
}
|
|
132
|
+
variation={ variation.name }
|
|
71
133
|
/>
|
|
72
134
|
) );
|
|
73
135
|
}
|
|
74
136
|
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
137
|
+
function BlockStylesNavigationScreens( {
|
|
138
|
+
parentMenu,
|
|
139
|
+
blockStyles,
|
|
140
|
+
blockName,
|
|
141
|
+
} ) {
|
|
142
|
+
return blockStyles.map( ( style, index ) => (
|
|
143
|
+
<GlobalStylesNavigationScreen
|
|
144
|
+
key={ index }
|
|
145
|
+
path={ parentMenu + '/variations/' + style.name }
|
|
146
|
+
>
|
|
147
|
+
<ScreenVariation blockName={ blockName } style={ style } />
|
|
148
|
+
</GlobalStylesNavigationScreen>
|
|
149
|
+
) );
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function ContextScreens( { name, parentMenu = '', variation = '' } ) {
|
|
84
153
|
const blockStyleVariations = useSelect(
|
|
85
154
|
( select ) => {
|
|
86
155
|
const { getBlockStyles } = select( blocksStore );
|
|
@@ -89,24 +158,10 @@ function ContextScreens( { name, parentMenu = '' } ) {
|
|
|
89
158
|
[ name ]
|
|
90
159
|
);
|
|
91
160
|
|
|
92
|
-
const BlockStylesNavigationScreens = ( { blockStyles, blockName } ) => {
|
|
93
|
-
return blockStyles.map( ( style, index ) => (
|
|
94
|
-
<GlobalStylesNavigationScreen
|
|
95
|
-
key={ index }
|
|
96
|
-
path={ parentMenu + '/variations/' + style.name }
|
|
97
|
-
>
|
|
98
|
-
<ScreenVariation blockName={ blockName } style={ style } />
|
|
99
|
-
</GlobalStylesNavigationScreen>
|
|
100
|
-
) );
|
|
101
|
-
};
|
|
102
|
-
|
|
103
161
|
return (
|
|
104
162
|
<>
|
|
105
163
|
<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>
|
|
106
|
-
<ScreenTypography
|
|
107
|
-
name={ name }
|
|
108
|
-
variationPath={ variationPath }
|
|
109
|
-
/>
|
|
164
|
+
<ScreenTypography name={ name } variation={ variation } />
|
|
110
165
|
</GlobalStylesNavigationScreen>
|
|
111
166
|
|
|
112
167
|
<GlobalStylesNavigationScreen
|
|
@@ -134,7 +189,7 @@ function ContextScreens( { name, parentMenu = '' } ) {
|
|
|
134
189
|
</GlobalStylesNavigationScreen>
|
|
135
190
|
|
|
136
191
|
<GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>
|
|
137
|
-
<ScreenColors name={ name }
|
|
192
|
+
<ScreenColors name={ name } variation={ variation } />
|
|
138
193
|
</GlobalStylesNavigationScreen>
|
|
139
194
|
|
|
140
195
|
<GlobalStylesNavigationScreen
|
|
@@ -146,54 +201,44 @@ function ContextScreens( { name, parentMenu = '' } ) {
|
|
|
146
201
|
<GlobalStylesNavigationScreen
|
|
147
202
|
path={ parentMenu + '/colors/background' }
|
|
148
203
|
>
|
|
149
|
-
<ScreenBackgroundColor
|
|
150
|
-
name={ name }
|
|
151
|
-
variationPath={ variationPath }
|
|
152
|
-
/>
|
|
204
|
+
<ScreenBackgroundColor name={ name } variation={ variation } />
|
|
153
205
|
</GlobalStylesNavigationScreen>
|
|
154
206
|
|
|
155
207
|
<GlobalStylesNavigationScreen path={ parentMenu + '/colors/text' }>
|
|
156
|
-
<ScreenTextColor
|
|
157
|
-
name={ name }
|
|
158
|
-
variationPath={ variationPath }
|
|
159
|
-
/>
|
|
208
|
+
<ScreenTextColor name={ name } variation={ variation } />
|
|
160
209
|
</GlobalStylesNavigationScreen>
|
|
161
210
|
|
|
162
211
|
<GlobalStylesNavigationScreen path={ parentMenu + '/colors/link' }>
|
|
163
|
-
<ScreenLinkColor
|
|
164
|
-
name={ name }
|
|
165
|
-
variationPath={ variationPath }
|
|
166
|
-
/>
|
|
212
|
+
<ScreenLinkColor name={ name } variation={ variation } />
|
|
167
213
|
</GlobalStylesNavigationScreen>
|
|
168
214
|
|
|
169
215
|
<GlobalStylesNavigationScreen
|
|
170
216
|
path={ parentMenu + '/colors/heading' }
|
|
171
217
|
>
|
|
172
|
-
<ScreenHeadingColor
|
|
173
|
-
name={ name }
|
|
174
|
-
variationPath={ variationPath }
|
|
175
|
-
/>
|
|
218
|
+
<ScreenHeadingColor name={ name } variation={ variation } />
|
|
176
219
|
</GlobalStylesNavigationScreen>
|
|
177
220
|
|
|
178
221
|
<GlobalStylesNavigationScreen
|
|
179
222
|
path={ parentMenu + '/colors/button' }
|
|
180
223
|
>
|
|
181
|
-
<ScreenButtonColor
|
|
182
|
-
name={ name }
|
|
183
|
-
variationPath={ variationPath }
|
|
184
|
-
/>
|
|
224
|
+
<ScreenButtonColor name={ name } variation={ variation } />
|
|
185
225
|
</GlobalStylesNavigationScreen>
|
|
186
226
|
|
|
187
227
|
<GlobalStylesNavigationScreen path={ parentMenu + '/border' }>
|
|
188
|
-
<ScreenBorder name={ name }
|
|
228
|
+
<ScreenBorder name={ name } variation={ variation } />
|
|
189
229
|
</GlobalStylesNavigationScreen>
|
|
190
230
|
|
|
191
231
|
<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>
|
|
192
|
-
<ScreenLayout name={ name }
|
|
232
|
+
<ScreenLayout name={ name } variation={ variation } />
|
|
233
|
+
</GlobalStylesNavigationScreen>
|
|
234
|
+
|
|
235
|
+
<GlobalStylesNavigationScreen path={ parentMenu + '/css' }>
|
|
236
|
+
<ScreenCSS name={ name } />
|
|
193
237
|
</GlobalStylesNavigationScreen>
|
|
194
238
|
|
|
195
239
|
{ !! blockStyleVariations?.length && (
|
|
196
240
|
<BlockStylesNavigationScreens
|
|
241
|
+
parentMenu={ parentMenu }
|
|
197
242
|
blockStyles={ blockStyleVariations }
|
|
198
243
|
blockName={ name }
|
|
199
244
|
/>
|
|
@@ -280,11 +325,10 @@ function GlobalStylesUI( { isStyleBookOpened, onCloseStyleBook } ) {
|
|
|
280
325
|
{ isStyleBookOpened && (
|
|
281
326
|
<GlobalStylesStyleBook onClose={ onCloseStyleBook } />
|
|
282
327
|
) }
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
</GlobalStylesNavigationScreen>
|
|
328
|
+
|
|
329
|
+
<GlobalStylesActionMenu />
|
|
286
330
|
</NavigatorProvider>
|
|
287
331
|
);
|
|
288
332
|
}
|
|
289
|
-
|
|
333
|
+
export { GlobalStylesMenuSlot };
|
|
290
334
|
export default GlobalStylesUI;
|