@wordpress/edit-site 5.9.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 +2 -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 +6 -3
- 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/editor/index.js +43 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +18 -4
- package/build/components/editor-canvas-container/index.js.map +1 -1
- 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 +3 -1
- 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/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 +61 -108
- 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 +1 -1
- 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 +13 -7
- 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 +1 -1
- 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 +9 -3
- 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 +36 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- 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/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/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 +4 -1
- 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/editor/index.js +45 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +21 -6
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- 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 +3 -1
- 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/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 +61 -105
- 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 +2 -2
- 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 +9 -3
- 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 +1 -1
- 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 +9 -3
- 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 +34 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -17
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -1
- 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/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/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 +199 -78
- package/build-style/style.css +199 -78
- package/package.json +36 -34
- 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 +3 -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/style.scss +15 -8
- package/src/components/editor/index.js +48 -7
- package/src/components/editor-canvas-container/index.js +30 -17
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/border-panel.js +3 -1
- 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/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 +72 -101
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/index.js +5 -2
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/index.js +7 -3
- package/src/components/layout/style.scss +2 -4
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +4 -0
- package/src/components/list/table.js +3 -1
- 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/sidebar/index.js +12 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
- 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 +89 -58
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/start-template-options/index.js +19 -27
- package/src/components/start-template-options/style.scss +29 -21
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- 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/template-areas.js +4 -1
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/test/actions.js +6 -14
- package/src/style.scss +4 -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 -50
- 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 -126
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -97
- 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 -40
- 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 -109
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
- 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 -39
- 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 -112
- package/src/hooks/commands/use-wp-admin-commands.js +0 -79
- package/src/utils/history.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +0 -0
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
.edit-site-start-template-options__modal {
|
|
2
|
+
.components-modal__content {
|
|
3
|
+
padding-bottom: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.components-modal__children-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
height: 100%;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
|
|
11
|
+
.edit-site-start-template-options__modal__actions {
|
|
12
|
+
margin-top: auto;
|
|
13
|
+
position: sticky;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
background-color: $white;
|
|
16
|
+
margin-left: - $grid-unit-40;
|
|
17
|
+
margin-right: - $grid-unit-40;
|
|
18
|
+
padding: $grid-unit-30 $grid-unit-40 $grid-unit-40;
|
|
19
|
+
border-top: 1px solid $gray-300;
|
|
20
|
+
z-index: z-index(".edit-site-start-template-options__modal__actions");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.block-editor-block-patterns-list {
|
|
25
|
+
padding-bottom: $grid-unit-40;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
1
29
|
.edit-site-start-template-options__modal-content .block-editor-block-patterns-list {
|
|
2
30
|
column-count: 2;
|
|
3
31
|
column-gap: $grid-unit-30;
|
|
4
32
|
|
|
5
33
|
// Small top padding required to avoid cutting off the visible outline when hovering items
|
|
6
|
-
padding-top: $border-width-focus;
|
|
34
|
+
padding-top: $border-width-focus-fallback;
|
|
7
35
|
|
|
8
36
|
@include break-medium() {
|
|
9
37
|
column-count: 3;
|
|
@@ -28,24 +56,4 @@
|
|
|
28
56
|
box-shadow: 0 0 0 1px $gray-300;
|
|
29
57
|
}
|
|
30
58
|
}
|
|
31
|
-
|
|
32
|
-
// The start blank pattern is the last and we are selecting it.
|
|
33
|
-
.block-editor-block-patterns-list__list-item:nth-last-child(2) {
|
|
34
|
-
.block-editor-block-preview__container {
|
|
35
|
-
position: absolute;
|
|
36
|
-
padding: 0;
|
|
37
|
-
background: #f0f0f0;
|
|
38
|
-
min-height: $grid-unit-50 * 4;
|
|
39
|
-
&::after {
|
|
40
|
-
width: 100%;
|
|
41
|
-
top: 50%;
|
|
42
|
-
margin-top: -1em;
|
|
43
|
-
content: var(--wp-edit-site-start-template-options-start-blank);
|
|
44
|
-
text-align: center;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
iframe {
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
59
|
}
|
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
import { useEffect } from '@wordpress/element';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
7
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
|
-
import { useLocation } from '../routes';
|
|
12
12
|
import { store as editSiteStore } from '../../store';
|
|
13
|
+
import { unlock } from '../../private-apis';
|
|
14
|
+
|
|
15
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
13
16
|
|
|
14
17
|
export default function useInitEditedEntityFromURL() {
|
|
15
18
|
const { params: { postId, postType } = {} } = useLocation();
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect, useRef } from '@wordpress/element';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
11
|
import { store as editSiteStore } from '../../store';
|
|
11
|
-
import { useLocation, useHistory } from '../routes';
|
|
12
12
|
import { unlock } from '../../private-apis';
|
|
13
13
|
|
|
14
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
15
|
+
|
|
14
16
|
export default function useSyncCanvasModeWithURL() {
|
|
15
17
|
const history = useHistory();
|
|
16
18
|
const { params } = useLocation();
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
|
|
5
5
|
import { useEffect, useRef } from '@wordpress/element';
|
|
6
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
9
10
|
*/
|
|
10
|
-
import {
|
|
11
|
+
import { unlock } from '../../private-apis';
|
|
12
|
+
|
|
13
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
11
14
|
|
|
12
15
|
export function getPathFromURL( urlParams ) {
|
|
13
16
|
let path = urlParams?.path ?? '/';
|
|
@@ -17,6 +20,7 @@ export function getPathFromURL( urlParams ) {
|
|
|
17
20
|
switch ( urlParams.postType ) {
|
|
18
21
|
case 'wp_template':
|
|
19
22
|
case 'wp_template_part':
|
|
23
|
+
case 'page':
|
|
20
24
|
path = `/${ encodeURIComponent(
|
|
21
25
|
urlParams.postType
|
|
22
26
|
) }/${ encodeURIComponent( urlParams.postId ) }`;
|
|
@@ -73,6 +77,15 @@ export default function useSyncPathWithURL() {
|
|
|
73
77
|
postId: navigatorParams?.postId,
|
|
74
78
|
path: undefined,
|
|
75
79
|
} );
|
|
80
|
+
} else if (
|
|
81
|
+
navigatorLocation.path.startsWith( '/page/' ) &&
|
|
82
|
+
navigatorParams?.postId
|
|
83
|
+
) {
|
|
84
|
+
updateUrlParams( {
|
|
85
|
+
postType: 'page',
|
|
86
|
+
postId: navigatorParams?.postId,
|
|
87
|
+
path: undefined,
|
|
88
|
+
} );
|
|
76
89
|
} else {
|
|
77
90
|
updateUrlParams( {
|
|
78
91
|
postType: undefined,
|
|
@@ -7,14 +7,17 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
7
7
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
8
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
9
|
import { moreVertical } from '@wordpress/icons';
|
|
10
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
13
14
|
*/
|
|
14
15
|
import { store as editSiteStore } from '../../store';
|
|
15
16
|
import isTemplateRevertable from '../../utils/is-template-revertable';
|
|
16
|
-
import { useLocation } from '../routes';
|
|
17
17
|
import { useLink } from '../routes/link';
|
|
18
|
+
import { unlock } from '../../private-apis';
|
|
19
|
+
|
|
20
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
18
21
|
|
|
19
22
|
function TemplatePartItemMore( {
|
|
20
23
|
onClose,
|
|
@@ -8,12 +8,15 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
8
8
|
import { ToolbarButton } from '@wordpress/components';
|
|
9
9
|
import { addFilter } from '@wordpress/hooks';
|
|
10
10
|
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
11
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
15
|
-
import { useLocation } from '../components/routes';
|
|
16
16
|
import { useLink } from '../components/routes/link';
|
|
17
|
+
import { unlock } from '../private-apis';
|
|
18
|
+
|
|
19
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
17
20
|
|
|
18
21
|
function EditTemplatePartMenuItem( { attributes } ) {
|
|
19
22
|
const { theme, slug } = attributes;
|
package/src/index.js
CHANGED
|
@@ -105,3 +105,4 @@ export function reinitializeEditor() {
|
|
|
105
105
|
export { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';
|
|
106
106
|
export { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';
|
|
107
107
|
export { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';
|
|
108
|
+
export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
|
|
@@ -168,21 +168,13 @@ describe( 'actions', () => {
|
|
|
168
168
|
const ID = 'emptytheme//single';
|
|
169
169
|
const SLUG = 'single';
|
|
170
170
|
|
|
171
|
-
window.fetch = async ( path ) => {
|
|
172
|
-
if ( path === '/?_wp-find-template=true' ) {
|
|
173
|
-
return {
|
|
174
|
-
json: async () => ( { data: { id: ID, slug: SLUG } } ),
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
throw {
|
|
179
|
-
code: 'unknown_path',
|
|
180
|
-
message: `Unknown path: ${ path }`,
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
|
|
184
171
|
apiFetch.setFetchHandler( async ( options ) => {
|
|
185
|
-
const { method = 'GET', path } = options;
|
|
172
|
+
const { method = 'GET', path, url } = options;
|
|
173
|
+
|
|
174
|
+
// Called with url arg in `__experimentalGetTemplateForLink`
|
|
175
|
+
if ( url ) {
|
|
176
|
+
return { data: { id: ID, slug: SLUG } };
|
|
177
|
+
}
|
|
186
178
|
|
|
187
179
|
if ( method === 'GET' ) {
|
|
188
180
|
if ( path.startsWith( '/wp/v2/types' ) ) {
|
package/src/style.scss
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@import "./components/canvas-spinner/style.scss";
|
|
6
6
|
@import "./components/code-editor/style.scss";
|
|
7
7
|
@import "./components/global-styles/style.scss";
|
|
8
|
+
@import "./components/global-styles/screen-revisions/style.scss";
|
|
8
9
|
@import "./components/header-edit-mode/style.scss";
|
|
9
10
|
@import "./components/header-edit-mode/document-actions/style.scss";
|
|
10
11
|
@import "./components/list/style.scss";
|
|
@@ -25,8 +26,10 @@
|
|
|
25
26
|
@import "./components/sidebar-button/style.scss";
|
|
26
27
|
@import "./components/sidebar-navigation-item/style.scss";
|
|
27
28
|
@import "./components/sidebar-navigation-screen/style.scss";
|
|
29
|
+
@import "./components/sidebar-navigation-screen-pages/style.scss";
|
|
28
30
|
@import "./components/sidebar-navigation-screen-template/style.scss";
|
|
29
31
|
@import "./components/sidebar-navigation-screen-templates/style.scss";
|
|
32
|
+
@import "./components/sidebar-navigation-subtitle/style.scss";
|
|
30
33
|
@import "./components/site-hub/style.scss";
|
|
31
34
|
@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";
|
|
32
35
|
@import "./components/site-icon/style.scss";
|
|
@@ -85,7 +88,7 @@ body.site-editor-php {
|
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
.interface-interface-skeleton__content {
|
|
88
|
-
background-color: $gray-
|
|
91
|
+
background-color: $gray-900;
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { getQueryArg } from '@wordpress/url';
|
|
5
|
+
|
|
6
|
+
export function isPreviewingTheme() {
|
|
7
|
+
return (
|
|
8
|
+
window?.__experimentalEnableThemePreviews &&
|
|
9
|
+
getQueryArg( window.location.href, 'theme_preview' ) !== undefined
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function currentlyPreviewingTheme() {
|
|
14
|
+
if ( isPreviewingTheme() ) {
|
|
15
|
+
return getQueryArg( window.location.href, 'theme_preview' );
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { unlock } from '../private-apis';
|
|
10
|
+
import {
|
|
11
|
+
isPreviewingTheme,
|
|
12
|
+
currentlyPreviewingTheme,
|
|
13
|
+
} from './is-previewing-theme';
|
|
14
|
+
|
|
15
|
+
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This should be refactored to use the REST API, once the REST API can activate themes.
|
|
19
|
+
*
|
|
20
|
+
* @return {Function} A function that activates the theme.
|
|
21
|
+
*/
|
|
22
|
+
export function useActivateTheme() {
|
|
23
|
+
const history = useHistory();
|
|
24
|
+
const location = useLocation();
|
|
25
|
+
|
|
26
|
+
return async () => {
|
|
27
|
+
if ( isPreviewingTheme() ) {
|
|
28
|
+
const activationURL =
|
|
29
|
+
'themes.php?action=activate&stylesheet=' +
|
|
30
|
+
currentlyPreviewingTheme() +
|
|
31
|
+
'&_wpnonce=' +
|
|
32
|
+
window.BLOCK_THEME_ACTIVATE_NONCE;
|
|
33
|
+
await window.fetch( activationURL );
|
|
34
|
+
const { theme_preview: themePreview, ...params } = location.params;
|
|
35
|
+
history.replace( params );
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
|
-
var _icons = require("@wordpress/icons");
|
|
13
|
-
|
|
14
|
-
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
|
|
16
|
-
var _data = require("@wordpress/data");
|
|
17
|
-
|
|
18
|
-
var _coreData = require("@wordpress/core-data");
|
|
19
|
-
|
|
20
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
21
|
-
|
|
22
|
-
var _variationsPanel = require("./variations-panel");
|
|
23
|
-
|
|
24
|
-
var _navigationButton = require("./navigation-button");
|
|
25
|
-
|
|
26
|
-
var _iconWithCurrentColor = require("./icon-with-current-color");
|
|
27
|
-
|
|
28
|
-
var _screenVariations = require("./screen-variations");
|
|
29
|
-
|
|
30
|
-
var _privateApis = require("../../private-apis");
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* WordPress dependencies
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Internal dependencies
|
|
38
|
-
*/
|
|
39
|
-
const {
|
|
40
|
-
useHasDimensionsPanel,
|
|
41
|
-
useHasTypographyPanel,
|
|
42
|
-
useHasBorderPanel,
|
|
43
|
-
useHasColorPanel,
|
|
44
|
-
useHasEffectsPanel,
|
|
45
|
-
useHasFiltersPanel,
|
|
46
|
-
useGlobalSetting,
|
|
47
|
-
useSettingsForBlockElement
|
|
48
|
-
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
49
|
-
|
|
50
|
-
function ContextMenu(_ref) {
|
|
51
|
-
let {
|
|
52
|
-
name,
|
|
53
|
-
parentMenu = ''
|
|
54
|
-
} = _ref;
|
|
55
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
56
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
57
|
-
const hasTypographyPanel = useHasTypographyPanel(settings);
|
|
58
|
-
const hasColorPanel = useHasColorPanel(settings);
|
|
59
|
-
const hasBorderPanel = useHasBorderPanel(settings);
|
|
60
|
-
const hasEffectsPanel = useHasEffectsPanel(settings);
|
|
61
|
-
const hasFilterPanel = useHasFiltersPanel(settings);
|
|
62
|
-
const hasDimensionsPanel = useHasDimensionsPanel(settings);
|
|
63
|
-
const hasLayoutPanel = hasDimensionsPanel;
|
|
64
|
-
const hasVariationsPanel = (0, _variationsPanel.useHasVariationsPanel)(name, parentMenu);
|
|
65
|
-
const {
|
|
66
|
-
canEditCSS
|
|
67
|
-
} = (0, _data.useSelect)(select => {
|
|
68
|
-
var _globalStyles$_links$, _globalStyles$_links;
|
|
69
|
-
|
|
70
|
-
const {
|
|
71
|
-
getEntityRecord,
|
|
72
|
-
__experimentalGetCurrentGlobalStylesId
|
|
73
|
-
} = select(_coreData.store);
|
|
74
|
-
|
|
75
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
76
|
-
|
|
77
|
-
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
78
|
-
return {
|
|
79
|
-
canEditCSS: (_globalStyles$_links$ = !!(globalStyles !== null && globalStyles !== void 0 && (_globalStyles$_links = globalStyles._links) !== null && _globalStyles$_links !== void 0 && _globalStyles$_links['wp:action-edit-css'])) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
|
|
80
|
-
};
|
|
81
|
-
}, []);
|
|
82
|
-
const isBlocksPanel = parentMenu.includes('blocks') && !parentMenu.includes('variations');
|
|
83
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalItemGroup, null, hasTypographyPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
84
|
-
icon: _icons.typography,
|
|
85
|
-
path: parentMenu + '/typography',
|
|
86
|
-
"aria-label": (0, _i18n.__)('Typography styles')
|
|
87
|
-
}, (0, _i18n.__)('Typography')), hasColorPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
88
|
-
icon: _icons.color,
|
|
89
|
-
path: parentMenu + '/colors',
|
|
90
|
-
"aria-label": (0, _i18n.__)('Colors styles')
|
|
91
|
-
}, (0, _i18n.__)('Colors')), hasBorderPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
92
|
-
icon: _icons.border,
|
|
93
|
-
path: parentMenu + '/border',
|
|
94
|
-
"aria-label": (0, _i18n.__)('Border')
|
|
95
|
-
}, (0, _i18n.__)('Border')), hasEffectsPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
96
|
-
icon: _icons.shadow,
|
|
97
|
-
path: parentMenu + '/effects',
|
|
98
|
-
"aria-label": (0, _i18n.__)('Effects')
|
|
99
|
-
}, (0, _i18n.__)('Effects')), hasFilterPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
100
|
-
icon: _icons.filter,
|
|
101
|
-
path: parentMenu + '/filters',
|
|
102
|
-
"aria-label": (0, _i18n.__)('Filters styles')
|
|
103
|
-
}, (0, _i18n.__)('Filters')), hasLayoutPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
104
|
-
icon: _icons.layout,
|
|
105
|
-
path: parentMenu + '/layout',
|
|
106
|
-
"aria-label": (0, _i18n.__)('Layout styles')
|
|
107
|
-
}, (0, _i18n.__)('Layout')), hasVariationsPanel && (0, _element.createElement)(_screenVariations.ScreenVariations, {
|
|
108
|
-
name: name,
|
|
109
|
-
path: parentMenu
|
|
110
|
-
}), isBlocksPanel && canEditCSS && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.CardDivider, null), (0, _element.createElement)(_components.CardBody, null, (0, _element.createElement)(_components.__experimentalSpacer, {
|
|
111
|
-
as: "p",
|
|
112
|
-
paddingTop: 2,
|
|
113
|
-
marginBottom: 4
|
|
114
|
-
}, (0, _i18n.__)('Add your own CSS to customize the block appearance.')), (0, _element.createElement)(_components.__experimentalItemGroup, null, (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
115
|
-
path: parentMenu + '/css',
|
|
116
|
-
"aria-label": (0, _i18n.__)('Additional block CSS')
|
|
117
|
-
}, (0, _element.createElement)(_components.__experimentalHStack, {
|
|
118
|
-
justify: "space-between"
|
|
119
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _i18n.__)('Additional block CSS')), (0, _element.createElement)(_iconWithCurrentColor.IconWithCurrentColor, {
|
|
120
|
-
icon: (0, _i18n.isRTL)() ? _icons.chevronLeft : _icons.chevronRight
|
|
121
|
-
}))))), (0, _element.createElement)(_components.CardDivider, null))));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var _default = ContextMenu;
|
|
125
|
-
exports.default = _default;
|
|
126
|
-
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useHasColorPanel","useHasEffectsPanel","useHasFiltersPanel","useGlobalSetting","useSettingsForBlockElement","blockEditorPrivateApis","ContextMenu","name","parentMenu","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasEffectsPanel","hasFilterPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","isBlocksPanel","includes","typography","color","border","shadow","filter","layout","chevronLeft","chevronRight"],"mappings":";;;;;;;;;AAGA;;AAQA;;AAUA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjCA;AACA;AACA;;AAwBA;AACA;AACA;AAOA,MAAM;AACLA,EAAAA,qBADK;AAELC,EAAAA,qBA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;AAHd,KAKG,cAAI,QAAJ,CALH,CA/CF,EAuDGU,kBAAkB,IACnB,4BAAC,kCAAD;AAAkB,IAAA,IAAI,EAAGX,IAAzB;AAAgC,IAAA,IAAI,EAAGC;AAAvC,IAxDF,EA0DGoB,aAAa,IAAIT,UAAjB,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,oBAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,EAAE,EAAC,GAAX;AAAe,IAAA,UAAU,EAAG,CAA5B;AAAgC,IAAA,YAAY,EAAG;AAA/C,KACG,cACD,qDADC,CADH,CADD,EAMC,4BAAC,mCAAD,QACC,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGX,UAAU,GAAG,MADrB;AAEC,kBAAa,cAAI,sBAAJ;AAFd,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,oBAAD,QACG,cAAI,sBAAJ,CADH,CADD,EAIC,4BAAC,0CAAD;AACC,IAAA,IAAI,EACH,qBACG4B,kBADH,GAEGC;AAJL,IAJD,CAJD,CADD,CAND,CAFD,EA4BC,4BAAC,uBAAD,OA5BD,CA3DF,CADD,CADD;AA+FA;;eAEc/B,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\tFlexItem,\n\tCardBody,\n\tCardDivider,\n} from '@wordpress/components';\nimport {\n\ttypography,\n\tborder,\n\tfilter,\n\tshadow,\n\tcolor,\n\tlayout,\n\tchevronLeft,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\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 { useHasVariationsPanel } from './variations-panel';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { ScreenVariations } from './screen-variations';\nimport { unlock } from '../../private-apis';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseHasColorPanel,\n\tuseHasEffectsPanel,\n\tuseHasFiltersPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n} = unlock( blockEditorPrivateApis );\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\tconst hasFilterPanel = useHasFiltersPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\tconst hasVariationsPanel = useHasVariationsPanel( name, parentMenu );\n\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\tconst isBlocksPanel =\n\t\tparentMenu.includes( 'blocks' ) &&\n\t\t! parentMenu.includes( 'variations' );\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBorderPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ border }\n\t\t\t\t\t\tpath={ parentMenu + '/border' }\n\t\t\t\t\t\taria-label={ __( 'Border' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Border' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasEffectsPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ shadow }\n\t\t\t\t\t\tpath={ parentMenu + '/effects' }\n\t\t\t\t\t\taria-label={ __( 'Effects' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Effects' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasFilterPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ filter }\n\t\t\t\t\t\tpath={ parentMenu + '/filters' }\n\t\t\t\t\t\taria-label={ __( 'Filters styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Filters' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasVariationsPanel && (\n\t\t\t\t\t<ScreenVariations name={ name } path={ parentMenu } />\n\t\t\t\t) }\n\t\t\t\t{ isBlocksPanel && canEditCSS && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<Spacer as=\"p\" paddingTop={ 2 } marginBottom={ 4 }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Add your own CSS to customize the block appearance.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\t\tpath={ parentMenu + '/css' }\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronRight\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default ContextMenu;\n"]}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
|
-
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
|
|
16
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
-
|
|
18
|
-
var _icons = require("@wordpress/icons");
|
|
19
|
-
|
|
20
|
-
var _privateApis = require("../../private-apis");
|
|
21
|
-
|
|
22
|
-
var _subtitle = _interopRequireDefault(require("./subtitle"));
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
const {
|
|
32
|
-
useGlobalStyle
|
|
33
|
-
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
34
|
-
|
|
35
|
-
function CustomCSSControl(_ref) {
|
|
36
|
-
let {
|
|
37
|
-
blockName
|
|
38
|
-
} = _ref;
|
|
39
|
-
// If blockName is defined, we are customizing CSS at the block level:
|
|
40
|
-
// styles.blocks.blockName.css
|
|
41
|
-
const block = !!blockName ? blockName : null;
|
|
42
|
-
const [customCSS, setCustomCSS] = useGlobalStyle('css', block);
|
|
43
|
-
const [themeCSS] = useGlobalStyle('css', block, 'base');
|
|
44
|
-
const [cssError, setCSSError] = (0, _element.useState)(null);
|
|
45
|
-
const ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */'; // If there is custom css from theme.json show it in the edit box
|
|
46
|
-
// so the user can selectively overwrite it, rather than have the user CSS
|
|
47
|
-
// completely overwrite the theme CSS by default.
|
|
48
|
-
|
|
49
|
-
const themeCustomCSS = !customCSS && themeCSS ? `/* ${(0, _i18n.__)('Theme Custom CSS start')} */\n${themeCSS}\n/* ${(0, _i18n.__)('Theme Custom CSS end')} */` : undefined;
|
|
50
|
-
|
|
51
|
-
function handleOnChange(value) {
|
|
52
|
-
// If there is theme custom CSS, but the user clears the input box then save the
|
|
53
|
-
// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.
|
|
54
|
-
if (themeCSS && value === '') {
|
|
55
|
-
setCustomCSS(ignoreThemeCustomCSS);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
setCustomCSS(value);
|
|
60
|
-
|
|
61
|
-
if (cssError) {
|
|
62
|
-
const [transformed] = (0, _blockEditor.transformStyles)([{
|
|
63
|
-
css: value
|
|
64
|
-
}], '.editor-styles-wrapper');
|
|
65
|
-
|
|
66
|
-
if (transformed) {
|
|
67
|
-
setCSSError(null);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function handleOnBlur(event) {
|
|
73
|
-
var _event$target;
|
|
74
|
-
|
|
75
|
-
if (!(event !== null && event !== void 0 && (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.value)) {
|
|
76
|
-
setCSSError(null);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const [transformed] = (0, _blockEditor.transformStyles)([{
|
|
81
|
-
css: event.target.value
|
|
82
|
-
}], '.editor-styles-wrapper');
|
|
83
|
-
setCSSError(transformed === null ? (0, _i18n.__)('There is an error with your CSS structure.') : null);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const originalThemeCustomCSS = themeCSS && customCSS && themeCustomCSS !== customCSS ? themeCSS : undefined;
|
|
87
|
-
return (0, _element.createElement)(_element.Fragment, null, originalThemeCustomCSS && (0, _element.createElement)(_components.Panel, null, (0, _element.createElement)(_components.PanelBody, {
|
|
88
|
-
title: (0, _i18n.__)('Original Theme Custom CSS'),
|
|
89
|
-
initialOpen: false
|
|
90
|
-
}, (0, _element.createElement)("pre", {
|
|
91
|
-
className: "edit-site-global-styles__custom-css-theme-css"
|
|
92
|
-
}, originalThemeCustomCSS))), (0, _element.createElement)(_components.__experimentalVStack, {
|
|
93
|
-
spacing: 3
|
|
94
|
-
}, (0, _element.createElement)(_subtitle.default, null, (0, _i18n.__)('Additional CSS')), (0, _element.createElement)(_components.TextareaControl, {
|
|
95
|
-
__nextHasNoMarginBottom: true,
|
|
96
|
-
value: (customCSS === null || customCSS === void 0 ? void 0 : customCSS.replace(ignoreThemeCustomCSS, '')) || themeCustomCSS,
|
|
97
|
-
onChange: value => handleOnChange(value),
|
|
98
|
-
onBlur: handleOnBlur,
|
|
99
|
-
className: "edit-site-global-styles__custom-css-input",
|
|
100
|
-
spellCheck: false
|
|
101
|
-
}), cssError && (0, _element.createElement)(_components.Tooltip, {
|
|
102
|
-
text: cssError
|
|
103
|
-
}, (0, _element.createElement)("div", {
|
|
104
|
-
className: "edit-site-global-styles__custom-css-validation-wrapper"
|
|
105
|
-
}, (0, _element.createElement)(_components.Icon, {
|
|
106
|
-
icon: _icons.info,
|
|
107
|
-
className: "edit-site-global-styles__custom-css-validation-icon"
|
|
108
|
-
})))));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
var _default = CustomCSSControl;
|
|
112
|
-
exports.default = _default;
|
|
113
|
-
//# sourceMappingURL=custom-css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/custom-css.js"],"names":["useGlobalStyle","blockEditorPrivateApis","CustomCSSControl","blockName","block","customCSS","setCustomCSS","themeCSS","cssError","setCSSError","ignoreThemeCustomCSS","themeCustomCSS","undefined","handleOnChange","value","transformed","css","handleOnBlur","event","target","originalThemeCustomCSS","replace","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C,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGc,WADR;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,CADD,CAdF,CAbD,CADD;AAwCA;;eAEcpB,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tTextareaControl,\n\tPanel,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\tTooltip,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\ttransformStyles,\n} from '@wordpress/block-editor';\nimport { info } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport Subtitle from './subtitle';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nfunction CustomCSSControl( { blockName } ) {\n\t// If blockName is defined, we are customizing CSS at the block level:\n\t// styles.blocks.blockName.css\n\tconst block = !! blockName ? blockName : null;\n\n\tconst [ customCSS, setCustomCSS ] = useGlobalStyle( 'css', block );\n\tconst [ themeCSS ] = useGlobalStyle( 'css', block, 'base' );\n\tconst [ cssError, setCSSError ] = useState( null );\n\tconst ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */';\n\n\t// If there is custom css from theme.json show it in the edit box\n\t// so the user can selectively overwrite it, rather than have the user CSS\n\t// completely overwrite the theme CSS by default.\n\tconst themeCustomCSS =\n\t\t! customCSS && themeCSS\n\t\t\t? `/* ${ __(\n\t\t\t\t\t'Theme Custom CSS start'\n\t\t\t ) } */\\n${ themeCSS }\\n/* ${ __( 'Theme Custom CSS end' ) } */`\n\t\t\t: undefined;\n\n\tfunction handleOnChange( value ) {\n\t\t// If there is theme custom CSS, but the user clears the input box then save the\n\t\t// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.\n\t\tif ( themeCSS && value === '' ) {\n\t\t\tsetCustomCSS( ignoreThemeCustomCSS );\n\t\t\treturn;\n\t\t}\n\t\tsetCustomCSS( value );\n\t\tif ( cssError ) {\n\t\t\tconst [ transformed ] = transformStyles(\n\t\t\t\t[ { css: value } ],\n\t\t\t\t'.editor-styles-wrapper'\n\t\t\t);\n\t\t\tif ( transformed ) {\n\t\t\t\tsetCSSError( null );\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction handleOnBlur( event ) {\n\t\tif ( ! event?.target?.value ) {\n\t\t\tsetCSSError( null );\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ transformed ] = transformStyles(\n\t\t\t[ { css: event.target.value } ],\n\t\t\t'.editor-styles-wrapper'\n\t\t);\n\n\t\tsetCSSError(\n\t\t\ttransformed === null\n\t\t\t\t? __( 'There is an error with your CSS structure.' )\n\t\t\t\t: null\n\t\t);\n\t}\n\n\tconst originalThemeCustomCSS =\n\t\tthemeCSS && customCSS && themeCustomCSS !== customCSS\n\t\t\t? themeCSS\n\t\t\t: undefined;\n\n\treturn (\n\t\t<>\n\t\t\t{ originalThemeCustomCSS && (\n\t\t\t\t<Panel>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\ttitle={ __( 'Original Theme Custom CSS' ) }\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<pre className=\"edit-site-global-styles__custom-css-theme-css\">\n\t\t\t\t\t\t\t{ originalThemeCustomCSS }\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</Panel>\n\t\t\t) }\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t<Subtitle>{ __( 'Additional CSS' ) }</Subtitle>\n\t\t\t\t<TextareaControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tcustomCSS?.replace( ignoreThemeCustomCSS, '' ) ||\n\t\t\t\t\t\tthemeCustomCSS\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( value ) => handleOnChange( value ) }\n\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\tclassName=\"edit-site-global-styles__custom-css-input\"\n\t\t\t\t\tspellCheck={ false }\n\t\t\t\t/>\n\t\t\t\t{ cssError && (\n\t\t\t\t\t<Tooltip text={ cssError }>\n\t\t\t\t\t\t<div className=\"edit-site-global-styles__custom-css-validation-wrapper\">\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ info }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles__custom-css-validation-icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default CustomCSSControl;\n"]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = EffectsPanel;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
|
|
12
|
-
var _privateApis = require("../../private-apis");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
const {
|
|
22
|
-
useGlobalSetting,
|
|
23
|
-
useGlobalStyle,
|
|
24
|
-
EffectsPanel: StylesEffectsPanel,
|
|
25
|
-
useSettingsForBlockElement
|
|
26
|
-
} = (0, _privateApis.unlock)(_blockEditor.privateApis);
|
|
27
|
-
|
|
28
|
-
function EffectsPanel(_ref) {
|
|
29
|
-
let {
|
|
30
|
-
name,
|
|
31
|
-
variation = ''
|
|
32
|
-
} = _ref;
|
|
33
|
-
let prefixParts = [];
|
|
34
|
-
|
|
35
|
-
if (variation) {
|
|
36
|
-
prefixParts = ['variations', variation].concat(prefixParts);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const prefix = prefixParts.join('.');
|
|
40
|
-
const [style] = useGlobalStyle(prefix, name, 'user', false);
|
|
41
|
-
const [inheritedStyle, setStyle] = useGlobalStyle(prefix, name, 'all', {
|
|
42
|
-
shouldDecodeEncode: false
|
|
43
|
-
});
|
|
44
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
45
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
46
|
-
return (0, _element.createElement)(StylesEffectsPanel, {
|
|
47
|
-
inheritedValue: inheritedStyle,
|
|
48
|
-
value: style,
|
|
49
|
-
onChange: setStyle,
|
|
50
|
-
settings: settings
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=effects-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/effects-panel.js"],"names":["useGlobalSetting","useGlobalStyle","EffectsPanel","StylesEffectsPanel","useSettingsForBlockElement","blockEditorPrivateApis","name","variation","prefixParts","concat","prefix","join","style","inheritedStyle","setStyle","shouldDecodeEncode","rawSettings","settings"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AACLA,EAAAA,gBADK;AAELC,EAAAA,cAFK;AAGLC,EAAAA,YAAY,EAAEC,kBAHT;AAILC,EAAAA;AAJK,IAKF,yBAAQC,wBAAR,CALJ;;AAOe,SAASH,YAAT,OAAkD;AAAA,MAA3B;AAAEI,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AAChE,MAAIC,WAAW,GAAG,EAAlB;;AACA,MAAKD,SAAL,EAAiB;AAChBC,IAAAA,WAAW,GAAG,CAAE,YAAF,EAAgBD,SAAhB,EAA4BE,MAA5B,CAAoCD,WAApC,CAAd;AACA;;AACD,QAAME,MAAM,GAAGF,WAAW,CAACG,IAAZ,CAAkB,GAAlB,CAAf;AAEA,QAAM,CAAEC,KAAF,IAAYX,cAAc,CAAES,MAAF,EAAUJ,IAAV,EAAgB,MAAhB,EAAwB,KAAxB,CAAhC;AACA,QAAM,CAAEO,cAAF,EAAkBC,QAAlB,IAA+Bb,cAAc,CAAES,MAAF,EAAUJ,IAAV,EAAgB,KAAhB,EAAuB;AACzES,IAAAA,kBAAkB,EAAE;AADqD,GAAvB,CAAnD;AAGA,QAAM,CAAEC,WAAF,IAAkBhB,gBAAgB,CAAE,EAAF,EAAMM,IAAN,CAAxC;AACA,QAAMW,QAAQ,GAAGb,0BAA0B,CAAEY,WAAF,EAAeV,IAAf,CAA3C;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,cAAc,EAAGO,cADlB;AAEC,IAAA,KAAK,EAAGD,KAFT;AAGC,IAAA,QAAQ,EAAGE,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\tuseGlobalSetting,\n\tuseGlobalStyle,\n\tEffectsPanel: StylesEffectsPanel,\n\tuseSettingsForBlockElement,\n} = unlock( blockEditorPrivateApis );\n\nexport default function EffectsPanel( { name, variation = '' } ) {\n\tlet prefixParts = [];\n\tif ( variation ) {\n\t\tprefixParts = [ 'variations', variation ].concat( prefixParts );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, name, 'user', false );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\n\treturn (\n\t\t<StylesEffectsPanel\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"]}
|