@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/utils/history.js"],"names":["history","originalHistoryPush","push","originalHistoryReplace","replace","params","state","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","newUrl","call"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,OAAO,GAAG,oCAAhB;AAEA,MAAMC,mBAAmB,GAAGD,OAAO,CAACE,IAApC;AACA,MAAMC,sBAAsB,GAAGH,OAAO,CAACI,OAAvC;;AAEA,SAASF,IAAT,CAAeG,MAAf,EAAuBC,KAAvB,EAA+B;AAC9B,QAAMC,WAAW,GAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,CAApB;AACA,QAAMC,qBAAqB,GAAG,0BAC7BH,MAAM,CAACC,QAAP,CAAgBC,IADa,EAE7B,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAF0B,CAA9B;AAIA,QAAMO,MAAM,GAAG,uBAAcH,qBAAd,EAAqCN,MAArC,CAAf;AACA,SAAOJ,mBAAmB,CAACc,IAApB,CAA0Bf,OAA1B,EAAmCc,MAAnC,EAA2CR,KAA3C,CAAP;AACA;;AAED,SAASF,OAAT,CAAkBC,MAAlB,EAA0BC,KAA1B,EAAkC;AACjC,QAAMC,WAAW,GAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,CAApB;AACA,QAAMC,qBAAqB,GAAG,0BAC7BH,MAAM,CAACC,QAAP,CAAgBC,IADa,EAE7B,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAF0B,CAA9B;AAIA,QAAMO,MAAM,GAAG,uBAAcH,qBAAd,EAAqCN,MAArC,CAAf;AACA,SAAOF,sBAAsB,CAACY,IAAvB,CAA6Bf,OAA7B,EAAsCc,MAAtC,EAA8CR,KAA9C,CAAP;AACA;;AAEDN,OAAO,CAACE,IAAR,GAAeA,IAAf;AACAF,OAAO,CAACI,OAAR,GAAkBA,OAAlB;eAEeJ,O","sourcesContent":["/**\n * External dependencies\n */\nimport { createBrowserHistory } from 'history';\n\n/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\n\nconst history = createBrowserHistory();\n\nconst originalHistoryPush = history.push;\nconst originalHistoryReplace = history.replace;\n\nfunction push( params, state ) {\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\treturn originalHistoryPush.call( history, newUrl, state );\n}\n\nfunction replace( params, state ) {\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\treturn originalHistoryReplace.call( history, newUrl, state );\n}\n\nhistory.push = push;\nhistory.replace = replace;\n\nexport default history;\n"]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalSpacer as Spacer, FlexItem, CardBody, CardDivider } from '@wordpress/components';
|
|
7
|
-
import { typography, border, filter, shadow, color, layout, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
8
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
9
|
-
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { useHasVariationsPanel } from './variations-panel';
|
|
17
|
-
import { NavigationButtonAsItem } from './navigation-button';
|
|
18
|
-
import { IconWithCurrentColor } from './icon-with-current-color';
|
|
19
|
-
import { ScreenVariations } from './screen-variations';
|
|
20
|
-
import { unlock } from '../../private-apis';
|
|
21
|
-
const {
|
|
22
|
-
useHasDimensionsPanel,
|
|
23
|
-
useHasTypographyPanel,
|
|
24
|
-
useHasBorderPanel,
|
|
25
|
-
useHasColorPanel,
|
|
26
|
-
useHasEffectsPanel,
|
|
27
|
-
useHasFiltersPanel,
|
|
28
|
-
useGlobalSetting,
|
|
29
|
-
useSettingsForBlockElement
|
|
30
|
-
} = unlock(blockEditorPrivateApis);
|
|
31
|
-
|
|
32
|
-
function ContextMenu(_ref) {
|
|
33
|
-
let {
|
|
34
|
-
name,
|
|
35
|
-
parentMenu = ''
|
|
36
|
-
} = _ref;
|
|
37
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
38
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
39
|
-
const hasTypographyPanel = useHasTypographyPanel(settings);
|
|
40
|
-
const hasColorPanel = useHasColorPanel(settings);
|
|
41
|
-
const hasBorderPanel = useHasBorderPanel(settings);
|
|
42
|
-
const hasEffectsPanel = useHasEffectsPanel(settings);
|
|
43
|
-
const hasFilterPanel = useHasFiltersPanel(settings);
|
|
44
|
-
const hasDimensionsPanel = useHasDimensionsPanel(settings);
|
|
45
|
-
const hasLayoutPanel = hasDimensionsPanel;
|
|
46
|
-
const hasVariationsPanel = useHasVariationsPanel(name, parentMenu);
|
|
47
|
-
const {
|
|
48
|
-
canEditCSS
|
|
49
|
-
} = useSelect(select => {
|
|
50
|
-
var _globalStyles$_links$, _globalStyles$_links;
|
|
51
|
-
|
|
52
|
-
const {
|
|
53
|
-
getEntityRecord,
|
|
54
|
-
__experimentalGetCurrentGlobalStylesId
|
|
55
|
-
} = select(coreStore);
|
|
56
|
-
|
|
57
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
58
|
-
|
|
59
|
-
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
60
|
-
return {
|
|
61
|
-
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
|
|
62
|
-
};
|
|
63
|
-
}, []);
|
|
64
|
-
const isBlocksPanel = parentMenu.includes('blocks') && !parentMenu.includes('variations');
|
|
65
|
-
return createElement(Fragment, null, createElement(ItemGroup, null, hasTypographyPanel && createElement(NavigationButtonAsItem, {
|
|
66
|
-
icon: typography,
|
|
67
|
-
path: parentMenu + '/typography',
|
|
68
|
-
"aria-label": __('Typography styles')
|
|
69
|
-
}, __('Typography')), hasColorPanel && createElement(NavigationButtonAsItem, {
|
|
70
|
-
icon: color,
|
|
71
|
-
path: parentMenu + '/colors',
|
|
72
|
-
"aria-label": __('Colors styles')
|
|
73
|
-
}, __('Colors')), hasBorderPanel && createElement(NavigationButtonAsItem, {
|
|
74
|
-
icon: border,
|
|
75
|
-
path: parentMenu + '/border',
|
|
76
|
-
"aria-label": __('Border')
|
|
77
|
-
}, __('Border')), hasEffectsPanel && createElement(NavigationButtonAsItem, {
|
|
78
|
-
icon: shadow,
|
|
79
|
-
path: parentMenu + '/effects',
|
|
80
|
-
"aria-label": __('Effects')
|
|
81
|
-
}, __('Effects')), hasFilterPanel && createElement(NavigationButtonAsItem, {
|
|
82
|
-
icon: filter,
|
|
83
|
-
path: parentMenu + '/filters',
|
|
84
|
-
"aria-label": __('Filters styles')
|
|
85
|
-
}, __('Filters')), hasLayoutPanel && createElement(NavigationButtonAsItem, {
|
|
86
|
-
icon: layout,
|
|
87
|
-
path: parentMenu + '/layout',
|
|
88
|
-
"aria-label": __('Layout styles')
|
|
89
|
-
}, __('Layout')), hasVariationsPanel && createElement(ScreenVariations, {
|
|
90
|
-
name: name,
|
|
91
|
-
path: parentMenu
|
|
92
|
-
}), isBlocksPanel && canEditCSS && createElement(Fragment, null, createElement(CardDivider, null), createElement(CardBody, null, createElement(Spacer, {
|
|
93
|
-
as: "p",
|
|
94
|
-
paddingTop: 2,
|
|
95
|
-
marginBottom: 4
|
|
96
|
-
}, __('Add your own CSS to customize the block appearance.')), createElement(ItemGroup, null, createElement(NavigationButtonAsItem, {
|
|
97
|
-
path: parentMenu + '/css',
|
|
98
|
-
"aria-label": __('Additional block CSS')
|
|
99
|
-
}, createElement(HStack, {
|
|
100
|
-
justify: "space-between"
|
|
101
|
-
}, createElement(FlexItem, null, __('Additional block CSS')), createElement(IconWithCurrentColor, {
|
|
102
|
-
icon: isRTL() ? chevronLeft : chevronRight
|
|
103
|
-
}))))), createElement(CardDivider, null))));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export default ContextMenu;
|
|
107
|
-
//# sourceMappingURL=context-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","FlexItem","CardBody","CardDivider","typography","border","filter","shadow","color","layout","chevronLeft","chevronRight","isRTL","__","useSelect","store","coreStore","privateApis","blockEditorPrivateApis","useHasVariationsPanel","NavigationButtonAsItem","IconWithCurrentColor","ScreenVariations","unlock","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useHasColorPanel","useHasEffectsPanel","useHasFiltersPanel","useGlobalSetting","useSettingsForBlockElement","ContextMenu","name","parentMenu","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasEffectsPanel","hasFilterPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","isBlocksPanel","includes"],"mappings":"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","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,98 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { useState } from '@wordpress/element';
|
|
7
|
-
import { TextareaControl, Panel, PanelBody, __experimentalVStack as VStack, Tooltip, Icon } from '@wordpress/components';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { privateApis as blockEditorPrivateApis, transformStyles } from '@wordpress/block-editor';
|
|
10
|
-
import { info } from '@wordpress/icons';
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { unlock } from '../../private-apis';
|
|
16
|
-
import Subtitle from './subtitle';
|
|
17
|
-
const {
|
|
18
|
-
useGlobalStyle
|
|
19
|
-
} = unlock(blockEditorPrivateApis);
|
|
20
|
-
|
|
21
|
-
function CustomCSSControl(_ref) {
|
|
22
|
-
let {
|
|
23
|
-
blockName
|
|
24
|
-
} = _ref;
|
|
25
|
-
// If blockName is defined, we are customizing CSS at the block level:
|
|
26
|
-
// styles.blocks.blockName.css
|
|
27
|
-
const block = !!blockName ? blockName : null;
|
|
28
|
-
const [customCSS, setCustomCSS] = useGlobalStyle('css', block);
|
|
29
|
-
const [themeCSS] = useGlobalStyle('css', block, 'base');
|
|
30
|
-
const [cssError, setCSSError] = useState(null);
|
|
31
|
-
const ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */'; // If there is custom css from theme.json show it in the edit box
|
|
32
|
-
// so the user can selectively overwrite it, rather than have the user CSS
|
|
33
|
-
// completely overwrite the theme CSS by default.
|
|
34
|
-
|
|
35
|
-
const themeCustomCSS = !customCSS && themeCSS ? `/* ${__('Theme Custom CSS start')} */\n${themeCSS}\n/* ${__('Theme Custom CSS end')} */` : undefined;
|
|
36
|
-
|
|
37
|
-
function handleOnChange(value) {
|
|
38
|
-
// If there is theme custom CSS, but the user clears the input box then save the
|
|
39
|
-
// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.
|
|
40
|
-
if (themeCSS && value === '') {
|
|
41
|
-
setCustomCSS(ignoreThemeCustomCSS);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setCustomCSS(value);
|
|
46
|
-
|
|
47
|
-
if (cssError) {
|
|
48
|
-
const [transformed] = transformStyles([{
|
|
49
|
-
css: value
|
|
50
|
-
}], '.editor-styles-wrapper');
|
|
51
|
-
|
|
52
|
-
if (transformed) {
|
|
53
|
-
setCSSError(null);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function handleOnBlur(event) {
|
|
59
|
-
var _event$target;
|
|
60
|
-
|
|
61
|
-
if (!(event !== null && event !== void 0 && (_event$target = event.target) !== null && _event$target !== void 0 && _event$target.value)) {
|
|
62
|
-
setCSSError(null);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const [transformed] = transformStyles([{
|
|
67
|
-
css: event.target.value
|
|
68
|
-
}], '.editor-styles-wrapper');
|
|
69
|
-
setCSSError(transformed === null ? __('There is an error with your CSS structure.') : null);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const originalThemeCustomCSS = themeCSS && customCSS && themeCustomCSS !== customCSS ? themeCSS : undefined;
|
|
73
|
-
return createElement(Fragment, null, originalThemeCustomCSS && createElement(Panel, null, createElement(PanelBody, {
|
|
74
|
-
title: __('Original Theme Custom CSS'),
|
|
75
|
-
initialOpen: false
|
|
76
|
-
}, createElement("pre", {
|
|
77
|
-
className: "edit-site-global-styles__custom-css-theme-css"
|
|
78
|
-
}, originalThemeCustomCSS))), createElement(VStack, {
|
|
79
|
-
spacing: 3
|
|
80
|
-
}, createElement(Subtitle, null, __('Additional CSS')), createElement(TextareaControl, {
|
|
81
|
-
__nextHasNoMarginBottom: true,
|
|
82
|
-
value: (customCSS === null || customCSS === void 0 ? void 0 : customCSS.replace(ignoreThemeCustomCSS, '')) || themeCustomCSS,
|
|
83
|
-
onChange: value => handleOnChange(value),
|
|
84
|
-
onBlur: handleOnBlur,
|
|
85
|
-
className: "edit-site-global-styles__custom-css-input",
|
|
86
|
-
spellCheck: false
|
|
87
|
-
}), cssError && createElement(Tooltip, {
|
|
88
|
-
text: cssError
|
|
89
|
-
}, createElement("div", {
|
|
90
|
-
className: "edit-site-global-styles__custom-css-validation-wrapper"
|
|
91
|
-
}, createElement(Icon, {
|
|
92
|
-
icon: info,
|
|
93
|
-
className: "edit-site-global-styles__custom-css-validation-icon"
|
|
94
|
-
})))));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export default CustomCSSControl;
|
|
98
|
-
//# sourceMappingURL=custom-css.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/custom-css.js"],"names":["useState","TextareaControl","Panel","PanelBody","__experimentalVStack","VStack","Tooltip","Icon","__","privateApis","blockEditorPrivateApis","transformStyles","info","unlock","Subtitle","useGlobalStyle","CustomCSSControl","blockName","block","customCSS","setCustomCSS","themeCSS","cssError","setCSSError","ignoreThemeCustomCSS","themeCustomCSS","undefined","handleOnChange","value","transformed","css","handleOnBlur","event","target","originalThemeCustomCSS","replace"],"mappings":"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","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,43 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { unlock } from '../../private-apis';
|
|
12
|
-
const {
|
|
13
|
-
useGlobalSetting,
|
|
14
|
-
useGlobalStyle,
|
|
15
|
-
EffectsPanel: StylesEffectsPanel,
|
|
16
|
-
useSettingsForBlockElement
|
|
17
|
-
} = unlock(blockEditorPrivateApis);
|
|
18
|
-
export default function EffectsPanel(_ref) {
|
|
19
|
-
let {
|
|
20
|
-
name,
|
|
21
|
-
variation = ''
|
|
22
|
-
} = _ref;
|
|
23
|
-
let prefixParts = [];
|
|
24
|
-
|
|
25
|
-
if (variation) {
|
|
26
|
-
prefixParts = ['variations', variation].concat(prefixParts);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const prefix = prefixParts.join('.');
|
|
30
|
-
const [style] = useGlobalStyle(prefix, name, 'user', false);
|
|
31
|
-
const [inheritedStyle, setStyle] = useGlobalStyle(prefix, name, 'all', {
|
|
32
|
-
shouldDecodeEncode: false
|
|
33
|
-
});
|
|
34
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
35
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
36
|
-
return createElement(StylesEffectsPanel, {
|
|
37
|
-
inheritedValue: inheritedStyle,
|
|
38
|
-
value: style,
|
|
39
|
-
onChange: setStyle,
|
|
40
|
-
settings: settings
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=effects-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/effects-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalSetting","useGlobalStyle","EffectsPanel","StylesEffectsPanel","useSettingsForBlockElement","name","variation","prefixParts","concat","prefix","join","style","inheritedStyle","setStyle","shouldDecodeEncode","rawSettings","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AACLC,EAAAA,gBADK;AAELC,EAAAA,cAFK;AAGLC,EAAAA,YAAY,EAAEC,kBAHT;AAILC,EAAAA;AAJK,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASI,YAAT,OAAkD;AAAA,MAA3B;AAAEG,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,IAAYV,cAAc,CAAEQ,MAAF,EAAUJ,IAAV,EAAgB,MAAhB,EAAwB,KAAxB,CAAhC;AACA,QAAM,CAAEO,cAAF,EAAkBC,QAAlB,IAA+BZ,cAAc,CAAEQ,MAAF,EAAUJ,IAAV,EAAgB,KAAhB,EAAuB;AACzES,IAAAA,kBAAkB,EAAE;AADqD,GAAvB,CAAnD;AAGA,QAAM,CAAEC,WAAF,IAAkBf,gBAAgB,CAAE,EAAF,EAAMK,IAAN,CAAxC;AACA,QAAMW,QAAQ,GAAGZ,0BAA0B,CAAEW,WAAF,EAAeV,IAAf,CAA3C;AAEA,SACC,cAAC,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"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { unlock } from '../../private-apis';
|
|
12
|
-
const {
|
|
13
|
-
useGlobalStyle,
|
|
14
|
-
useGlobalSetting,
|
|
15
|
-
useSettingsForBlockElement,
|
|
16
|
-
FiltersPanel: StylesFiltersPanel
|
|
17
|
-
} = unlock(blockEditorPrivateApis);
|
|
18
|
-
export default function FiltersPanel(_ref) {
|
|
19
|
-
let {
|
|
20
|
-
name
|
|
21
|
-
} = _ref;
|
|
22
|
-
const [style] = useGlobalStyle('', name, 'user', false);
|
|
23
|
-
const [inheritedStyle, setStyle] = useGlobalStyle('', name, 'all', {
|
|
24
|
-
shouldDecodeEncode: false
|
|
25
|
-
});
|
|
26
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
27
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
28
|
-
return createElement(StylesFiltersPanel, {
|
|
29
|
-
inheritedValue: inheritedStyle,
|
|
30
|
-
value: style,
|
|
31
|
-
onChange: setStyle,
|
|
32
|
-
settings: settings
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=filters-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/filters-panel.js"],"names":["privateApis","blockEditorPrivateApis","unlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","FiltersPanel","StylesFiltersPanel","name","style","inheritedStyle","setStyle","shouldDecodeEncode","rawSettings","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,MAAM;AACLC,EAAAA,cADK;AAELC,EAAAA,gBAFK;AAGLC,EAAAA,0BAHK;AAILC,EAAAA,YAAY,EAAEC;AAJT,IAKFL,MAAM,CAAED,sBAAF,CALV;AAOA,eAAe,SAASK,YAAT,OAAkC;AAAA,MAAX;AAAEE,IAAAA;AAAF,GAAW;AAChD,QAAM,CAAEC,KAAF,IAAYN,cAAc,CAAE,EAAF,EAAMK,IAAN,EAAY,MAAZ,EAAoB,KAApB,CAAhC;AACA,QAAM,CAAEE,cAAF,EAAkBC,QAAlB,IAA+BR,cAAc,CAAE,EAAF,EAAMK,IAAN,EAAY,KAAZ,EAAmB;AACrEI,IAAAA,kBAAkB,EAAE;AADiD,GAAnB,CAAnD;AAGA,QAAM,CAAEC,WAAF,IAAkBT,gBAAgB,CAAE,EAAF,EAAMI,IAAN,CAAxC;AACA,QAAMM,QAAQ,GAAGT,0BAA0B,CAAEQ,WAAF,EAAeL,IAAf,CAA3C;AAEA,SACC,cAAC,kBAAD;AACC,IAAA,cAAc,EAAGE,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';\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tFiltersPanel: StylesFiltersPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function FiltersPanel( { name } ) {\n\tconst [ style ] = useGlobalStyle( '', name, 'user', false );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', 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<StylesFiltersPanel\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"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import ScreenHeader from './header';
|
|
13
|
-
import BorderPanel from './border-panel';
|
|
14
|
-
import BlockPreviewPanel from './block-preview-panel';
|
|
15
|
-
import { getVariationClassName } from './utils';
|
|
16
|
-
import { unlock } from '../../private-apis';
|
|
17
|
-
const {
|
|
18
|
-
useHasBorderPanel,
|
|
19
|
-
useGlobalSetting,
|
|
20
|
-
useSettingsForBlockElement
|
|
21
|
-
} = unlock(blockEditorPrivateApis);
|
|
22
|
-
|
|
23
|
-
function ScreenBorder(_ref) {
|
|
24
|
-
let {
|
|
25
|
-
name,
|
|
26
|
-
variation = ''
|
|
27
|
-
} = _ref;
|
|
28
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
29
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
30
|
-
const hasBorderPanel = useHasBorderPanel(settings);
|
|
31
|
-
const variationClassName = getVariationClassName(variation);
|
|
32
|
-
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
33
|
-
title: __('Border')
|
|
34
|
-
}), createElement(BlockPreviewPanel, {
|
|
35
|
-
name: name,
|
|
36
|
-
variation: variationClassName
|
|
37
|
-
}), hasBorderPanel && createElement(BorderPanel, {
|
|
38
|
-
name: name,
|
|
39
|
-
variation: variation
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default ScreenBorder;
|
|
44
|
-
//# sourceMappingURL=screen-border.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-border.js"],"names":["__","privateApis","blockEditorPrivateApis","ScreenHeader","BorderPanel","BlockPreviewPanel","getVariationClassName","unlock","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","ScreenBorder","name","variation","rawSettings","settings","hasBorderPanel","variationClassName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA,iBAAF;AAAqBC,EAAAA,gBAArB;AAAuCC,EAAAA;AAAvC,IACLH,MAAM,CAAEL,sBAAF,CADP;;AAGA,SAASS,YAAT,OAAkD;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AACjD,QAAM,CAAEC,WAAF,IAAkBL,gBAAgB,CAAE,EAAF,EAAMG,IAAN,CAAxC;AACA,QAAMG,QAAQ,GAAGL,0BAA0B,CAAEI,WAAF,EAAeF,IAAf,CAA3C;AACA,QAAMI,cAAc,GAAGR,iBAAiB,CAAEO,QAAF,CAAxC;AACA,QAAME,kBAAkB,GAAGX,qBAAqB,CAAEO,SAAF,CAAhD;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGb,EAAE,CAAE,QAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGY,IAA1B;AAAiC,IAAA,SAAS,EAAGK;AAA7C,IAFD,EAGGD,cAAc,IACf,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGJ,IAApB;AAA2B,IAAA,SAAS,EAAGC;AAAvC,IAJF,CADD;AASA;;AAED,eAAeF,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BorderPanel from './border-panel';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { getVariationClassName } from './utils';\nimport { unlock } from '../../private-apis';\n\nconst { useHasBorderPanel, useGlobalSetting, useSettingsForBlockElement } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenBorder( { name, variation = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst variationClassName = getVariationClassName( variation );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Border' ) } />\n\t\t\t<BlockPreviewPanel name={ name } variation={ variationClassName } />\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel name={ name } variation={ variation } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBorder;\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import ScreenHeader from './header';
|
|
13
|
-
import BlockPreviewPanel from './block-preview-panel';
|
|
14
|
-
import { getVariationClassName } from './utils';
|
|
15
|
-
import { unlock } from '../../private-apis';
|
|
16
|
-
import EffectsPanel from './effects-panel';
|
|
17
|
-
const {
|
|
18
|
-
useGlobalSetting,
|
|
19
|
-
useSettingsForBlockElement,
|
|
20
|
-
useHasEffectsPanel
|
|
21
|
-
} = unlock(blockEditorPrivateApis);
|
|
22
|
-
|
|
23
|
-
function ScreenEffects(_ref) {
|
|
24
|
-
let {
|
|
25
|
-
name,
|
|
26
|
-
variation = ''
|
|
27
|
-
} = _ref;
|
|
28
|
-
const [rawSettings] = useGlobalSetting('', name);
|
|
29
|
-
const settings = useSettingsForBlockElement(rawSettings, name);
|
|
30
|
-
const variationClassName = getVariationClassName(variation);
|
|
31
|
-
const hasEffectsPanel = useHasEffectsPanel(settings);
|
|
32
|
-
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
33
|
-
title: __('Effects')
|
|
34
|
-
}), createElement(BlockPreviewPanel, {
|
|
35
|
-
name: name,
|
|
36
|
-
variation: variationClassName
|
|
37
|
-
}), hasEffectsPanel && createElement(EffectsPanel, {
|
|
38
|
-
name: name,
|
|
39
|
-
variation: variation
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default ScreenEffects;
|
|
44
|
-
//# sourceMappingURL=screen-effects.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-effects.js"],"names":["__","privateApis","blockEditorPrivateApis","ScreenHeader","BlockPreviewPanel","getVariationClassName","unlock","EffectsPanel","useGlobalSetting","useSettingsForBlockElement","useHasEffectsPanel","ScreenEffects","name","variation","rawSettings","settings","variationClassName","hasEffectsPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AAEA,MAAM;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA,0BAApB;AAAgDC,EAAAA;AAAhD,IACLJ,MAAM,CAAEJ,sBAAF,CADP;;AAGA,SAASS,aAAT,OAAmD;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AAClD,QAAM,CAAEC,WAAF,IAAkBN,gBAAgB,CAAE,EAAF,EAAMI,IAAN,CAAxC;AACA,QAAMG,QAAQ,GAAGN,0BAA0B,CAAEK,WAAF,EAAeF,IAAf,CAA3C;AACA,QAAMI,kBAAkB,GAAGX,qBAAqB,CAAEQ,SAAF,CAAhD;AACA,QAAMI,eAAe,GAAGP,kBAAkB,CAAEK,QAAF,CAA1C;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGf,EAAE,CAAE,SAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGY,IAA1B;AAAiC,IAAA,SAAS,EAAGI;AAA7C,IAFD,EAGGC,eAAe,IAChB,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGL,IAArB;AAA4B,IAAA,SAAS,EAAGC;AAAxC,IAJF,CADD;AASA;;AAED,eAAeF,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { getVariationClassName } from './utils';\nimport { unlock } from '../../private-apis';\nimport EffectsPanel from './effects-panel';\n\nconst { useGlobalSetting, useSettingsForBlockElement, useHasEffectsPanel } =\n\tunlock( blockEditorPrivateApis );\n\nfunction ScreenEffects( { name, variation = '' } ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', name );\n\tconst settings = useSettingsForBlockElement( rawSettings, name );\n\tconst variationClassName = getVariationClassName( variation );\n\tconst hasEffectsPanel = useHasEffectsPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Effects' ) } />\n\t\t\t<BlockPreviewPanel name={ name } variation={ variationClassName } />\n\t\t\t{ hasEffectsPanel && (\n\t\t\t\t<EffectsPanel name={ name } variation={ variation } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenEffects;\n"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import FiltersPanel from './filters-panel';
|
|
12
|
-
import BlockPreviewPanel from './block-preview-panel';
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import ScreenHeader from './header';
|
|
18
|
-
|
|
19
|
-
function ScreenFilters(_ref) {
|
|
20
|
-
let {
|
|
21
|
-
name
|
|
22
|
-
} = _ref;
|
|
23
|
-
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
24
|
-
title: __('Filters')
|
|
25
|
-
}), createElement(BlockPreviewPanel, {
|
|
26
|
-
name: name
|
|
27
|
-
}), createElement(FiltersPanel, {
|
|
28
|
-
name: name
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default ScreenFilters;
|
|
33
|
-
//# sourceMappingURL=screen-filters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-filters.js"],"names":["__","FiltersPanel","BlockPreviewPanel","ScreenHeader","ScreenFilters","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;;AAEA,SAASC,aAAT,OAAmC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAClC,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGL,EAAE,CAAE,SAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGK;AAA1B,IAFD,EAGC,cAAC,YAAD;AAAc,IAAA,IAAI,EAAGA;AAArB,IAHD,CADD;AAOA;;AAED,eAAeD,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport FiltersPanel from './filters-panel';\nimport BlockPreviewPanel from './block-preview-panel';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\n\nfunction ScreenFilters( { name } ) {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Filters' ) } />\n\t\t\t<BlockPreviewPanel name={ name } />\n\t\t\t<FiltersPanel name={ name } />\n\t\t</>\n\t);\n}\n\nexport default ScreenFilters;\n"]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { VariationPanel, VariationsPanel, useHasVariationsPanel } from './variations-panel';
|
|
13
|
-
import ScreenHeader from './header';
|
|
14
|
-
import BlockPreviewPanel from './block-preview-panel';
|
|
15
|
-
import Subtitle from './subtitle';
|
|
16
|
-
export function ScreenVariations(_ref) {
|
|
17
|
-
let {
|
|
18
|
-
name,
|
|
19
|
-
path = ''
|
|
20
|
-
} = _ref;
|
|
21
|
-
const hasVariationsPanel = useHasVariationsPanel(name, path);
|
|
22
|
-
|
|
23
|
-
if (!hasVariationsPanel) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return createElement("div", {
|
|
28
|
-
className: "edit-site-global-styles-screen-variations"
|
|
29
|
-
}, createElement(VStack, {
|
|
30
|
-
spacing: 3
|
|
31
|
-
}, createElement(Subtitle, null, __('Style Variations')), createElement(VariationsPanel, {
|
|
32
|
-
name: name
|
|
33
|
-
})));
|
|
34
|
-
}
|
|
35
|
-
export function ScreenVariation(_ref2) {
|
|
36
|
-
let {
|
|
37
|
-
blockName,
|
|
38
|
-
style
|
|
39
|
-
} = _ref2;
|
|
40
|
-
const {
|
|
41
|
-
name: styleName,
|
|
42
|
-
label: styleLabel
|
|
43
|
-
} = style;
|
|
44
|
-
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
45
|
-
title: styleLabel
|
|
46
|
-
}), createElement(BlockPreviewPanel, {
|
|
47
|
-
name: blockName,
|
|
48
|
-
variation: `is-style-${styleName}`
|
|
49
|
-
}), createElement(VariationPanel, {
|
|
50
|
-
blockName: blockName,
|
|
51
|
-
styleName: styleName
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=screen-variations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-variations.js"],"names":["__","__experimentalVStack","VStack","VariationPanel","VariationsPanel","useHasVariationsPanel","ScreenHeader","BlockPreviewPanel","Subtitle","ScreenVariations","name","path","hasVariationsPanel","ScreenVariation","blockName","style","styleName","label","styleLabel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,oBAAoB,IAAIC,MAAjC,QAA+C,uBAA/C;AACA;AACA;AACA;;AACA,SACCC,cADD,EAECC,eAFD,EAGCC,qBAHD,QAIO,oBAJP;AAKA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,QAAP,MAAqB,YAArB;AAEA,OAAO,SAASC,gBAAT,OAAiD;AAAA,MAAtB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAI,GAAG;AAAf,GAAsB;AACvD,QAAMC,kBAAkB,GAAGP,qBAAqB,CAAEK,IAAF,EAAQC,IAAR,CAAhD;;AAEA,MAAK,CAAEC,kBAAP,EAA4B;AAC3B,WAAO,IAAP;AACA;;AACD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,cAAC,QAAD,QAAYZ,EAAE,CAAE,kBAAF,CAAd,CADD,EAEC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAGU;AAAxB,IAFD,CADD,CADD;AAQA;AAED,OAAO,SAASG,eAAT,QAAiD;AAAA,MAAvB;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAAuB;AACvD,QAAM;AAAEL,IAAAA,IAAI,EAAEM,SAAR;AAAmBC,IAAAA,KAAK,EAAEC;AAA1B,MAAyCH,KAA/C;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGG;AAAtB,IADD,EAEC,cAAC,iBAAD;AACC,IAAA,IAAI,EAAGJ,SADR;AAEC,IAAA,SAAS,EAAI,YAAYE,SAAW;AAFrC,IAFD,EAMC,cAAC,cAAD;AAAgB,IAAA,SAAS,EAAGF,SAA5B;AAAwC,IAAA,SAAS,EAAGE;AAApD,IAND,CADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport {\n\tVariationPanel,\n\tVariationsPanel,\n\tuseHasVariationsPanel,\n} from './variations-panel';\nimport ScreenHeader from './header';\nimport BlockPreviewPanel from './block-preview-panel';\nimport Subtitle from './subtitle';\n\nexport function ScreenVariations( { name, path = '' } ) {\n\tconst hasVariationsPanel = useHasVariationsPanel( name, path );\n\n\tif ( ! hasVariationsPanel ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<div className=\"edit-site-global-styles-screen-variations\">\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t<Subtitle>{ __( 'Style Variations' ) }</Subtitle>\n\t\t\t\t<VariationsPanel name={ name } />\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport function ScreenVariation( { blockName, style } ) {\n\tconst { name: styleName, label: styleLabel } = style;\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ styleLabel } />\n\t\t\t<BlockPreviewPanel\n\t\t\t\tname={ blockName }\n\t\t\t\tvariation={ `is-style-${ styleName }` }\n\t\t\t/>\n\t\t\t<VariationPanel blockName={ blockName } styleName={ styleName } />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { createContext, useState, useEffect, useContext } from '@wordpress/element';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import history from '../../utils/history';
|
|
12
|
-
const RoutesContext = createContext();
|
|
13
|
-
const HistoryContext = createContext();
|
|
14
|
-
export function useLocation() {
|
|
15
|
-
return useContext(RoutesContext);
|
|
16
|
-
}
|
|
17
|
-
export function useHistory() {
|
|
18
|
-
return useContext(HistoryContext);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function getLocationWithParams(location) {
|
|
22
|
-
const searchParams = new URLSearchParams(location.search);
|
|
23
|
-
return { ...location,
|
|
24
|
-
params: Object.fromEntries(searchParams.entries())
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function Routes(_ref) {
|
|
29
|
-
let {
|
|
30
|
-
children
|
|
31
|
-
} = _ref;
|
|
32
|
-
const [location, setLocation] = useState(() => getLocationWithParams(history.location));
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
return history.listen(_ref2 => {
|
|
35
|
-
let {
|
|
36
|
-
location: updatedLocation
|
|
37
|
-
} = _ref2;
|
|
38
|
-
setLocation(getLocationWithParams(updatedLocation));
|
|
39
|
-
});
|
|
40
|
-
}, []);
|
|
41
|
-
return createElement(HistoryContext.Provider, {
|
|
42
|
-
value: history
|
|
43
|
-
}, createElement(RoutesContext.Provider, {
|
|
44
|
-
value: location
|
|
45
|
-
}, children));
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/index.js"],"names":["createContext","useState","useEffect","useContext","history","RoutesContext","HistoryContext","useLocation","useHistory","getLocationWithParams","location","searchParams","URLSearchParams","search","params","Object","fromEntries","entries","Routes","children","setLocation","listen","updatedLocation"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,SAHD,EAICC,UAJD,QAKO,oBALP;AAOA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,qBAApB;AAEA,MAAMC,aAAa,GAAGL,aAAa,EAAnC;AACA,MAAMM,cAAc,GAAGN,aAAa,EAApC;AAEA,OAAO,SAASO,WAAT,GAAuB;AAC7B,SAAOJ,UAAU,CAAEE,aAAF,CAAjB;AACA;AAED,OAAO,SAASG,UAAT,GAAsB;AAC5B,SAAOL,UAAU,CAAEG,cAAF,CAAjB;AACA;;AAED,SAASG,qBAAT,CAAgCC,QAAhC,EAA2C;AAC1C,QAAMC,YAAY,GAAG,IAAIC,eAAJ,CAAqBF,QAAQ,CAACG,MAA9B,CAArB;AACA,SAAO,EACN,GAAGH,QADG;AAENI,IAAAA,MAAM,EAAEC,MAAM,CAACC,WAAP,CAAoBL,YAAY,CAACM,OAAb,EAApB;AAFF,GAAP;AAIA;;AAED,OAAO,SAASC,MAAT,OAAgC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACtC,QAAM,CAAET,QAAF,EAAYU,WAAZ,IAA4BnB,QAAQ,CAAE,MAC3CQ,qBAAqB,CAAEL,OAAO,CAACM,QAAV,CADoB,CAA1C;AAIAR,EAAAA,SAAS,CAAE,MAAM;AAChB,WAAOE,OAAO,CAACiB,MAAR,CAAgB,SAAqC;AAAA,UAAnC;AAAEX,QAAAA,QAAQ,EAAEY;AAAZ,OAAmC;AAC3DF,MAAAA,WAAW,CAAEX,qBAAqB,CAAEa,eAAF,CAAvB,CAAX;AACA,KAFM,CAAP;AAGA,GAJQ,EAIN,EAJM,CAAT;AAMA,SACC,cAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAGlB;AAAjC,KACC,cAAC,aAAD,CAAe,QAAf;AAAwB,IAAA,KAAK,EAAGM;AAAhC,KACGS,QADH,CADD,CADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport history from '../../utils/history';\n\nconst RoutesContext = createContext();\nconst HistoryContext = createContext();\n\nexport function useLocation() {\n\treturn useContext( RoutesContext );\n}\n\nexport function useHistory() {\n\treturn useContext( HistoryContext );\n}\n\nfunction getLocationWithParams( location ) {\n\tconst searchParams = new URLSearchParams( location.search );\n\treturn {\n\t\t...location,\n\t\tparams: Object.fromEntries( searchParams.entries() ),\n\t};\n}\n\nexport function Routes( { children } ) {\n\tconst [ location, setLocation ] = useState( () =>\n\t\tgetLocationWithParams( history.location )\n\t);\n\n\tuseEffect( () => {\n\t\treturn history.listen( ( { location: updatedLocation } ) => {\n\t\t\tsetLocation( getLocationWithParams( updatedLocation ) );\n\t\t} );\n\t}, [] );\n\n\treturn (\n\t\t<HistoryContext.Provider value={ history }>\n\t\t\t<RoutesContext.Provider value={ location }>\n\t\t\t\t{ children }\n\t\t\t</RoutesContext.Provider>\n\t\t</HistoryContext.Provider>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-card/last-revision.js"],"names":["Button","sprintf","_n","backup","addQueryArgs","PostTypeSupportCheck","useEditedEntityRecord","useRevisionData","record","currentTemplate","lastRevisionId","_links","id","revisionsCount","count","PostLastRevisionCheck","children","PostLastRevision","revision","gutenberg","LastRevision"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,kBAAvB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,oBAAT,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,gCAAlC;;AAEA,MAAMC,eAAe,GAAG,MAAM;AAAA;;AAC7B,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAA8BH,qBAAqB,EAAzD;AAEA,QAAMI,cAAc,4BACnBD,eADmB,aACnBA,eADmB,iDACnBA,eAAe,CAAEE,MADE,qFACnB,uBAA2B,qBAA3B,CADmB,qFACnB,uBAAsD,CAAtD,CADmB,2DACnB,uBAA2DC,EADxC,yEAC8C,IADlE;AAGA,QAAMC,cAAc,GACnB,2BAAEJ,eAAF,aAAEA,eAAF,iDAAEA,eAAe,CAAEE,MAAnB,qFAAE,uBAA2B,iBAA3B,CAAF,qFAAE,uBAAkD,CAAlD,CAAF,2DAAE,uBAAuDG,KAAzD,2EAAkE,CAAlE,IACA,CAFD;AAIA,SAAO;AACNL,IAAAA,eADM;AAENC,IAAAA,cAFM;AAGNG,IAAAA;AAHM,GAAP;AAKA,CAfD;;AAiBA,SAASE,qBAAT,OAA+C;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC9C,QAAM;AAAEN,IAAAA,cAAF;AAAkBG,IAAAA;AAAlB,MAAqCN,eAAe,EAA1D;;AAEA,MAAK,CAAEG,cAAF,IAAoBG,cAAc,GAAG,CAA1C,EAA8C;AAC7C,WAAO,IAAP;AACA;;AAED,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACGG,QADH,CADD;AAKA;;AAED,MAAMC,gBAAgB,GAAG,MAAM;AAC9B,QAAM;AAAEP,IAAAA,cAAF;AAAkBG,IAAAA;AAAlB,MAAqCN,eAAe,EAA1D;AAEA,SACC,cAAC,qBAAD,QACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGH,YAAY,CAAE,cAAF,EAAkB;AACpCc,MAAAA,QAAQ,EAAER,cAD0B;AAEpCS,MAAAA,SAAS,EAAE;AAFyB,KAAlB,CADpB;AAKC,IAAA,SAAS,EAAC,yCALX;AAMC,IAAA,IAAI,EAAGhB;AANR,KAQGF,OAAO;AACR;AACAC,EAAAA,EAAE,CAAE,aAAF,EAAiB,cAAjB,EAAiCW,cAAjC,CAFM,EAGRA,cAHQ,CARV,CADD,CADD;AAkBA,CArBD;;AAuBA,eAAe,SAASO,YAAT,GAAwB;AACtC,SACC,cAAC,qBAAD,QACC,cAAC,gBAAD,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { sprintf, _n } from '@wordpress/i18n';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\nimport { PostTypeSupportCheck } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../../use-edited-entity-record';\n\nconst useRevisionData = () => {\n\tconst { record: currentTemplate } = useEditedEntityRecord();\n\n\tconst lastRevisionId =\n\t\tcurrentTemplate?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\n\tconst revisionsCount =\n\t\t( currentTemplate?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0 ) +\n\t\t1;\n\n\treturn {\n\t\tcurrentTemplate,\n\t\tlastRevisionId,\n\t\trevisionsCount,\n\t};\n};\n\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useRevisionData();\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nconst PostLastRevision = () => {\n\tconst { lastRevisionId, revisionsCount } = useRevisionData();\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t\tgutenberg: true,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"edit-site-template-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %d: number of revisions */\n\t\t\t\t\t_n( '%d Revision', '%d Revisions', revisionsCount ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t</Button>\n\t\t</PostLastRevisionCheck>\n\t);\n};\n\nexport default function LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostLastRevision />\n\t\t</PostLastRevisionCheck>\n\t);\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useNavigationCommands } from './use-navigation-commands';
|
|
5
|
-
import { useWPAdminCommands } from './use-wp-admin-commands';
|
|
6
|
-
export function useCommands() {
|
|
7
|
-
useWPAdminCommands();
|
|
8
|
-
useNavigationCommands();
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=index.js.map
|