@wordpress/edit-site 5.1.0 → 5.3.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 +8 -0
- package/LICENSE.md +1 -1
- 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 +5 -9
- package/build/components/add-new-template/new-template-part.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 +0 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +25 -59
- 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/block-editor/resize-handle.js +2 -1
- package/build/components/block-editor/resize-handle.js.map +1 -1
- 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 +4 -2
- 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 +10 -4
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +18 -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 +47 -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 +50 -27
- 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 +28 -13
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-border.js +16 -4
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +17 -9
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +59 -26
- 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 +24 -16
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +9 -3
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +19 -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 +15 -7
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +23 -11
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/screen-variations.js +71 -0
- package/build/components/global-styles/screen-variations.js.map +1 -0
- 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 +37 -22
- 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 +139 -21
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -290
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +85 -0
- package/build/components/global-styles/variations-panel.js.map +1 -0
- 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 +86 -15
- 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} +3 -2
- package/build/components/navigation-inspector/index.js.map +1 -0
- package/build/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/navigation-menu.js +13 -15
- 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 +35 -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 -11
- 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 +54 -0
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
- package/build/components/template-details/edit-template-title.js +1 -0
- package/build/components/template-details/edit-template-title.js.map +1 -1
- package/build/components/template-details/template-part-area-selector.js +1 -0
- package/build/components/template-details/template-part-area-selector.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 +68 -9
- 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/reducer.js +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +7 -27
- 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 +5 -9
- package/build-module/components/add-new-template/new-template-part.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 +0 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +27 -57
- 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/block-editor/resize-handle.js +2 -1
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- 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 +3 -2
- 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 +10 -4
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +18 -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 +46 -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 +50 -28
- 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 +27 -15
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +3 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +14 -4
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +17 -11
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +56 -27
- 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 +24 -18
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +8 -3
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +19 -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 +15 -9
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +19 -10
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/screen-variations.js +54 -0
- package/build-module/components/global-styles/screen-variations.js.map +1 -0
- 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 +37 -24
- 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 +132 -22
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +7 -277
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +68 -0
- package/build-module/components/global-styles/variations-panel.js.map +1 -0
- 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 +86 -17
- 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} +3 -2
- 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 +13 -16
- 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 +23 -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 +12 -11
- 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 +43 -0
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -0
- package/build-module/components/template-details/edit-template-title.js +1 -0
- package/build-module/components/template-details/edit-template-title.js.map +1 -1
- package/build-module/components/template-details/template-part-area-selector.js +1 -0
- package/build-module/components/template-details/template-part-area-selector.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 +65 -6
- 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/reducer.js +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +6 -26
- 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 +448 -278
- package/build-style/style.css +448 -278
- 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 +12 -11
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/app/index.js +2 -2
- package/src/components/block-editor/editor-canvas.js +0 -1
- package/src/components/block-editor/index.js +21 -77
- package/src/components/block-editor/inserter-media-categories.js +247 -0
- package/src/components/block-editor/resize-handle.js +6 -2
- package/src/components/block-editor/style.scss +55 -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 +5 -3
- 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 +16 -4
- package/src/components/global-styles/border-panel.js +22 -16
- package/src/components/global-styles/color-palette-panel.js +10 -7
- package/src/components/global-styles/context-menu.js +117 -41
- package/src/components/global-styles/custom-css.js +76 -19
- package/src/components/global-styles/dimensions-panel.js +58 -31
- 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 +42 -19
- package/src/components/global-styles/screen-block-list.js +6 -1
- package/src/components/global-styles/screen-border.js +13 -5
- package/src/components/global-styles/screen-button-color.js +21 -19
- package/src/components/global-styles/screen-colors.js +66 -22
- 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 +7 -4
- package/src/components/global-styles/screen-link-color.js +34 -22
- 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 -15
- package/src/components/global-styles/screen-typography.js +34 -12
- package/src/components/global-styles/screen-variations.js +47 -0
- package/src/components/global-styles/shadow-panel.js +174 -0
- package/src/components/global-styles/style.scss +94 -1
- package/src/components/global-styles/typography-panel.js +58 -23
- package/src/components/global-styles/typography-preview.js +28 -9
- package/src/components/global-styles/ui.js +130 -17
- package/src/components/global-styles/utils.js +7 -330
- package/src/components/global-styles/variations-panel.js +78 -0
- 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 +116 -21
- package/src/components/layout/style.scss +29 -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} +3 -4
- 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 +4 -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 +25 -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 +120 -109
- 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 +40 -0
- package/src/components/template-details/edit-template-title.js +1 -0
- package/src/components/template-details/template-part-area-selector.js +1 -0
- 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 +66 -8
- package/src/index.js +51 -59
- package/src/store/reducer.js +1 -1
- package/src/store/selectors.js +6 -26
- 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 -857
- 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 -815
- 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 -936
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/index.js +0 -37
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
12
|
+
experiments as blockEditorExperiments,
|
|
13
|
+
} from '@wordpress/block-editor';
|
|
6
14
|
|
|
7
15
|
/**
|
|
8
16
|
* Internal dependencies
|
|
@@ -12,43 +20,52 @@ import {
|
|
|
12
20
|
getSupportedGlobalStylesPanels,
|
|
13
21
|
useColorsPerOrigin,
|
|
14
22
|
useGradientsPerOrigin,
|
|
15
|
-
useSetting,
|
|
16
|
-
useStyle,
|
|
17
23
|
} from './hooks';
|
|
24
|
+
import { unlock } from '../../experiments';
|
|
25
|
+
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
18
27
|
|
|
19
|
-
function ScreenBackgroundColor( { name } ) {
|
|
28
|
+
function ScreenBackgroundColor( { name, variation = '' } ) {
|
|
29
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
20
30
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
21
|
-
const [
|
|
22
|
-
const [
|
|
23
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
24
|
-
const [ areCustomGradientsEnabled ] = useSetting(
|
|
31
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
32
|
+
const [ areCustomGradientsEnabled ] = useGlobalSetting(
|
|
25
33
|
'color.customGradient',
|
|
26
34
|
name
|
|
27
35
|
);
|
|
28
|
-
|
|
29
36
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
30
37
|
const gradientsPerOrigin = useGradientsPerOrigin( name );
|
|
31
38
|
|
|
32
|
-
const [ isBackgroundEnabled ] =
|
|
39
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
40
|
+
'color.background',
|
|
41
|
+
name
|
|
42
|
+
);
|
|
33
43
|
|
|
34
44
|
const hasBackgroundColor =
|
|
35
45
|
supports.includes( 'backgroundColor' ) &&
|
|
36
46
|
isBackgroundEnabled &&
|
|
37
|
-
(
|
|
47
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
38
48
|
const hasGradientColor =
|
|
39
49
|
supports.includes( 'background' ) &&
|
|
40
|
-
(
|
|
41
|
-
const [ backgroundColor, setBackgroundColor ] =
|
|
42
|
-
'color.background',
|
|
50
|
+
( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );
|
|
51
|
+
const [ backgroundColor, setBackgroundColor ] = useGlobalStyle(
|
|
52
|
+
prefix + 'color.background',
|
|
43
53
|
name
|
|
44
54
|
);
|
|
45
|
-
const [ userBackgroundColor ] =
|
|
46
|
-
'color.background',
|
|
55
|
+
const [ userBackgroundColor ] = useGlobalStyle(
|
|
56
|
+
prefix + 'color.background',
|
|
57
|
+
name,
|
|
58
|
+
'user'
|
|
59
|
+
);
|
|
60
|
+
const [ gradient, setGradient ] = useGlobalStyle(
|
|
61
|
+
prefix + 'color.gradient',
|
|
62
|
+
name
|
|
63
|
+
);
|
|
64
|
+
const [ userGradient ] = useGlobalStyle(
|
|
65
|
+
prefix + 'color.gradient',
|
|
47
66
|
name,
|
|
48
67
|
'user'
|
|
49
68
|
);
|
|
50
|
-
const [ gradient, setGradient ] = useStyle( 'color.gradient', name );
|
|
51
|
-
const [ userGradient ] = useStyle( 'color.gradient', name, 'user' );
|
|
52
69
|
|
|
53
70
|
if ( ! hasBackgroundColor && ! hasGradientColor ) {
|
|
54
71
|
return null;
|
|
@@ -91,7 +108,13 @@ function ScreenBackgroundColor( { name } ) {
|
|
|
91
108
|
) }
|
|
92
109
|
/>
|
|
93
110
|
<ColorGradientControl
|
|
94
|
-
className=
|
|
111
|
+
className={ classnames(
|
|
112
|
+
'edit-site-screen-background-color__control',
|
|
113
|
+
{
|
|
114
|
+
'has-no-tabs':
|
|
115
|
+
! hasBackgroundColor || ! hasGradientColor,
|
|
116
|
+
}
|
|
117
|
+
) }
|
|
95
118
|
colors={ colorsPerOrigin }
|
|
96
119
|
gradients={ gradientsPerOrigin }
|
|
97
120
|
disableCustomColors={ ! areCustomSolidsEnabled }
|
|
@@ -21,6 +21,7 @@ import { useHasBorderPanel } from './border-panel';
|
|
|
21
21
|
import { useHasColorPanel } from './color-utils';
|
|
22
22
|
import { useHasDimensionsPanel } from './dimensions-panel';
|
|
23
23
|
import { useHasTypographyPanel } from './typography-panel';
|
|
24
|
+
import { useHasVariationsPanel } from './variations-panel';
|
|
24
25
|
import ScreenHeader from './header';
|
|
25
26
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
26
27
|
|
|
@@ -53,8 +54,12 @@ function BlockMenuItem( { block } ) {
|
|
|
53
54
|
const hasBorderPanel = useHasBorderPanel( block.name );
|
|
54
55
|
const hasDimensionsPanel = useHasDimensionsPanel( block.name );
|
|
55
56
|
const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;
|
|
57
|
+
const hasVariationsPanel = useHasVariationsPanel( block.name );
|
|
56
58
|
const hasBlockMenuItem =
|
|
57
|
-
hasTypographyPanel ||
|
|
59
|
+
hasTypographyPanel ||
|
|
60
|
+
hasColorPanel ||
|
|
61
|
+
hasLayoutPanel ||
|
|
62
|
+
hasVariationsPanel;
|
|
58
63
|
|
|
59
64
|
if ( ! hasBlockMenuItem ) {
|
|
60
65
|
return null;
|
|
@@ -9,15 +9,23 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import ScreenHeader from './header';
|
|
10
10
|
import BorderPanel, { useHasBorderPanel } from './border-panel';
|
|
11
11
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
|
+
import { getVariationClassName } from './utils';
|
|
13
|
+
import ShadowPanel, { useHasShadowControl } from './shadow-panel';
|
|
12
14
|
|
|
13
|
-
function ScreenBorder( { name } ) {
|
|
15
|
+
function ScreenBorder( { name, variation = '' } ) {
|
|
14
16
|
const hasBorderPanel = useHasBorderPanel( name );
|
|
15
|
-
|
|
17
|
+
const variationClassName = getVariationClassName( variation );
|
|
18
|
+
const hasShadowPanel = useHasShadowControl( name );
|
|
16
19
|
return (
|
|
17
20
|
<>
|
|
18
|
-
<ScreenHeader title={ __( 'Border' ) } />
|
|
19
|
-
<BlockPreviewPanel name={ name } />
|
|
20
|
-
{ hasBorderPanel &&
|
|
21
|
+
<ScreenHeader title={ __( 'Border & Shadow' ) } />
|
|
22
|
+
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
23
|
+
{ hasBorderPanel && (
|
|
24
|
+
<BorderPanel name={ name } variation={ variation } />
|
|
25
|
+
) }
|
|
26
|
+
{ hasShadowPanel && (
|
|
27
|
+
<ShadowPanel name={ name } variation={ variation } />
|
|
28
|
+
) }
|
|
21
29
|
</>
|
|
22
30
|
);
|
|
23
31
|
}
|
|
@@ -2,48 +2,50 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
7
|
+
experiments as blockEditorExperiments,
|
|
8
|
+
} from '@wordpress/block-editor';
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
11
|
* Internal dependencies
|
|
9
12
|
*/
|
|
10
13
|
import ScreenHeader from './header';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
useSetting,
|
|
14
|
-
useStyle,
|
|
15
|
-
useColorsPerOrigin,
|
|
16
|
-
} from './hooks';
|
|
14
|
+
import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
|
|
15
|
+
import { unlock } from '../../experiments';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
const supports = getSupportedGlobalStylesPanels( name );
|
|
20
|
-
const [ solids ] = useSetting( 'color.palette', name );
|
|
21
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
17
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
22
18
|
|
|
19
|
+
function ScreenButtonColor( { name, variation = '' } ) {
|
|
20
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
21
|
+
const supports = getSupportedGlobalStylesPanels( name );
|
|
23
22
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
24
|
-
|
|
25
|
-
const [ isBackgroundEnabled ] =
|
|
23
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
24
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
25
|
+
'color.background',
|
|
26
|
+
name
|
|
27
|
+
);
|
|
26
28
|
|
|
27
29
|
const hasButtonColor =
|
|
28
30
|
supports.includes( 'buttonColor' ) &&
|
|
29
31
|
isBackgroundEnabled &&
|
|
30
|
-
(
|
|
32
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
31
33
|
|
|
32
|
-
const [ buttonTextColor, setButtonTextColor ] =
|
|
33
|
-
'elements.button.color.text',
|
|
34
|
+
const [ buttonTextColor, setButtonTextColor ] = useGlobalStyle(
|
|
35
|
+
prefix + 'elements.button.color.text',
|
|
34
36
|
name
|
|
35
37
|
);
|
|
36
|
-
const [ userButtonTextColor ] =
|
|
38
|
+
const [ userButtonTextColor ] = useGlobalStyle(
|
|
37
39
|
'elements.button.color.text',
|
|
38
40
|
name,
|
|
39
41
|
'user'
|
|
40
42
|
);
|
|
41
43
|
|
|
42
|
-
const [ buttonBgColor, setButtonBgColor ] =
|
|
44
|
+
const [ buttonBgColor, setButtonBgColor ] = useGlobalStyle(
|
|
43
45
|
'elements.button.color.background',
|
|
44
46
|
name
|
|
45
47
|
);
|
|
46
|
-
const [ userButtonBgColor ] =
|
|
48
|
+
const [ userButtonBgColor ] = useGlobalStyle(
|
|
47
49
|
'elements.button.color.background',
|
|
48
50
|
name,
|
|
49
51
|
'user'
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
FlexItem,
|
|
11
11
|
ColorIndicator,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
|
+
import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Internal dependencies
|
|
@@ -17,18 +18,27 @@ import {
|
|
|
17
18
|
import ScreenHeader from './header';
|
|
18
19
|
import Palette from './palette';
|
|
19
20
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
20
|
-
import { getSupportedGlobalStylesPanels
|
|
21
|
+
import { getSupportedGlobalStylesPanels } from './hooks';
|
|
21
22
|
import Subtitle from './subtitle';
|
|
22
23
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
23
24
|
import BlockPreviewPanel from './block-preview-panel';
|
|
25
|
+
import { getVariationClassName } from './utils';
|
|
26
|
+
import { unlock } from '../../experiments';
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
const { useGlobalStyle } = unlock( blockEditorExperiments );
|
|
29
|
+
|
|
30
|
+
function BackgroundColorItem( { name, parentMenu, variation = '' } ) {
|
|
31
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
32
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
26
33
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
27
34
|
const hasSupport =
|
|
28
35
|
supports.includes( 'backgroundColor' ) ||
|
|
29
36
|
supports.includes( 'background' );
|
|
30
|
-
const [ backgroundColor ] =
|
|
31
|
-
|
|
37
|
+
const [ backgroundColor ] = useGlobalStyle(
|
|
38
|
+
prefix + 'color.background',
|
|
39
|
+
name
|
|
40
|
+
);
|
|
41
|
+
const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );
|
|
32
42
|
|
|
33
43
|
if ( ! hasSupport ) {
|
|
34
44
|
return null;
|
|
@@ -36,7 +46,7 @@ function BackgroundColorItem( { name, parentMenu } ) {
|
|
|
36
46
|
|
|
37
47
|
return (
|
|
38
48
|
<NavigationButtonAsItem
|
|
39
|
-
path={ parentMenu + '/colors/background' }
|
|
49
|
+
path={ parentMenu + urlPrefix + '/colors/background' }
|
|
40
50
|
aria-label={ __( 'Colors background styles' ) }
|
|
41
51
|
>
|
|
42
52
|
<HStack justify="flex-start">
|
|
@@ -54,10 +64,12 @@ function BackgroundColorItem( { name, parentMenu } ) {
|
|
|
54
64
|
);
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
function TextColorItem( { name, parentMenu } ) {
|
|
67
|
+
function TextColorItem( { name, parentMenu, variation = '' } ) {
|
|
68
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
69
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
58
70
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
59
71
|
const hasSupport = supports.includes( 'color' );
|
|
60
|
-
const [ color ] =
|
|
72
|
+
const [ color ] = useGlobalStyle( prefix + 'color.text', name );
|
|
61
73
|
|
|
62
74
|
if ( ! hasSupport ) {
|
|
63
75
|
return null;
|
|
@@ -65,7 +77,7 @@ function TextColorItem( { name, parentMenu } ) {
|
|
|
65
77
|
|
|
66
78
|
return (
|
|
67
79
|
<NavigationButtonAsItem
|
|
68
|
-
path={ parentMenu + '/colors/text' }
|
|
80
|
+
path={ parentMenu + urlPrefix + '/colors/text' }
|
|
69
81
|
aria-label={ __( 'Colors text styles' ) }
|
|
70
82
|
>
|
|
71
83
|
<HStack justify="flex-start">
|
|
@@ -83,11 +95,19 @@ function TextColorItem( { name, parentMenu } ) {
|
|
|
83
95
|
);
|
|
84
96
|
}
|
|
85
97
|
|
|
86
|
-
function LinkColorItem( { name, parentMenu } ) {
|
|
98
|
+
function LinkColorItem( { name, parentMenu, variation = '' } ) {
|
|
99
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
100
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
87
101
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
88
102
|
const hasSupport = supports.includes( 'linkColor' );
|
|
89
|
-
const [ color ] =
|
|
90
|
-
|
|
103
|
+
const [ color ] = useGlobalStyle(
|
|
104
|
+
prefix + 'elements.link.color.text',
|
|
105
|
+
name
|
|
106
|
+
);
|
|
107
|
+
const [ colorHover ] = useGlobalStyle(
|
|
108
|
+
prefix + 'elements.link.:hover.color.text',
|
|
109
|
+
name
|
|
110
|
+
);
|
|
91
111
|
|
|
92
112
|
if ( ! hasSupport ) {
|
|
93
113
|
return null;
|
|
@@ -95,7 +115,7 @@ function LinkColorItem( { name, parentMenu } ) {
|
|
|
95
115
|
|
|
96
116
|
return (
|
|
97
117
|
<NavigationButtonAsItem
|
|
98
|
-
path={ parentMenu + '/colors/link' }
|
|
118
|
+
path={ parentMenu + urlPrefix + '/colors/link' }
|
|
99
119
|
aria-label={ __( 'Colors link styles' ) }
|
|
100
120
|
>
|
|
101
121
|
<HStack justify="flex-start">
|
|
@@ -115,11 +135,19 @@ function LinkColorItem( { name, parentMenu } ) {
|
|
|
115
135
|
);
|
|
116
136
|
}
|
|
117
137
|
|
|
118
|
-
function HeadingColorItem( { name, parentMenu } ) {
|
|
138
|
+
function HeadingColorItem( { name, parentMenu, variation = '' } ) {
|
|
139
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
140
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
119
141
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
120
142
|
const hasSupport = supports.includes( 'color' );
|
|
121
|
-
const [ color ] =
|
|
122
|
-
|
|
143
|
+
const [ color ] = useGlobalStyle(
|
|
144
|
+
prefix + 'elements.heading.color.text',
|
|
145
|
+
name
|
|
146
|
+
);
|
|
147
|
+
const [ bgColor ] = useGlobalStyle(
|
|
148
|
+
prefix + 'elements.heading.color.background',
|
|
149
|
+
name
|
|
150
|
+
);
|
|
123
151
|
|
|
124
152
|
if ( ! hasSupport ) {
|
|
125
153
|
return null;
|
|
@@ -127,7 +155,7 @@ function HeadingColorItem( { name, parentMenu } ) {
|
|
|
127
155
|
|
|
128
156
|
return (
|
|
129
157
|
<NavigationButtonAsItem
|
|
130
|
-
path={ parentMenu + '/colors/heading' }
|
|
158
|
+
path={ parentMenu + urlPrefix + '/colors/heading' }
|
|
131
159
|
aria-label={ __( 'Colors heading styles' ) }
|
|
132
160
|
>
|
|
133
161
|
<HStack justify="flex-start">
|
|
@@ -145,18 +173,28 @@ function HeadingColorItem( { name, parentMenu } ) {
|
|
|
145
173
|
);
|
|
146
174
|
}
|
|
147
175
|
|
|
148
|
-
function ButtonColorItem( { name, parentMenu } ) {
|
|
176
|
+
function ButtonColorItem( { name, parentMenu, variation = '' } ) {
|
|
177
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
178
|
+
const urlPrefix = variation ? `/variations/${ variation }` : '';
|
|
149
179
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
150
180
|
const hasSupport = supports.includes( 'buttonColor' );
|
|
151
|
-
const [ color ] =
|
|
152
|
-
|
|
181
|
+
const [ color ] = useGlobalStyle(
|
|
182
|
+
prefix + 'elements.button.color.text',
|
|
183
|
+
name
|
|
184
|
+
);
|
|
185
|
+
const [ bgColor ] = useGlobalStyle(
|
|
186
|
+
prefix + 'elements.button.color.background',
|
|
187
|
+
name
|
|
188
|
+
);
|
|
153
189
|
|
|
154
190
|
if ( ! hasSupport ) {
|
|
155
191
|
return null;
|
|
156
192
|
}
|
|
157
193
|
|
|
158
194
|
return (
|
|
159
|
-
<NavigationButtonAsItem
|
|
195
|
+
<NavigationButtonAsItem
|
|
196
|
+
path={ parentMenu + urlPrefix + '/colors/button' }
|
|
197
|
+
>
|
|
160
198
|
<HStack justify="flex-start">
|
|
161
199
|
<ZStack isLayered={ false } offset={ -8 }>
|
|
162
200
|
<ColorIndicatorWrapper expanded={ false }>
|
|
@@ -174,9 +212,10 @@ function ButtonColorItem( { name, parentMenu } ) {
|
|
|
174
212
|
);
|
|
175
213
|
}
|
|
176
214
|
|
|
177
|
-
function ScreenColors( { name } ) {
|
|
215
|
+
function ScreenColors( { name, variation = '' } ) {
|
|
178
216
|
const parentMenu =
|
|
179
217
|
name === undefined ? '' : '/blocks/' + encodeURIComponent( name );
|
|
218
|
+
const variationClassName = getVariationClassName( variation );
|
|
180
219
|
|
|
181
220
|
return (
|
|
182
221
|
<>
|
|
@@ -187,7 +226,7 @@ function ScreenColors( { name } ) {
|
|
|
187
226
|
) }
|
|
188
227
|
/>
|
|
189
228
|
|
|
190
|
-
<BlockPreviewPanel name={ name } />
|
|
229
|
+
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
191
230
|
|
|
192
231
|
<div className="edit-site-global-styles-screen-colors">
|
|
193
232
|
<VStack spacing={ 10 }>
|
|
@@ -199,22 +238,27 @@ function ScreenColors( { name } ) {
|
|
|
199
238
|
<BackgroundColorItem
|
|
200
239
|
name={ name }
|
|
201
240
|
parentMenu={ parentMenu }
|
|
241
|
+
variation={ variation }
|
|
202
242
|
/>
|
|
203
243
|
<TextColorItem
|
|
204
244
|
name={ name }
|
|
205
245
|
parentMenu={ parentMenu }
|
|
246
|
+
variation={ variation }
|
|
206
247
|
/>
|
|
207
248
|
<LinkColorItem
|
|
208
249
|
name={ name }
|
|
209
250
|
parentMenu={ parentMenu }
|
|
251
|
+
variation={ variation }
|
|
210
252
|
/>
|
|
211
253
|
<HeadingColorItem
|
|
212
254
|
name={ name }
|
|
213
255
|
parentMenu={ parentMenu }
|
|
256
|
+
variation={ variation }
|
|
214
257
|
/>
|
|
215
258
|
<ButtonColorItem
|
|
216
259
|
name={ name }
|
|
217
260
|
parentMenu={ parentMenu }
|
|
261
|
+
variation={ variation }
|
|
218
262
|
/>
|
|
219
263
|
</ItemGroup>
|
|
220
264
|
</VStack>
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
4
|
+
import { sprintf, __ } from '@wordpress/i18n';
|
|
5
|
+
import { ExternalLink } from '@wordpress/components';
|
|
6
|
+
import { getBlockType } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
11
|
import ScreenHeader from './header';
|
|
11
|
-
import Subtitle from './subtitle';
|
|
12
12
|
import CustomCSSControl from './custom-css';
|
|
13
13
|
|
|
14
|
-
function ScreenCSS() {
|
|
14
|
+
function ScreenCSS( { name } ) {
|
|
15
|
+
// If name is defined, we are customizing CSS at the block level.
|
|
16
|
+
// Display the block title in the description.
|
|
17
|
+
const blockType = getBlockType( name );
|
|
18
|
+
const title = blockType?.title;
|
|
19
|
+
|
|
20
|
+
const description =
|
|
21
|
+
title !== undefined
|
|
22
|
+
? sprintf(
|
|
23
|
+
// translators: %s: is the name of a block e.g., 'Image' or 'Table'.
|
|
24
|
+
__(
|
|
25
|
+
'Add your own CSS to customize the appearance of the %s block.'
|
|
26
|
+
),
|
|
27
|
+
title
|
|
28
|
+
)
|
|
29
|
+
: __(
|
|
30
|
+
'Add your own CSS to customize the appearance and layout of your site.'
|
|
31
|
+
);
|
|
32
|
+
|
|
15
33
|
return (
|
|
16
34
|
<>
|
|
17
|
-
<ScreenHeader
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
<ScreenHeader title={ __( 'CSS' ) } description={ description } />
|
|
36
|
+
<ExternalLink
|
|
37
|
+
href="https://wordpress.org/support/article/css/"
|
|
38
|
+
className="edit-site-global-styles-screen-css-help-link"
|
|
39
|
+
>
|
|
40
|
+
{ __( 'Learn more about CSS' ) }
|
|
41
|
+
</ExternalLink>
|
|
23
42
|
<div className="edit-site-global-styles-screen-css">
|
|
24
|
-
<
|
|
25
|
-
<Subtitle>{ __( 'ADDITIONAL CSS' ) }</Subtitle>
|
|
26
|
-
<CustomCSSControl />
|
|
27
|
-
</VStack>
|
|
43
|
+
<CustomCSSControl blockName={ name } />
|
|
28
44
|
</div>
|
|
29
45
|
</>
|
|
30
46
|
);
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
7
7
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
__experimentalColorGradientControl as ColorGradientControl,
|
|
11
|
+
experiments as blockEditorExperiments,
|
|
12
|
+
} from '@wordpress/block-editor';
|
|
10
13
|
import { useState } from '@wordpress/element';
|
|
11
14
|
|
|
12
15
|
/**
|
|
@@ -15,67 +18,68 @@ import { useState } from '@wordpress/element';
|
|
|
15
18
|
import ScreenHeader from './header';
|
|
16
19
|
import {
|
|
17
20
|
getSupportedGlobalStylesPanels,
|
|
18
|
-
useSetting,
|
|
19
|
-
useStyle,
|
|
20
21
|
useColorsPerOrigin,
|
|
21
22
|
useGradientsPerOrigin,
|
|
22
23
|
} from './hooks';
|
|
24
|
+
import { unlock } from '../../experiments';
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorExperiments );
|
|
26
27
|
|
|
28
|
+
function ScreenHeadingColor( { name, variation = '' } ) {
|
|
29
|
+
const prefix = variation ? `variations.${ variation }.` : '';
|
|
30
|
+
const [ selectedLevel, setCurrentTab ] = useState( 'heading' );
|
|
27
31
|
const supports = getSupportedGlobalStylesPanels( name );
|
|
28
|
-
const [
|
|
29
|
-
const [
|
|
30
|
-
const [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );
|
|
31
|
-
const [ areCustomGradientsEnabled ] = useSetting(
|
|
32
|
+
const [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );
|
|
33
|
+
const [ areCustomGradientsEnabled ] = useGlobalSetting(
|
|
32
34
|
'color.customGradient',
|
|
33
35
|
name
|
|
34
36
|
);
|
|
35
|
-
const [ isTextEnabled ] =
|
|
36
|
-
const [ isBackgroundEnabled ] =
|
|
37
|
-
|
|
37
|
+
const [ isTextEnabled ] = useGlobalSetting( 'color.text', name );
|
|
38
|
+
const [ isBackgroundEnabled ] = useGlobalSetting(
|
|
39
|
+
'color.background',
|
|
40
|
+
name
|
|
41
|
+
);
|
|
38
42
|
const colorsPerOrigin = useColorsPerOrigin( name );
|
|
39
43
|
const gradientsPerOrigin = useGradientsPerOrigin( name );
|
|
40
44
|
|
|
41
45
|
const hasTextColor =
|
|
42
46
|
supports.includes( 'color' ) &&
|
|
43
47
|
isTextEnabled &&
|
|
44
|
-
(
|
|
48
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
45
49
|
|
|
46
50
|
const hasBackgroundColor =
|
|
47
51
|
supports.includes( 'backgroundColor' ) &&
|
|
48
52
|
isBackgroundEnabled &&
|
|
49
|
-
(
|
|
53
|
+
( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );
|
|
50
54
|
const hasGradientColor =
|
|
51
55
|
supports.includes( 'background' ) &&
|
|
52
|
-
(
|
|
56
|
+
( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );
|
|
53
57
|
|
|
54
|
-
const [ color, setColor ] =
|
|
55
|
-
'elements.' + selectedLevel + '.color.text',
|
|
58
|
+
const [ color, setColor ] = useGlobalStyle(
|
|
59
|
+
prefix + 'elements.' + selectedLevel + '.color.text',
|
|
56
60
|
name
|
|
57
61
|
);
|
|
58
|
-
const [ userColor ] =
|
|
59
|
-
'elements.' + selectedLevel + '.color.text',
|
|
62
|
+
const [ userColor ] = useGlobalStyle(
|
|
63
|
+
prefix + 'elements.' + selectedLevel + '.color.text',
|
|
60
64
|
name,
|
|
61
65
|
'user'
|
|
62
66
|
);
|
|
63
67
|
|
|
64
|
-
const [ backgroundColor, setBackgroundColor ] =
|
|
65
|
-
'elements.' + selectedLevel + '.color.background',
|
|
68
|
+
const [ backgroundColor, setBackgroundColor ] = useGlobalStyle(
|
|
69
|
+
prefix + 'elements.' + selectedLevel + '.color.background',
|
|
66
70
|
name
|
|
67
71
|
);
|
|
68
|
-
const [ userBackgroundColor ] =
|
|
69
|
-
'elements.' + selectedLevel + '.color.background',
|
|
72
|
+
const [ userBackgroundColor ] = useGlobalStyle(
|
|
73
|
+
prefix + 'elements.' + selectedLevel + '.color.background',
|
|
70
74
|
name,
|
|
71
75
|
'user'
|
|
72
76
|
);
|
|
73
|
-
const [ gradient, setGradient ] =
|
|
74
|
-
'elements.' + selectedLevel + '.color.gradient',
|
|
77
|
+
const [ gradient, setGradient ] = useGlobalStyle(
|
|
78
|
+
prefix + 'elements.' + selectedLevel + '.color.gradient',
|
|
75
79
|
name
|
|
76
80
|
);
|
|
77
|
-
const [ userGradient ] =
|
|
78
|
-
'elements.' + selectedLevel + '.color.gradient',
|
|
81
|
+
const [ userGradient ] = useGlobalStyle(
|
|
82
|
+
prefix + 'elements.' + selectedLevel + '.color.gradient',
|
|
79
83
|
name,
|
|
80
84
|
'user'
|
|
81
85
|
);
|
|
@@ -124,6 +128,7 @@ function ScreenHeadingColor( { name } ) {
|
|
|
124
128
|
<h4>{ __( 'Select heading level' ) }</h4>
|
|
125
129
|
|
|
126
130
|
<ToggleGroupControl
|
|
131
|
+
__nextHasNoMarginBottom
|
|
127
132
|
label={ __( 'Select heading level' ) }
|
|
128
133
|
hideLabelFromVision={ true }
|
|
129
134
|
value={ selectedLevel }
|
|
@@ -9,15 +9,18 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import DimensionsPanel, { useHasDimensionsPanel } from './dimensions-panel';
|
|
10
10
|
import ScreenHeader from './header';
|
|
11
11
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
|
+
import { getVariationClassName } from './utils';
|
|
12
13
|
|
|
13
|
-
function ScreenLayout( { name } ) {
|
|
14
|
+
function ScreenLayout( { name, variation = '' } ) {
|
|
14
15
|
const hasDimensionsPanel = useHasDimensionsPanel( name );
|
|
15
|
-
|
|
16
|
+
const variationClassName = getVariationClassName( variation );
|
|
16
17
|
return (
|
|
17
18
|
<>
|
|
18
19
|
<ScreenHeader title={ __( 'Layout' ) } />
|
|
19
|
-
<BlockPreviewPanel name={ name } />
|
|
20
|
-
{ hasDimensionsPanel &&
|
|
20
|
+
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
|
+
{ hasDimensionsPanel && (
|
|
22
|
+
<DimensionsPanel name={ name } variation={ variation } />
|
|
23
|
+
) }
|
|
21
24
|
</>
|
|
22
25
|
);
|
|
23
26
|
}
|