@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
|
@@ -1,379 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { getTypographyFontSizeValue } from './typography-utils';
|
|
10
|
-
|
|
11
|
-
/* Supporting data. */
|
|
12
|
-
export const ROOT_BLOCK_NAME = 'root';
|
|
13
|
-
export const ROOT_BLOCK_SELECTOR = 'body';
|
|
14
|
-
export const ROOT_BLOCK_SUPPORTS = [
|
|
15
|
-
'background',
|
|
16
|
-
'backgroundColor',
|
|
17
|
-
'color',
|
|
18
|
-
'linkColor',
|
|
19
|
-
'buttonColor',
|
|
20
|
-
'fontFamily',
|
|
21
|
-
'fontSize',
|
|
22
|
-
'fontStyle',
|
|
23
|
-
'fontWeight',
|
|
24
|
-
'lineHeight',
|
|
25
|
-
'textDecoration',
|
|
26
|
-
'textTransform',
|
|
27
|
-
'padding',
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
export const PRESET_METADATA = [
|
|
31
|
-
{
|
|
32
|
-
path: [ 'color', 'palette' ],
|
|
33
|
-
valueKey: 'color',
|
|
34
|
-
cssVarInfix: 'color',
|
|
35
|
-
classes: [
|
|
36
|
-
{ classSuffix: 'color', propertyName: 'color' },
|
|
37
|
-
{
|
|
38
|
-
classSuffix: 'background-color',
|
|
39
|
-
propertyName: 'background-color',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
classSuffix: 'border-color',
|
|
43
|
-
propertyName: 'border-color',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
path: [ 'color', 'gradients' ],
|
|
49
|
-
valueKey: 'gradient',
|
|
50
|
-
cssVarInfix: 'gradient',
|
|
51
|
-
classes: [
|
|
52
|
-
{
|
|
53
|
-
classSuffix: 'gradient-background',
|
|
54
|
-
propertyName: 'background',
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
path: [ 'color', 'duotone' ],
|
|
60
|
-
cssVarInfix: 'duotone',
|
|
61
|
-
valueFunc: ( { slug } ) => `url( '#wp-duotone-${ slug }' )`,
|
|
62
|
-
classes: [],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
path: [ 'typography', 'fontSizes' ],
|
|
66
|
-
valueFunc: ( preset, { typography: typographySettings } ) =>
|
|
67
|
-
getTypographyFontSizeValue( preset, typographySettings ),
|
|
68
|
-
valueKey: 'size',
|
|
69
|
-
cssVarInfix: 'font-size',
|
|
70
|
-
classes: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
path: [ 'typography', 'fontFamilies' ],
|
|
74
|
-
valueKey: 'fontFamily',
|
|
75
|
-
cssVarInfix: 'font-family',
|
|
76
|
-
classes: [
|
|
77
|
-
{ classSuffix: 'font-family', propertyName: 'font-family' },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
path: [ 'spacing', 'spacingSizes' ],
|
|
82
|
-
valueKey: 'size',
|
|
83
|
-
cssVarInfix: 'spacing',
|
|
84
|
-
valueFunc: ( { size } ) => size,
|
|
85
|
-
classes: [],
|
|
86
|
-
},
|
|
87
|
-
];
|
|
88
|
-
|
|
89
|
-
export const STYLE_PATH_TO_CSS_VAR_INFIX = {
|
|
90
|
-
'color.background': 'color',
|
|
91
|
-
'color.text': 'color',
|
|
92
|
-
'elements.link.color.text': 'color',
|
|
93
|
-
'elements.link.:hover.color.text': 'color',
|
|
94
|
-
'elements.link.typography.fontFamily': 'font-family',
|
|
95
|
-
'elements.link.typography.fontSize': 'font-size',
|
|
96
|
-
'elements.button.color.text': 'color',
|
|
97
|
-
'elements.button.color.background': 'color',
|
|
98
|
-
'elements.button.typography.fontFamily': 'font-family',
|
|
99
|
-
'elements.button.typography.fontSize': 'font-size',
|
|
100
|
-
'elements.heading.color': 'color',
|
|
101
|
-
'elements.heading.color.background': 'color',
|
|
102
|
-
'elements.heading.typography.fontFamily': 'font-family',
|
|
103
|
-
'elements.heading.gradient': 'gradient',
|
|
104
|
-
'elements.heading.color.gradient': 'gradient',
|
|
105
|
-
'elements.h1.color': 'color',
|
|
106
|
-
'elements.h1.color.background': 'color',
|
|
107
|
-
'elements.h1.typography.fontFamily': 'font-family',
|
|
108
|
-
'elements.h1.color.gradient': 'gradient',
|
|
109
|
-
'elements.h2.color': 'color',
|
|
110
|
-
'elements.h2.color.background': 'color',
|
|
111
|
-
'elements.h2.typography.fontFamily': 'font-family',
|
|
112
|
-
'elements.h2.color.gradient': 'gradient',
|
|
113
|
-
'elements.h3.color': 'color',
|
|
114
|
-
'elements.h3.color.background': 'color',
|
|
115
|
-
'elements.h3.typography.fontFamily': 'font-family',
|
|
116
|
-
'elements.h3.color.gradient': 'gradient',
|
|
117
|
-
'elements.h4.color': 'color',
|
|
118
|
-
'elements.h4.color.background': 'color',
|
|
119
|
-
'elements.h4.typography.fontFamily': 'font-family',
|
|
120
|
-
'elements.h4.color.gradient': 'gradient',
|
|
121
|
-
'elements.h5.color': 'color',
|
|
122
|
-
'elements.h5.color.background': 'color',
|
|
123
|
-
'elements.h5.typography.fontFamily': 'font-family',
|
|
124
|
-
'elements.h5.color.gradient': 'gradient',
|
|
125
|
-
'elements.h6.color': 'color',
|
|
126
|
-
'elements.h6.color.background': 'color',
|
|
127
|
-
'elements.h6.typography.fontFamily': 'font-family',
|
|
128
|
-
'elements.h6.color.gradient': 'gradient',
|
|
129
|
-
'color.gradient': 'gradient',
|
|
130
|
-
'typography.fontSize': 'font-size',
|
|
131
|
-
'typography.fontFamily': 'font-family',
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// A static list of block attributes that store global style preset slugs.
|
|
135
|
-
export const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
136
|
-
'color.background': 'backgroundColor',
|
|
137
|
-
'color.text': 'textColor',
|
|
138
|
-
'color.gradient': 'gradient',
|
|
139
|
-
'typography.fontSize': 'fontSize',
|
|
140
|
-
'typography.fontFamily': 'fontFamily',
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
function findInPresetsBy(
|
|
144
|
-
features,
|
|
145
|
-
blockName,
|
|
146
|
-
presetPath,
|
|
147
|
-
presetProperty,
|
|
148
|
-
presetValueValue
|
|
149
|
-
) {
|
|
150
|
-
// Block presets take priority above root level presets.
|
|
151
|
-
const orderedPresetsByOrigin = [
|
|
152
|
-
get( features, [ 'blocks', blockName, ...presetPath ] ),
|
|
153
|
-
get( features, presetPath ),
|
|
154
|
-
];
|
|
155
|
-
|
|
156
|
-
for ( const presetByOrigin of orderedPresetsByOrigin ) {
|
|
157
|
-
if ( presetByOrigin ) {
|
|
158
|
-
// Preset origins ordered by priority.
|
|
159
|
-
const origins = [ 'custom', 'theme', 'default' ];
|
|
160
|
-
for ( const origin of origins ) {
|
|
161
|
-
const presets = presetByOrigin[ origin ];
|
|
162
|
-
if ( presets ) {
|
|
163
|
-
const presetObject = presets.find(
|
|
164
|
-
( preset ) =>
|
|
165
|
-
preset[ presetProperty ] === presetValueValue
|
|
166
|
-
);
|
|
167
|
-
if ( presetObject ) {
|
|
168
|
-
if ( presetProperty === 'slug' ) {
|
|
169
|
-
return presetObject;
|
|
170
|
-
}
|
|
171
|
-
// If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.
|
|
172
|
-
const highestPresetObjectWithSameSlug = findInPresetsBy(
|
|
173
|
-
features,
|
|
174
|
-
blockName,
|
|
175
|
-
presetPath,
|
|
176
|
-
'slug',
|
|
177
|
-
presetObject.slug
|
|
178
|
-
);
|
|
179
|
-
if (
|
|
180
|
-
highestPresetObjectWithSameSlug[
|
|
181
|
-
presetProperty
|
|
182
|
-
] === presetObject[ presetProperty ]
|
|
183
|
-
) {
|
|
184
|
-
return presetObject;
|
|
185
|
-
}
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function getPresetVariableFromValue(
|
|
195
|
-
features,
|
|
196
|
-
blockName,
|
|
197
|
-
variableStylePath,
|
|
198
|
-
presetPropertyValue
|
|
199
|
-
) {
|
|
200
|
-
if ( ! presetPropertyValue ) {
|
|
201
|
-
return presetPropertyValue;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];
|
|
205
|
-
|
|
206
|
-
const metadata = PRESET_METADATA.find(
|
|
207
|
-
( data ) => data.cssVarInfix === cssVarInfix
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
if ( ! metadata ) {
|
|
211
|
-
// The property doesn't have preset data
|
|
212
|
-
// so the value should be returned as it is.
|
|
213
|
-
return presetPropertyValue;
|
|
214
|
-
}
|
|
215
|
-
const { valueKey, path } = metadata;
|
|
216
|
-
|
|
217
|
-
const presetObject = findInPresetsBy(
|
|
218
|
-
features,
|
|
219
|
-
blockName,
|
|
220
|
-
path,
|
|
221
|
-
valueKey,
|
|
222
|
-
presetPropertyValue
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
if ( ! presetObject ) {
|
|
226
|
-
// Value wasn't found in the presets,
|
|
227
|
-
// so it must be a custom value.
|
|
228
|
-
return presetPropertyValue;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return `var:preset|${ cssVarInfix }|${ presetObject.slug }`;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function getValueFromPresetVariable(
|
|
235
|
-
features,
|
|
236
|
-
blockName,
|
|
237
|
-
variable,
|
|
238
|
-
[ presetType, slug ]
|
|
239
|
-
) {
|
|
240
|
-
const metadata = PRESET_METADATA.find(
|
|
241
|
-
( data ) => data.cssVarInfix === presetType
|
|
242
|
-
);
|
|
243
|
-
if ( ! metadata ) {
|
|
244
|
-
return variable;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const presetObject = findInPresetsBy(
|
|
248
|
-
features.settings,
|
|
249
|
-
blockName,
|
|
250
|
-
metadata.path,
|
|
251
|
-
'slug',
|
|
252
|
-
slug
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
if ( presetObject ) {
|
|
256
|
-
const { valueKey } = metadata;
|
|
257
|
-
const result = presetObject[ valueKey ];
|
|
258
|
-
return getValueFromVariable( features, blockName, result );
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return variable;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function getValueFromCustomVariable( features, blockName, variable, path ) {
|
|
265
|
-
const result =
|
|
266
|
-
get( features.settings, [ 'blocks', blockName, 'custom', ...path ] ) ??
|
|
267
|
-
get( features.settings, [ 'custom', ...path ] );
|
|
268
|
-
if ( ! result ) {
|
|
269
|
-
return variable;
|
|
270
|
-
}
|
|
271
|
-
// A variable may reference another variable so we need recursion until we find the value.
|
|
272
|
-
return getValueFromVariable( features, blockName, result );
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Attempts to fetch the value of a theme.json CSS variable.
|
|
277
|
-
*
|
|
278
|
-
* @param {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree.
|
|
279
|
-
* @param {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks.
|
|
280
|
-
* @param {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value.
|
|
281
|
-
* @return {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument.
|
|
282
|
-
*/
|
|
283
|
-
export function getValueFromVariable( features, blockName, variable ) {
|
|
284
|
-
if ( ! variable || typeof variable !== 'string' ) {
|
|
285
|
-
if ( variable?.ref && typeof variable?.ref === 'string' ) {
|
|
286
|
-
const refPath = variable.ref.split( '.' );
|
|
287
|
-
variable = get( features, refPath );
|
|
288
|
-
// Presence of another ref indicates a reference to another dynamic value.
|
|
289
|
-
// Pointing to another dynamic value is not supported.
|
|
290
|
-
if ( ! variable || !! variable?.ref ) {
|
|
291
|
-
return variable;
|
|
292
|
-
}
|
|
293
|
-
} else {
|
|
294
|
-
return variable;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
const USER_VALUE_PREFIX = 'var:';
|
|
298
|
-
const THEME_VALUE_PREFIX = 'var(--wp--';
|
|
299
|
-
const THEME_VALUE_SUFFIX = ')';
|
|
300
|
-
|
|
301
|
-
let parsedVar;
|
|
302
|
-
|
|
303
|
-
if ( variable.startsWith( USER_VALUE_PREFIX ) ) {
|
|
304
|
-
parsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );
|
|
305
|
-
} else if (
|
|
306
|
-
variable.startsWith( THEME_VALUE_PREFIX ) &&
|
|
307
|
-
variable.endsWith( THEME_VALUE_SUFFIX )
|
|
308
|
-
) {
|
|
309
|
-
parsedVar = variable
|
|
310
|
-
.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )
|
|
311
|
-
.split( '--' );
|
|
312
|
-
} else {
|
|
313
|
-
// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`
|
|
314
|
-
return variable;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const [ type, ...path ] = parsedVar;
|
|
318
|
-
if ( type === 'preset' ) {
|
|
319
|
-
return getValueFromPresetVariable(
|
|
320
|
-
features,
|
|
321
|
-
blockName,
|
|
322
|
-
variable,
|
|
323
|
-
path
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
if ( type === 'custom' ) {
|
|
327
|
-
return getValueFromCustomVariable(
|
|
328
|
-
features,
|
|
329
|
-
blockName,
|
|
330
|
-
variable,
|
|
331
|
-
path
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
return variable;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Function that scopes a selector with another one. This works a bit like
|
|
339
|
-
* SCSS nesting except the `&` operator isn't supported.
|
|
340
|
-
*
|
|
341
|
-
* @example
|
|
342
|
-
* ```js
|
|
343
|
-
* const scope = '.a, .b .c';
|
|
344
|
-
* const selector = '> .x, .y';
|
|
345
|
-
* const merged = scopeSelector( scope, selector );
|
|
346
|
-
* // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'
|
|
347
|
-
* ```
|
|
348
|
-
*
|
|
349
|
-
* @param {string} scope Selector to scope to.
|
|
350
|
-
* @param {string} selector Original selector.
|
|
351
|
-
*
|
|
352
|
-
* @return {string} Scoped selector.
|
|
353
|
-
*/
|
|
354
|
-
export function scopeSelector( scope, selector ) {
|
|
355
|
-
const scopes = scope.split( ',' );
|
|
356
|
-
const selectors = selector.split( ',' );
|
|
357
|
-
|
|
358
|
-
const selectorsScoped = [];
|
|
359
|
-
scopes.forEach( ( outer ) => {
|
|
360
|
-
selectors.forEach( ( inner ) => {
|
|
361
|
-
selectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );
|
|
362
|
-
} );
|
|
363
|
-
} );
|
|
364
|
-
|
|
365
|
-
return selectorsScoped.join( ', ' );
|
|
366
|
-
}
|
|
367
|
-
|
|
368
1
|
/**
|
|
369
2
|
*
|
|
370
|
-
* @param {string}
|
|
3
|
+
* @param {string} variation The variation name.
|
|
371
4
|
*
|
|
372
5
|
* @return {string} The variation class name.
|
|
373
6
|
*/
|
|
374
|
-
export function
|
|
375
|
-
if ( !
|
|
7
|
+
export function getVariationClassName( variation ) {
|
|
8
|
+
if ( ! variation ) {
|
|
376
9
|
return '';
|
|
377
10
|
}
|
|
378
|
-
return `is-style-${
|
|
11
|
+
return `is-style-${ variation }`;
|
|
379
12
|
}
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect } from '@wordpress/element';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { experiments as blockEditorExperiments } from '@wordpress/block-editor';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
11
|
import { store as editSiteStore } from '../../store';
|
|
12
|
+
import { unlock } from '../../experiments';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { useGlobalStylesOutput } from '../global-styles/use-global-styles-output';
|
|
14
|
+
const { useGlobalStylesOutput } = unlock( blockEditorExperiments );
|
|
16
15
|
|
|
17
16
|
function useGlobalStylesRenderer() {
|
|
18
17
|
const [ styles, settings, svgFilters ] = useGlobalStylesOutput();
|
|
@@ -88,6 +88,7 @@ export default function DocumentActions() {
|
|
|
88
88
|
// Use the title wrapper as the popover anchor so that the dropdown is
|
|
89
89
|
// centered over the whole title area rather than just one part of it.
|
|
90
90
|
anchor: popoverAnchor,
|
|
91
|
+
placement: 'bottom',
|
|
91
92
|
} ),
|
|
92
93
|
[ popoverAnchor ]
|
|
93
94
|
);
|
|
@@ -146,7 +147,6 @@ export default function DocumentActions() {
|
|
|
146
147
|
|
|
147
148
|
<Dropdown
|
|
148
149
|
popoverProps={ popoverProps }
|
|
149
|
-
position="bottom center"
|
|
150
150
|
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
151
151
|
<Button
|
|
152
152
|
className="edit-site-document-actions__get-info"
|
|
@@ -38,6 +38,7 @@ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-e
|
|
|
38
38
|
import SiteHub from '../site-hub';
|
|
39
39
|
import ResizeHandle from '../block-editor/resize-handle';
|
|
40
40
|
import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';
|
|
41
|
+
import { unlock } from '../../experiments';
|
|
41
42
|
|
|
42
43
|
const ANIMATION_DURATION = 0.5;
|
|
43
44
|
const emptyResizeHandleStyles = {
|
|
@@ -52,7 +53,7 @@ const emptyResizeHandleStyles = {
|
|
|
52
53
|
left: undefined,
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
export default function Layout(
|
|
56
|
+
export default function Layout() {
|
|
56
57
|
// This ensures the edited entity id and type are initialized properly.
|
|
57
58
|
useInitEditedEntityFromURL();
|
|
58
59
|
useSyncCanvasModeWithURL();
|
|
@@ -66,9 +67,9 @@ export default function Layout( { onError } ) {
|
|
|
66
67
|
const { getAllShortcutKeyCombinations } = select(
|
|
67
68
|
keyboardShortcutsStore
|
|
68
69
|
);
|
|
69
|
-
const {
|
|
70
|
+
const { getCanvasMode } = unlock( select( editSiteStore ) );
|
|
70
71
|
return {
|
|
71
|
-
canvasMode:
|
|
72
|
+
canvasMode: getCanvasMode(),
|
|
72
73
|
previousShortcut: getAllShortcutKeyCombinations(
|
|
73
74
|
'core/edit-site/previous-region'
|
|
74
75
|
),
|
|
@@ -236,6 +237,13 @@ export default function Layout( { onError } ) {
|
|
|
236
237
|
<ResizeHandle
|
|
237
238
|
direction="right"
|
|
238
239
|
variation="separator"
|
|
240
|
+
resizeWidthBy={ ( delta ) => {
|
|
241
|
+
setForcedWidth(
|
|
242
|
+
( forcedWidth ??
|
|
243
|
+
defaultSidebarWidth ) +
|
|
244
|
+
delta
|
|
245
|
+
);
|
|
246
|
+
} }
|
|
239
247
|
/>
|
|
240
248
|
),
|
|
241
249
|
} }
|
|
@@ -307,7 +315,7 @@ export default function Layout( { onError } ) {
|
|
|
307
315
|
ease: 'easeOut',
|
|
308
316
|
} }
|
|
309
317
|
>
|
|
310
|
-
<ErrorBoundary
|
|
318
|
+
<ErrorBoundary>
|
|
311
319
|
{ isEditorPage && <Editor /> }
|
|
312
320
|
{ isListPage && <ListPage /> }
|
|
313
321
|
</ErrorBoundary>
|
|
@@ -63,7 +63,6 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
|
|
|
63
63
|
.edit-site-layout__content {
|
|
64
64
|
flex-grow: 1;
|
|
65
65
|
display: flex;
|
|
66
|
-
gap: $canvas-padding;
|
|
67
66
|
|
|
68
67
|
// Hide scrollbars during the edit/view animation.
|
|
69
68
|
overflow: hidden;
|
|
@@ -85,15 +84,15 @@ $hub-height: $grid-unit-20 * 2 + $button-size;
|
|
|
85
84
|
top: 0;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
.resizable-editor__drag-handle.is-right {
|
|
89
|
-
right: math.div(-$grid-unit-15, 2);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
87
|
> div {
|
|
93
88
|
overflow-y: auto;
|
|
94
89
|
min-height: 100%;
|
|
95
90
|
@include custom-scrollbars-on-hover;
|
|
96
91
|
}
|
|
92
|
+
|
|
93
|
+
.resizable-editor__drag-handle {
|
|
94
|
+
right: 0;
|
|
95
|
+
}
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
.edit-site-layout__canvas-container {
|
|
@@ -6,11 +6,11 @@ import { useState } from '@wordpress/element';
|
|
|
6
6
|
import { useDispatch } from '@wordpress/data';
|
|
7
7
|
import {
|
|
8
8
|
Button,
|
|
9
|
-
Flex,
|
|
10
|
-
FlexItem,
|
|
11
9
|
MenuItem,
|
|
12
10
|
Modal,
|
|
13
11
|
TextControl,
|
|
12
|
+
__experimentalHStack as HStack,
|
|
13
|
+
__experimentalVStack as VStack,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
16
16
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -75,30 +75,22 @@ export default function RenameMenuItem( { template, onClose } ) {
|
|
|
75
75
|
{ isModalOpen && (
|
|
76
76
|
<Modal
|
|
77
77
|
title={ __( 'Rename' ) }
|
|
78
|
-
closeLabel={ __( 'Close' ) }
|
|
79
78
|
onRequestClose={ () => {
|
|
80
79
|
setIsModalOpen( false );
|
|
81
80
|
} }
|
|
82
81
|
overlayClassName="edit-site-list__rename-modal"
|
|
83
82
|
>
|
|
84
83
|
<form onSubmit={ onTemplateRename }>
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</FlexItem>
|
|
94
|
-
</Flex>
|
|
84
|
+
<VStack spacing="5">
|
|
85
|
+
<TextControl
|
|
86
|
+
__nextHasNoMarginBottom
|
|
87
|
+
label={ __( 'Name' ) }
|
|
88
|
+
value={ title }
|
|
89
|
+
onChange={ setTitle }
|
|
90
|
+
required
|
|
91
|
+
/>
|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
className="edit-site-list__rename-modal-actions"
|
|
98
|
-
justify="flex-end"
|
|
99
|
-
expanded={ false }
|
|
100
|
-
>
|
|
101
|
-
<FlexItem>
|
|
93
|
+
<HStack justify="right">
|
|
102
94
|
<Button
|
|
103
95
|
variant="tertiary"
|
|
104
96
|
onClick={ () => {
|
|
@@ -107,13 +99,12 @@ export default function RenameMenuItem( { template, onClose } ) {
|
|
|
107
99
|
>
|
|
108
100
|
{ __( 'Cancel' ) }
|
|
109
101
|
</Button>
|
|
110
|
-
|
|
111
|
-
<FlexItem>
|
|
102
|
+
|
|
112
103
|
<Button variant="primary" type="submit">
|
|
113
104
|
{ __( 'Save' ) }
|
|
114
105
|
</Button>
|
|
115
|
-
</
|
|
116
|
-
</
|
|
106
|
+
</HStack>
|
|
107
|
+
</VStack>
|
|
117
108
|
</form>
|
|
118
109
|
</Modal>
|
|
119
110
|
) }
|
|
@@ -20,7 +20,7 @@ import NavigationMenu from './navigation-menu';
|
|
|
20
20
|
|
|
21
21
|
const NAVIGATION_MENUS_QUERY = [ { per_page: -1, status: 'publish' } ];
|
|
22
22
|
|
|
23
|
-
export default function NavigationInspector() {
|
|
23
|
+
export default function NavigationInspector( { onSelect } ) {
|
|
24
24
|
const {
|
|
25
25
|
selectedNavigationBlockId,
|
|
26
26
|
clientIdToRef,
|
|
@@ -207,8 +207,8 @@ export default function NavigationInspector() {
|
|
|
207
207
|
onInput={ onInput }
|
|
208
208
|
>
|
|
209
209
|
<NavigationMenu
|
|
210
|
-
id={ navMenuListId }
|
|
211
210
|
innerBlocks={ publishedInnerBlocks }
|
|
211
|
+
onSelect={ onSelect }
|
|
212
212
|
/>
|
|
213
213
|
</BlockEditorProvider>
|
|
214
214
|
) }
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
__experimentalOffCanvasEditor as OffCanvasEditor,
|
|
5
|
+
experiments as blockEditorExperiments,
|
|
7
6
|
store as blockEditorStore,
|
|
8
7
|
} from '@wordpress/block-editor';
|
|
9
8
|
import { useEffect } from '@wordpress/element';
|
|
10
9
|
import { useDispatch } from '@wordpress/data';
|
|
11
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { unlock } from '../../experiments';
|
|
15
|
+
|
|
12
16
|
const ALLOWED_BLOCKS = {
|
|
13
17
|
'core/navigation': [
|
|
14
18
|
'core/navigation-link',
|
|
@@ -32,9 +36,11 @@ const ALLOWED_BLOCKS = {
|
|
|
32
36
|
],
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
export default function NavigationMenu( { innerBlocks,
|
|
39
|
+
export default function NavigationMenu( { innerBlocks, onSelect } ) {
|
|
36
40
|
const { updateBlockListSettings } = useDispatch( blockEditorStore );
|
|
37
41
|
|
|
42
|
+
const { OffCanvasEditor } = unlock( blockEditorExperiments );
|
|
43
|
+
|
|
38
44
|
//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
|
39
45
|
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
|
40
46
|
useEffect( () => {
|
|
@@ -50,13 +56,5 @@ export default function NavigationMenu( { innerBlocks, id } ) {
|
|
|
50
56
|
} );
|
|
51
57
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
52
58
|
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<OffCanvasEditor
|
|
56
|
-
blocks={ innerBlocks }
|
|
57
|
-
selectBlockInCanvas={ false }
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
return <ListView id={ id } />;
|
|
59
|
+
return <OffCanvasEditor blocks={ innerBlocks } onSelect={ onSelect } />;
|
|
62
60
|
}
|
package/src/components/{sidebar-edit-mode/navigation-menu-sidebar → navigation-inspector}/style.scss
RENAMED
|
@@ -44,20 +44,3 @@
|
|
|
44
44
|
.edit-site-navigation-inspector__empty-msg {
|
|
45
45
|
padding: 0 $grid-unit-10;
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
.edit-site-navigation-menu-sidebar__panel {
|
|
49
|
-
padding: $grid-unit-20;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.edit-site-navigation-sidebar__beta {
|
|
53
|
-
display: inline-flex;
|
|
54
|
-
margin-left: $grid-unit-10;
|
|
55
|
-
padding: 0 $grid-unit-10;
|
|
56
|
-
height: $grid-unit-30;
|
|
57
|
-
border-radius: $radius-block-ui;
|
|
58
|
-
background-color: $gray-900;
|
|
59
|
-
color: $white;
|
|
60
|
-
align-items: center;
|
|
61
|
-
font-size: $helptext-font-size;
|
|
62
|
-
line-height: 1;
|
|
63
|
-
}
|
|
@@ -10,6 +10,7 @@ import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress
|
|
|
10
10
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
11
11
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
12
12
|
import useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';
|
|
13
|
+
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
13
14
|
|
|
14
15
|
function SidebarScreens() {
|
|
15
16
|
useSyncSidebarPathWithURL();
|
|
@@ -17,6 +18,7 @@ function SidebarScreens() {
|
|
|
17
18
|
return (
|
|
18
19
|
<>
|
|
19
20
|
<SidebarNavigationScreenMain />
|
|
21
|
+
<SidebarNavigationScreenNavigationMenus />
|
|
20
22
|
<SidebarNavigationScreenTemplates postType="wp_template" />
|
|
21
23
|
<SidebarNavigationScreenTemplates postType="wp_template_part" />
|
|
22
24
|
</>
|