@wordpress/edit-site 6.17.0 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +0 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +0 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +0 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +0 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/editor/index.js +7 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/{maybe-editor/index.js → editor/site-preview.js} +9 -25
- package/build/components/editor/site-preview.js.map +1 -0
- package/build/components/editor-canvas-container/index.js +0 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +0 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -5
- 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 +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +0 -1
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +0 -1
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +0 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -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-details.js +0 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +1 -5
- 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 +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +0 -1
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +0 -1
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +0 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +0 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +0 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +0 -1
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/preview-wrapper.js +0 -1
- package/build/components/global-styles/preview-wrapper.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +9 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-css.js +9 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +1 -0
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js +0 -1
- package/build/components/global-styles/shadow-utils.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +0 -1
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +0 -1
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +0 -1
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typeset.js +0 -1
- package/build/components/global-styles/typeset.js.map +1 -1
- package/build/components/global-styles/ui.js +0 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +0 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +0 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +0 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +0 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +0 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/media/index.js +2 -3
- package/build/components/media/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +0 -1
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +0 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +6 -7
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +0 -1
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +0 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +0 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +5 -6
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +0 -1
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +0 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +0 -1
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +1 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-button/index.js +0 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +0 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +0 -1
- package/build/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build/components/save-panel/index.js +0 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +0 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +0 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +0 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +0 -6
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +12 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +0 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/site-editor-routes/home.js +3 -3
- package/build/components/site-editor-routes/home.js.map +1 -1
- package/build/components/site-editor-routes/index.js +2 -2
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/notfound.js +33 -0
- package/build/components/site-editor-routes/notfound.js.map +1 -0
- package/build/components/site-editor-routes/template-item.js +3 -3
- package/build/components/site-editor-routes/template-item.js.map +1 -1
- package/build/components/site-editor-routes/template-part-item.js +3 -3
- package/build/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build/components/style-book/categories.js +0 -1
- package/build/components/style-book/categories.js.map +1 -1
- package/build/components/style-book/color-examples.js +0 -1
- package/build/components/style-book/color-examples.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +0 -1
- package/build/components/style-book/duotone-examples.js.map +1 -1
- package/build/components/style-book/examples.js +0 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +7 -18
- package/build/components/style-book/index.js.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/posts.js +0 -1
- package/build/posts.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js +0 -1
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build/utils/set-nested-value.js +0 -1
- package/build/utils/set-nested-value.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +0 -1
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +0 -1
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +0 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/editor/index.js +7 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/{maybe-editor/index.js → editor/site-preview.js} +8 -25
- package/build-module/components/editor/site-preview.js.map +1 -0
- package/build-module/components/editor-canvas-container/index.js +0 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +0 -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 +3 -6
- 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 +0 -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 +0 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +0 -1
- 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 +0 -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-details.js +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +3 -7
- 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 +0 -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/filter-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -1
- 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/make-families-from-faces.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +0 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +0 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +0 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +0 -1
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/preview-wrapper.js +0 -1
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +10 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +9 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js +0 -1
- package/build-module/components/global-styles/shadow-utils.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +0 -1
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +0 -1
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +0 -1
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset.js +0 -1
- package/build-module/components/global-styles/typeset.js.map +1 -1
- package/build-module/components/global-styles/ui.js +0 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +0 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +0 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +0 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +0 -1
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +0 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/media/index.js +2 -3
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +0 -1
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +0 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +2 -3
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +0 -1
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +0 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +0 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -3
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +0 -1
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +0 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +0 -1
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +1 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-button/index.js +0 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +0 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +0 -1
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +0 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +0 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +0 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +0 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +0 -6
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +12 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +0 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/site-editor-routes/home.js +3 -3
- package/build-module/components/site-editor-routes/home.js.map +1 -1
- package/build-module/components/site-editor-routes/index.js +2 -2
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/notfound.js +25 -0
- package/build-module/components/site-editor-routes/notfound.js.map +1 -0
- package/build-module/components/site-editor-routes/template-item.js +3 -3
- package/build-module/components/site-editor-routes/template-item.js.map +1 -1
- package/build-module/components/site-editor-routes/template-part-item.js +3 -3
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build-module/components/style-book/categories.js +0 -1
- package/build-module/components/style-book/categories.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +0 -1
- package/build-module/components/style-book/color-examples.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +0 -1
- package/build-module/components/style-book/duotone-examples.js.map +1 -1
- package/build-module/components/style-book/examples.js +0 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +7 -18
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +0 -1
- package/build-module/posts.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js +0 -1
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/utils/set-nested-value.js +0 -1
- package/build-module/utils/set-nested-value.js.map +1 -1
- package/build-style/posts-rtl.css +8 -4
- package/build-style/posts.css +8 -4
- package/build-style/style-rtl.css +17 -24
- package/build-style/style.css +17 -24
- package/package.json +42 -42
- package/src/components/editor/index.js +12 -6
- package/src/components/{maybe-editor/index.js → editor/site-preview.js} +7 -20
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +3 -11
- package/src/components/global-styles/font-library-modal/library-font-variant.js +3 -12
- package/src/components/global-styles/screen-block-list.js +15 -6
- package/src/components/global-styles/screen-css.js +9 -0
- package/src/components/global-styles/screen-root.js +1 -0
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/layout/style.scss +4 -0
- package/src/components/media/index.js +2 -2
- package/src/components/page-patterns/index.js +1 -2
- package/src/components/page-patterns/style.scss +2 -0
- package/src/components/page-templates/index.js +1 -2
- package/src/components/page-templates/style.scss +2 -0
- package/src/components/resizable-frame/index.js +1 -1
- package/src/components/sidebar-navigation-screen/index.js +0 -9
- package/src/components/sidebar-navigation-screen/style.scss +0 -23
- package/src/components/sidebar-navigation-screen-main/index.js +15 -10
- package/src/components/site-editor-routes/home.js +2 -2
- package/src/components/site-editor-routes/index.js +2 -0
- package/src/components/site-editor-routes/notfound.js +27 -0
- package/src/components/site-editor-routes/template-item.js +3 -3
- package/src/components/site-editor-routes/template-part-item.js +3 -3
- package/src/components/style-book/index.js +1 -13
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/maybe-editor/index.js.map +0 -1
- package/build-module/components/maybe-editor/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["toggleFont","font","face","initialfonts","isFontActivated","f","slug","getActivatedFont","fonts","find","toggleEntireFontFamily","activatedFont","filter","toggleFontVariant","isFaceActivated","fontWeight","fontStyle","fontFace","newFontFaces","length","map"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/toggleFont.js"],"sourcesContent":["/**\n * Toggles the activation of a given font or font variant within a list of custom fonts.\n *\n * - If only the font is provided (without face), the entire font family's activation is toggled.\n * - If both font and face are provided, the activation of the specific font variant is toggled.\n *\n * @param {Object} font - The font to be toggled.\n * @param {string} font.slug - The unique identifier for the font.\n * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.\n *\n * @param {Object} [face] - The specific font variant to be toggled.\n * @param {string} face.fontWeight - The weight of the font variant.\n * @param {string} face.fontStyle - The style of the font variant.\n *\n * @param {Array} initialfonts - The initial list of custom fonts.\n *\n * @return {Array} - The updated list of custom fonts with the font/font variant toggled.\n *\n * @example\n * const customFonts = [\n * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }\n * ];\n *\n * toggleFont({ slug: 'roboto' }, null, customFonts);\n * // This will remove 'roboto' from customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);\n * // This will remove the specified face from 'roboto' in customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);\n * // This will add the specified face to 'roboto' in customFonts\n */\nexport function toggleFont( font, face, initialfonts ) {\n\t// Helper to check if a font is activated based on its slug\n\tconst isFontActivated = ( f ) => f.slug === font.slug;\n\n\t// Helper to get the activated font from a list of fonts\n\tconst getActivatedFont = ( fonts ) => fonts.find( isFontActivated );\n\n\t// Toggle the activation status of an entire font family\n\tconst toggleEntireFontFamily = ( activatedFont ) => {\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font is not active, activate the entire font family\n\t\t\treturn [ ...initialfonts, font ];\n\t\t}\n\t\t// If the font is already active, deactivate the entire font family\n\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t};\n\n\t// Toggle the activation status of a specific font variant\n\tconst toggleFontVariant = ( activatedFont ) => {\n\t\tconst isFaceActivated = ( f ) =>\n\t\t\tf.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;\n\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font family is not active, activate the font family with the font variant\n\t\t\treturn [ ...initialfonts, { ...font, fontFace: [ face ] } ];\n\t\t}\n\n\t\tlet newFontFaces = activatedFont.fontFace || [];\n\n\t\tif ( newFontFaces.find( isFaceActivated ) ) {\n\t\t\t// If the font variant is active, deactivate it\n\t\t\tnewFontFaces = newFontFaces.filter(\n\t\t\t\t( f ) => ! isFaceActivated( f )\n\t\t\t);\n\t\t} else {\n\t\t\t// If the font variant is not active, activate it\n\t\t\tnewFontFaces = [ ...newFontFaces, face ];\n\t\t}\n\n\t\t// If there are no more font faces, deactivate the font family\n\t\tif ( newFontFaces.length === 0 ) {\n\t\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t\t}\n\n\t\t// Return updated fonts list with toggled font variant\n\t\treturn initialfonts.map( ( f ) =>\n\t\t\tisFontActivated( f ) ? { ...f, fontFace: newFontFaces } : f\n\t\t);\n\t};\n\n\tconst activatedFont = getActivatedFont( initialfonts );\n\n\tif ( ! face ) {\n\t\treturn toggleEntireFontFamily( activatedFont );\n\t}\n\n\treturn toggleFontVariant( activatedFont );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["toggleFont","font","face","initialfonts","isFontActivated","f","slug","getActivatedFont","fonts","find","toggleEntireFontFamily","activatedFont","filter","toggleFontVariant","isFaceActivated","fontWeight","fontStyle","fontFace","newFontFaces","length","map"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/toggleFont.js"],"sourcesContent":["/**\n * Toggles the activation of a given font or font variant within a list of custom fonts.\n *\n * - If only the font is provided (without face), the entire font family's activation is toggled.\n * - If both font and face are provided, the activation of the specific font variant is toggled.\n *\n * @param {Object} font - The font to be toggled.\n * @param {string} font.slug - The unique identifier for the font.\n * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.\n *\n * @param {Object} [face] - The specific font variant to be toggled.\n * @param {string} face.fontWeight - The weight of the font variant.\n * @param {string} face.fontStyle - The style of the font variant.\n *\n * @param {Array} initialfonts - The initial list of custom fonts.\n *\n * @return {Array} - The updated list of custom fonts with the font/font variant toggled.\n *\n * @example\n * const customFonts = [\n * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }\n * ];\n *\n * toggleFont({ slug: 'roboto' }, null, customFonts);\n * // This will remove 'roboto' from customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);\n * // This will remove the specified face from 'roboto' in customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);\n * // This will add the specified face to 'roboto' in customFonts\n */\nexport function toggleFont( font, face, initialfonts ) {\n\t// Helper to check if a font is activated based on its slug\n\tconst isFontActivated = ( f ) => f.slug === font.slug;\n\n\t// Helper to get the activated font from a list of fonts\n\tconst getActivatedFont = ( fonts ) => fonts.find( isFontActivated );\n\n\t// Toggle the activation status of an entire font family\n\tconst toggleEntireFontFamily = ( activatedFont ) => {\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font is not active, activate the entire font family\n\t\t\treturn [ ...initialfonts, font ];\n\t\t}\n\t\t// If the font is already active, deactivate the entire font family\n\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t};\n\n\t// Toggle the activation status of a specific font variant\n\tconst toggleFontVariant = ( activatedFont ) => {\n\t\tconst isFaceActivated = ( f ) =>\n\t\t\tf.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;\n\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font family is not active, activate the font family with the font variant\n\t\t\treturn [ ...initialfonts, { ...font, fontFace: [ face ] } ];\n\t\t}\n\n\t\tlet newFontFaces = activatedFont.fontFace || [];\n\n\t\tif ( newFontFaces.find( isFaceActivated ) ) {\n\t\t\t// If the font variant is active, deactivate it\n\t\t\tnewFontFaces = newFontFaces.filter(\n\t\t\t\t( f ) => ! isFaceActivated( f )\n\t\t\t);\n\t\t} else {\n\t\t\t// If the font variant is not active, activate it\n\t\t\tnewFontFaces = [ ...newFontFaces, face ];\n\t\t}\n\n\t\t// If there are no more font faces, deactivate the font family\n\t\tif ( newFontFaces.length === 0 ) {\n\t\t\treturn initialfonts.filter( ( f ) => ! isFontActivated( f ) );\n\t\t}\n\n\t\t// Return updated fonts list with toggled font variant\n\t\treturn initialfonts.map( ( f ) =>\n\t\t\tisFontActivated( f ) ? { ...f, fontFace: newFontFaces } : f\n\t\t);\n\t};\n\n\tconst activatedFont = getActivatedFont( initialfonts );\n\n\tif ( ! face ) {\n\t\treturn toggleEntireFontFamily( activatedFont );\n\t}\n\n\treturn toggleFontVariant( activatedFont );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,UAAUA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,YAAY,EAAG;EACtD;EACA,MAAMC,eAAe,GAAKC,CAAC,IAAMA,CAAC,CAACC,IAAI,KAAKL,IAAI,CAACK,IAAI;;EAErD;EACA,MAAMC,gBAAgB,GAAKC,KAAK,IAAMA,KAAK,CAACC,IAAI,CAAEL,eAAgB,CAAC;;EAEnE;EACA,MAAMM,sBAAsB,GAAKC,aAAa,IAAM;IACnD,IAAK,CAAEA,aAAa,EAAG;MACtB;MACA,OAAO,CAAE,GAAGR,YAAY,EAAEF,IAAI,CAAE;IACjC;IACA;IACA,OAAOE,YAAY,CAACS,MAAM,CAAIP,CAAC,IAAM,CAAED,eAAe,CAAEC,CAAE,CAAE,CAAC;EAC9D,CAAC;;EAED;EACA,MAAMQ,iBAAiB,GAAKF,aAAa,IAAM;IAC9C,MAAMG,eAAe,GAAKT,CAAC,IAC1BA,CAAC,CAACU,UAAU,KAAKb,IAAI,CAACa,UAAU,IAAIV,CAAC,CAACW,SAAS,KAAKd,IAAI,CAACc,SAAS;IAEnE,IAAK,CAAEL,aAAa,EAAG;MACtB;MACA,OAAO,CAAE,GAAGR,YAAY,EAAE;QAAE,GAAGF,IAAI;QAAEgB,QAAQ,EAAE,CAAEf,IAAI;MAAG,CAAC,CAAE;IAC5D;IAEA,IAAIgB,YAAY,GAAGP,aAAa,CAACM,QAAQ,IAAI,EAAE;IAE/C,IAAKC,YAAY,CAACT,IAAI,CAAEK,eAAgB,CAAC,EAAG;MAC3C;MACAI,YAAY,GAAGA,YAAY,CAACN,MAAM,CAC/BP,CAAC,IAAM,CAAES,eAAe,CAAET,CAAE,CAC/B,CAAC;IACF,CAAC,MAAM;MACN;MACAa,YAAY,GAAG,CAAE,GAAGA,YAAY,EAAEhB,IAAI,CAAE;IACzC;;IAEA;IACA,IAAKgB,YAAY,CAACC,MAAM,KAAK,CAAC,EAAG;MAChC,OAAOhB,YAAY,CAACS,MAAM,CAAIP,CAAC,IAAM,CAAED,eAAe,CAAEC,CAAE,CAAE,CAAC;IAC9D;;IAEA;IACA,OAAOF,YAAY,CAACiB,GAAG,CAAIf,CAAC,IAC3BD,eAAe,CAAEC,CAAE,CAAC,GAAG;MAAE,GAAGA,CAAC;MAAEY,QAAQ,EAAEC;IAAa,CAAC,GAAGb,CAC3D,CAAC;EACF,CAAC;EAED,MAAMM,aAAa,GAAGJ,gBAAgB,CAAEJ,YAAa,CAAC;EAEtD,IAAK,CAAED,IAAI,EAAG;IACb,OAAOQ,sBAAsB,CAAEC,aAAc,CAAC;EAC/C;EAEA,OAAOE,iBAAiB,CAAEF,aAAc,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","blockEditorPrivateApis","__","sprintf","__experimentalSpacer","Spacer","useNavigator","__experimentalView","View","__experimentalHStack","HStack","__experimentalVStack","VStack","componentsPrivateApis","Button","FlexItem","ToggleControl","moreVertical","useState","useEffect","unlock","ScreenHeader","FontSizePreview","ConfirmDeleteFontSizeDialog","RenameFontSizeDialog","SizeControl","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","useGlobalSetting","FontSize","_fontSizes$origin","isDeleteConfirmOpen","setIsDeleteConfirmOpen","isRenameDialogOpen","setIsRenameDialogOpen","params","origin","slug","goBack","fontSizes","setFontSizes","globalFluid","sizes","fontSize","find","size","isFluid","fluid","undefined","isCustomFluid","handleNameChange","value","updateFontSize","handleFontSizeChange","handleFluidChange","handleCustomFluidValues","min","max","handleMinChange","handleMaxChange","key","newFontSizes","map","handleRemoveFontSize","filter","toggleDeleteConfirm","toggleRenameDialog","children","isOpen","toggleOpen","handleRename","spacing","justify","align","title","name","description","marginTop","marginBottom","paddingX","TriggerButton","render","icon","label","Popover","Item","onClick","ItemLabel","paddingBottom","onChange","disabled","help","checked","__nextHasNoMarginBottom"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/font-size.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalSpacer as Spacer,\n\tuseNavigator,\n\t__experimentalView as View,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tFlexItem,\n\tToggleControl,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport ScreenHeader from '../header';\nimport FontSizePreview from './font-size-preview';\nimport ConfirmDeleteFontSizeDialog from './confirm-delete-font-size-dialog';\nimport RenameFontSizeDialog from './rename-font-size-dialog';\nimport SizeControl from '../size-control';\n\nconst { Menu } = unlock( componentsPrivateApis );\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontSize() {\n\tconst [ isDeleteConfirmOpen, setIsDeleteConfirmOpen ] = useState( false );\n\tconst [ isRenameDialogOpen, setIsRenameDialogOpen ] = useState( false );\n\n\tconst {\n\t\tparams: { origin, slug },\n\t\tgoBack,\n\t} = useNavigator();\n\n\tconst [ fontSizes, setFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes'\n\t);\n\n\tconst [ globalFluid ] = useGlobalSetting( 'typography.fluid' );\n\n\t// Get the font sizes from the origin, default to empty array.\n\tconst sizes = fontSizes[ origin ] ?? [];\n\n\t// Get the font size by slug.\n\tconst fontSize = sizes.find( ( size ) => size.slug === slug );\n\n\t// Navigate to the font sizes list if the font size is not available.\n\tuseEffect( () => {\n\t\tif ( !! slug && ! fontSize ) {\n\t\t\tgoBack();\n\t\t}\n\t}, [ slug, fontSize, goBack ] );\n\n\tif ( ! origin || ! slug || ! fontSize ) {\n\t\treturn null;\n\t}\n\n\t// Whether the font size is fluid. If not defined, use the global fluid value of the theme.\n\tconst isFluid =\n\t\tfontSize?.fluid !== undefined ? !! fontSize.fluid : !! globalFluid;\n\n\t// Whether custom fluid values are used.\n\tconst isCustomFluid = typeof fontSize?.fluid === 'object';\n\n\tconst handleNameChange = ( value ) => {\n\t\tupdateFontSize( 'name', value );\n\t};\n\n\tconst handleFontSizeChange = ( value ) => {\n\t\tupdateFontSize( 'size', value );\n\t};\n\n\tconst handleFluidChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', value );\n\t};\n\n\tconst handleCustomFluidValues = ( value ) => {\n\t\tif ( value ) {\n\t\t\t// If custom values are used, init the values with the current ones.\n\t\t\tupdateFontSize( 'fluid', {\n\t\t\t\tmin: fontSize.size,\n\t\t\t\tmax: fontSize.size,\n\t\t\t} );\n\t\t} else {\n\t\t\t// If custom fluid values are disabled, set fluid to true.\n\t\t\tupdateFontSize( 'fluid', true );\n\t\t}\n\t};\n\n\tconst handleMinChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', { ...fontSize.fluid, min: value } );\n\t};\n\n\tconst handleMaxChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', { ...fontSize.fluid, max: value } );\n\t};\n\n\tconst updateFontSize = ( key, value ) => {\n\t\tconst newFontSizes = sizes.map( ( size ) => {\n\t\t\tif ( size.slug === slug ) {\n\t\t\t\treturn { ...size, [ key ]: value }; // Create a new object with updated key\n\t\t\t}\n\t\t\treturn size;\n\t\t} );\n\n\t\tsetFontSizes( {\n\t\t\t...fontSizes,\n\t\t\t[ origin ]: newFontSizes,\n\t\t} );\n\t};\n\n\tconst handleRemoveFontSize = () => {\n\t\tconst newFontSizes = sizes.filter( ( size ) => size.slug !== slug );\n\t\tsetFontSizes( {\n\t\t\t...fontSizes,\n\t\t\t[ origin ]: newFontSizes,\n\t\t} );\n\t};\n\n\tconst toggleDeleteConfirm = () => {\n\t\tsetIsDeleteConfirmOpen( ! isDeleteConfirmOpen );\n\t};\n\n\tconst toggleRenameDialog = () => {\n\t\tsetIsRenameDialogOpen( ! isRenameDialogOpen );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ConfirmDeleteFontSizeDialog\n\t\t\t\tfontSize={ fontSize }\n\t\t\t\tisOpen={ isDeleteConfirmOpen }\n\t\t\t\ttoggleOpen={ toggleDeleteConfirm }\n\t\t\t\thandleRemoveFontSize={ handleRemoveFontSize }\n\t\t\t/>\n\n\t\t\t{ isRenameDialogOpen && (\n\t\t\t\t<RenameFontSizeDialog\n\t\t\t\t\tfontSize={ fontSize }\n\t\t\t\t\ttoggleOpen={ toggleRenameDialog }\n\t\t\t\t\thandleRename={ handleNameChange }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<HStack justify=\"space-between\" align=\"flex-start\">\n\t\t\t\t\t<ScreenHeader\n\t\t\t\t\t\ttitle={ fontSize.name }\n\t\t\t\t\t\tdescription={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: font size preset name. */\n\t\t\t\t\t\t\t__( 'Manage the font size %s.' ),\n\t\t\t\t\t\t\tfontSize.name\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ origin === 'custom' && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\t\tmarginTop={ 3 }\n\t\t\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\t\t\tpaddingX={ 4 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Menu>\n\t\t\t\t\t\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Font size options'\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\t<Menu.Popover>\n\t\t\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\t\t\tonClick={ toggleRenameDialog }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\t\t\tonClick={ toggleDeleteConfirm }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t\t\t</Menu>\n\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\n\t\t\t\t<View>\n\t\t\t\t\t<Spacer\n\t\t\t\t\t\tpaddingX={ 4 }\n\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\tpaddingBottom={ 6 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<FontSizePreview fontSize={ fontSize } />\n\t\t\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\t\t\t\tvalue={ ! isCustomFluid ? fontSize.size : '' }\n\t\t\t\t\t\t\t\tonChange={ handleFontSizeChange }\n\t\t\t\t\t\t\t\tdisabled={ isCustomFluid }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Fluid typography' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Scale the font size dynamically to fit the screen or viewport.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ isFluid }\n\t\t\t\t\t\t\t\tonChange={ handleFluidChange }\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{ isFluid && (\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom fluid values' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Set custom min and max values for the fluid font size.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ isCustomFluid }\n\t\t\t\t\t\t\t\t\tonChange={ handleCustomFluidValues }\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t{ isCustomFluid && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Minimum' ) }\n\t\t\t\t\t\t\t\t\t\tvalue={ fontSize.fluid?.min }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleMinChange }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Maximum' ) }\n\t\t\t\t\t\t\t\t\t\tvalue={ fontSize.fluid?.max }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleMaxChange }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</View>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default FontSize;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,YAAY,EACZC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BZ,WAAW,IAAIa,qBAAqB,EACpCC,MAAM,EACNC,QAAQ,EACRC,aAAa,QACP,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,OAAOC,YAAY,MAAM,WAAW;AACpC,OAAOC,eAAe,MAAM,qBA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GtF,EAAE,CAAE,SAAU,CAAG;gBACzBsD,KAAK,EAAGR,QAAQ,CAACI,KAAK,EAAEU,GAAK;gBAC7BgC,QAAQ,EAAG9B;cAAiB,CAC5B,CAAC;YAAA,CACD,CACF;UAAA,CACM;QAAC,CACF;MAAC,CACJ,CAAC;IAAA,CACA,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAe9B,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["privateApis","blockEditorPrivateApis","__","sprintf","__experimentalSpacer","Spacer","useNavigator","__experimentalView","View","__experimentalHStack","HStack","__experimentalVStack","VStack","componentsPrivateApis","Button","FlexItem","ToggleControl","moreVertical","useState","useEffect","unlock","ScreenHeader","FontSizePreview","ConfirmDeleteFontSizeDialog","RenameFontSizeDialog","SizeControl","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","useGlobalSetting","FontSize","_fontSizes$origin","isDeleteConfirmOpen","setIsDeleteConfirmOpen","isRenameDialogOpen","setIsRenameDialogOpen","params","origin","slug","goBack","fontSizes","setFontSizes","globalFluid","sizes","fontSize","find","size","isFluid","fluid","undefined","isCustomFluid","handleNameChange","value","updateFontSize","handleFontSizeChange","handleFluidChange","handleCustomFluidValues","min","max","handleMinChange","handleMaxChange","key","newFontSizes","map","handleRemoveFontSize","filter","toggleDeleteConfirm","toggleRenameDialog","children","isOpen","toggleOpen","handleRename","spacing","justify","align","title","name","description","marginTop","marginBottom","paddingX","TriggerButton","render","icon","label","Popover","Item","onClick","ItemLabel","paddingBottom","onChange","disabled","help","checked","__nextHasNoMarginBottom"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/font-size.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalSpacer as Spacer,\n\tuseNavigator,\n\t__experimentalView as View,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tFlexItem,\n\tToggleControl,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport ScreenHeader from '../header';\nimport FontSizePreview from './font-size-preview';\nimport ConfirmDeleteFontSizeDialog from './confirm-delete-font-size-dialog';\nimport RenameFontSizeDialog from './rename-font-size-dialog';\nimport SizeControl from '../size-control';\n\nconst { Menu } = unlock( componentsPrivateApis );\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontSize() {\n\tconst [ isDeleteConfirmOpen, setIsDeleteConfirmOpen ] = useState( false );\n\tconst [ isRenameDialogOpen, setIsRenameDialogOpen ] = useState( false );\n\n\tconst {\n\t\tparams: { origin, slug },\n\t\tgoBack,\n\t} = useNavigator();\n\n\tconst [ fontSizes, setFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes'\n\t);\n\n\tconst [ globalFluid ] = useGlobalSetting( 'typography.fluid' );\n\n\t// Get the font sizes from the origin, default to empty array.\n\tconst sizes = fontSizes[ origin ] ?? [];\n\n\t// Get the font size by slug.\n\tconst fontSize = sizes.find( ( size ) => size.slug === slug );\n\n\t// Navigate to the font sizes list if the font size is not available.\n\tuseEffect( () => {\n\t\tif ( !! slug && ! fontSize ) {\n\t\t\tgoBack();\n\t\t}\n\t}, [ slug, fontSize, goBack ] );\n\n\tif ( ! origin || ! slug || ! fontSize ) {\n\t\treturn null;\n\t}\n\n\t// Whether the font size is fluid. If not defined, use the global fluid value of the theme.\n\tconst isFluid =\n\t\tfontSize?.fluid !== undefined ? !! fontSize.fluid : !! globalFluid;\n\n\t// Whether custom fluid values are used.\n\tconst isCustomFluid = typeof fontSize?.fluid === 'object';\n\n\tconst handleNameChange = ( value ) => {\n\t\tupdateFontSize( 'name', value );\n\t};\n\n\tconst handleFontSizeChange = ( value ) => {\n\t\tupdateFontSize( 'size', value );\n\t};\n\n\tconst handleFluidChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', value );\n\t};\n\n\tconst handleCustomFluidValues = ( value ) => {\n\t\tif ( value ) {\n\t\t\t// If custom values are used, init the values with the current ones.\n\t\t\tupdateFontSize( 'fluid', {\n\t\t\t\tmin: fontSize.size,\n\t\t\t\tmax: fontSize.size,\n\t\t\t} );\n\t\t} else {\n\t\t\t// If custom fluid values are disabled, set fluid to true.\n\t\t\tupdateFontSize( 'fluid', true );\n\t\t}\n\t};\n\n\tconst handleMinChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', { ...fontSize.fluid, min: value } );\n\t};\n\n\tconst handleMaxChange = ( value ) => {\n\t\tupdateFontSize( 'fluid', { ...fontSize.fluid, max: value } );\n\t};\n\n\tconst updateFontSize = ( key, value ) => {\n\t\tconst newFontSizes = sizes.map( ( size ) => {\n\t\t\tif ( size.slug === slug ) {\n\t\t\t\treturn { ...size, [ key ]: value }; // Create a new object with updated key\n\t\t\t}\n\t\t\treturn size;\n\t\t} );\n\n\t\tsetFontSizes( {\n\t\t\t...fontSizes,\n\t\t\t[ origin ]: newFontSizes,\n\t\t} );\n\t};\n\n\tconst handleRemoveFontSize = () => {\n\t\tconst newFontSizes = sizes.filter( ( size ) => size.slug !== slug );\n\t\tsetFontSizes( {\n\t\t\t...fontSizes,\n\t\t\t[ origin ]: newFontSizes,\n\t\t} );\n\t};\n\n\tconst toggleDeleteConfirm = () => {\n\t\tsetIsDeleteConfirmOpen( ! isDeleteConfirmOpen );\n\t};\n\n\tconst toggleRenameDialog = () => {\n\t\tsetIsRenameDialogOpen( ! isRenameDialogOpen );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ConfirmDeleteFontSizeDialog\n\t\t\t\tfontSize={ fontSize }\n\t\t\t\tisOpen={ isDeleteConfirmOpen }\n\t\t\t\ttoggleOpen={ toggleDeleteConfirm }\n\t\t\t\thandleRemoveFontSize={ handleRemoveFontSize }\n\t\t\t/>\n\n\t\t\t{ isRenameDialogOpen && (\n\t\t\t\t<RenameFontSizeDialog\n\t\t\t\t\tfontSize={ fontSize }\n\t\t\t\t\ttoggleOpen={ toggleRenameDialog }\n\t\t\t\t\thandleRename={ handleNameChange }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<HStack justify=\"space-between\" align=\"flex-start\">\n\t\t\t\t\t<ScreenHeader\n\t\t\t\t\t\ttitle={ fontSize.name }\n\t\t\t\t\t\tdescription={ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: font size preset name. */\n\t\t\t\t\t\t\t__( 'Manage the font size %s.' ),\n\t\t\t\t\t\t\tfontSize.name\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ origin === 'custom' && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\t\tmarginTop={ 3 }\n\t\t\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\t\t\tpaddingX={ 4 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Menu>\n\t\t\t\t\t\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Font size options'\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\t<Menu.Popover>\n\t\t\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\t\t\tonClick={ toggleRenameDialog }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t\t\t<Menu.Item\n\t\t\t\t\t\t\t\t\t\t\tonClick={ toggleDeleteConfirm }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t\t\t</Menu>\n\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\n\t\t\t\t<View>\n\t\t\t\t\t<Spacer\n\t\t\t\t\t\tpaddingX={ 4 }\n\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\tpaddingBottom={ 6 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<FontSizePreview fontSize={ fontSize } />\n\t\t\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\t\t\t\tvalue={ ! isCustomFluid ? fontSize.size : '' }\n\t\t\t\t\t\t\t\tonChange={ handleFontSizeChange }\n\t\t\t\t\t\t\t\tdisabled={ isCustomFluid }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Fluid typography' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Scale the font size dynamically to fit the screen or viewport.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ isFluid }\n\t\t\t\t\t\t\t\tonChange={ handleFluidChange }\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{ isFluid && (\n\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom fluid values' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Set custom min and max values for the fluid font size.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tchecked={ isCustomFluid }\n\t\t\t\t\t\t\t\t\tonChange={ handleCustomFluidValues }\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t{ isCustomFluid && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Minimum' ) }\n\t\t\t\t\t\t\t\t\t\tvalue={ fontSize.fluid?.min }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleMinChange }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<SizeControl\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Maximum' ) }\n\t\t\t\t\t\t\t\t\t\tvalue={ fontSize.fluid?.max }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleMaxChange }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</Spacer>\n\t\t\t\t</View>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default FontSize;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC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bwE,KAAK,EAAGtF,EAAE,CAAE,qBAAsB,CAAG;cACrC8F,IAAI,EAAG9F,EAAE,CACR,wDACD,CAAG;cACH+F,OAAO,EAAG3C,aAAe;cACzBwC,QAAQ,EAAGlC,uBAAyB;cACpCsC,uBAAuB;YAAA,CACvB,CACD,EAEC5C,aAAa,iBACdzB,KAAA,CAAAE,SAAA;cAAAyC,QAAA,gBACC7C,IAAA,CAACF,WAAW;gBACX+D,KAAK,EAAGtF,EAAE,CAAE,SAAU,CAAG;gBACzBsD,KAAK,EAAGR,QAAQ,CAACI,KAAK,EAAES,GAAK;gBAC7BiC,QAAQ,EAAG/B;cAAiB,CAC5B,CAAC,eACFpC,IAAA,CAACF,WAAW;gBACX+D,KAAK,EAAGtF,EAAE,CAAE,SAAU,CAAG;gBACzBsD,KAAK,EAAGR,QAAQ,CAACI,KAAK,EAAEU,GAAK;gBAC7BgC,QAAQ,EAAG9B;cAAiB,CAC5B,CAAC;YAAA,CACD,CACF;UAAA,CACM;QAAC,CACF;MAAC,CACJ,CAAC;IAAA,CACA,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAe9B,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","blockEditorPrivateApis","__","sprintf","isRTL","componentsPrivateApis","__experimentalSpacer","Spacer","__experimentalView","View","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","Button","Icon","plus","moreVertical","chevronLeft","chevronRight","useState","unlock","Subtitle","NavigationButtonAsItem","getNewIndexFromPresets","ScreenHeader","ConfirmResetFontSizesDialog","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","useGlobalSetting","FontSizeGroup","label","origin","sizes","handleAddFontSize","handleResetFontSizes","isResetDialogOpen","setIsResetDialogOpen","toggleResetDialog","resetDialogText","children","text","confirmButtonText","isOpen","toggleOpen","onConfirm","spacing","justify","align","level","icon","size","onClick","TriggerButton","render","Popover","Item","ItemLabel","length","isBordered","isSeparated","map","path","slug","className","name","display","FontSizes","themeFontSizes","setThemeFontSizes","baseThemeFontSizes","defaultFontSizes","setDefaultFontSizes","baseDefaultFontSizes","customFontSizes","setCustomFontSizes","defaultFontSizesEnabled","index","newFontSize","hasSameSizeValues","arr1","arr2","item","join","title","description","paddingX","baseSizes"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/font-sizes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\t__experimentalSpacer as Spacer,\n\t__experimentalView as View,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tIcon,\n\tplus,\n\tmoreVertical,\n\tchevronLeft,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport Subtitle from '../subtitle';\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { getNewIndexFromPresets } from '../utils';\nimport ScreenHeader from '../header';\nimport ConfirmResetFontSizesDialog from './confirm-reset-font-sizes-dialog';\n\nconst { Menu } = unlock( componentsPrivateApis );\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontSizeGroup( {\n\tlabel,\n\torigin,\n\tsizes,\n\thandleAddFontSize,\n\thandleResetFontSizes,\n} ) {\n\tconst [ isResetDialogOpen, setIsResetDialogOpen ] = useState( false );\n\n\tconst toggleResetDialog = () => setIsResetDialogOpen( ! isResetDialogOpen );\n\n\tconst resetDialogText =\n\t\torigin === 'custom'\n\t\t\t? __(\n\t\t\t\t\t'Are you sure you want to remove all custom font size presets?'\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Are you sure you want to reset all font size presets to their default values?'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t{ isResetDialogOpen && (\n\t\t\t\t<ConfirmResetFontSizesDialog\n\t\t\t\t\ttext={ resetDialogText }\n\t\t\t\t\tconfirmButtonText={\n\t\t\t\t\t\torigin === 'custom' ? __( 'Remove' ) : __( 'Reset' )\n\t\t\t\t\t}\n\t\t\t\t\tisOpen={ isResetDialogOpen }\n\t\t\t\t\ttoggleOpen={ toggleResetDialog }\n\t\t\t\t\tonConfirm={ handleResetFontSizes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<HStack justify=\"space-between\" align=\"center\">\n\t\t\t\t\t<Subtitle level={ 3 }>{ label }</Subtitle>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t{ origin === 'custom' && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ __( 'Add font size' ) }\n\t\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tonClick={ handleAddFontSize }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! handleResetFontSizes && (\n\t\t\t\t\t\t\t<Menu>\n\t\t\t\t\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Font size presets options'\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/>\n\t\t\t\t\t\t\t\t<Menu.Popover>\n\t\t\t\t\t\t\t\t\t<Menu.Item onClick={ toggleResetDialog }>\n\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t{ origin === 'custom'\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\t\t\t'Remove font size presets'\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\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Reset font size presets'\n\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t\t</Menu>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</HStack>\n\n\t\t\t\t{ !! sizes.length && (\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t{ sizes.map( ( size ) => (\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tkey={ size.slug }\n\t\t\t\t\t\t\t\tpath={ `/typography/font-sizes/${ origin }/${ size.slug }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack>\n\t\t\t\t\t\t\t\t\t<FlexItem className=\"edit-site-font-size__item\">\n\t\t\t\t\t\t\t\t\t\t{ size.name }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<FlexItem display=\"flex\">\n\t\t\t\t\t\t\t\t\t\t<Icon\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</FlexItem>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nfunction FontSizes() {\n\tconst [ themeFontSizes, setThemeFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.theme'\n\t);\n\n\tconst [ baseThemeFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.theme',\n\t\tnull,\n\t\t'base'\n\t);\n\tconst [ defaultFontSizes, setDefaultFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.default'\n\t);\n\n\tconst [ baseDefaultFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.default',\n\t\tnull,\n\t\t'base'\n\t);\n\n\tconst [ customFontSizes = [], setCustomFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.custom'\n\t);\n\n\tconst [ defaultFontSizesEnabled ] = useGlobalSetting(\n\t\t'typography.defaultFontSizes'\n\t);\n\n\tconst handleAddFontSize = () => {\n\t\tconst index = getNewIndexFromPresets( customFontSizes, 'custom-' );\n\t\tconst newFontSize = {\n\t\t\t/* translators: %d: font size index */\n\t\t\tname: sprintf( __( 'New Font Size %d' ), index ),\n\t\t\tsize: '16px',\n\t\t\tslug: `custom-${ index }`,\n\t\t};\n\n\t\tsetCustomFontSizes( [ ...customFontSizes, newFontSize ] );\n\t};\n\n\tconst hasSameSizeValues = ( arr1, arr2 ) =>\n\t\tarr1.map( ( item ) => item.size ).join( '' ) ===\n\t\tarr2.map( ( item ) => item.size ).join( '' );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Font size presets' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Create and edit the presets used for font sizes across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<View>\n\t\t\t\t<Spacer paddingX={ 4 }>\n\t\t\t\t\t<VStack spacing={ 8 }>\n\t\t\t\t\t\t{ !! themeFontSizes?.length && (\n\t\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\t\tlabel={ __( 'Theme' ) }\n\t\t\t\t\t\t\t\torigin=\"theme\"\n\t\t\t\t\t\t\t\tsizes={ themeFontSizes }\n\t\t\t\t\t\t\t\tbaseSizes={ baseThemeFontSizes }\n\t\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\t\thasSameSizeValues(\n\t\t\t\t\t\t\t\t\t\tthemeFontSizes,\n\t\t\t\t\t\t\t\t\t\tbaseThemeFontSizes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetThemeFontSizes(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseThemeFontSizes\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ defaultFontSizesEnabled &&\n\t\t\t\t\t\t\t!! defaultFontSizes?.length && (\n\t\t\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t\t\torigin=\"default\"\n\t\t\t\t\t\t\t\t\tsizes={ defaultFontSizes }\n\t\t\t\t\t\t\t\t\tbaseSizes={ baseDefaultFontSizes }\n\t\t\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\t\t\thasSameSizeValues(\n\t\t\t\t\t\t\t\t\t\t\tdefaultFontSizes,\n\t\t\t\t\t\t\t\t\t\t\tbaseDefaultFontSizes\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetDefaultFontSizes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbaseDefaultFontSizes\n\t\t\t\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/>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\torigin=\"custom\"\n\t\t\t\t\t\t\tsizes={ customFontSizes }\n\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\tcustomFontSizes.length > 0\n\t\t\t\t\t\t\t\t\t? () => setCustomFontSizes( [] )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t</VStack>\n\t);\n}\n\nexport default FontSizes;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SACCJ,WAAW,IAAIK,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,uBAAuB,IAAIC,SAAS,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,QAAQ,EACRC,MAAM,QACA,uBAAuB;AAC9B,SACCC,IAAI,EACJC,IAAI,EACJC,YAAY,EACZC,WAAW,EACXC,YAAY,QACN,kBAAkB;AACzB,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,s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AAM,EAAC,SAAS;YAChBC,KAAK,EAAGsC,gBAAkB;YAC1BgB,SAAS,EAAGd,oBAAsB;YAClCvC,iBAAiB,EAAGA,iBAAmB;YACvCC,oBAAoB,EACnB4C,iBAAiB,CAChBR,gBAAgB,EAChBE,oBACD,CAAC,GACE,IAAI,GACJ,MACAD,mBAAmB,CAClBC,oBACD;UACH,CACD,CACD,eAEFlD,IAAA,CAACO,aAAa;YACbC,KAAK,EAAGrC,EAAE,CAAE,QAAS,CAAG;YACxBsC,MAAM,EAAC,QAAQ;YACfC,KAAK,EAAGyC,eAAiB;YACzBxC,iBAAiB,EAAGA,iBAAmB;YACvCC,oBAAoB,EACnBuC,eAAe,CAAChB,MAAM,GAAG,CAAC,GACvB,MAAMiB,kBAAkB,CAAE,EAAG,CAAC,GAC9B;UACH,CACD,CAAC;QAAA,CACK;MAAC,CACF;IAAC,CACJ,CAAC;EAAA,CACA,CAAC;AAEX;AAEA,eAAeR,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["privateApis","blockEditorPrivateApis","__","sprintf","isRTL","componentsPrivateApis","__experimentalSpacer","Spacer","__experimentalView","View","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","Button","Icon","plus","moreVertical","chevronLeft","chevronRight","useState","unlock","Subtitle","NavigationButtonAsItem","getNewIndexFromPresets","ScreenHeader","ConfirmResetFontSizesDialog","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","useGlobalSetting","FontSizeGroup","label","origin","sizes","handleAddFontSize","handleResetFontSizes","isResetDialogOpen","setIsResetDialogOpen","toggleResetDialog","resetDialogText","children","text","confirmButtonText","isOpen","toggleOpen","onConfirm","spacing","justify","align","level","icon","size","onClick","TriggerButton","render","Popover","Item","ItemLabel","length","isBordered","isSeparated","map","path","slug","className","name","display","FontSizes","themeFontSizes","setThemeFontSizes","baseThemeFontSizes","defaultFontSizes","setDefaultFontSizes","baseDefaultFontSizes","customFontSizes","setCustomFontSizes","defaultFontSizesEnabled","index","newFontSize","hasSameSizeValues","arr1","arr2","item","join","title","description","paddingX","baseSizes"],"sources":["@wordpress/edit-site/src/components/global-styles/font-sizes/font-sizes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\t__experimentalSpacer as Spacer,\n\t__experimentalView as View,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tIcon,\n\tplus,\n\tmoreVertical,\n\tchevronLeft,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport Subtitle from '../subtitle';\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { getNewIndexFromPresets } from '../utils';\nimport ScreenHeader from '../header';\nimport ConfirmResetFontSizesDialog from './confirm-reset-font-sizes-dialog';\n\nconst { Menu } = unlock( componentsPrivateApis );\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nfunction FontSizeGroup( {\n\tlabel,\n\torigin,\n\tsizes,\n\thandleAddFontSize,\n\thandleResetFontSizes,\n} ) {\n\tconst [ isResetDialogOpen, setIsResetDialogOpen ] = useState( false );\n\n\tconst toggleResetDialog = () => setIsResetDialogOpen( ! isResetDialogOpen );\n\n\tconst resetDialogText =\n\t\torigin === 'custom'\n\t\t\t? __(\n\t\t\t\t\t'Are you sure you want to remove all custom font size presets?'\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Are you sure you want to reset all font size presets to their default values?'\n\t\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t{ isResetDialogOpen && (\n\t\t\t\t<ConfirmResetFontSizesDialog\n\t\t\t\t\ttext={ resetDialogText }\n\t\t\t\t\tconfirmButtonText={\n\t\t\t\t\t\torigin === 'custom' ? __( 'Remove' ) : __( 'Reset' )\n\t\t\t\t\t}\n\t\t\t\t\tisOpen={ isResetDialogOpen }\n\t\t\t\t\ttoggleOpen={ toggleResetDialog }\n\t\t\t\t\tonConfirm={ handleResetFontSizes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<HStack justify=\"space-between\" align=\"center\">\n\t\t\t\t\t<Subtitle level={ 3 }>{ label }</Subtitle>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t{ origin === 'custom' && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ __( 'Add font size' ) }\n\t\t\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tonClick={ handleAddFontSize }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! handleResetFontSizes && (\n\t\t\t\t\t\t\t<Menu>\n\t\t\t\t\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Font size presets options'\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/>\n\t\t\t\t\t\t\t\t<Menu.Popover>\n\t\t\t\t\t\t\t\t\t<Menu.Item onClick={ toggleResetDialog }>\n\t\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t\t{ origin === 'custom'\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\t\t\t'Remove font size presets'\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\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Reset font size presets'\n\t\t\t\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t</Menu.Item>\n\t\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t\t</Menu>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</HStack>\n\n\t\t\t\t{ !! sizes.length && (\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t{ sizes.map( ( size ) => (\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tkey={ size.slug }\n\t\t\t\t\t\t\t\tpath={ `/typography/font-sizes/${ origin }/${ size.slug }` }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack>\n\t\t\t\t\t\t\t\t\t<FlexItem className=\"edit-site-font-size__item\">\n\t\t\t\t\t\t\t\t\t\t{ size.name }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<FlexItem display=\"flex\">\n\t\t\t\t\t\t\t\t\t\t<Icon\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</FlexItem>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nfunction FontSizes() {\n\tconst [ themeFontSizes, setThemeFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.theme'\n\t);\n\n\tconst [ baseThemeFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.theme',\n\t\tnull,\n\t\t'base'\n\t);\n\tconst [ defaultFontSizes, setDefaultFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.default'\n\t);\n\n\tconst [ baseDefaultFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.default',\n\t\tnull,\n\t\t'base'\n\t);\n\n\tconst [ customFontSizes = [], setCustomFontSizes ] = useGlobalSetting(\n\t\t'typography.fontSizes.custom'\n\t);\n\n\tconst [ defaultFontSizesEnabled ] = useGlobalSetting(\n\t\t'typography.defaultFontSizes'\n\t);\n\n\tconst handleAddFontSize = () => {\n\t\tconst index = getNewIndexFromPresets( customFontSizes, 'custom-' );\n\t\tconst newFontSize = {\n\t\t\t/* translators: %d: font size index */\n\t\t\tname: sprintf( __( 'New Font Size %d' ), index ),\n\t\t\tsize: '16px',\n\t\t\tslug: `custom-${ index }`,\n\t\t};\n\n\t\tsetCustomFontSizes( [ ...customFontSizes, newFontSize ] );\n\t};\n\n\tconst hasSameSizeValues = ( arr1, arr2 ) =>\n\t\tarr1.map( ( item ) => item.size ).join( '' ) ===\n\t\tarr2.map( ( item ) => item.size ).join( '' );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Font size presets' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Create and edit the presets used for font sizes across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<View>\n\t\t\t\t<Spacer paddingX={ 4 }>\n\t\t\t\t\t<VStack spacing={ 8 }>\n\t\t\t\t\t\t{ !! themeFontSizes?.length && (\n\t\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\t\tlabel={ __( 'Theme' ) }\n\t\t\t\t\t\t\t\torigin=\"theme\"\n\t\t\t\t\t\t\t\tsizes={ themeFontSizes }\n\t\t\t\t\t\t\t\tbaseSizes={ baseThemeFontSizes }\n\t\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\t\thasSameSizeValues(\n\t\t\t\t\t\t\t\t\t\tthemeFontSizes,\n\t\t\t\t\t\t\t\t\t\tbaseThemeFontSizes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetThemeFontSizes(\n\t\t\t\t\t\t\t\t\t\t\t\t\tbaseThemeFontSizes\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ defaultFontSizesEnabled &&\n\t\t\t\t\t\t\t!! defaultFontSizes?.length && (\n\t\t\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Default' ) }\n\t\t\t\t\t\t\t\t\torigin=\"default\"\n\t\t\t\t\t\t\t\t\tsizes={ defaultFontSizes }\n\t\t\t\t\t\t\t\t\tbaseSizes={ baseDefaultFontSizes }\n\t\t\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\t\t\thasSameSizeValues(\n\t\t\t\t\t\t\t\t\t\t\tdefaultFontSizes,\n\t\t\t\t\t\t\t\t\t\t\tbaseDefaultFontSizes\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetDefaultFontSizes(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbaseDefaultFontSizes\n\t\t\t\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/>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<FontSizeGroup\n\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\torigin=\"custom\"\n\t\t\t\t\t\t\tsizes={ customFontSizes }\n\t\t\t\t\t\t\thandleAddFontSize={ handleAddFontSize }\n\t\t\t\t\t\t\thandleResetFontSizes={\n\t\t\t\t\t\t\t\tcustomFontSizes.length > 0\n\t\t\t\t\t\t\t\t\t? () => setCustomFontSizes( [] )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t</VStack>\n\t);\n}\n\nexport default FontSizes;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SACCJ,WAAW,IAAIK,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,uBAAuB,IAAIC,SAAS,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,QAAQ,EACRC,MAAM,QACA,uBAAuB;AAC9B,SACCC,IAAI,EACJC,IAAI,EACJC,YAAY,EACZC,WAAW,EACXC,YAAY,QACN,kBAAkB;AACzB,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,UAAU;AACjD,OAAOC,YAAY,MAAM,WAAW;AACpC,OAAOC,2BAA2B,MAAM,mCAAmC;AAAC,S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C,iBAAiB,CAChBR,gBAAgB,EAChBE,oBACD,CAAC,GACE,IAAI,GACJ,MACAD,mBAAmB,CAClBC,oBACD;UACH,CACD,CACD,eAEFlD,IAAA,CAACO,aAAa;YACbC,KAAK,EAAGrC,EAAE,CAAE,QAAS,CAAG;YACxBsC,MAAM,EAAC,QAAQ;YACfC,KAAK,EAAGyC,eAAiB;YACzBxC,iBAAiB,EAAGA,iBAAmB;YACvCC,oBAAoB,EACnBuC,eAAe,CAAChB,MAAM,GAAG,CAAC,GACvB,MAAMiB,kBAAkB,CAAE,EAAG,CAAC,GAC9B;UACH,CACD,CAAC;QAAA,CACK;MAAC,CACF;IAAC,CACJ,CAAC;EAAA,CACA,CAAC;AAEX;AAEA,eAAeR,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__unstableMotion","motion","useStylesPreviewColors","jsx","_jsx","HighlightedColors","normalizedColorSwatchSize","ratio","highlightedColors","scaledSwatchSize","map","slug","color","index","div","style","height","width","background","borderRadius","animate","scale","opacity","initial","transition","delay"],"sources":["@wordpress/edit-site/src/components/global-styles/highlighted-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function HighlightedColors( {\n\tnormalizedColorSwatchSize,\n\tratio,\n} ) {\n\tconst { highlightedColors } = useStylesPreviewColors();\n\tconst scaledSwatchSize = normalizedColorSwatchSize * ratio;\n\treturn highlightedColors.map( ( { slug, color }, index ) => (\n\t\t<motion.div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\theight: scaledSwatchSize,\n\t\t\t\twidth: scaledSwatchSize,\n\t\t\t\tbackground: color,\n\t\t\t\tborderRadius: scaledSwatchSize / 2,\n\t\t\t} }\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: index === 1 ? 0.2 : 0.1,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["__unstableMotion","motion","useStylesPreviewColors","jsx","_jsx","HighlightedColors","normalizedColorSwatchSize","ratio","highlightedColors","scaledSwatchSize","map","slug","color","index","div","style","height","width","background","borderRadius","animate","scale","opacity","initial","transition","delay"],"sources":["@wordpress/edit-site/src/components/global-styles/highlighted-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function HighlightedColors( {\n\tnormalizedColorSwatchSize,\n\tratio,\n} ) {\n\tconst { highlightedColors } = useStylesPreviewColors();\n\tconst scaledSwatchSize = normalizedColorSwatchSize * ratio;\n\treturn highlightedColors.map( ( { slug, color }, index ) => (\n\t\t<motion.div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\theight: scaledSwatchSize,\n\t\t\t\twidth: scaledSwatchSize,\n\t\t\t\tbackground: color,\n\t\t\t\tborderRadius: scaledSwatchSize / 2,\n\t\t\t} }\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: index === 1 ? 0.2 : 0.1,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;;AAElE;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,yBAAyB;EACzBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAkB,CAAC,GAAGN,sBAAsB,CAAC,CAAC;EACtD,MAAMO,gBAAgB,GAAGH,yBAAyB,GAAGC,KAAK;EAC1D,OAAOC,iBAAiB,CAACE,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,kBACrDT,IAAA,CAACH,MAAM,CAACa,GAAG;IAEVC,KAAK,EAAG;MACPC,MAAM,EAAEP,gBAAgB;MACxBQ,KAAK,EAAER,gBAAgB;MACvBS,UAAU,EAAEN,KAAK;MACjBO,YAAY,EAAEV,gBAAgB,GAAG;IAClC,CAAG;IACHW,OAAO,EAAG;MACTC,KAAK,EAAE,CAAC;MACRC,OAAO,EAAE;IACV,CAAG;IACHC,OAAO,EAAG;MACTF,KAAK,EAAE,GAAG;MACVC,OAAO,EAAE;IACV,CAAG;IACHE,UAAU,EAAG;MACZC,KAAK,EAAEZ,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG;IAC5B;EAAG,GAjBG,GAAIF,IAAI,IAAME,KAAK,EAkBzB,CACA,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["colord","extend","a11yPlugin","store","blocksStore","privateApis","blockEditorPrivateApis","unlock","useSelect","useGlobalSetting","useGlobalStyle","useColorRandomizer","name","themeColors","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer","useStylesPreviewColors","textColor","backgroundColor","headingColor","linkColor","buttonBackgroundColor","coreColors","customColors","paletteColors","concat","textColorObject","filter","buttonBackgroundColorObject","highlightedColors","slice","useSupportedStyles","element","supportedPanels","select","getSupportedStyles"],"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useSelect } from '@wordpress/data';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n\nexport function useStylesPreviewColors() {\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\tconst [ linkColor = headingColor ] = useGlobalStyle(\n\t\t'elements.link.color.text'\n\t);\n\n\tconst [ buttonBackgroundColor = linkColor ] = useGlobalStyle(\n\t\t'elements.button.color.background'\n\t);\n\tconst [ coreColors ] = useGlobalSetting( 'color.palette.core' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\n\tconst paletteColors = ( themeColors ?? [] )\n\t\t.concat( customColors ?? [] )\n\t\t.concat( coreColors ?? [] );\n\n\tconst textColorObject = paletteColors.filter(\n\t\t( { color } ) => color === textColor\n\t);\n\tconst buttonBackgroundColorObject = paletteColors.filter(\n\t\t( { color } ) => color === buttonBackgroundColor\n\t);\n\n\tconst highlightedColors = textColorObject\n\t\t.concat( buttonBackgroundColorObject )\n\t\t.concat( paletteColors )\n\t\t.filter(\n\t\t\t// we exclude these background color because it is already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor\n\t\t)\n\t\t.slice( 0, 2 );\n\n\treturn {\n\t\tpaletteColors,\n\t\thighlightedColors,\n\t};\n}\n\nexport function useSupportedStyles( name, element ) {\n\tconst { supportedPanels } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedPanels: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( name, element ),\n\t\t\t};\n\t\t},\n\t\t[ name, element ]\n\t);\n\n\treturn supportedPanels;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["colord","extend","a11yPlugin","store","blocksStore","privateApis","blockEditorPrivateApis","unlock","useSelect","useGlobalSetting","useGlobalStyle","useColorRandomizer","name","themeColors","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer","useStylesPreviewColors","textColor","backgroundColor","headingColor","linkColor","buttonBackgroundColor","coreColors","customColors","paletteColors","concat","textColorObject","filter","buttonBackgroundColorObject","highlightedColors","slice","useSupportedStyles","element","supportedPanels","select","getSupportedStyles"],"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useSelect } from '@wordpress/data';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n\nexport function useStylesPreviewColors() {\n\tconst [ textColor = 'black' ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ headingColor = textColor ] = useGlobalStyle(\n\t\t'elements.h1.color.text'\n\t);\n\tconst [ linkColor = headingColor ] = useGlobalStyle(\n\t\t'elements.link.color.text'\n\t);\n\n\tconst [ buttonBackgroundColor = linkColor ] = useGlobalStyle(\n\t\t'elements.button.color.background'\n\t);\n\tconst [ coreColors ] = useGlobalSetting( 'color.palette.core' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\n\tconst paletteColors = ( themeColors ?? [] )\n\t\t.concat( customColors ?? [] )\n\t\t.concat( coreColors ?? [] );\n\n\tconst textColorObject = paletteColors.filter(\n\t\t( { color } ) => color === textColor\n\t);\n\tconst buttonBackgroundColorObject = paletteColors.filter(\n\t\t( { color } ) => color === buttonBackgroundColor\n\t);\n\n\tconst highlightedColors = textColorObject\n\t\t.concat( buttonBackgroundColorObject )\n\t\t.concat( paletteColors )\n\t\t.filter(\n\t\t\t// we exclude these background color because it is already visible in the preview.\n\t\t\t( { color } ) => color !== backgroundColor\n\t\t)\n\t\t.slice( 0, 2 );\n\n\treturn {\n\t\tpaletteColors,\n\t\thighlightedColors,\n\t};\n}\n\nexport function useSupportedStyles( name, element ) {\n\tconst { supportedPanels } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedPanels: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( name, element ),\n\t\t\t};\n\t\t},\n\t\t[ name, element ]\n\t);\n\n\treturn supportedPanels;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,OAAOC,UAAU,MAAM,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,MAAM;EAAEC,gBAAgB;EAAEC;AAAe,CAAC,GAAGH,MAAM,CAAED,sBAAuB,CAAC;;AAE7E;AACAL,MAAM,CAAE,CAAEC,UAAU,CAAG,CAAC;AAExB,OAAO,SAASS,kBAAkBA,CAAEC,IAAI,EAAG;EAC1C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGL,gBAAgB,CACvD,qBAAqB,EACrBG,IACD,CAAC;EAED,SAASG,eAAeA,CAAA,EAAG;IAC1B;IACA,MAAMC,mBAAmB,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,GAAI,CAAC;IAC7D;;IAEA,MAAM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AVA,UAAU,cAAVA,UAAU,GAAI,EAAG,CAAC;EAE5B,MAAMI,eAAe,GAAGF,aAAa,CAACG,MAAM,CAC3C,CAAE;IAAEjB;EAAM,CAAC,KAAMA,KAAK,KAAKO,SAC5B,CAAC;EACD,MAAMW,2BAA2B,GAAGJ,aAAa,CAACG,MAAM,CACvD,CAAE;IAAEjB;EAAM,CAAC,KAAMA,KAAK,KAAKW,qBAC5B,CAAC;EAED,MAAMQ,iBAAiB,GAAGH,eAAe,CACvCD,MAAM,CAAEG,2BAA4B,CAAC,CACrCH,MAAM,CAAED,aAAc,CAAC,CACvBG,MAAM;EACN;EACA,CAAE;IAAEjB;EAAM,CAAC,KAAMA,KAAK,KAAKQ,eAC5B,CAAC,CACAY,KAAK,CAAE,CAAC,EAAE,CAAE,CAAC;EAEf,OAAO;IACNN,aAAa;IACbK;EACD,CAAC;AACF;AAEA,OAAO,SAASE,kBAAkBA,CAAEhC,IAAI,EAAEiC,OAAO,EAAG;EACnD,MAAM;IAAEC;EAAgB,CAAC,GAAGtC,SAAS,CAClCuC,MAAM,IAAM;IACb,OAAO;MACND,eAAe,EAAEvC,MAAM,CACtBwC,MAAM,CAAE3C,WAAY,CACrB,CAAC,CAAC4C,kBAAkB,CAAEpC,IAAI,EAAEiC,OAAQ;IACrC,CAAC;EACF,CAAC,EACD,CAAEjC,IAAI,EAAEiC,OAAO,CAChB,CAAC;EAED,OAAOC,eAAe;AACvB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","ColorIndicator","Button","isRTL","__","Icon","shuffle","chevronLeft","chevronRight","useMemo","privateApis","blockEditorPrivateApis","Subtitle","NavigationButtonAsItem","useColorRandomizer","ColorIndicatorWrapper","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useGlobalSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","spacing","children","level","isBordered","isSeparated","path","direction","length","isLayered","offset","slice","map","color","index","colorValue","isBlock","icon","window","__experimentalEnableColorRandomizer","__next40pxDefaultSize","variant","onClick"],"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { Icon, shuffle, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem path={ screenPath }>\n\t\t\t\t\t<HStack direction=\"row\">\n\t\t\t\t\t\t{ colors.length > 0 ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorValue={ color }\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</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t\t{ __( 'Edit palette' ) }\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Add colors' ) }</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Icon icon={ isRTL() ? chevronLeft : chevronRight } />\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ window.__experimentalEnableColorRandomizer &&\n\t\t\t\tthemeColors?.length > 0 && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","FlexItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalVStack","VStack","ColorIndicator","Button","isRTL","__","Icon","shuffle","chevronLeft","chevronRight","useMemo","privateApis","blockEditorPrivateApis","Subtitle","NavigationButtonAsItem","useColorRandomizer","ColorIndicatorWrapper","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useGlobalSetting","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","spacing","children","level","isBordered","isSeparated","path","direction","length","isLayered","offset","slice","map","color","index","colorValue","isBlock","icon","window","__experimentalEnableColorRandomizer","__next40pxDefaultSize","variant","onClick"],"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { Icon, shuffle, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem path={ screenPath }>\n\t\t\t\t\t<HStack direction=\"row\">\n\t\t\t\t\t\t{ colors.length > 0 ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorIndicator\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorValue={ color }\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</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t\t{ __( 'Edit palette' ) }\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Add colors' ) }</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Icon icon={ isRTL() ? chevronLeft : chevronRight } />\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ window.__experimentalEnableColorRandomizer &&\n\t\t\t\tthemeColors?.length > 0 && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,EACdC,MAAM,QACA,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,EAAEC,OAAO,EAAEC,WAAW,EAAEC,YAAY,QAAQ,kBAAkB;AAC3E,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,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ChB,MAAM;MACNoD,qBAAqB;MACrBC,OAAO,EAAC,WAAW;MACnBJ,IAAI,EAAG7C,OAAS;MAChBkD,OAAO,EAAGzB,oBAAsB;MAAAK,QAAA,EAE9BhC,EAAE,CAAE,kBAAmB;IAAC,CACnB,CACR;EAAA,CACK,CAAC;AAEX;AAEA,eAAeqB,OAAO","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStylesPreviewColors","jsx","_jsx","PresetColors","paletteColors","slice","map","slug","color","index","style","flexGrow","height","background"],"sources":["@wordpress/edit-site/src/components/global-styles/preset-colors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function PresetColors() {\n\tconst { paletteColors } = useStylesPreviewColors();\n\treturn paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (\n\t\t<div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\tflexGrow: 1,\n\t\t\t\theight: '100%',\n\t\t\t\tbackground: color,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useStylesPreviewColors","jsx","_jsx","PresetColors","paletteColors","slice","map","slug","color","index","style","flexGrow","height","background"],"sources":["@wordpress/edit-site/src/components/global-styles/preset-colors.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useStylesPreviewColors } from './hooks';\n\nexport default function PresetColors() {\n\tconst { paletteColors } = useStylesPreviewColors();\n\treturn paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (\n\t\t<div\n\t\t\tkey={ `${ slug }-${ index }` }\n\t\t\tstyle={ {\n\t\t\t\tflexGrow: 1,\n\t\t\t\theight: '100%',\n\t\t\t\tbackground: color,\n\t\t\t} }\n\t\t/>\n\t) );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAc,CAAC,GAAGJ,sBAAsB,CAAC,CAAC;EAClD,OAAOI,aAAa,CAACC,KAAK,CAAE,CAAC,EAAE,CAAE,CAAC,CAACC,GAAG,CAAE,CAAE;IAAEC,IAAI;IAAEC;EAAM,CAAC,EAAEC,KAAK,kBAC/DP,IAAA;IAECQ,KAAK,EAAG;MACPC,QAAQ,EAAE,CAAC;MACXC,MAAM,EAAE,MAAM;MACdC,UAAU,EAAEL;IACb;EAAG,GALG,GAAID,IAAI,IAAME,KAAK,EAMzB,CACA,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","blockEditorPrivateApis","__experimentalHStack","HStack","__experimentalVStack","VStack","__unstableMotion","motion","unlock","useStylesPreviewColors","TypographyExample","HighlightedColors","PreviewWrapper","jsx","_jsx","jsxs","_jsxs","useGlobalStyle","firstFrameVariants","start","scale","opacity","hover","midFrameVariants","secondFrameVariants","PreviewStyles","label","isFocused","withHoverView","variation","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","paletteColors","children","ratio","key","div","variants","style","height","overflow","spacing","justify","fontSize","normalizedColorSwatchSize","width","position","top","filter","slice","map","color","index","background","flexGrow","padding","boxSizing","lineHeight","textAlign"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useStylesPreviewColors } from './hooks';\nimport TypographyExample from './typography-example';\nimport HighlightedColors from './highlighted-colors';\nimport PreviewWrapper from './preview-wrapper';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst firstFrameVariants = {\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 midFrameVariants = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrameVariants = {\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 PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {\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\n\tconst { paletteColors } = useStylesPreviewColors();\n\n\treturn (\n\t\t<PreviewWrapper\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\t\tfontSize={ 65 * ratio }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 32 }\n\t\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ withHoverView && midFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ secondFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\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</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewWrapper>\n\t);\n};\n\nexport default PreviewStyles;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["privateApis","blockEditorPrivateApis","__experimentalHStack","HStack","__experimentalVStack","VStack","__unstableMotion","motion","unlock","useStylesPreviewColors","TypographyExample","HighlightedColors","PreviewWrapper","jsx","_jsx","jsxs","_jsxs","useGlobalStyle","firstFrameVariants","start","scale","opacity","hover","midFrameVariants","secondFrameVariants","PreviewStyles","label","isFocused","withHoverView","variation","fontWeight","fontFamily","headingFontFamily","headingFontWeight","textColor","headingColor","paletteColors","children","ratio","key","div","variants","style","height","overflow","spacing","justify","fontSize","normalizedColorSwatchSize","width","position","top","filter","slice","map","color","index","background","flexGrow","padding","boxSizing","lineHeight","textAlign"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { useStylesPreviewColors } from './hooks';\nimport TypographyExample from './typography-example';\nimport HighlightedColors from './highlighted-colors';\nimport PreviewWrapper from './preview-wrapper';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst firstFrameVariants = {\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 midFrameVariants = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrameVariants = {\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 PreviewStyles = ( { label, isFocused, withHoverView, variation } ) => {\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\n\tconst { paletteColors } = useStylesPreviewColors();\n\n\treturn (\n\t\t<PreviewWrapper\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\t\tfontSize={ 65 * ratio }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 32 }\n\t\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ withHoverView && midFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ secondFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\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</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewWrapper>\n\t);\n};\n\nexport default PreviewStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;;AAE9B;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,SAAS;AAChD,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,cAAc,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/C,MAAM;EAAEC;AAAe,CAAC,GAAGT,MAAM,CAAEP,sBAAuB,CAAC;AAE3D,MAAMiB,kBAAkB,GAAG;EAC1BC,KAAK,EAAE;IACNC,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACNF,KAAK,EAAE,CAAC;IACRC,OAAO,EAAE;EACV;AACD,CAAC;AA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E;UACX;QAAG,GALGF,KAMN,CACA;MAAC,CACG;IAAC,GAhCHjB,GAiCK,CACZ,EACC,CAAE;MAAED,KAAK;MAAEC;IAAI,CAAC,kBACjBzB,IAAA,CAACP,MAAM,CAACiC,GAAG;MAEVC,QAAQ,EAAGjB,mBAAqB;MAChCkB,KAAK,EAAG;QACPC,MAAM,EAAE,MAAM;QACdM,KAAK,EAAE,MAAM;QACbL,QAAQ,EAAE,QAAQ;QAClBM,QAAQ,EAAE,UAAU;QACpBC,GAAG,EAAE;MACN,CAAG;MAAAd,QAAA,eAEHvB,IAAA,CAACT,MAAM;QACNwC,OAAO,EAAG,CAAC,GAAGP,KAAO;QACrBQ,OAAO,EAAC,QAAQ;QAChBJ,KAAK,EAAG;UACPC,MAAM,EAAE,MAAM;UACdC,QAAQ,EAAE,QAAQ;UAClBe,OAAO,EAAE,EAAE,GAAGrB,KAAK;UACnBsB,SAAS,EAAE;QACZ,CAAG;QAAAvB,QAAA,EAEDX,KAAK,iBACNZ,IAAA;UACC4B,KAAK,EAAG;YACPK,QAAQ,EAAE,EAAE,GAAGT,KAAK;YACpBP,UAAU,EAAEC,iBAAiB;YAC7BuB,KAAK,EAAEpB,YAAY;YACnBL,UAAU,EAAEG,iBAAiB;YAC7B4B,UAAU,EAAE,KAAK;YACjBC,SAAS,EAAE;UACZ,CAAG;UAAAzB,QAAA,EAEDX;QAAK,CACH;MACL,CACM;IAAC,GAlCHa,GAmCK,CACZ;EAAA,CACc,CAAC;AAEnB,CAAC;AAED,eAAed,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","blockEditorPrivateApis","__unstableMotion","motion","useThrottle","useReducedMotion","useResizeObserver","useLayoutEffect","useState","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useGlobalStyle","normalizedWidth","normalizedHeight","THROTTLE_OPTIONS","leading","trailing","PreviewWrapper","children","label","isFocused","withHoverView","backgroundColor","gradientValue","disableMotion","isHovered","setIsHovered","containerResizeListener","width","throttledWidth","setThrottledWidthState","ratioState","setRatioState","setThrottledWidth","newRatio","ratioDiff","isRatioDiffBigEnough","Math","abs","fallbackRatio","ratio","isReady","style","position","className","height","onMouseEnter","onMouseLeave","tabIndex","div","background","cursor","undefined","initial","animate","concat","map","child","key"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-wrapper.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\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\nexport default function PreviewWrapper( {\n\tchildren,\n\tlabel,\n\tisFocused,\n\twithHoverView,\n} ) {\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\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 container 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 container 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/*\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\t */\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\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<div\n\t\t\t\t\tclassName=\"edit-site-global-styles-preview__wrapper\"\n\t\t\t\t\tstyle={ {\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<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{ []\n\t\t\t\t\t\t\t.concat( children ) // This makes sure children is always an array.\n\t\t\t\t\t\t\t.map( ( child, key ) => child( { ratio, key } ) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["privateApis","blockEditorPrivateApis","__unstableMotion","motion","useThrottle","useReducedMotion","useResizeObserver","useLayoutEffect","useState","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useGlobalStyle","normalizedWidth","normalizedHeight","THROTTLE_OPTIONS","leading","trailing","PreviewWrapper","children","label","isFocused","withHoverView","backgroundColor","gradientValue","disableMotion","isHovered","setIsHovered","containerResizeListener","width","throttledWidth","setThrottledWidthState","ratioState","setRatioState","setThrottledWidth","newRatio","ratioDiff","isRatioDiffBigEnough","Math","abs","fallbackRatio","ratio","isReady","style","position","className","height","onMouseEnter","onMouseLeave","tabIndex","div","background","cursor","undefined","initial","animate","concat","map","child","key"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-wrapper.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\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\nexport default function PreviewWrapper( {\n\tchildren,\n\tlabel,\n\tisFocused,\n\twithHoverView,\n} ) {\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\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 container 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 container 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/*\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\t */\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\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<div\n\t\t\t\t\tclassName=\"edit-site-global-styles-preview__wrapper\"\n\t\t\t\t\tstyle={ {\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<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{ []\n\t\t\t\t\t\t\t.concat( children ) // This makes sure children is always an array.\n\t\t\t\t\t\t\t.map( ( child, key ) => child( { ratio, key } ) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,gBAAg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ACR,MAAM,CAACmD,GAAG;QACVP,KAAK,EAAG;UACPG,MAAM,EAAEhC,gBAAgB,GAAG2B,KAAK;UAChCZ,KAAK,EAAE,MAAM;UACbsB,UAAU,EAAE3B,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAID,eAAe;UAC5C6B,MAAM,EAAE9B,aAAa,GAAG,SAAS,GAAG+B;QACrC,CAAG;QACHC,OAAO,EAAC,OAAO;QACfC,OAAO,EACN,CAAE7B,SAAS,IAAIL,SAAS,KACxB,CAAEI,aAAa,IACfL,KAAK,GACF,OAAO,GACP,OACH;QAAAD,QAAA,EAEC,EAAE,CACFqC,MAAM,CAAErC,QAAS,CAAC,CAAC;QAAA,CACnBsC,GAAG,CAAE,CAAEC,KAAK,EAAEC,GAAG,KAAMD,KAAK,CAAE;UAAEjB,KAAK;UAAEkB;QAAI,CAAE,CAAE;MAAC,CACvC;IAAC,CACT,CACL;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* wp:polyfill */
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
5
4
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
6
5
|
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
7
|
-
import { FlexItem, SearchControl, __experimentalHStack as HStack } from '@wordpress/components';
|
|
6
|
+
import { FlexItem, SearchControl, __experimentalHStack as HStack, __experimentalText as Text } from '@wordpress/components';
|
|
8
7
|
import { useSelect } from '@wordpress/data';
|
|
9
8
|
import { useState, useEffect, useRef, useDeferredValue, memo } from '@wordpress/element';
|
|
10
9
|
import { BlockIcon, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
@@ -114,8 +113,15 @@ function BlockList({
|
|
|
114
113
|
}, [filterValue, debouncedSpeak]);
|
|
115
114
|
return /*#__PURE__*/_jsx("div", {
|
|
116
115
|
ref: blockTypesListRef,
|
|
117
|
-
className: "edit-site-block-types-item-list"
|
|
118
|
-
|
|
116
|
+
className: "edit-site-block-types-item-list"
|
|
117
|
+
// By default, BlockMenuItem has a role=listitem so this div must have a list role.
|
|
118
|
+
,
|
|
119
|
+
role: "list",
|
|
120
|
+
children: filteredBlockTypes.length === 0 ? /*#__PURE__*/_jsx(Text, {
|
|
121
|
+
align: "center",
|
|
122
|
+
as: "p",
|
|
123
|
+
children: __('No blocks found.')
|
|
124
|
+
}) : filteredBlockTypes.map(block => /*#__PURE__*/_jsx(BlockMenuItem, {
|
|
119
125
|
block: block
|
|
120
126
|
}, 'menu-itemblock-' + block.name))
|
|
121
127
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","__","sprintf","_n","FlexItem","SearchControl","__experimentalHStack","HStack","useSelect","useState","useEffect","useRef","useDeferredValue","memo","BlockIcon","privateApis","blockEditorPrivateApis","useDebounce","speak","useBlockVariations","ScreenHeader","NavigationButtonAsItem","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useSortedBlockTypes","blockItems","select","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","path","encodeURIComponent","children","justify","icon","title","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","count","current","childElementCount","resultsFoundMessage","ref","className","map","MemoizedBlockList","ScreenBlockList","setFilterValue","deferredFilterValue","description","__nextHasNoMarginBottom","onChange","value","label","placeholder"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.map( ( block ) => (\n\t\t\t\t<BlockMenuItem\n\t\t\t\t\tblock={ block }\n\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterValue={ deferredFilterValue } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SACCC,QAAQ,EACRC,aAAa,EACbC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;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AAU,CAAC;AAE3C,SAASiB,eAAeA,CAAA,EAAG;EAC1B,MAAM,CAAEhB,WAAW,EAAEiB,cAAc,CAAE,GAAGhF,QAAQ,CAAE,EAAG,CAAC;EACtD,MAAMiF,mBAAmB,GAAG9E,gBAAgB,CAAE4D,WAAY,CAAC;EAE3D,oBACC9C,KAAA,CAAAE,SAAA;IAAAuC,QAAA,gBACC3C,IAAA,CAACJ,YAAY;MACZkD,KAAK,EAAGrE,EAAE,CAAE,QAAS,CAAG;MACxB0F,WAAW,EAAG1F,EAAE,CACf,qEACD;IAAG,CACH,CAAC,eACFuB,IAAA,CAACnB,aAAa;MACbuF,uBAAuB;MACvBP,SAAS,EAAC,8BAA8B;MACxCQ,QAAQ,EAAGJ,cAAgB;MAC3BK,KAAK,EAAGtB,WAAa;MACrBuB,KAAK,EAAG9F,EAAE,CAAE,QAAS,CAAG;MACxB+F,WAAW,EAAG/F,EAAE,CAAE,QAAS;IAAG,CAC9B,CAAC,eACFuB,IAAA,CAAC+D,iBAAiB;MAACf,WAAW,EAAGkB;IAAqB,CAAE,CAAC;EAAA,CACxD,CAAC;AAEL;AAEA,eAAeF,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["store","blocksStore","__","sprintf","_n","FlexItem","SearchControl","__experimentalHStack","HStack","__experimentalText","Text","useSelect","useState","useEffect","useRef","useDeferredValue","memo","BlockIcon","privateApis","blockEditorPrivateApis","useDebounce","speak","useBlockVariations","ScreenHeader","NavigationButtonAsItem","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHasDimensionsPanel","useHasTypographyPanel","useHasBorderPanel","useGlobalSetting","useSettingsForBlockElement","useHasColorPanel","useSortedBlockTypes","blockItems","select","getBlockTypes","groupByType","blocks","block","core","noncore","type","name","startsWith","push","coreItems","nonCoreItems","reduce","useBlockHasGlobalStyles","blockName","rawSettings","settings","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","length","hasGlobalStyles","BlockMenuItem","hasBlockMenuItem","path","encodeURIComponent","children","justify","icon","title","BlockList","filterValue","sortedBlockTypes","debouncedSpeak","isMatchingSearchTerm","filteredBlockTypes","filter","blockType","blockTypesListRef","count","current","childElementCount","resultsFoundMessage","ref","className","role","align","as","map","MemoizedBlockList","ScreenBlockList","setFilterValue","deferredFilterValue","description","__nextHasNoMarginBottom","onChange","value","label","placeholder"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-block-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport {\n\tFlexItem,\n\tSearchControl,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tuseDeferredValue,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tBlockIcon,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { useBlockVariations } from './variations/variations-panel';\nimport ScreenHeader from './header';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasBorderPanel,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tuseHasColorPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction useSortedBlockTypes() {\n\tconst blockItems = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\t// Ensure core blocks are prioritized in the returned results,\n\t// because third party blocks can be registered earlier than\n\t// the core blocks (usually by using the `init` action),\n\t// thus affecting the display order.\n\t// We don't sort reusable blocks as they are handled differently.\n\tconst groupByType = ( blocks, block ) => {\n\t\tconst { core, noncore } = blocks;\n\t\tconst type = block.name.startsWith( 'core/' ) ? core : noncore;\n\t\ttype.push( block );\n\t\treturn blocks;\n\t};\n\tconst { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(\n\t\tgroupByType,\n\t\t{ core: [], noncore: [] }\n\t);\n\treturn [ ...coreItems, ...nonCoreItems ];\n}\n\nexport function useBlockHasGlobalStyles( blockName ) {\n\tconst [ rawSettings ] = useGlobalSetting( '', blockName );\n\tconst settings = useSettingsForBlockElement( rawSettings, blockName );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasBorderPanel = useHasBorderPanel( settings );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasBorderPanel || hasDimensionsPanel;\n\tconst hasVariationsPanel = !! useBlockVariations( blockName )?.length;\n\tconst hasGlobalStyles =\n\t\thasTypographyPanel ||\n\t\thasColorPanel ||\n\t\thasLayoutPanel ||\n\t\thasVariationsPanel;\n\treturn hasGlobalStyles;\n}\n\nfunction BlockMenuItem( { block } ) {\n\tconst hasBlockMenuItem = useBlockHasGlobalStyles( block.name );\n\tif ( ! hasBlockMenuItem ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<BlockIcon icon={ block.icon } />\n\t\t\t\t<FlexItem>{ block.title }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction BlockList( { filterValue } ) {\n\tconst sortedBlockTypes = useSortedBlockTypes();\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst { isMatchingSearchTerm } = useSelect( blocksStore );\n\n\tconst filteredBlockTypes = ! filterValue\n\t\t? sortedBlockTypes\n\t\t: sortedBlockTypes.filter( ( blockType ) =>\n\t\t\t\tisMatchingSearchTerm( blockType, filterValue )\n\t\t );\n\n\tconst blockTypesListRef = useRef();\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\t\t// We extract the results from the wrapper div's `ref` because\n\t\t// filtered items can contain items that will eventually not\n\t\t// render and there is no reliable way to detect when a child\n\t\t// will return `null`.\n\t\t// TODO: We should find a better way of handling this as it's\n\t\t// fragile and depends on the number of rendered elements of `BlockMenuItem`,\n\t\t// which is now one.\n\t\t// @see https://github.com/WordPress/gutenberg/pull/39117#discussion_r816022116\n\t\tconst count = blockTypesListRef.current.childElementCount;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage, count );\n\t}, [ filterValue, debouncedSpeak ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ blockTypesListRef }\n\t\t\tclassName=\"edit-site-block-types-item-list\"\n\t\t\t// By default, BlockMenuItem has a role=listitem so this div must have a list role.\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t{ filteredBlockTypes.length === 0 ? (\n\t\t\t\t<Text align=\"center\" as=\"p\">\n\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\tfilteredBlockTypes.map( ( block ) => (\n\t\t\t\t\t<BlockMenuItem\n\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\tkey={ 'menu-itemblock-' + block.name }\n\t\t\t\t\t/>\n\t\t\t\t) )\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nconst MemoizedBlockList = memo( BlockList );\n\nfunction ScreenBlockList() {\n\tconst [ filterValue, setFilterValue ] = useState( '' );\n\tconst deferredFilterValue = useDeferredValue( filterValue );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Blocks' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of specific blocks and for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tclassName=\"edit-site-block-types-search\"\n\t\t\t\tonChange={ setFilterValue }\n\t\t\t\tvalue={ filterValue }\n\t\t\t\tlabel={ __( 'Search' ) }\n\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t/>\n\t\t\t<MemoizedBlockList filterValue={ deferredFilterValue } />\n\t\t</>\n\t);\n}\n\nexport default ScreenBlockList;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SACCC,QAAQ,EACRC,aAAa,EACbC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,SAAS,EACTC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,QACE,oBAAoB;AAC3B,SACCC,SAAS,EACTC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,OAAOC,YAAY,MAAM,UAAU;AACnC,SAASC,sBAAsB,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAM;EACLC,qBAAqB;EACrBC,qBAAqB;EACrBC,iBAAiB;EACjBC,gBAAgB;EAChBC,0BAA0B;EAC1BC;AACD,CAAC,GAAGZ,MAAM,CAAEN,sBAAuB,CAAC;AAEpC,SAASmB,mBAAmB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AAS,EAAC,8BAA8B;MACxCW,QAAQ,EAAGJ,cAAgB;MAC3BK,KAAK,EAAGzB,WAAa;MACrB0B,KAAK,EAAGnG,EAAE,CAAE,QAAS,CAAG;MACxBoG,WAAW,EAAGpG,EAAE,CAAE,QAAS;IAAG,CAC9B,CAAC,eACFyB,IAAA,CAACkE,iBAAiB;MAAClB,WAAW,EAAGqB;IAAqB,CAAE,CAAC;EAAA,CACxD,CAAC;AAEL;AAEA,eAAeF,eAAe","ignoreList":[]}
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { ExternalLink } from '@wordpress/components';
|
|
6
6
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
12
|
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import { store as editSiteStore } from '../../store';
|
|
12
14
|
import ScreenHeader from './header';
|
|
13
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const {
|
|
@@ -23,6 +25,9 @@ function ScreenCSS() {
|
|
|
23
25
|
const [inheritedStyle, setStyle] = useGlobalStyle('', undefined, 'all', {
|
|
24
26
|
shouldDecodeEncode: false
|
|
25
27
|
});
|
|
28
|
+
const {
|
|
29
|
+
setEditorCanvasContainerView
|
|
30
|
+
} = unlock(useDispatch(editSiteStore));
|
|
26
31
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
27
32
|
children: [/*#__PURE__*/_jsx(ScreenHeader, {
|
|
28
33
|
title: __('CSS'),
|
|
@@ -32,7 +37,10 @@ function ScreenCSS() {
|
|
|
32
37
|
className: "edit-site-global-styles-screen-css-help-link",
|
|
33
38
|
children: __('Learn more about CSS')
|
|
34
39
|
})]
|
|
35
|
-
})
|
|
40
|
+
}),
|
|
41
|
+
onBack: () => {
|
|
42
|
+
setEditorCanvasContainerView(undefined);
|
|
43
|
+
}
|
|
36
44
|
}), /*#__PURE__*/_jsx("div", {
|
|
37
45
|
className: "edit-site-global-styles-screen-css",
|
|
38
46
|
children: /*#__PURE__*/_jsx(StylesAdvancedPanel, {
|