@wordpress/edit-site 5.28.5 → 5.30.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/actions/index.js +1 -1
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +10 -11
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +2 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/code-editor/index.js +3 -2
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/editor/index.js +5 -19
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +9 -0
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +11 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +5 -16
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +2 -2
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +27 -0
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +50 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +131 -0
- package/build/components/global-styles/preview-iframe.js.map +1 -0
- package/build/components/global-styles/preview-styles.js +163 -0
- package/build/components/global-styles/preview-styles.js.map +1 -0
- package/build/components/global-styles/preview-typography.js +65 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- 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.js +10 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +12 -84
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -0
- package/build/components/global-styles/utils.js +22 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +90 -0
- package/build/components/global-styles/variations/variation.js.map +1 -0
- package/build/components/global-styles/variations/variations-color.js +36 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -0
- package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build/components/global-styles/variations/variations-typography.js +64 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/document-tools/index.js +1 -2
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -13
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +17 -6
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -18
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +4 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +0 -1
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
- package/build/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +14 -6
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-button/index.js +2 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-panel/index.js +18 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +48 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +3 -171
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +4 -5
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +156 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build/store/actions.js +19 -50
- package/build/store/actions.js.map +1 -1
- package/build/utils/clone-deep.js +15 -0
- package/build/utils/clone-deep.js.map +1 -0
- package/build-module/components/actions/index.js +1 -1
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +10 -11
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +2 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/code-editor/index.js +3 -2
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +6 -20
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +2 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -0
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +12 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -18
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -2
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +26 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +43 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +54 -0
- package/build-module/components/global-styles/preview-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-iframe.js +124 -0
- package/build-module/components/global-styles/preview-iframe.js.map +1 -0
- package/build-module/components/global-styles/preview-styles.js +155 -0
- package/build-module/components/global-styles/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/preview-typography.js +58 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +10 -2
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- 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.js +10 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +13 -85
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- package/build-module/components/global-styles/utils.js +21 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +82 -0
- package/build-module/components/global-styles/variations/variation.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-color.js +28 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
- package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js +56 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/document-tools/index.js +1 -2
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +17 -14
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +19 -8
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -13
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -18
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +5 -3
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +25 -8
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +0 -1
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +13 -5
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +18 -3
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -5
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +20 -5
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +50 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +2 -9
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -172
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +144 -0
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -0
- package/build-module/store/actions.js +19 -50
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/clone-deep.js +9 -0
- package/build-module/utils/clone-deep.js.map +1 -0
- package/build-style/style-rtl.css +152 -472
- package/build-style/style.css +152 -472
- package/package.json +43 -42
- package/src/components/actions/index.js +1 -1
- package/src/components/block-editor/editor-canvas.js +13 -12
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/block-editor/use-site-editor-settings.js +1 -0
- package/src/components/code-editor/index.js +3 -2
- package/src/components/editor/index.js +10 -27
- package/src/components/editor-canvas-container/index.js +2 -5
- package/src/components/{test → error-boundary/test}/error-boundary.js +7 -5
- package/src/components/global-styles/color-palette-panel.js +11 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +24 -0
- package/src/components/global-styles/font-library-modal/font-collection.js +7 -24
- package/src/components/global-styles/font-library-modal/index.js +2 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/library-font-variant.js +1 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/utils/index.js +34 -0
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +2 -1
- package/src/components/global-styles/gradients-palette-panel.js +2 -2
- package/src/components/global-styles/header.js +1 -1
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +153 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/preview-typography.js +62 -0
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +4 -1
- package/src/components/global-styles/screen-colors.js +13 -1
- package/src/components/global-styles/screen-revisions/style.scss +2 -2
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography.js +19 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +1 -35
- package/src/components/global-styles/utils.js +37 -0
- package/src/components/global-styles/variations/style.scss +44 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +30 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +85 -0
- package/src/components/header-edit-mode/document-tools/index.js +1 -2
- package/src/components/header-edit-mode/index.js +22 -31
- package/src/components/header-edit-mode/more-menu/index.js +25 -11
- package/src/components/header-edit-mode/style.scss +4 -0
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -11
- package/src/components/keyboard-shortcuts/register.js +0 -19
- package/src/components/layout/index.js +5 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +41 -10
- package/src/components/page-patterns/header.js +1 -0
- package/src/components/page-patterns/index.js +1 -2
- package/src/components/page-patterns/style.scss +0 -182
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +20 -3
- package/src/components/page-templates-template-parts/style.scss +48 -0
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-button/index.js +2 -1
- package/src/components/save-hub/style.scss +1 -1
- package/src/components/save-panel/index.js +34 -12
- package/src/components/sidebar/index.js +1 -1
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +5 -7
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/style.scss +4 -0
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +37 -24
- package/src/components/sidebar-edit-mode/template-panel/index.js +76 -18
- package/src/components/sidebar-edit-mode/template-panel/style.scss +5 -14
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +1 -12
- package/src/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/start-template-options/index.js +1 -1
- package/src/hooks/commands/use-edit-mode-commands.js +3 -184
- package/src/hooks/index.js +0 -1
- package/src/hooks/push-changes-to-global-styles/index.js +1 -4
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1137 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +159 -0
- package/src/store/actions.js +21 -85
- package/src/store/test/actions.js +0 -75
- package/src/style.scss +3 -8
- package/src/utils/clone-deep.js +8 -0
- package/build/components/global-styles/preview.js +0 -271
- package/build/components/global-styles/preview.js.map +0 -1
- package/build/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build/components/global-styles/variations-panel.js.map +0 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -62
- package/build/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build/components/list/added-by.js.map +0 -1
- package/build/components/list/header.js +0 -55
- package/build/components/list/header.js.map +0 -1
- package/build/components/list/index.js +0 -80
- package/build/components/list/index.js.map +0 -1
- package/build/components/list/table.js +0 -94
- package/build/components/list/table.js.map +0 -1
- package/build/components/list/use-register-shortcuts.js +0 -51
- package/build/components/list/use-register-shortcuts.js.map +0 -1
- package/build/components/page-patterns/duplicate-menu-item.js +0 -93
- package/build/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build/components/page-patterns/grid-item.js +0 -223
- package/build/components/page-patterns/grid-item.js.map +0 -1
- package/build/components/page-patterns/grid.js +0 -31
- package/build/components/page-patterns/grid.js.map +0 -1
- package/build/components/page-patterns/no-patterns.js +0 -18
- package/build/components/page-patterns/no-patterns.js.map +0 -1
- package/build/components/page-patterns/patterns-list.js +0 -168
- package/build/components/page-patterns/patterns-list.js.map +0 -1
- package/build/components/page-patterns/rename-menu-item.js +0 -105
- package/build/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -83
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +0 -36
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build/hooks/navigation-menu-edit.js +0 -82
- package/build/hooks/navigation-menu-edit.js.map +0 -1
- package/build-module/components/global-styles/preview.js +0 -264
- package/build-module/components/global-styles/preview.js.map +0 -1
- package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build-module/components/global-styles/variations-panel.js.map +0 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -56
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +0 -1
- package/build-module/components/list/added-by.js.map +0 -1
- package/build-module/components/list/header.js +0 -47
- package/build-module/components/list/header.js.map +0 -1
- package/build-module/components/list/index.js +0 -72
- package/build-module/components/list/index.js.map +0 -1
- package/build-module/components/list/table.js +0 -86
- package/build-module/components/list/table.js.map +0 -1
- package/build-module/components/list/use-register-shortcuts.js +0 -45
- package/build-module/components/list/use-register-shortcuts.js.map +0 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +0 -85
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +0 -1
- package/build-module/components/page-patterns/grid-item.js +0 -215
- package/build-module/components/page-patterns/grid-item.js.map +0 -1
- package/build-module/components/page-patterns/grid.js +0 -23
- package/build-module/components/page-patterns/grid.js.map +0 -1
- package/build-module/components/page-patterns/no-patterns.js +0 -11
- package/build-module/components/page-patterns/no-patterns.js.map +0 -1
- package/build-module/components/page-patterns/patterns-list.js +0 -160
- package/build-module/components/page-patterns/patterns-list.js.map +0 -1
- package/build-module/components/page-patterns/rename-menu-item.js +0 -98
- package/build-module/components/page-patterns/rename-menu-item.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -76
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -29
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build-module/hooks/navigation-menu-edit.js +0 -75
- package/build-module/hooks/navigation-menu-edit.js.map +0 -1
- package/src/components/global-styles/preview.js +0 -327
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -60
- package/src/components/list/header.js +0 -48
- package/src/components/list/index.js +0 -87
- package/src/components/list/style.scss +0 -188
- package/src/components/list/table.js +0 -140
- package/src/components/list/use-register-shortcuts.js +0 -49
- package/src/components/page-patterns/duplicate-menu-item.js +0 -105
- package/src/components/page-patterns/grid-item.js +0 -331
- package/src/components/page-patterns/grid.js +0 -22
- package/src/components/page-patterns/no-patterns.js +0 -12
- package/src/components/page-patterns/patterns-list.js +0 -229
- package/src/components/page-patterns/rename-menu-item.js +0 -132
- package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +0 -89
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
- package/src/hooks/navigation-menu-edit.js +0 -92
- /package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_coreData","_data","_element","_i18n","_notices","_constants","RenameMenuItem","item","onClose","title","setTitle","useState","isModalOpen","setIsModalOpen","editEntityRecord","saveEditedEntityRecord","useDispatch","coreStore","createSuccessNotice","createErrorNotice","noticesStore","type","TEMPLATE_PART_POST_TYPE","isCustom","onRename","event","preventDefault","id","throwOnError","__","error","fallbackErrorMessage","errorMessage","message","code","_react","createElement","Fragment","MenuItem","onClick","Modal","onRequestClose","overlayClassName","onSubmit","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","value","onChange","required","__experimentalHStack","justify","Button","variant"],"sources":["@wordpress/edit-site/src/components/page-patterns/rename-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tMenuItem,\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nexport default function RenameMenuItem( { item, onClose } ) {\n\tconst [ title, setTitle ] = useState( () => item.title );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tif ( item.type === TEMPLATE_PART_POST_TYPE && ! item.isCustom ) {\n\t\treturn null;\n\t}\n\n\tasync function onRename( event ) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', item.type, item.id, { title } );\n\n\t\t\t// Update state before saving rerenders the list.\n\t\t\tsetTitle( '' );\n\t\t\tsetIsModalOpen( false );\n\t\t\tonClose();\n\n\t\t\t// Persist edited entity.\n\t\t\tawait saveEditedEntityRecord( 'postType', item.type, item.id, {\n\t\t\t\tthrowOnError: true,\n\t\t\t} );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\titem.type === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t? __( 'Template part renamed.' )\n\t\t\t\t\t: __( 'Pattern renamed.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst fallbackErrorMessage =\n\t\t\t\titem.type === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'An error occurred while renaming the template part.'\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'An error occurred while renaming the pattern.' );\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: fallbackErrorMessage;\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\tsetTitle( item.title );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ onRename }>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t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AI,EAAC;EAAQ,GAEX,IAAAQ,QAAE,EAAE,MAAO,CACN,CACD,CACD,CACH,CACA,CAEP,CAAC;AAEL"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = ReplaceTemplateButton;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
var _components = require("@wordpress/components");
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
var _coreData = require("@wordpress/core-data");
|
|
14
|
-
var _compose = require("@wordpress/compose");
|
|
15
|
-
var _blocks = require("@wordpress/blocks");
|
|
16
|
-
var _store = require("../../../store");
|
|
17
|
-
/**
|
|
18
|
-
* WordPress dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Internal dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
function ReplaceTemplateButton({
|
|
26
|
-
onClick,
|
|
27
|
-
availableTemplates
|
|
28
|
-
}) {
|
|
29
|
-
const {
|
|
30
|
-
editEntityRecord
|
|
31
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
32
|
-
const [showModal, setShowModal] = (0, _element.useState)(false);
|
|
33
|
-
const onClose = () => {
|
|
34
|
-
setShowModal(false);
|
|
35
|
-
};
|
|
36
|
-
const {
|
|
37
|
-
postId,
|
|
38
|
-
postType
|
|
39
|
-
} = (0, _data.useSelect)(select => {
|
|
40
|
-
return {
|
|
41
|
-
postId: select(_store.store).getEditedPostId(),
|
|
42
|
-
postType: select(_store.store).getEditedPostType()
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
|
-
const onTemplateSelect = async selectedTemplate => {
|
|
46
|
-
onClose(); // Close the template suggestions modal first.
|
|
47
|
-
onClick();
|
|
48
|
-
await editEntityRecord('postType', postType, postId, {
|
|
49
|
-
blocks: selectedTemplate.blocks,
|
|
50
|
-
content: (0, _blocks.serialize)(selectedTemplate.blocks)
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
if (!availableTemplates.length || availableTemplates.length < 1) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuItem, {
|
|
57
|
-
info: (0, _i18n.__)('Replace the contents of this template with another.'),
|
|
58
|
-
onClick: () => setShowModal(true)
|
|
59
|
-
}, (0, _i18n.__)('Replace template')), showModal && (0, _react.createElement)(_components.Modal, {
|
|
60
|
-
title: (0, _i18n.__)('Choose a template'),
|
|
61
|
-
onRequestClose: onClose,
|
|
62
|
-
overlayClassName: "edit-site-template-panel__replace-template-modal",
|
|
63
|
-
isFullScreen: true
|
|
64
|
-
}, (0, _react.createElement)("div", {
|
|
65
|
-
className: "edit-site-template-panel__replace-template-modal__content"
|
|
66
|
-
}, (0, _react.createElement)(TemplatesList, {
|
|
67
|
-
availableTemplates: availableTemplates,
|
|
68
|
-
onSelect: onTemplateSelect
|
|
69
|
-
}))));
|
|
70
|
-
}
|
|
71
|
-
function TemplatesList({
|
|
72
|
-
availableTemplates,
|
|
73
|
-
onSelect
|
|
74
|
-
}) {
|
|
75
|
-
const shownTemplates = (0, _compose.useAsyncList)(availableTemplates);
|
|
76
|
-
return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
|
|
77
|
-
label: (0, _i18n.__)('Templates'),
|
|
78
|
-
blockPatterns: availableTemplates,
|
|
79
|
-
shownPatterns: shownTemplates,
|
|
80
|
-
onClickPattern: onSelect
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=replace-template-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_blockEditor","_components","_i18n","_coreData","_compose","_blocks","_store","ReplaceTemplateButton","onClick","availableTemplates","editEntityRecord","useDispatch","coreStore","showModal","setShowModal","useState","onClose","postId","postType","useSelect","select","editSiteStore","getEditedPostId","getEditedPostType","onTemplateSelect","selectedTemplate","blocks","content","serialize","length","_react","createElement","Fragment","MenuItem","info","__","Modal","title","onRequestClose","overlayClassName","isFullScreen","className","TemplatesList","onSelect","shownTemplates","useAsyncList","__experimentalBlockPatternsList","label","blockPatterns","shownPatterns","onClickPattern"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/replace-template-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { MenuItem, Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nexport default function ReplaceTemplateButton( {\n\tonClick,\n\tavailableTemplates,\n} ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ showModal, setShowModal ] = useState( false );\n\tconst onClose = () => {\n\t\tsetShowModal( false );\n\t};\n\n\tconst { postId, postType } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostId: select( editSiteStore ).getEditedPostId(),\n\t\t\tpostType: select( editSiteStore ).getEditedPostType(),\n\t\t};\n\t}, [] );\n\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tonClose(); // Close the template suggestions modal first.\n\t\tonClick();\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\n\tif ( ! availableTemplates.length || availableTemplates.length < 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Replace the contents of this template with another.'\n\t\t\t\t) }\n\t\t\t\tonClick={ () => setShowModal( true ) }\n\t\t\t>\n\t\t\t\t{ __( 'Replace template' ) }\n\t\t\t</MenuItem>\n\n\t\t\t{ showModal && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Choose a template' ) }\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\toverlayClassName=\"edit-site-template-panel__replace-template-modal\"\n\t\t\t\t\tisFullScreen\n\t\t\t\t>\n\t\t\t\t\t<div className=\"edit-site-template-panel__replace-template-modal__content\">\n\t\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\t\tavailableTemplates={ availableTemplates }\n\t\t\t\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASS,qBAAqBA,CAAE;EAC9CC,OAAO;EACPC;AACD,CAAC,E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,IAAAiB,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAAmC,KAAK;IACLC,KAAK,EAAG,IAAAF,QAAE,EAAE,mBAAoB,CAAG;IACnCG,cAAc,EAAGtB,OAAS;IAC1BuB,gBAAgB,EAAC,kDAAkD;IACnEC,YAAY;EAAA,GAEZ,IAAAV,MAAA,CAAAC,aAAA;IAAKU,SAAS,EAAC;EAA2D,GACzE,IAAAX,MAAA,CAAAC,aAAA,EAACW,aAAa;IACbjC,kBAAkB,EAAGA,kBAAoB;IACzCkC,QAAQ,EAAGnB;EAAkB,CAC7B,CACG,CACC,CAEP,CAAC;AAEL;AAEA,SAASkB,aAAaA,CAAE;EAAEjC,kBAAkB;EAAEkC;AAAS,CAAC,EAAG;EAC1D,MAAMC,cAAc,GAAG,IAAAC,qBAAY,EAAEpC,kBAAmB,CAAC;EAEzD,OACC,IAAAqB,MAAA,CAAAC,aAAA,EAAC/B,YAAA,CAAA8C,+BAAiB;IACjBC,KAAK,EAAG,IAAAZ,QAAE,EAAE,WAAY,CAAG;IAC3Ba,aAAa,EAAGvC,kBAAoB;IACpCwC,aAAa,EAAGL,cAAgB;IAChCM,cAAc,EAAGP;EAAU,CAC3B,CAAC;AAEJ"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = TemplatePartHint;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _preferences = require("@wordpress/preferences");
|
|
12
|
-
/**
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const PREFERENCE_NAME = 'isTemplatePartMoveHintVisible';
|
|
17
|
-
function TemplatePartHint() {
|
|
18
|
-
const showTemplatePartHint = (0, _data.useSelect)(select => {
|
|
19
|
-
var _select$get;
|
|
20
|
-
return (_select$get = select(_preferences.store).get('core', PREFERENCE_NAME)) !== null && _select$get !== void 0 ? _select$get : true;
|
|
21
|
-
}, []);
|
|
22
|
-
const {
|
|
23
|
-
set: setPreference
|
|
24
|
-
} = (0, _data.useDispatch)(_preferences.store);
|
|
25
|
-
if (!showTemplatePartHint) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return (0, _react.createElement)(_components.Notice, {
|
|
29
|
-
politeness: "polite",
|
|
30
|
-
className: "edit-site-sidebar__notice",
|
|
31
|
-
onRemove: () => {
|
|
32
|
-
setPreference('core', PREFERENCE_NAME, false);
|
|
33
|
-
}
|
|
34
|
-
}, (0, _i18n.__)('Looking for template parts? Find them in "Patterns".'));
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=template-part-hint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_i18n","_preferences","PREFERENCE_NAME","TemplatePartHint","showTemplatePartHint","useSelect","select","_select$get","preferencesStore","get","set","setPreference","useDispatch","_react","createElement","Notice","politeness","className","onRemove","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nconst PREFERENCE_NAME = 'isTemplatePartMoveHintVisible';\n\nexport default function TemplatePartHint() {\n\tconst showTemplatePartHint = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true,\n\t\t[]\n\t);\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tif ( ! showTemplatePartHint ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Notice\n\t\t\tpoliteness=\"polite\"\n\t\t\tclassName=\"edit-site-sidebar__notice\"\n\t\t\tonRemove={ () => {\n\t\t\t\tsetPreference( 'core', PREFERENCE_NAME, false );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Looking for template parts? Find them in \"Patterns\".' ) }\n\t\t</Notice>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,MAAMI,eAAe,GAAG,+BAA+B;AAExC,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAMC,oBAAoB,GAAG,IAAAC,eAAS,EACnCC,MAAM;IAAA,IAAAC,WAAA;IAAA,QAAAA,WAAA,GACPD,MAAM,CAAEE,kBAAiB,CAAC,CAACC,GAAG,CAAE,MAAM,EAAEP,eAAgB,CAAC,cAAAK,WAAA,cAAAA,WAAA,GAAI,IAAI;EAAA,GAClE,EACD,CAAC;EAED,MAAM;IAAEG,GAAG,EAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,kBAAiB,CAAC;EAC9D,IAAK,CAAEJ,oBAAoB,EAAG;IAC7B,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,MAAM;IACNC,UAAU,EAAC,QAAQ;IACnBC,SAAS,EAAC,2BAA2B;IACrCC,QAAQ,EAAGA,CAAA,KAAM;MAChBP,aAAa,CAAE,MAAM,EAAET,eAAe,EAAE,KAAM,CAAC;IAChD;EAAG,GAED,IAAAiB,QAAE,EAAE,sDAAuD,CACtD,CAAC;AAEX"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = EditButton;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _icons = require("@wordpress/icons");
|
|
11
|
-
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
12
|
-
var _link = require("../routes/link");
|
|
13
|
-
var _constants = require("../../utils/constants");
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
function EditButton({
|
|
23
|
-
postId
|
|
24
|
-
}) {
|
|
25
|
-
const linkInfo = (0, _link.useLink)({
|
|
26
|
-
postId,
|
|
27
|
-
postType: _constants.NAVIGATION_POST_TYPE,
|
|
28
|
-
canvas: 'edit'
|
|
29
|
-
});
|
|
30
|
-
return (0, _react.createElement)(_sidebarButton.default, {
|
|
31
|
-
...linkInfo,
|
|
32
|
-
label: (0, _i18n.__)('Edit'),
|
|
33
|
-
icon: _icons.pencil
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=edit-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_sidebarButton","_interopRequireDefault","_link","_constants","EditButton","postId","linkInfo","useLink","postType","NAVIGATION_POST_TYPE","canvas","_react","createElement","default","label","__","icon","pencil"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function EditButton( { postId } ) {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tcanvas: 'edit',\n\t} );\n\treturn (\n\t\t<SidebarButton { ...linkInfo } label={ __( 'Edit' ) } icon={ pencil } />\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASM,UAAUA,CAAE;EAAEC;AAAO,CAAC,EAAG;EAChD,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBF,MAAM;IACNG,QAAQ,EAAEC,+BAAoB;IAC9BC,MAAM,EAAE;EACT,CAAE,CAAC;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,cAAA,CAAAa,OAAa;IAAA,GAAMP,QAAQ;IAAGQ,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IAACC,IAAI,EAAGC;EAAQ,CAAE,CAAC;AAE1E"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.withEditBlockControls = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
var _coreData = require("@wordpress/core-data");
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
var _hooks = require("@wordpress/hooks");
|
|
14
|
-
var _compose = require("@wordpress/compose");
|
|
15
|
-
var _router = require("@wordpress/router");
|
|
16
|
-
var _link = require("../components/routes/link");
|
|
17
|
-
var _lockUnlock = require("../lock-unlock");
|
|
18
|
-
var _constants = require("../utils/constants");
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
useLocation
|
|
29
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
30
|
-
function NavigationMenuEdit({
|
|
31
|
-
attributes
|
|
32
|
-
}) {
|
|
33
|
-
const {
|
|
34
|
-
ref
|
|
35
|
-
} = attributes;
|
|
36
|
-
const {
|
|
37
|
-
params
|
|
38
|
-
} = useLocation();
|
|
39
|
-
const blockEditingMode = (0, _blockEditor.useBlockEditingMode)();
|
|
40
|
-
const navigationMenu = (0, _data.useSelect)(select => {
|
|
41
|
-
return select(_coreData.store).getEntityRecord('postType', _constants.NAVIGATION_POST_TYPE,
|
|
42
|
-
// Ideally this should be an official public API.
|
|
43
|
-
ref);
|
|
44
|
-
}, [ref]);
|
|
45
|
-
const linkProps = (0, _link.useLink)({
|
|
46
|
-
postId: navigationMenu?.id,
|
|
47
|
-
postType: navigationMenu?.type,
|
|
48
|
-
canvas: 'edit'
|
|
49
|
-
}, {
|
|
50
|
-
// this applies to Navigation Menus as well.
|
|
51
|
-
fromTemplateId: params.postId || navigationMenu?.id
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// A non-default setting for block editing mode indicates that the
|
|
55
|
-
// editor should restrict "editing" actions. Therefore the `Edit` button
|
|
56
|
-
// should not be displayed.
|
|
57
|
-
if (!navigationMenu || blockEditingMode !== 'default') {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
return (0, _react.createElement)(_blockEditor.BlockControls, {
|
|
61
|
-
group: "other"
|
|
62
|
-
}, (0, _react.createElement)(_components.ToolbarButton, {
|
|
63
|
-
...linkProps,
|
|
64
|
-
onClick: event => {
|
|
65
|
-
linkProps.onClick(event);
|
|
66
|
-
}
|
|
67
|
-
}, (0, _i18n.__)('Edit')));
|
|
68
|
-
}
|
|
69
|
-
const withEditBlockControls = exports.withEditBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
70
|
-
const {
|
|
71
|
-
attributes,
|
|
72
|
-
name
|
|
73
|
-
} = props;
|
|
74
|
-
const isDisplayed = name === 'core/navigation' && attributes.ref;
|
|
75
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
|
|
76
|
-
...props
|
|
77
|
-
}), isDisplayed && (0, _react.createElement)(NavigationMenuEdit, {
|
|
78
|
-
attributes: attributes
|
|
79
|
-
}));
|
|
80
|
-
}, 'withEditBlockControls');
|
|
81
|
-
(0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-site/navigation-edit-button', withEditBlockControls);
|
|
82
|
-
//# sourceMappingURL=navigation-menu-edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_blockEditor","_coreData","_components","_hooks","_compose","_router","_link","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","NavigationMenuEdit","attributes","ref","params","blockEditingMode","useBlockEditingMode","navigationMenu","useSelect","select","coreStore","getEntityRecord","NAVIGATION_POST_TYPE","linkProps","useLink","postId","id","postType","type","canvas","fromTemplateId","_react","createElement","BlockControls","group","ToolbarButton","onClick","event","__","withEditBlockControls","exports","createHigherOrderComponent","BlockEdit","props","name","isDisplayed","Fragment","addFilter"],"sources":["@wordpress/edit-site/src/hooks/navigation-menu-edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls, useBlockEditingMode } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useLink } from '../components/routes/link';\nimport { unlock } from '../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction NavigationMenuEdit( { attributes } ) {\n\tconst { ref } = attributes;\n\tconst { params } = useLocation();\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst navigationMenu = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\tref\n\t\t\t);\n\t\t},\n\t\t[ ref ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: navigationMenu?.id,\n\t\t\tpostType: navigationMenu?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\t// this applies to Navigation Menus as well.\n\t\t\tfromTemplateId: params.postId || navigationMenu?.id,\n\t\t}\n\t);\n\n\t// A non-default setting for block editing mode indicates that the\n\t// editor should restrict \"editing\" actions. Therefore the `Edit` button\n\t// should not be displayed.\n\tif ( ! navigationMenu || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/navigation' && attributes.ref;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<NavigationMenuEdit attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\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cAAc,IAAIF,gBAAgB,KAAK,SAAS,EAAG;IACzD,OAAO,IAAI;EACZ;EAEA,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAACjC,YAAA,CAAAkC,aAAa;IAACC,KAAK,EAAC;EAAO,GAC3B,IAAAH,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAkC,aAAa;IAAA,GACRZ,SAAS;IACda,OAAO,EAAKC,KAAK,IAAM;MACtBd,SAAS,CAACa,OAAO,CAAEC,KAAM,CAAC;IAC3B;EAAG,GAED,IAAAC,QAAE,EAAE,MAAO,CACC,CACD,CAAC;AAElB;AAEO,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,IAAAE,mCAA0B,EAC5DC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAE/B,UAAU;IAAEgC;EAAK,CAAC,GAAGD,KAAK;EAClC,MAAME,WAAW,GAAGD,IAAI,KAAK,iBAAiB,IAAIhC,UAAU,CAACC,GAAG;EAEhE,OACC,IAAAkB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAe,QAAA,QACC,IAAAf,MAAA,CAAAC,aAAA,EAACU,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBE,WAAW,IACZ,IAAAd,MAAA,CAAAC,aAAA,EAACrB,kBAAkB;IAACC,UAAU,EAAGA;EAAY,CAAE,CAE/C,CAAC;AAEL,CAAC,EACD,uBACD,CAAC;AAED,IAAAmC,gBAAS,EACR,kBAAkB,EAClB,uCAAuC,EACvCR,qBACD,CAAC"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __unstableIframe as Iframe, __unstableEditorStyles as EditorStyles, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
6
|
-
import { __unstableMotion as motion, __experimentalHStack as HStack, __experimentalVStack as VStack } from '@wordpress/components';
|
|
7
|
-
import { useThrottle, useReducedMotion, useResizeObserver } from '@wordpress/compose';
|
|
8
|
-
import { useLayoutEffect, useState, useMemo } from '@wordpress/element';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { unlock } from '../../lock-unlock';
|
|
14
|
-
import { useStylesPreviewColors } from './hooks';
|
|
15
|
-
const {
|
|
16
|
-
useGlobalStyle,
|
|
17
|
-
useGlobalStylesOutput
|
|
18
|
-
} = unlock(blockEditorPrivateApis);
|
|
19
|
-
const firstFrame = {
|
|
20
|
-
start: {
|
|
21
|
-
scale: 1,
|
|
22
|
-
opacity: 1
|
|
23
|
-
},
|
|
24
|
-
hover: {
|
|
25
|
-
scale: 0,
|
|
26
|
-
opacity: 0
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const midFrame = {
|
|
30
|
-
hover: {
|
|
31
|
-
opacity: 1
|
|
32
|
-
},
|
|
33
|
-
start: {
|
|
34
|
-
opacity: 0.5
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const secondFrame = {
|
|
38
|
-
hover: {
|
|
39
|
-
scale: 1,
|
|
40
|
-
opacity: 1
|
|
41
|
-
},
|
|
42
|
-
start: {
|
|
43
|
-
scale: 0,
|
|
44
|
-
opacity: 0
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const normalizedWidth = 248;
|
|
48
|
-
const normalizedHeight = 152;
|
|
49
|
-
const normalizedColorSwatchSize = 32;
|
|
50
|
-
|
|
51
|
-
// Throttle options for useThrottle. Must be defined outside of the component,
|
|
52
|
-
// so that the object reference is the same on each render.
|
|
53
|
-
const THROTTLE_OPTIONS = {
|
|
54
|
-
leading: true,
|
|
55
|
-
trailing: true
|
|
56
|
-
};
|
|
57
|
-
const StylesPreview = ({
|
|
58
|
-
label,
|
|
59
|
-
isFocused,
|
|
60
|
-
withHoverView
|
|
61
|
-
}) => {
|
|
62
|
-
const [fontWeight] = useGlobalStyle('typography.fontWeight');
|
|
63
|
-
const [fontFamily = 'serif'] = useGlobalStyle('typography.fontFamily');
|
|
64
|
-
const [headingFontFamily = fontFamily] = useGlobalStyle('elements.h1.typography.fontFamily');
|
|
65
|
-
const [headingFontWeight = fontWeight] = useGlobalStyle('elements.h1.typography.fontWeight');
|
|
66
|
-
const [textColor = 'black'] = useGlobalStyle('color.text');
|
|
67
|
-
const [headingColor = textColor] = useGlobalStyle('elements.h1.color.text');
|
|
68
|
-
const [backgroundColor = 'white'] = useGlobalStyle('color.background');
|
|
69
|
-
const [gradientValue] = useGlobalStyle('color.gradient');
|
|
70
|
-
const [styles] = useGlobalStylesOutput();
|
|
71
|
-
const disableMotion = useReducedMotion();
|
|
72
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
73
|
-
const [containerResizeListener, {
|
|
74
|
-
width
|
|
75
|
-
}] = useResizeObserver();
|
|
76
|
-
const [throttledWidth, setThrottledWidthState] = useState(width);
|
|
77
|
-
const [ratioState, setRatioState] = useState();
|
|
78
|
-
const setThrottledWidth = useThrottle(setThrottledWidthState, 250, THROTTLE_OPTIONS);
|
|
79
|
-
|
|
80
|
-
// Must use useLayoutEffect to avoid a flash of the iframe at the wrong
|
|
81
|
-
// size before the width is set.
|
|
82
|
-
useLayoutEffect(() => {
|
|
83
|
-
if (width) {
|
|
84
|
-
setThrottledWidth(width);
|
|
85
|
-
}
|
|
86
|
-
}, [width, setThrottledWidth]);
|
|
87
|
-
|
|
88
|
-
// Must use useLayoutEffect to avoid a flash of the iframe at the wrong
|
|
89
|
-
// size before the width is set.
|
|
90
|
-
useLayoutEffect(() => {
|
|
91
|
-
const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;
|
|
92
|
-
const ratioDiff = newRatio - (ratioState || 0);
|
|
93
|
-
|
|
94
|
-
// Only update the ratio state if the difference is big enough
|
|
95
|
-
// or if the ratio state is not yet set. This is to avoid an
|
|
96
|
-
// endless loop of updates at particular viewport heights when the
|
|
97
|
-
// presence of a scrollbar causes the width to change slightly.
|
|
98
|
-
const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1;
|
|
99
|
-
if (isRatioDiffBigEnough || !ratioState) {
|
|
100
|
-
setRatioState(newRatio);
|
|
101
|
-
}
|
|
102
|
-
}, [throttledWidth, ratioState]);
|
|
103
|
-
|
|
104
|
-
// Set a fallbackRatio to use before the throttled ratio has been set.
|
|
105
|
-
const fallbackRatio = width ? width / normalizedWidth : 1;
|
|
106
|
-
// Use the throttled ratio if it has been calculated, otherwise
|
|
107
|
-
// use the fallback ratio. The throttled ratio is used to avoid
|
|
108
|
-
// an endless loop of updates at particular viewport heights.
|
|
109
|
-
// See: https://github.com/WordPress/gutenberg/issues/55112
|
|
110
|
-
const ratio = ratioState ? ratioState : fallbackRatio;
|
|
111
|
-
const {
|
|
112
|
-
paletteColors,
|
|
113
|
-
highlightedColors
|
|
114
|
-
} = useStylesPreviewColors();
|
|
115
|
-
|
|
116
|
-
// Reset leaked styles from WP common.css and remove main content layout padding and border.
|
|
117
|
-
const editorStyles = useMemo(() => {
|
|
118
|
-
if (styles) {
|
|
119
|
-
return [...styles, {
|
|
120
|
-
css: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}',
|
|
121
|
-
isGlobalStyles: true
|
|
122
|
-
}];
|
|
123
|
-
}
|
|
124
|
-
return styles;
|
|
125
|
-
}, [styles]);
|
|
126
|
-
const isReady = !!width;
|
|
127
|
-
return createElement(Fragment, null, createElement("div", {
|
|
128
|
-
style: {
|
|
129
|
-
position: 'relative'
|
|
130
|
-
}
|
|
131
|
-
}, containerResizeListener), isReady && createElement(Iframe, {
|
|
132
|
-
className: "edit-site-global-styles-preview__iframe",
|
|
133
|
-
style: {
|
|
134
|
-
width: '100%',
|
|
135
|
-
height: normalizedHeight * ratio
|
|
136
|
-
},
|
|
137
|
-
onMouseEnter: () => setIsHovered(true),
|
|
138
|
-
onMouseLeave: () => setIsHovered(false),
|
|
139
|
-
tabIndex: -1
|
|
140
|
-
}, createElement(EditorStyles, {
|
|
141
|
-
styles: editorStyles
|
|
142
|
-
}), createElement(motion.div, {
|
|
143
|
-
style: {
|
|
144
|
-
height: normalizedHeight * ratio,
|
|
145
|
-
width: '100%',
|
|
146
|
-
background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor,
|
|
147
|
-
cursor: withHoverView ? 'pointer' : undefined
|
|
148
|
-
},
|
|
149
|
-
initial: "start",
|
|
150
|
-
animate: (isHovered || isFocused) && !disableMotion && label ? 'hover' : 'start'
|
|
151
|
-
}, createElement(motion.div, {
|
|
152
|
-
variants: firstFrame,
|
|
153
|
-
style: {
|
|
154
|
-
height: '100%',
|
|
155
|
-
overflow: 'hidden'
|
|
156
|
-
}
|
|
157
|
-
}, createElement(HStack, {
|
|
158
|
-
spacing: 10 * ratio,
|
|
159
|
-
justify: "center",
|
|
160
|
-
style: {
|
|
161
|
-
height: '100%',
|
|
162
|
-
overflow: 'hidden'
|
|
163
|
-
}
|
|
164
|
-
}, createElement(motion.div, {
|
|
165
|
-
style: {
|
|
166
|
-
fontFamily: headingFontFamily,
|
|
167
|
-
fontSize: 65 * ratio,
|
|
168
|
-
color: headingColor,
|
|
169
|
-
fontWeight: headingFontWeight
|
|
170
|
-
},
|
|
171
|
-
animate: {
|
|
172
|
-
scale: 1,
|
|
173
|
-
opacity: 1
|
|
174
|
-
},
|
|
175
|
-
initial: {
|
|
176
|
-
scale: 0.1,
|
|
177
|
-
opacity: 0
|
|
178
|
-
},
|
|
179
|
-
transition: {
|
|
180
|
-
delay: 0.3,
|
|
181
|
-
type: 'tween'
|
|
182
|
-
}
|
|
183
|
-
}, "Aa"), createElement(VStack, {
|
|
184
|
-
spacing: 4 * ratio
|
|
185
|
-
}, highlightedColors.map(({
|
|
186
|
-
slug,
|
|
187
|
-
color
|
|
188
|
-
}, index) => createElement(motion.div, {
|
|
189
|
-
key: slug,
|
|
190
|
-
style: {
|
|
191
|
-
height: normalizedColorSwatchSize * ratio,
|
|
192
|
-
width: normalizedColorSwatchSize * ratio,
|
|
193
|
-
background: color,
|
|
194
|
-
borderRadius: normalizedColorSwatchSize * ratio / 2
|
|
195
|
-
},
|
|
196
|
-
animate: {
|
|
197
|
-
scale: 1,
|
|
198
|
-
opacity: 1
|
|
199
|
-
},
|
|
200
|
-
initial: {
|
|
201
|
-
scale: 0.1,
|
|
202
|
-
opacity: 0
|
|
203
|
-
},
|
|
204
|
-
transition: {
|
|
205
|
-
delay: index === 1 ? 0.2 : 0.1
|
|
206
|
-
}
|
|
207
|
-
}))))), createElement(motion.div, {
|
|
208
|
-
variants: withHoverView && midFrame,
|
|
209
|
-
style: {
|
|
210
|
-
height: '100%',
|
|
211
|
-
width: '100%',
|
|
212
|
-
position: 'absolute',
|
|
213
|
-
top: 0,
|
|
214
|
-
overflow: 'hidden',
|
|
215
|
-
filter: 'blur(60px)',
|
|
216
|
-
opacity: 0.1
|
|
217
|
-
}
|
|
218
|
-
}, createElement(HStack, {
|
|
219
|
-
spacing: 0,
|
|
220
|
-
justify: "flex-start",
|
|
221
|
-
style: {
|
|
222
|
-
height: '100%',
|
|
223
|
-
overflow: 'hidden'
|
|
224
|
-
}
|
|
225
|
-
}, paletteColors.slice(0, 4).map(({
|
|
226
|
-
color
|
|
227
|
-
}, index) => createElement("div", {
|
|
228
|
-
key: index,
|
|
229
|
-
style: {
|
|
230
|
-
height: '100%',
|
|
231
|
-
background: color,
|
|
232
|
-
flexGrow: 1
|
|
233
|
-
}
|
|
234
|
-
})))), createElement(motion.div, {
|
|
235
|
-
variants: secondFrame,
|
|
236
|
-
style: {
|
|
237
|
-
height: '100%',
|
|
238
|
-
width: '100%',
|
|
239
|
-
overflow: 'hidden',
|
|
240
|
-
position: 'absolute',
|
|
241
|
-
top: 0
|
|
242
|
-
}
|
|
243
|
-
}, createElement(VStack, {
|
|
244
|
-
spacing: 3 * ratio,
|
|
245
|
-
justify: "center",
|
|
246
|
-
style: {
|
|
247
|
-
height: '100%',
|
|
248
|
-
overflow: 'hidden',
|
|
249
|
-
padding: 10 * ratio,
|
|
250
|
-
boxSizing: 'border-box'
|
|
251
|
-
}
|
|
252
|
-
}, label && createElement("div", {
|
|
253
|
-
style: {
|
|
254
|
-
fontSize: 40 * ratio,
|
|
255
|
-
fontFamily: headingFontFamily,
|
|
256
|
-
color: headingColor,
|
|
257
|
-
fontWeight: headingFontWeight,
|
|
258
|
-
lineHeight: '1em',
|
|
259
|
-
textAlign: 'center'
|
|
260
|
-
}
|
|
261
|
-
}, label))))));
|
|
262
|
-
};
|
|
263
|
-
export default StylesPreview;
|
|
264
|
-
//# sourceMappingURL=preview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__unstableIframe","Iframe","__unstableEditorStyles","EditorStyles","privateApis","blockEditorPrivateApis","__unstableMotion","motion","__experimentalHStack","HStack","__experimentalVStack","VStack","useThrottle","useReducedMotion","useResizeObserver","useLayoutEffect","useState","useMemo","unlock","useStylesPreviewColors","useGlobalStyle","useGlobalStylesOutput","firstFrame","start","scale","opacity","hover","midFrame","secondFrame","normalizedWidth","normalizedHeight","normalizedColorSwatchSize","THROTTLE_OPTIONS","leading","trailing","StylesPreview","label","isFocused","withHoverView","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","backgroundColor","gradientValue","styles","disableMotion","isHovered","setIsHovered","containerResizeListener","width","throttledWidth","setThrottledWidthState","ratioState","setRatioState","setThrottledWidth","newRatio","ratioDiff","isRatioDiffBigEnough","Math","abs","fallbackRatio","ratio","paletteColors","highlightedColors","editorStyles","css","isGlobalStyles","isReady","createElement","Fragment","style","position","className","height","onMouseEnter","onMouseLeave","tabIndex","div","background","cursor","undefined","initial","animate","variants","overflow","spacing","justify","fontSize","color","transition","delay","type","map","slug","index","key","borderRadius","top","filter","slice","flexGrow","padding","boxSizing","lineHeight","textAlign"],"sources":["@wordpress/edit-site/src/components/global-styles/preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__unstableIframe as Iframe,\n\t__unstableEditorStyles as EditorStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\t__unstableMotion as motion,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useStylesPreviewColors } from './hooks';\n\nconst { useGlobalStyle, useGlobalStylesOutput } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst firstFrame = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst midFrame = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrame = {\n\thover: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\n\nconst normalizedColorSwatchSize = 32;\n\n// Throttle options for useThrottle. Must be defined outside of the component,\n// so that the object reference is the same on each render.\nconst THROTTLE_OPTIONS = {\n\tleading: true,\n\ttrailing: true,\n};\n\nconst StylesPreview = ( { label, isFocused, withHoverView } ) => {\n\tconst [ fontWeight ] = useGlobalStyle( 'typography.fontWeight' );\n\tconst [ fontFamily = 'serif' ] = useGlobalStyle( 'typography.fontFamily' );\n\tconst [ headingFontFamily = fontFamily ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontFamily'\n\t);\n\tconst [ headingFontWeight = fontWeight ] = useGlobalStyle(\n\t\t'elements.h1.typography.fontWeight'\n\t);\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\tconst [ styles ] = useGlobalStylesOutput();\n\tconst disableMotion = useReducedMotion();\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ containerResizeListener, { width } ] = useResizeObserver();\n\tconst [ throttledWidth, setThrottledWidthState ] = useState( width );\n\tconst [ ratioState, setRatioState ] = useState();\n\n\tconst setThrottledWidth = useThrottle(\n\t\tsetThrottledWidthState,\n\t\t250,\n\t\tTHROTTLE_OPTIONS\n\t);\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tif ( width ) {\n\t\t\tsetThrottledWidth( width );\n\t\t}\n\t}, [ width, setThrottledWidth ] );\n\n\t// Must use useLayoutEffect to avoid a flash of the iframe at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tconst newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;\n\t\tconst ratioDiff = newRatio - ( ratioState || 0 );\n\n\t\t// Only update the ratio state if the difference is big enough\n\t\t// or if the ratio state is not yet set. This is to avoid an\n\t\t// endless loop of updates at particular viewport heights when the\n\t\t// presence of a scrollbar causes the width to change slightly.\n\t\tconst isRatioDiffBigEnough = Math.abs( ratioDiff ) > 0.1;\n\n\t\tif ( isRatioDiffBigEnough || ! ratioState ) {\n\t\t\tsetRatioState( newRatio );\n\t\t}\n\t}, [ throttledWidth, ratioState ] );\n\n\t// Set a fallbackRatio to use before the throttled ratio has been set.\n\tconst fallbackRatio = width ? width / normalizedWidth : 1;\n\t// Use the throttled ratio if it has been calculated, otherwise\n\t// use the fallback ratio. The throttled ratio is used to avoid\n\t// an endless loop of updates at particular viewport heights.\n\t// See: https://github.com/WordPress/gutenberg/issues/55112\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\n\tconst { paletteColors, highlightedColors } = useStylesPreviewColors();\n\n\t// Reset leaked styles from WP common.css and remove main content layout padding and border.\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}',\n\t\t\t\t\tisGlobalStyles: true,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles ] );\n\tconst isReady = !! width;\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t{ isReady && (\n\t\t\t\t<Iframe\n\t\t\t\t\tclassName=\"edit-site-global-styles-preview__iframe\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t} }\n\t\t\t\t\tonMouseEnter={ () => setIsHovered( true ) }\n\t\t\t\t\tonMouseLeave={ () => setIsHovered( false ) }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\t\tcursor: withHoverView ? 'pointer' : undefined,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tinitial=\"start\"\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t( isHovered || isFocused ) &&\n\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'start'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tvariants={ firstFrame }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\t\tfontSize: 65 * ratio,\n\t\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tanimate={ { scale: 1, opacity: 1 } }\n\t\t\t\t\t\t\t\t\tinitial={ { scale: 0.1, opacity: 0 } }\n\t\t\t\t\t\t\t\t\ttransition={ { delay: 0.3, type: 'tween' } }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tAa\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t\t\t{ highlightedColors.map(\n\t\t\t\t\t\t\t\t\t\t( { slug, color }, index ) => (\n\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnormalizedColorSwatchSize *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tratio,\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnormalizedColorSwatchSize *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tratio,\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\t\t\t\tborderRadius:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( normalizedColorSwatchSize *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tratio ) /\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 0.1,\n\t\t\t\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdelay:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex === 1 ? 0.2 : 0.1,\n\t\t\t\t\t\t\t\t\t\t\t\t} }\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) }\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tvariants={ withHoverView && midFrame }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\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) ) }\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tvariants={ secondFrame }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</motion.div>\n\t\t\t\t</Iframe>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default StylesPreview;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,gBAAgB,IAAIC,MAAM,EAC1BC,sBAAsB,IAAIC,YAAY,EACtCC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SACCC,WAAW,EACXC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;AAC3B,SAASC,eAAe,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,SAAS;AA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1D,WAAa;IACxB6C,KAAK,EAAG;MACPG,MAAM,EAAE,MAAM;MACdxB,KAAK,EAAE,MAAM;MACbmC,QAAQ,EAAE,QAAQ;MAClBb,QAAQ,EAAE,UAAU;MACpB0B,GAAG,EAAE;IACN;EAAG,GAEH7B,aAAA,CAAC5D,MAAM;IACN6E,OAAO,EAAG,CAAC,GAAGxB,KAAO;IACrByB,OAAO,EAAC,QAAQ;IAChBhB,KAAK,EAAG;MACPG,MAAM,EAAE,MAAM;MACdW,QAAQ,EAAE,QAAQ;MAClBiB,OAAO,EAAE,EAAE,GAAGxC,KAAK;MACnByC,SAAS,EAAE;IACZ;EAAG,GAEDrE,KAAK,IACNmC,aAAA;IACCE,KAAK,EAAG;MACPiB,QAAQ,EAAE,EAAE,GAAG1B,KAAK;MACpBxB,UAAU,EAAEC,iBAAiB;MAC7BkD,KAAK,EAAE/C,YAAY;MACnBL,UAAU,EAAEG,iBAAiB;MAC7BgE,UAAU,EAAE,KAAK;MACjBC,SAAS,EAAE;IACZ;EAAG,GAEDvE,KACE,CAEC,CACG,CACD,CACL,CAER,CAAC;AAEL,CAAC;AAED,eAAeD,aAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","privateApis","blockEditorPrivateApis","NavigationButtonAsItem","Subtitle","unlock","useGlobalStyle","ElementItem","parentMenu","element","label","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","gradientValue","color","navigationButtonLabel","createElement","path","justify","className","style","background","TypographyElements","spacing","level","isBordered","isSeparated"],"sources":["@wordpress/edit-site/src/components/global-styles/typogrphy-elements.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\n\nimport { unlock } from '../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ElementItem( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction TypographyElements() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"text\"\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"link\"\n\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"heading\"\n\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"caption\"\n\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"button\"\n\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t/>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default TypographyElements;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AAC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,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,QAAQ;IAChBC,KAAK,EAAGlB,EAAE,CAAE,SAAU;EAAG,CACzB,CACS,CACJ,CAAC;AAEX;AAEA,eAAeoC,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","useSelect","__experimentalItemGroup","ItemGroup","NavigationButtonAsItem","getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","select","getBlockStyles","coreBlockStyles","VariationsPanel","createElement","isBordered","isSeparated","map","index","isDefault","key","path","encodeURIComponent","label"],"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E;AACA;AACA;;AAEA,SAASC,sBAAsB,QAAQ,qBAAqB;AAE5D,SAASC,kBAAkBA,CAAEC,WAAW,EAAG;EAC1C,OAAOA,WAAW,EAAEC,MAAM,CAAIC,KAAK,IAAMA,KAAK,CAACC,MAAM,KAAK,OAAQ,CAAC;AACpE;AAEA,OAAO,SAASC,kBAAkBA,CAAEC,IAAI,EAAG;EAC1C,MAAML,WAAW,GAAGL,SAAS,CAC1BW,MAAM,IAAM;IACb,MAAM;MAAEC;IAAe,CAAC,GAAGD,MAAM,CAAEZ,WAAY,CAAC;IAChD,OAAOa,cAAc,CAAEF,IAAK,CAAC;EAC9B,CAAC,EACD,CAAEA,IAAI,CACP,CAAC;EACD,MAAMG,eAAe,GAAGT,kBAAkB,CAAEC,WAAY,CAAC;EACzD,OAAOQ,eAAe;AACvB;AAEA,OAAO,SAASC,eAAeA,CAAE;EAAEJ;AAAK,CAAC,EAAG;EAC3C,MAAMG,eAAe,GAAGJ,kBAAkB,CAAEC,IAAK,CAAC;EAElD,OACCK,aAAA,CAACb,SAAS;IAACc,UAAU;IAACC,WAAW;EAAA,GAC9BJ,eAAe,CAACK,GAAG,CAAE,CAAEX,KAAK,EAAEY,KAAK,KAAM;IAC1C,IAAKZ,KAAK,EAAEa,SAAS,EAAG;MACvB,OAAO,IAAI;IACZ;IACA,OACCL,aAAA,CAACZ,sBAAsB;MAC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