@wordpress/edit-site 5.8.0 → 5.10.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 +4 -0
- package/build/components/add-new-template/add-custom-template-modal.js +21 -6
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +8 -2
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +8 -4
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +8 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +10 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +39 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +7 -7
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +43 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +131 -0
- package/build/components/editor-canvas-container/index.js.map +1 -0
- package/build/components/global-styles/block-preview-panel.js +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +53 -5
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +14 -3
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -18
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +4 -18
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -3
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/root-menu.js +61 -0
- package/build/components/global-styles/root-menu.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +3 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +158 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +9 -26
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -15
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +4 -17
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +148 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +132 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +130 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -3
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -39
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +3 -8
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +7 -11
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +66 -120
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +4 -28
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/index.js +11 -7
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +22 -14
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +9 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +4 -4
- package/build/components/list/table.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +44 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build/components/revisions/index.js +95 -0
- package/build/components/revisions/index.js.map +1 -0
- package/build/components/routes/link.js +17 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +8 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +31 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -31
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +20 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -7
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +16 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +35 -14
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +9 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +5 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -7
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -5
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +67 -0
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +18 -0
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build/components/site-hub/index.js +64 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +8 -7
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +21 -24
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +9 -41
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -5
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +3 -1
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +9 -3
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/hooks/template-part-edit.js +8 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/store/private-actions.js +19 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +13 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +23 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +27 -0
- package/build/utils/is-previewing-theme.js.map +1 -0
- package/build/utils/use-activate-theme.js +46 -0
- package/build/utils/use-activate-theme.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js +21 -6
- 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 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +7 -3
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +6 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +6 -1
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +37 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +6 -6
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +45 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +115 -0
- package/build-module/components/editor-canvas-container/index.js.map +1 -0
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +54 -5
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +13 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -18
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +5 -19
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +47 -0
- package/build-module/components/global-styles/root-menu.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +4 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +151 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +9 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +20 -15
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -16
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +128 -0
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +121 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +116 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +11 -37
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +3 -7
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +7 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +66 -118
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +3 -22
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +10 -7
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +1 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +17 -10
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +5 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +4 -4
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +35 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build-module/components/revisions/index.js +77 -0
- package/build-module/components/revisions/index.js.map +1 -0
- package/build-module/components/routes/link.js +13 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +28 -6
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +13 -32
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +19 -7
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -8
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +35 -16
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +10 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +6 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +25 -8
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +13 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -3
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +64 -14
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +8 -7
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +22 -25
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +10 -41
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +3 -1
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +5 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-actions.js +15 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +23 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +17 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +36 -0
- package/build-module/utils/use-activate-theme.js.map +1 -0
- package/build-style/style-rtl.css +310 -137
- package/build-style/style.css +310 -137
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-template-modal.js +31 -8
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +6 -1
- package/src/components/add-new-template/style.scss +52 -48
- package/src/components/app/index.js +6 -3
- package/src/components/block-editor/back-button.js +4 -1
- package/src/components/block-editor/editor-canvas.js +36 -8
- package/src/components/block-editor/index.js +8 -8
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/editor/index.js +48 -7
- package/src/components/editor-canvas-container/index.js +128 -0
- package/src/components/editor-canvas-container/style.scss +19 -0
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/border-panel.js +46 -3
- package/src/components/global-styles/color-palette-panel.js +9 -0
- package/src/components/global-styles/dimensions-panel.js +15 -15
- package/src/components/global-styles/global-styles-provider.js +4 -18
- package/src/components/global-styles/gradients-palette-panel.js +8 -0
- package/src/components/global-styles/root-menu.js +66 -0
- package/src/components/global-styles/screen-block-list.js +2 -2
- package/src/components/global-styles/screen-block.js +184 -7
- package/src/components/global-styles/screen-colors.js +9 -16
- package/src/components/global-styles/screen-css.js +21 -21
- package/src/components/global-styles/screen-layout.js +5 -9
- package/src/components/global-styles/screen-revisions/index.js +177 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +131 -0
- package/src/components/global-styles/screen-revisions/style.scss +99 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +125 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +103 -0
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography-element.js +1 -3
- package/src/components/global-styles/screen-typography.js +44 -79
- package/src/components/global-styles/style-variations-container.js +4 -10
- package/src/components/global-styles/style.scss +1 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +82 -107
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/index.js +17 -5
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/index.js +16 -19
- package/src/components/layout/style.scss +32 -7
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +4 -0
- package/src/components/list/table.js +19 -3
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/revisions/index.js +104 -0
- package/src/components/routes/link.js +16 -1
- package/src/components/routes/use-title.js +4 -1
- package/src/components/save-button/index.js +27 -6
- package/src/components/save-hub/index.js +17 -35
- package/src/components/save-panel/index.js +15 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +2 -6
- package/src/components/secondary-sidebar/style.scss +23 -5
- package/src/components/sidebar/index.js +12 -1
- package/src/components/sidebar/style.scss +2 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +39 -18
- package/src/components/sidebar-edit-mode/index.js +17 -6
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
- package/src/components/sidebar-edit-mode/style.scss +10 -0
- package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +8 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen-main/index.js +43 -22
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +13 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +3 -3
- package/src/components/sidebar-navigation-screen-page/index.js +59 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
- package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +5 -1
- package/src/components/sidebar-navigation-subtitle/index.js +5 -0
- package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
- package/src/components/site-hub/index.js +92 -33
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/site-icon/index.js +6 -11
- package/src/components/site-icon/style.scss +8 -3
- package/src/components/start-template-options/index.js +32 -39
- package/src/components/start-template-options/style.scss +36 -46
- package/src/components/style-book/index.js +7 -51
- package/src/components/style-book/style.scss +0 -18
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -4
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
- package/src/components/template-details/index.js +1 -0
- package/src/components/template-details/template-areas.js +4 -1
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/private-actions.js +14 -0
- package/src/store/private-selectors.js +11 -0
- package/src/store/reducer.js +18 -0
- package/src/store/test/actions.js +6 -14
- package/src/style.scss +5 -1
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/global-styles/context-menu.js +0 -126
- package/build/components/global-styles/context-menu.js.map +0 -1
- package/build/components/global-styles/custom-css.js +0 -113
- package/build/components/global-styles/custom-css.js.map +0 -1
- package/build/components/global-styles/effects-panel.js +0 -53
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/components/global-styles/filters-panel.js +0 -45
- package/build/components/global-styles/filters-panel.js.map +0 -1
- package/build/components/global-styles/screen-border.js +0 -61
- package/build/components/global-styles/screen-border.js.map +0 -1
- package/build/components/global-styles/screen-effects.js +0 -61
- package/build/components/global-styles/screen-effects.js.map +0 -1
- package/build/components/global-styles/screen-filters.js +0 -46
- package/build/components/global-styles/screen-filters.js.map +0 -1
- package/build/components/global-styles/screen-variations.js +0 -71
- package/build/components/global-styles/screen-variations.js.map +0 -1
- package/build/components/routes/index.js +0 -60
- package/build/components/routes/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build/hooks/commands/index.js +0 -19
- package/build/hooks/commands/index.js.map +0 -1
- package/build/hooks/commands/use-navigation-commands.js +0 -117
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -94
- package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build/utils/history.js +0 -41
- package/build/utils/history.js.map +0 -1
- package/build-module/components/global-styles/context-menu.js +0 -107
- package/build-module/components/global-styles/context-menu.js.map +0 -1
- package/build-module/components/global-styles/custom-css.js +0 -98
- package/build-module/components/global-styles/custom-css.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -43
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/components/global-styles/filters-panel.js +0 -35
- package/build-module/components/global-styles/filters-panel.js.map +0 -1
- package/build-module/components/global-styles/screen-border.js +0 -44
- package/build-module/components/global-styles/screen-border.js.map +0 -1
- package/build-module/components/global-styles/screen-effects.js +0 -44
- package/build-module/components/global-styles/screen-effects.js.map +0 -1
- package/build-module/components/global-styles/screen-filters.js +0 -33
- package/build-module/components/global-styles/screen-filters.js.map +0 -1
- package/build-module/components/global-styles/screen-variations.js +0 -54
- package/build-module/components/global-styles/screen-variations.js.map +0 -1
- package/build-module/components/routes/index.js +0 -47
- package/build-module/components/routes/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build-module/hooks/commands/index.js +0 -10
- package/build-module/hooks/commands/index.js.map +0 -1
- package/build-module/hooks/commands/use-navigation-commands.js +0 -101
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -79
- package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build-module/utils/history.js +0 -31
- package/build-module/utils/history.js.map +0 -1
- package/src/components/global-styles/context-menu.js +0 -175
- package/src/components/global-styles/custom-css.js +0 -131
- package/src/components/global-styles/effects-panel.js +0 -40
- package/src/components/global-styles/filters-panel.js +0 -33
- package/src/components/global-styles/screen-border.js +0 -35
- package/src/components/global-styles/screen-effects.js +0 -35
- package/src/components/global-styles/screen-filters.js +0 -27
- package/src/components/global-styles/screen-variations.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -103
- package/src/hooks/commands/use-wp-admin-commands.js +0 -77
- package/src/utils/history.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useGlobalStylesRevisions;
|
|
7
|
+
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
|
|
10
|
+
var _coreData = require("@wordpress/core-data");
|
|
11
|
+
|
|
12
|
+
var _element = require("@wordpress/element");
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
var _lodash = require("lodash");
|
|
17
|
+
|
|
18
|
+
var _privateApis = require("../../../private-apis");
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* External dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
const SITE_EDITOR_AUTHORS_QUERY = {
|
|
32
|
+
per_page: -1,
|
|
33
|
+
_fields: 'id,name,avatar_urls',
|
|
34
|
+
context: 'view',
|
|
35
|
+
capabilities: ['edit_theme_options']
|
|
36
|
+
};
|
|
37
|
+
const {
|
|
38
|
+
GlobalStylesContext
|
|
39
|
+
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
40
|
+
|
|
41
|
+
function useGlobalStylesRevisions() {
|
|
42
|
+
const {
|
|
43
|
+
user: userConfig
|
|
44
|
+
} = (0, _element.useContext)(GlobalStylesContext);
|
|
45
|
+
const {
|
|
46
|
+
authors,
|
|
47
|
+
currentUser,
|
|
48
|
+
isDirty,
|
|
49
|
+
revisions,
|
|
50
|
+
isLoading
|
|
51
|
+
} = (0, _data.useSelect)(select => {
|
|
52
|
+
const {
|
|
53
|
+
__experimentalGetDirtyEntityRecords,
|
|
54
|
+
getCurrentUser,
|
|
55
|
+
getUsers,
|
|
56
|
+
getCurrentThemeGlobalStylesRevisions,
|
|
57
|
+
isResolving
|
|
58
|
+
} = select(_coreData.store);
|
|
59
|
+
|
|
60
|
+
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
61
|
+
|
|
62
|
+
const _currentUser = getCurrentUser();
|
|
63
|
+
|
|
64
|
+
const _isDirty = dirtyEntityRecords.length > 0;
|
|
65
|
+
|
|
66
|
+
const globalStylesRevisions = getCurrentThemeGlobalStylesRevisions() || [];
|
|
67
|
+
|
|
68
|
+
const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY);
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
authors: _authors,
|
|
72
|
+
currentUser: _currentUser,
|
|
73
|
+
isDirty: _isDirty,
|
|
74
|
+
revisions: globalStylesRevisions,
|
|
75
|
+
isLoading: !globalStylesRevisions.length || isResolving('getUsers', [SITE_EDITOR_AUTHORS_QUERY])
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
return (0, _element.useMemo)(() => {
|
|
79
|
+
var _modifiedRevisions$;
|
|
80
|
+
|
|
81
|
+
let _modifiedRevisions = [];
|
|
82
|
+
|
|
83
|
+
if (isLoading || !revisions.length) {
|
|
84
|
+
return {
|
|
85
|
+
revisions: _modifiedRevisions,
|
|
86
|
+
hasUnsavedChanges: isDirty,
|
|
87
|
+
isLoading
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/*
|
|
91
|
+
* Adds a flag to the first revision, which is the latest.
|
|
92
|
+
* Also adds author information to the revision.
|
|
93
|
+
* Then, if there are unsaved changes in the editor, create a
|
|
94
|
+
* new "revision" item that represents the unsaved changes.
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
_modifiedRevisions = revisions.map(revision => {
|
|
99
|
+
return { ...revision,
|
|
100
|
+
author: authors.find(author => author.id === revision.author)
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if (((_modifiedRevisions$ = _modifiedRevisions[0]) === null || _modifiedRevisions$ === void 0 ? void 0 : _modifiedRevisions$.id) !== 'unsaved') {
|
|
105
|
+
_modifiedRevisions[0].isLatest = true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (isDirty && !(0, _lodash.isEmpty)(userConfig) && currentUser) {
|
|
109
|
+
const unsavedRevision = {
|
|
110
|
+
id: 'unsaved',
|
|
111
|
+
styles: userConfig === null || userConfig === void 0 ? void 0 : userConfig.styles,
|
|
112
|
+
settings: userConfig === null || userConfig === void 0 ? void 0 : userConfig.settings,
|
|
113
|
+
author: {
|
|
114
|
+
name: currentUser === null || currentUser === void 0 ? void 0 : currentUser.name,
|
|
115
|
+
avatar_urls: currentUser === null || currentUser === void 0 ? void 0 : currentUser.avatar_urls
|
|
116
|
+
},
|
|
117
|
+
modified: new Date()
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
_modifiedRevisions.unshift(unsavedRevision);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
revisions: _modifiedRevisions,
|
|
125
|
+
hasUnsavedChanges: isDirty,
|
|
126
|
+
isLoading
|
|
127
|
+
};
|
|
128
|
+
}, [revisions.length, isDirty, isLoading]);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=use-global-styles-revisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","GlobalStylesContext","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","isLoading","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","map","revision","author","find","id","isLatest","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAIA;;AAIA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAOA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,yBAAQC,wBAAR,CAAhC;;AACe,SAASC,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAAuB,yBAAYJ,mBAAZ,CAA7B;AACA,QAAM;AAAEK,IAAAA,OAAF;AAAWC,IAAAA,WAAX;AAAwBC,IAAAA,OAAxB;AA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KAAcH,QAAQ,CAACC,MAD9B;AAFF,OAAP;AAMA,KAPoB,CAArB;;AASA,QAAK,wBAAAJ,kBAAkB,CAAE,CAAF,CAAlB,4EAAyBM,EAAzB,MAAgC,SAArC,EAAiD;AAChDN,MAAAA,kBAAkB,CAAE,CAAF,CAAlB,CAAwBO,QAAxB,GAAmC,IAAnC;AACA;;AAED,QAAKvB,OAAO,IAAI,CAAE,qBAASH,UAAT,CAAb,IAAsCE,WAA3C,EAAyD;AACxD,YAAMyB,eAAe,GAAG;AACvBF,QAAAA,EAAE,EAAE,SADmB;AAEvBG,QAAAA,MAAM,EAAE5B,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAE4B,MAFG;AAGvBC,QAAAA,QAAQ,EAAE7B,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAE6B,QAHC;AAIvBN,QAAAA,MAAM,EAAE;AACPO,UAAAA,IAAI,EAAE5B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE4B,IADZ;AAEPC,UAAAA,WAAW,EAAE7B,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAE6B;AAFnB,SAJe;AAQvBC,QAAAA,QAAQ,EAAE,IAAIC,IAAJ;AARa,OAAxB;;AAWAd,MAAAA,kBAAkB,CAACe,OAAnB,CAA4BP,eAA5B;AACA;;AACD,WAAO;AACNvB,MAAAA,SAAS,EAAEe,kBADL;AAENC,MAAAA,iBAAiB,EAAEjB,OAFb;AAGNE,MAAAA;AAHM,KAAP;AAKA,GA/CM,EA+CJ,CAAED,SAAS,CAACY,MAAZ,EAAoBb,OAApB,EAA6BE,SAA7B,CA/CI,CAAP;AAgDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../private-apis';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst { authors, currentUser, isDirty, revisions, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetCurrentThemeGlobalStylesRevisions() || [];\n\t\t\tconst _authors = getUsers( SITE_EDITOR_AUTHORS_QUERY );\n\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoading:\n\t\t\t\t\t! globalStylesRevisions.length ||\n\t\t\t\t\tisResolving( 'getUsers', [ SITE_EDITOR_AUTHORS_QUERY ] ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( isLoading || ! revisions.length ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading,\n\t\t\t};\n\t\t}\n\t\t/*\n\t\t * Adds a flag to the first revision, which is the latest.\n\t\t * Also adds author information to the revision.\n\t\t * Then, if there are unsaved changes in the editor, create a\n\t\t * new \"revision\" item that represents the unsaved changes.\n\t\t */\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tif ( _modifiedRevisions[ 0 ]?.id !== 'unsaved' ) {\n\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t}\n\n\t\tif ( isDirty && ! isEmpty( userConfig ) && currentUser ) {\n\t\t\tconst unsavedRevision = {\n\t\t\t\tid: 'unsaved',\n\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\tauthor: {\n\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t},\n\t\t\t\tmodified: new Date(),\n\t\t\t};\n\n\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t}\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading,\n\t\t};\n\t}, [ revisions.length, isDirty, isLoading ] );\n}\n"]}
|
|
@@ -25,7 +25,7 @@ var _iconWithCurrentColor = require("./icon-with-current-color");
|
|
|
25
25
|
|
|
26
26
|
var _navigationButton = require("./navigation-button");
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _rootMenu = _interopRequireDefault(require("./root-menu"));
|
|
29
29
|
|
|
30
30
|
var _preview = _interopRequireDefault(require("./preview"));
|
|
31
31
|
|
|
@@ -75,7 +75,7 @@ function ScreenRoot() {
|
|
|
75
75
|
justify: "space-between"
|
|
76
76
|
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Browse styles')), (0, _element.createElement)(_iconWithCurrentColor.IconWithCurrentColor, {
|
|
77
77
|
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
78
|
-
})))), (0, _element.createElement)(
|
|
78
|
+
})))), (0, _element.createElement)(_rootMenu.default, null))), (0, _element.createElement)(_components.CardDivider, null), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalSpacer, {
|
|
79
79
|
as: "p",
|
|
80
80
|
paddingTop: 2
|
|
81
81
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","useGlobalStyle","blockEditorPrivateApis","customCSS","variations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","_links","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;AAOA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqB,yBAAQC,wBAAR,CAA3B;AACA,QAAM,CAAEC,SAAF,IAAgBF,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEG,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,qBAAaC,MAAF,IAAc;AAAA;;AAC3D,UAAM;AACLC,MAAAA,eADK;AAELC,MAAAA,sCAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,eAAF,CAJV;;AAMA,UAAMC,cAAc,GAAGH,sCAAsC,EAA7D;;AACA,UAAMI,YAAY,GAAGD,cAAc,GAChCJ,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BI,cAA1B,CADiB,GAEhCE,SAFH;AAIA,WAAO;AACNT,MAAAA,UAAU,EAAEK,mDAAmD,EADzD;AAENJ,MAAAA,UAAU,2BACT,CAAC,EAAEO,YAAF,aAAEA,YAAF,uCAAEA,YAAY,CAAEE,MAAhB,iDAAE,qBAAwB,oBAAxB,CAAF,CADQ,yEAC4C;AAHhD,KAAP;AAKA,GAjBkC,EAiBhC,EAjBgC,CAAnC;AAmBA,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAC,OAAX;AAAmB,IAAA,SAAS,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gBAAD,QACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD,OADD,CADD,CADD,EAMG,CAAC,EAAEV,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEW,MAAd,CAAD,IACD,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAC,aADN;AAEC,kBAAa,cAAI,eAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACG,cAAI,eAAJ,CADH,CADD,EAIC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBAAUC,kBAAV,GAAwBC;AAF1B,IAJD,CAJD,CADD,CAPF,EAyBC,4BAAC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"names":["ScreenRoot","useGlobalStyle","blockEditorPrivateApis","customCSS","variations","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","_links","length","chevronLeft","chevronRight"],"mappings":";;;;;;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;AAOA,SAASA,UAAT,GAAsB;AACrB,QAAM;AAAEC,IAAAA;AAAF,MAAqB,yBAAQC,wBAAR,CAA3B;AACA,QAAM,CAAEC,SAAF,IAAgBF,cAAc,CAAE,KAAF,CAApC;AAEA,QAAM;AAAEG,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MA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ACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG;AACb;AACL;AACA;AACA;AACA;AAPI;AAQC,IAAA,QAAQ,EAAC,MARV;AASC,IAAA,YAAY,EAAG;AAThB,KAWG,cACD,iEADC,CAXH,CADD,EAgBC,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAC,SADN;AAEC,kBAAa,cAAI,eAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QAAY,cAAI,QAAJ,CAAZ,CADD,EAEC,4BAAC,0CAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,kBAAV,GAAwBC;AADhC,IAFD,CAJD,CADD,CAhBD,CAjCD,EAgEGZ,UAAU,IAAI,CAAC,CAAEF,SAAjB,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAC,GADJ;AAEC,IAAA,UAAU,EAAG,CAFd;AAGC,IAAA,QAAQ,EAAC,MAHV;AAIC,IAAA,YAAY,EAAG;AAJhB,KAMG,cACD,uEADC,CANH,CADD,EAWC,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,kBAAa,cAAI,gBAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACG,cAAI,gBAAJ,CADH,CADD,EAIC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBAAUa,kBAAV,GAAwBC;AAF1B,IAJD,CAJD,CADD,CAXD,CAFD,CAjEF,CADD;AAqGA;;eAEcjB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nfunction ScreenRoot() {\n\tconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { variations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tvariations: __experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<StylesPreview />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ !! variations?.length && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"]}
|
|
@@ -51,7 +51,6 @@ const elements = {
|
|
|
51
51
|
|
|
52
52
|
function ScreenTypographyElement(_ref) {
|
|
53
53
|
let {
|
|
54
|
-
name,
|
|
55
54
|
element
|
|
56
55
|
} = _ref;
|
|
57
56
|
const [headingLevel, setHeadingLevel] = (0, _element.useState)('heading');
|
|
@@ -61,7 +60,6 @@ function ScreenTypographyElement(_ref) {
|
|
|
61
60
|
}), (0, _element.createElement)(_components.__experimentalSpacer, {
|
|
62
61
|
marginX: 4
|
|
63
62
|
}, (0, _element.createElement)(_typographyPreview.default, {
|
|
64
|
-
name: name,
|
|
65
63
|
element: element,
|
|
66
64
|
headingLevel: headingLevel
|
|
67
65
|
})), element === 'heading' && (0, _element.createElement)(_components.__experimentalSpacer, {
|
|
@@ -100,7 +98,6 @@ function ScreenTypographyElement(_ref) {
|
|
|
100
98
|
value: "h6",
|
|
101
99
|
label: (0, _i18n.__)('H6')
|
|
102
100
|
}))), (0, _element.createElement)(_typographyPanel.default, {
|
|
103
|
-
name: name,
|
|
104
101
|
element: element,
|
|
105
102
|
headingLevel: headingLevel
|
|
106
103
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"names":["elements","text","description","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAUA;;AACA;;AACA;;AAhBA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE;AACLC,IAAAA,WAAW,EAAE,cAAI,oCAAJ,CADR;AAELC,IAAAA,KAAK,EAAE,cAAI,MAAJ;AAFF,GADU;AAKhBC,EAAAA,IAAI,EAAE;AACLF,IAAAA,WAAW,EAAE,cAAI,oDAAJ,CAD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,kDAAD;AACC,IAAA,KAAK,EAAC;AACN;AACP;AAHM;AAIC,IAAA,KAAK,EAAG,cAAI,KAAJ;AAJT,IATD,EAeC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAfD,EAmBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnBD,EAuBC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAvBD,EA2BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA3BD,EA+BC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IA/BD,EAmCC,4BAAC,kDAAD;AACC,IAAA,KAAK,EAAC,IADP;AAEC,IAAA,KAAK,EAAG,cAAI,IAAJ;AAFT,IAnCD,CADD,CAZF,EAuDC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,YAAY,EAAGC;AAFhB,IAvDD,CADD;AA8DA;;eAEcF,uB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\t/* translators: 'All' refers to selecting all heading levels \n\t\t\t\t\t\t\tand applying the same style to h1-h6. */\n\t\t\t\t\t\t\tlabel={ __( 'All' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"]}
|
|
@@ -21,12 +21,8 @@ var _navigationButton = require("./navigation-button");
|
|
|
21
21
|
|
|
22
22
|
var _subtitle = _interopRequireDefault(require("./subtitle"));
|
|
23
23
|
|
|
24
|
-
var _typographyPanel = _interopRequireDefault(require("./typography-panel"));
|
|
25
|
-
|
|
26
24
|
var _blockPreviewPanel = _interopRequireDefault(require("./block-preview-panel"));
|
|
27
25
|
|
|
28
|
-
var _utils = require("./utils");
|
|
29
|
-
|
|
30
26
|
var _privateApis = require("../../private-apis");
|
|
31
27
|
|
|
32
28
|
/**
|
|
@@ -42,28 +38,21 @@ const {
|
|
|
42
38
|
|
|
43
39
|
function Item(_ref) {
|
|
44
40
|
let {
|
|
45
|
-
name,
|
|
46
41
|
parentMenu,
|
|
47
42
|
element,
|
|
48
43
|
label
|
|
49
44
|
} = _ref;
|
|
50
|
-
const hasSupport = !name;
|
|
51
45
|
const prefix = element === 'text' || !element ? '' : `elements.${element}.`;
|
|
52
46
|
const extraStyles = element === 'link' ? {
|
|
53
47
|
textDecoration: 'underline'
|
|
54
48
|
} : {};
|
|
55
|
-
const [fontFamily] = useGlobalStyle(prefix + 'typography.fontFamily'
|
|
56
|
-
const [fontStyle] = useGlobalStyle(prefix + 'typography.fontStyle'
|
|
57
|
-
const [fontWeight] = useGlobalStyle(prefix + 'typography.fontWeight'
|
|
58
|
-
const [letterSpacing] = useGlobalStyle(prefix + 'typography.letterSpacing'
|
|
59
|
-
const [backgroundColor] = useGlobalStyle(prefix + 'color.background'
|
|
60
|
-
const [gradientValue] = useGlobalStyle(prefix + 'color.gradient'
|
|
61
|
-
const [color] = useGlobalStyle(prefix + 'color.text'
|
|
62
|
-
|
|
63
|
-
if (!hasSupport) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
49
|
+
const [fontFamily] = useGlobalStyle(prefix + 'typography.fontFamily');
|
|
50
|
+
const [fontStyle] = useGlobalStyle(prefix + 'typography.fontStyle');
|
|
51
|
+
const [fontWeight] = useGlobalStyle(prefix + 'typography.fontWeight');
|
|
52
|
+
const [letterSpacing] = useGlobalStyle(prefix + 'typography.letterSpacing');
|
|
53
|
+
const [backgroundColor] = useGlobalStyle(prefix + 'color.background');
|
|
54
|
+
const [gradientValue] = useGlobalStyle(prefix + 'color.gradient');
|
|
55
|
+
const [color] = useGlobalStyle(prefix + 'color.text');
|
|
67
56
|
const navigationButtonLabel = (0, _i18n.sprintf)( // translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
|
|
68
57
|
(0, _i18n.__)('Typography %s styles'), label);
|
|
69
58
|
return (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
@@ -85,20 +74,12 @@ function Item(_ref) {
|
|
|
85
74
|
}, (0, _i18n.__)('Aa')), (0, _element.createElement)(_components.FlexItem, null, label)));
|
|
86
75
|
}
|
|
87
76
|
|
|
88
|
-
function ScreenTypography(
|
|
89
|
-
|
|
90
|
-
name,
|
|
91
|
-
variation = ''
|
|
92
|
-
} = _ref2;
|
|
93
|
-
const parentMenu = name === undefined ? '' : '/blocks/' + name;
|
|
94
|
-
const variationClassName = (0, _utils.getVariationClassName)(variation);
|
|
77
|
+
function ScreenTypography() {
|
|
78
|
+
const parentMenu = '';
|
|
95
79
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
96
80
|
title: (0, _i18n.__)('Typography'),
|
|
97
81
|
description: (0, _i18n.__)('Manage the typography settings for different elements.')
|
|
98
|
-
}), (0, _element.createElement)(_blockPreviewPanel.default, {
|
|
99
|
-
name: name,
|
|
100
|
-
variation: variationClassName
|
|
101
|
-
}), !name && (0, _element.createElement)("div", {
|
|
82
|
+
}), (0, _element.createElement)(_blockPreviewPanel.default, null), (0, _element.createElement)("div", {
|
|
102
83
|
className: "edit-site-global-styles-screen-typography"
|
|
103
84
|
}, (0, _element.createElement)(_components.__experimentalVStack, {
|
|
104
85
|
spacing: 3
|
|
@@ -108,35 +89,26 @@ function ScreenTypography(_ref2) {
|
|
|
108
89
|
isBordered: true,
|
|
109
90
|
isSeparated: true
|
|
110
91
|
}, (0, _element.createElement)(Item, {
|
|
111
|
-
name: name,
|
|
112
92
|
parentMenu: parentMenu,
|
|
113
93
|
element: "text",
|
|
114
94
|
label: (0, _i18n.__)('Text')
|
|
115
95
|
}), (0, _element.createElement)(Item, {
|
|
116
|
-
name: name,
|
|
117
96
|
parentMenu: parentMenu,
|
|
118
97
|
element: "link",
|
|
119
98
|
label: (0, _i18n.__)('Links')
|
|
120
99
|
}), (0, _element.createElement)(Item, {
|
|
121
|
-
name: name,
|
|
122
100
|
parentMenu: parentMenu,
|
|
123
101
|
element: "heading",
|
|
124
102
|
label: (0, _i18n.__)('Headings')
|
|
125
103
|
}), (0, _element.createElement)(Item, {
|
|
126
|
-
name: name,
|
|
127
104
|
parentMenu: parentMenu,
|
|
128
105
|
element: "caption",
|
|
129
106
|
label: (0, _i18n.__)('Captions')
|
|
130
107
|
}), (0, _element.createElement)(Item, {
|
|
131
|
-
name: name,
|
|
132
108
|
parentMenu: parentMenu,
|
|
133
109
|
element: "button",
|
|
134
110
|
label: (0, _i18n.__)('Buttons')
|
|
135
|
-
}))))
|
|
136
|
-
name: name,
|
|
137
|
-
variation: variation,
|
|
138
|
-
element: "text"
|
|
139
|
-
}));
|
|
111
|
+
})))));
|
|
140
112
|
}
|
|
141
113
|
|
|
142
114
|
var _default = ScreenTypography;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["useGlobalStyle","blockEditorPrivateApis","Item","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"names":["useGlobalStyle","blockEditorPrivateApis","Item","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","background","ScreenTypography"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAqB,yBAAQC,wBAAR,CAA3B;;AAEA,SAASC,IAAT,OAAgD;AAAA,MAAjC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,OAAd;AAAuBC,IAAAA;AAAvB,GAAiC;AAC/C,QAAMC,MAAM,GACXF,OAAO,KAAK,MAAZ,IAAsB,CAAEA,OAAxB,GAAkC,EAAlC,GAAwC,YAAYA,OAAS,GAD9D;AAEA,QAAMG,WAAW,GAChBH,OAAO,KAAK,MAAZ,GACG;AACAI,IAAAA,cAAc,EAAE;AADhB,GADH,GAIG,EALJ;AAMA,QAAM,CAAEC,UAAF,IAAiBT,cAAc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AG,cAAI,YAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,wDADa;AAFf,IADD,EAQC,4BAAC,0BAAD,OARD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iBAAD;AAAU,IAAA,KAAK,EAAG;AAAlB,KAAwB,cAAI,UAAJ,CAAxB,CADD,EAEC,4BAAC,mCAAD;AAAW,IAAA,UAAU,MAArB;AAAsB,IAAA,WAAW;AAAjC,KACC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAG,cAAI,MAAJ;AAHT,IADD,EAMC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,IAAA,KAAK,EAAG,cAAI,OAAJ;AAHT,IAND,EAWC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAG,cAAI,UAAJ;AAHT,IAXD,EAgBC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,KAAK,EAAG,cAAI,UAAJ;AAHT,IAhBD,EAqBC,4BAAC,IAAD;AACC,IAAA,UAAU,EAAGA,UADd;AAEC,IAAA,OAAO,EAAC,QAFT;AAGC,IAAA,KAAK,EAAG,cAAI,SAAJ;AAHT,IArBD,CAFD,CADD,CAVD,CADD;AA6CA;;eAEce,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction Item( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction ScreenTypography() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Manage the typography settings for different elements.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<BlockPreviewPanel />\n\n\t\t\t<div className=\"edit-site-global-styles-screen-typography\">\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"text\"\n\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"link\"\n\t\t\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"heading\"\n\t\t\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"caption\"\n\t\t\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\t\t\telement=\"button\"\n\t\t\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _es = _interopRequireDefault(require("fast-deep-equal/es6"));
|
|
15
|
-
|
|
16
14
|
var _coreData = require("@wordpress/core-data");
|
|
17
15
|
|
|
18
16
|
var _data = require("@wordpress/data");
|
|
@@ -43,13 +41,10 @@ var _privateApis = require("../../private-apis");
|
|
|
43
41
|
* Internal dependencies
|
|
44
42
|
*/
|
|
45
43
|
const {
|
|
46
|
-
GlobalStylesContext
|
|
44
|
+
GlobalStylesContext,
|
|
45
|
+
areGlobalStyleConfigsEqual
|
|
47
46
|
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
48
47
|
|
|
49
|
-
function compareVariations(a, b) {
|
|
50
|
-
return (0, _es.default)(a.styles, b.styles) && (0, _es.default)(a.settings, b.settings);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
48
|
function Variation(_ref) {
|
|
54
49
|
let {
|
|
55
50
|
variation
|
|
@@ -91,7 +86,7 @@ function Variation(_ref) {
|
|
|
91
86
|
};
|
|
92
87
|
|
|
93
88
|
const isActive = (0, _element.useMemo)(() => {
|
|
94
|
-
return
|
|
89
|
+
return areGlobalStyleConfigsEqual(user, variation);
|
|
95
90
|
}, [user, variation]);
|
|
96
91
|
return (0, _element.createElement)(GlobalStylesContext.Provider, {
|
|
97
92
|
value: context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","isFocused","setIsFocused","base","user","setUserConfig","context","settings","styles","merged","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","title","StyleVariationsContainer","variations","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","map","index"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,yBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,SAAT,OAAoC;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AACnC,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAU,KAAV,CAApC;AACA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAAgC,yBAAYT,mBAAZ,CAAtC;AACA,QAAMU,OAAO,GAAG,sBAAS,MAAM;AAAA;;AAC9B,WAAO;AACNF,MAAAA,IAAI,EAAE;AACLG,QAAAA,QAAQ,yBAAEP,SAAS,CAACO,QAAZ,qEAAwB,EAD3B;AAELC,QAAAA,MAAM,uBAAER,SAAS,CAACQ,MAAZ,iEAAsB;AAFvB,OADA;AAKNL,MAAAA,IALM;AAMNM,MAAAA,MAAM,EAAE,mDAAyBN,IAAzB,EAA+BH,SAA/B,CANF;AAONK,MAAAA,aAAa,EAAE,MAAM,CAAE;AAPjB,KAAP;AASA,GAVe,EAUb,CAAEL,SAAF,EAAaG,IAAb,CAVa,CAAhB;;AAYA,QAAMO,eAAe,GAAG,MAAM;AAC7BL,IAAAA,aAAa,CAAE,MAAM;AACpB,aAAO;AACNE,QAAAA,QAAQ,EAAEP,SAAS,CAACO,QADd;AAENC,QAAAA,MAAM,EAAER,SAAS,CAACQ;AAFZ,OAAP;AAIA,KALY,CAAb;AAMA,GAPD;;AASA,QAAMG,aAAa,GAAKC,KAAF,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AAO,CACN;AACCN,MAAAA,KAAK,EAAE,cAAI,SAAJ,CADR;AAECV,MAAAA,QAAQ,EAAE,EAFX;AAGCC,MAAAA,MAAM,EAAE;AAHT,KADM,EAMN,GAAGW,UAAU,CAACK,GAAX,CAAkBxB,SAAF;AAAA;;AAAA,aAAmB,EACrC,GAAGA,SADkC;AAErCO,QAAAA,QAAQ,0BAAEP,SAAS,CAACO,QAAZ,uEAAwB,EAFK;AAGrCC,QAAAA,MAAM,wBAAER,SAAS,CAACQ,MAAZ,mEAAsB;AAHS,OAAnB;AAAA,KAAhB,CANG,CAAP;AAYA,GAb0B,EAaxB,CAAEW,UAAF,CAbwB,CAA3B;AAeA,SACC,qDACC,4BAAC,8BAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGI,kBAJH,aAIGA,kBAJH,uBAIGA,kBAAkB,CAAEC,GAApB,CAAyB,CAAExB,SAAF,EAAayB,KAAb,KAC1B,4BAAC,SAAD;AAAW,IAAA,GAAG,EAAGA,KAAjB;AAAyB,IAAA,SAAS,EAAGzB;AAArC,IADC,CAJH,CADD,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport StylesPreview from './preview';\nimport { unlock } from '../../private-apis';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction Variation( { variation } ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tuser: {\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t},\n\t\t\tbase,\n\t\t\tmerged: mergeBaseAndUserConfigs( base, variation ),\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base ] );\n\n\tconst selectVariation = () => {\n\t\tsetUserConfig( () => {\n\t\t\treturn {\n\t\t\t\tsettings: variation.settings,\n\t\t\t\tstyles: variation.styles,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo( () => {\n\t\treturn areGlobalStyleConfigsEqual( user, variation );\n\t}, [ user, variation ] );\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-global-styles-variations_item',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-active': isActive,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\trole=\"button\"\n\t\t\t\tonClick={ selectVariation }\n\t\t\t\tonKeyDown={ selectOnEnter }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\taria-label={ variation?.title }\n\t\t\t\taria-current={ isActive }\n\t\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-global-styles-variations_item-preview\">\n\t\t\t\t\t<StylesPreview\n\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\twithHoverView\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n\nexport default function StyleVariationsContainer() {\n\tconst { variations } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tvariations:\n\t\t\t\tselect(\n\t\t\t\t\tcoreStore\n\t\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations() || [],\n\t\t};\n\t}, [] );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variations.map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ variations ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Grid\n\t\t\t\tcolumns={ 2 }\n\t\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\t>\n\t\t\t\t{ withEmptyVariation?.map( ( variation, index ) => (\n\t\t\t\t\t<Variation key={ index } variation={ variation } />\n\t\t\t\t) ) }\n\t\t\t</Grid>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -27,10 +27,8 @@ const {
|
|
|
27
27
|
|
|
28
28
|
function TypographyPanel(_ref) {
|
|
29
29
|
let {
|
|
30
|
-
name,
|
|
31
30
|
element,
|
|
32
|
-
headingLevel
|
|
33
|
-
variation = ''
|
|
31
|
+
headingLevel
|
|
34
32
|
} = _ref;
|
|
35
33
|
let prefixParts = [];
|
|
36
34
|
|
|
@@ -40,18 +38,16 @@ function TypographyPanel(_ref) {
|
|
|
40
38
|
prefixParts = prefixParts.concat(['elements', element]);
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
if (variation) {
|
|
44
|
-
prefixParts = ['variations', variation].concat(prefixParts);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
41
|
const prefix = prefixParts.join('.');
|
|
48
|
-
const [style] = useGlobalStyle(prefix,
|
|
49
|
-
|
|
42
|
+
const [style] = useGlobalStyle(prefix, undefined, 'user', {
|
|
43
|
+
shouldDecodeEncode: false
|
|
44
|
+
});
|
|
45
|
+
const [inheritedStyle, setStyle] = useGlobalStyle(prefix, undefined, 'all', {
|
|
50
46
|
shouldDecodeEncode: false
|
|
51
47
|
});
|
|
52
|
-
const [rawSettings] = useGlobalSetting(''
|
|
48
|
+
const [rawSettings] = useGlobalSetting('');
|
|
53
49
|
const usedElement = element === 'heading' ? headingLevel : element;
|
|
54
|
-
const settings = useSettingsForBlockElement(rawSettings,
|
|
50
|
+
const settings = useSettingsForBlockElement(rawSettings, undefined, usedElement);
|
|
55
51
|
return (0, _element.createElement)(StylesTypographyPanel, {
|
|
56
52
|
inheritedValue: inheritedStyle,
|
|
57
53
|
value: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"names":["useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AACLA,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,eAAe,EAAEC;AAJZ,IAKF,yBAAQC,wBAAR,CALJ;;AAOe,SAASF,eAAT,OAAsD;AAAA,MAA5B;AAAEG,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA4B;AACpE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKF,OAAO,KAAK,SAAjB,EAA6B;AAC5BE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcF,YAAd,CAApB,CAAd;AACA,GAFD,MAEO,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAA5B,EAAqC;AAC3CE,IAAAA,WAAW,GAAGA,WAAW,CAACC,MAAZ,CAAoB,CAAE,UAAF,EAAcH,OAAd,CAApB,CAAd;AACA;;AACD,QAAMI,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYZ,cAAc,CAAEU,MAAF,EAAUG,SAAV,EAAqB,MAArB,EAA6B;AAC5DC,IAAAA,kBAAkB,EAAE;AADwC,GAA7B,CAAhC;AAGA,QAAM,CAAEC,cAAF,EAAkBC,QAAlB,IAA+BhB,cAAc,CAClDU,MADkD,EAElDG,SAFkD,EAGlD,KAHkD,EAIlD;AACCC,IAAAA,kBAAkB,EAAE;AADrB,GAJkD,CAAnD;AAQA,QAAM,CAAEG,WAAF,IAAkBhB,gBAAgB,CAAE,EAAF,CAAxC;AACA,QAAMiB,WAAW,GAAGZ,OAAO,KAAK,SAAZ,GAAwBC,YAAxB,GAAuCD,OAA3D;AACA,QAAMa,QAAQ,GAAGjB,0BAA0B,CAC1Ce,WAD0C,EAE1CJ,SAF0C,EAG1CK,WAH0C,CAA3C;AAMA,SACC,4BAAC,qBAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,KAAK,EAAGH,KAFT;AAGC,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,QAAQ,EAAGG;AAJZ,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"]}
|