@wordpress/edit-site 6.17.1 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-pattern/index.js +0 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.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 +0 -1
- 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 +0 -1
- 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 +14 -9
- 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 +1 -7
- 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/navigation-item.js +1 -4
- package/build/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build/components/site-editor-routes/notfound.js +41 -0
- package/build/components/site-editor-routes/notfound.js.map +1 -0
- package/build/components/site-editor-routes/patterns.js +21 -1
- package/build/components/site-editor-routes/patterns.js.map +1 -1
- 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/site-hub/index.js +7 -5
- package/build/components/site-hub/index.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/components/welcome-guide/page.js +3 -1
- package/build/components/welcome-guide/page.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-generic-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.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 +0 -1
- 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 +0 -1
- 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 +14 -9
- 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 +1 -7
- 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/navigation-item.js +1 -4
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build-module/components/site-editor-routes/notfound.js +33 -0
- package/build-module/components/site-editor-routes/notfound.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns.js +21 -1
- package/build-module/components/site-editor-routes/patterns.js.map +1 -1
- 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/site-hub/index.js +9 -7
- package/build-module/components/site-hub/index.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/components/welcome-guide/page.js +3 -1
- package/build-module/components/welcome-guide/page.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 +9 -8
- package/build-style/posts.css +9 -8
- package/build-style/style-rtl.css +18 -28
- package/build-style/style.css +18 -28
- package/package.json +42 -42
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -0
- 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/style.scss +2 -0
- package/src/components/page-templates/style.scss +2 -0
- package/src/components/resizable-frame/index.js +1 -1
- package/src/components/save-panel/index.js +16 -8
- package/src/components/sidebar-navigation-screen/index.js +2 -11
- 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/navigation-item.js +1 -4
- package/src/components/site-editor-routes/notfound.js +38 -0
- package/src/components/site-editor-routes/patterns.js +20 -1
- 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/site-hub/index.js +17 -21
- package/src/components/style-book/index.js +1 -13
- package/src/components/welcome-guide/page.js +1 -0
- 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
|
@@ -6,7 +6,6 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
10
9
|
import Editor from '../editor';
|
|
11
10
|
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
12
11
|
import { unlock } from '../../lock-unlock';
|
|
@@ -22,9 +21,7 @@ function MobileNavigationItemView() {
|
|
|
22
21
|
canvas = 'view'
|
|
23
22
|
} = query;
|
|
24
23
|
return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
|
|
25
|
-
backPath:
|
|
26
|
-
postType: NAVIGATION_POST_TYPE
|
|
27
|
-
}
|
|
24
|
+
backPath: "/navigation"
|
|
28
25
|
});
|
|
29
26
|
}
|
|
30
27
|
export const navigationItemRoute = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","routerPrivateApis","
|
|
1
|
+
{"version":3,"names":["privateApis","routerPrivateApis","Editor","SidebarNavigationScreenNavigationMenu","unlock","jsx","_jsx","useLocation","MobileNavigationItemView","query","canvas","backPath","navigationItemRoute","name","path","areas","sidebar","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction MobileNavigationItemView() {\n\tconst { query = {} } = useLocation();\n\tconst { canvas = 'view' } = query;\n\n\treturn canvas === 'edit' ? (\n\t\t<Editor />\n\t) : (\n\t\t<SidebarNavigationScreenNavigationMenu backPath=\"/navigation\" />\n\t);\n}\n\nexport const navigationItemRoute = {\n\tname: 'navigation-item',\n\tpath: '/wp_navigation/:postId',\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreenNavigationMenu backPath=\"/navigation\" />\n\t\t),\n\t\tpreview: <Editor />,\n\t\tmobile: <MobileNavigationItemView />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,qCAAqC,MAAM,8CAA8C;AAChG,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEH,iBAAkB,CAAC;AAEnD,SAASO,wBAAwBA,CAAA,EAAG;EACnC,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGF,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEG,MAAM,GAAG;EAAO,CAAC,GAAGD,KAAK;EAEjC,OAAOC,MAAM,KAAK,MAAM,gBACvBJ,IAAA,CAACJ,MAAM,IAAE,CAAC,gBAEVI,IAAA,CAACH,qCAAqC;IAACQ,QAAQ,EAAC;EAAa,CAAE,CAC/D;AACF;AAEA,OAAO,MAAMC,mBAAmB,GAAG;EAClCC,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE;IACNC,OAAO,eACNV,IAAA,CAACH,qCAAqC;MAACQ,QAAQ,EAAC;IAAa,CAAE,CAC/D;IACDM,OAAO,eAAEX,IAAA,CAACJ,MAAM,IAAE,CAAC;IACnBgB,MAAM,eAAEZ,IAAA,CAACE,wBAAwB,IAAE;EACpC;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
10
|
+
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
function NotFoundError() {
|
|
13
|
+
return /*#__PURE__*/_jsx(Notice, {
|
|
14
|
+
status: "error",
|
|
15
|
+
isDismissible: false,
|
|
16
|
+
children: __('The requested page could not be found. Please check the URL.')
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export const notFoundRoute = {
|
|
20
|
+
name: 'notfound',
|
|
21
|
+
path: '*',
|
|
22
|
+
areas: {
|
|
23
|
+
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {}),
|
|
24
|
+
mobile: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {
|
|
25
|
+
customDescription: /*#__PURE__*/_jsx(NotFoundError, {})
|
|
26
|
+
}),
|
|
27
|
+
content: /*#__PURE__*/_jsx(Spacer, {
|
|
28
|
+
padding: 2,
|
|
29
|
+
children: /*#__PURE__*/_jsx(NotFoundError, {})
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=notfound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","Notice","__experimentalSpacer","Spacer","SidebarNavigationScreenMain","jsx","_jsx","NotFoundError","status","isDismissible","children","notFoundRoute","name","path","areas","sidebar","mobile","customDescription","content","padding"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/notfound.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nfunction NotFoundError() {\n\treturn (\n\t\t<Notice status=\"error\" isDismissible={ false }>\n\t\t\t{ __(\n\t\t\t\t'The requested page could not be found. Please check the URL.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport const notFoundRoute = {\n\tname: 'notfound',\n\tpath: '*',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tmobile: (\n\t\t\t<SidebarNavigationScreenMain\n\t\t\t\tcustomDescription={ <NotFoundError /> }\n\t\t\t/>\n\t\t),\n\t\tcontent: (\n\t\t\t<Spacer padding={ 2 }>\n\t\t\t\t<NotFoundError />\n\t\t\t</Spacer>\n\t\t),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAC9E,OAAOC,2BAA2B,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,SAASC,aAAaA,CAAA,EAAG;EACxB,oBACCD,IAAA,CAACL,MAAM;IAACO,MAAM,EAAC,OAAO;IAACC,aAAa,EAAG,KAAO;IAAAC,QAAA,EAC3CV,EAAE,CACH,8DACD;EAAC,CACM,CAAC;AAEX;AAEA,OAAO,MAAMW,aAAa,GAAG;EAC5BC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,GAAG;EACTC,KAAK,EAAE;IACNC,OAAO,eAAET,IAAA,CAACF,2BAA2B,IAAE,CAAC;IACxCY,MAAM,eACLV,IAAA,CAACF,2BAA2B;MAC3Ba,iBAAiB,eAAGX,IAAA,CAACC,aAAa,IAAE;IAAG,CACvC,CACD;IACDW,OAAO,eACNZ,IAAA,CAACH,MAAM;MAACgB,OAAO,EAAG,CAAG;MAAAT,QAAA,eACpBJ,IAAA,CAACC,aAAa,IAAE;IAAC,CACV;EAEV;AACD,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Internal dependencies
|
|
3
8
|
*/
|
|
4
9
|
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
5
10
|
import PagePatterns from '../page-patterns';
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
6
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const {
|
|
14
|
+
useLocation
|
|
15
|
+
} = unlock(routerPrivateApis);
|
|
16
|
+
function MobilePatternsView() {
|
|
17
|
+
const {
|
|
18
|
+
query = {}
|
|
19
|
+
} = useLocation();
|
|
20
|
+
const {
|
|
21
|
+
categoryId
|
|
22
|
+
} = query;
|
|
23
|
+
return !!categoryId ? /*#__PURE__*/_jsx(PagePatterns, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenPatterns, {
|
|
24
|
+
backPath: "/"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
7
27
|
export const patternsRoute = {
|
|
8
28
|
name: 'patterns',
|
|
9
29
|
path: '/pattern',
|
|
@@ -12,7 +32,7 @@ export const patternsRoute = {
|
|
|
12
32
|
backPath: "/"
|
|
13
33
|
}),
|
|
14
34
|
content: /*#__PURE__*/_jsx(PagePatterns, {}),
|
|
15
|
-
mobile: /*#__PURE__*/_jsx(
|
|
35
|
+
mobile: /*#__PURE__*/_jsx(MobilePatternsView, {})
|
|
16
36
|
}
|
|
17
37
|
};
|
|
18
38
|
//# sourceMappingURL=patterns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SidebarNavigationScreenPatterns","PagePatterns","jsx","_jsx","patternsRoute","name","path","areas","sidebar","
|
|
1
|
+
{"version":3,"names":["privateApis","routerPrivateApis","SidebarNavigationScreenPatterns","PagePatterns","unlock","jsx","_jsx","useLocation","MobilePatternsView","query","categoryId","backPath","patternsRoute","name","path","areas","sidebar","content","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/patterns.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport PagePatterns from '../page-patterns';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction MobilePatternsView() {\n\tconst { query = {} } = useLocation();\n\tconst { categoryId } = query;\n\n\treturn !! categoryId ? (\n\t\t<PagePatterns />\n\t) : (\n\t\t<SidebarNavigationScreenPatterns backPath=\"/\" />\n\t);\n}\n\nexport const patternsRoute = {\n\tname: 'patterns',\n\tpath: '/pattern',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenPatterns backPath=\"/\" />,\n\t\tcontent: <PagePatterns />,\n\t\tmobile: <MobilePatternsView />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEH,iBAAkB,CAAC;AAEnD,SAASO,kBAAkBA,CAAA,EAAG;EAC7B,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGF,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEG;EAAW,CAAC,GAAGD,KAAK;EAE5B,OAAO,CAAC,CAAEC,UAAU,gBACnBJ,IAAA,CAACH,YAAY,IAAE,CAAC,gBAEhBG,IAAA,CAACJ,+BAA+B;IAACS,QAAQ,EAAC;EAAG,CAAE,CAC/C;AACF;AAEA,OAAO,MAAMC,aAAa,GAAG;EAC5BC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE;IACNC,OAAO,eAAEV,IAAA,CAACJ,+BAA+B;MAACS,QAAQ,EAAC;IAAG,CAAE,CAAC;IACzDM,OAAO,eAAEX,IAAA,CAACH,YAAY,IAAE,CAAC;IACzBe,MAAM,eAAEZ,IAAA,CAACE,kBAAkB,IAAE;EAC9B;AACD,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export const templateItemRoute = {
|
|
@@ -11,8 +11,8 @@ export const templateItemRoute = {
|
|
|
11
11
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenTemplatesBrowse, {
|
|
12
12
|
backPath: "/"
|
|
13
13
|
}),
|
|
14
|
-
mobile: /*#__PURE__*/_jsx(
|
|
15
|
-
preview: /*#__PURE__*/_jsx(
|
|
14
|
+
mobile: /*#__PURE__*/_jsx(Editor, {}),
|
|
15
|
+
preview: /*#__PURE__*/_jsx(Editor, {})
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=template-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Editor","SidebarNavigationScreenTemplatesBrowse","jsx","_jsx","templateItemRoute","name","path","areas","sidebar","backPath","mobile","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/template-item.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\n\nexport const templateItemRoute = {\n\tname: 'template-item',\n\tpath: '/wp_template/*postId',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenTemplatesBrowse backPath=\"/\" />,\n\t\tmobile: <Editor />,\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,sCAAsC,MAAM,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnG,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAE;IACNC,OAAO,eAAEL,IAAA,CAACF,sCAAsC;MAACQ,QAAQ,EAAC;IAAG,CAAE,CAAC;IAChEC,MAAM,eAAEP,IAAA,CAACH,MAAM,IAAE,CAAC;IAClBW,OAAO,eAAER,IAAA,CAACH,MAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export const templatePartItemRoute = {
|
|
@@ -11,8 +11,8 @@ export const templatePartItemRoute = {
|
|
|
11
11
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenPatterns, {
|
|
12
12
|
backPath: "/"
|
|
13
13
|
}),
|
|
14
|
-
mobile: /*#__PURE__*/_jsx(
|
|
15
|
-
preview: /*#__PURE__*/_jsx(
|
|
14
|
+
mobile: /*#__PURE__*/_jsx(Editor, {}),
|
|
15
|
+
preview: /*#__PURE__*/_jsx(Editor, {})
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=template-part-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Editor","SidebarNavigationScreenPatterns","jsx","_jsx","templatePartItemRoute","name","path","areas","sidebar","backPath","mobile","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/template-part-item.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\n\nexport const templatePartItemRoute = {\n\tname: 'template-part-item',\n\tpath: '/wp_template_part/*postId',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenPatterns backPath=\"/\" />,\n\t\tmobile: <Editor />,\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,+BAA+B,MAAM,uCAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpF,OAAO,MAAMC,qBAAqB,GAAG;EACpCC,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,2BAA2B;EACjCC,KAAK,EAAE;IACNC,OAAO,eAAEL,IAAA,CAACF,+BAA+B;MAACQ,QAAQ,EAAC;IAAG,CAAE,CAAC;IACzDC,MAAM,eAAEP,IAAA,CAACH,MAAM,IAAE,CAAC;IAClBW,OAAO,eAAER,IAAA,CAACH,MAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
|
|
@@ -24,11 +24,12 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
24
24
|
import { store as editSiteStore } from '../../store';
|
|
25
25
|
import SiteIcon from '../site-icon';
|
|
26
26
|
import { unlock } from '../../lock-unlock';
|
|
27
|
+
import { SidebarNavigationContext } from '../sidebar';
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
29
|
const {
|
|
30
|
+
useLocation,
|
|
28
31
|
useHistory
|
|
29
32
|
} = unlock(routerPrivateApis);
|
|
30
|
-
import { SidebarNavigationContext } from '../sidebar';
|
|
31
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
33
|
const SiteHub = memo(forwardRef(({
|
|
33
34
|
isTransparent
|
|
34
35
|
}, ref) => {
|
|
@@ -112,13 +113,15 @@ export default SiteHub;
|
|
|
112
113
|
export const SiteHubMobile = memo(forwardRef(({
|
|
113
114
|
isTransparent
|
|
114
115
|
}, ref) => {
|
|
116
|
+
const {
|
|
117
|
+
path
|
|
118
|
+
} = useLocation();
|
|
115
119
|
const history = useHistory();
|
|
116
120
|
const {
|
|
117
121
|
navigate
|
|
118
122
|
} = useContext(SidebarNavigationContext);
|
|
119
123
|
const {
|
|
120
124
|
dashboardLink,
|
|
121
|
-
isBlockTheme,
|
|
122
125
|
homeUrl,
|
|
123
126
|
siteTitle
|
|
124
127
|
} = useSelect(select => {
|
|
@@ -126,13 +129,11 @@ export const SiteHubMobile = memo(forwardRef(({
|
|
|
126
129
|
getSettings
|
|
127
130
|
} = unlock(select(editSiteStore));
|
|
128
131
|
const {
|
|
129
|
-
getEntityRecord
|
|
130
|
-
getCurrentTheme
|
|
132
|
+
getEntityRecord
|
|
131
133
|
} = select(coreStore);
|
|
132
134
|
const _site = getEntityRecord('root', 'site');
|
|
133
135
|
return {
|
|
134
136
|
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
135
|
-
isBlockTheme: getCurrentTheme()?.is_block_theme,
|
|
136
137
|
homeUrl: getEntityRecord('root', '__unstableBase')?.home,
|
|
137
138
|
siteTitle: !_site?.title && !!_site?.url ? filterURLForDisplay(_site?.url) : _site?.title
|
|
138
139
|
};
|
|
@@ -140,6 +141,7 @@ export const SiteHubMobile = memo(forwardRef(({
|
|
|
140
141
|
const {
|
|
141
142
|
open: openCommandCenter
|
|
142
143
|
} = useDispatch(commandsStore);
|
|
144
|
+
const isRoot = path === '/';
|
|
143
145
|
return /*#__PURE__*/_jsx("div", {
|
|
144
146
|
className: "edit-site-site-hub",
|
|
145
147
|
children: /*#__PURE__*/_jsxs(HStack, {
|
|
@@ -157,7 +159,7 @@ export const SiteHubMobile = memo(forwardRef(({
|
|
|
157
159
|
transform: 'scale(0.5)',
|
|
158
160
|
borderRadius: 4
|
|
159
161
|
},
|
|
160
|
-
...(
|
|
162
|
+
...(isRoot ? {
|
|
161
163
|
href: dashboardLink,
|
|
162
164
|
label: __('Go to the Dashboard')
|
|
163
165
|
} : {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","VisuallyHidden","__","store","coreStore","decodeEntities","memo","forwardRef","useContext","search","commandsStore","displayShortcut","filterURLForDisplay","privateApis","routerPrivateApis","editSiteStore","SiteIcon","unlock","useHistory","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getEntityRecord","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","__next40pxDefaultSize","href","label","style","transform","borderRadius","variant","target","as","expanded","size","icon","onClick","shortcut","primary","SiteHubMobile","history","navigate","isBlockTheme","getCurrentTheme","is_block_theme"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { dashboardLink, isBlockTheme, homeUrl, siteTitle } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\t\tconst { getEntityRecord, getCurrentTheme } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\t\treturn {\n\t\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\t\tisBlockTheme: getCurrentTheme()?.is_block_theme,\n\t\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\t\tsiteTitle:\n\t\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t\t: _site?.title,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t{ ...( ! isBlockTheme\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\thref: dashboardLink,\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\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\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.navigate( '/' );\n\t\t\t\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to Site Editor' ),\n\t\t\t\t\t\t\t\t } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASN,KAAK,IAAIO,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,WAAW,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,OAAO,EAAG,CAAG;UACbU,QAAQ,EAAG,KAAO;UAClBb,SAAS,EAAC,6BAA6B;UAAAC,QAAA,eAEvCpB,IAAA,CAACvB,MAAM;YACN8C,qBAAqB;YACrBJ,SAAS,EAAC,0CAA0C;YACpDe,IAAI,EAAG9C,MAAQ;YACf+C,OAAO,EAAGA,CAAA,KAAMjB,iBAAiB,CAAC,CAAG;YACrCO,KAAK,EAAG5C,EAAE,CAAE,sBAAuB,CAAG;YACtCuD,QAAQ,EAAG9C,eAAe,CAAC+C,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","VisuallyHidden","__","store","coreStore","decodeEntities","memo","forwardRef","useContext","search","commandsStore","displayShortcut","filterURLForDisplay","privateApis","routerPrivateApis","editSiteStore","SiteIcon","unlock","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","useLocation","useHistory","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getEntityRecord","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","__next40pxDefaultSize","href","label","style","transform","borderRadius","variant","target","as","expanded","size","icon","onClick","shortcut","primary","SiteHubMobile","path","history","navigate","isRoot"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { path } = useLocation();\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\t\tconst isRoot = path === '/';\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t{ ...( isRoot\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\thref: dashboardLink,\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\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\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.navigate( '/' );\n\t\t\t\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to Site Editor' ),\n\t\t\t\t\t\t\t\t } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASN,KAAK,IAAIO,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACtD,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGP,MAAM,CAAEH,iBAAkB,CAAC;AAE/D,MAAMW,OAAO,GAAGnB,IAAI,CACnBC,UAAU,CAAE,CAAE;EAAEmB;AAAc,CAAC,EAAEC,GAAG,KAAM;EACzC,MAAM;IAAEC,aAAa;IAAE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CAAE,CACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getCategories","STYLE_BOOK_CATEGORIES","STYLE_BOOK_THEME_SUBCATEGORIES","getExamplesByCategory","categoryDefinition","examples","_categoryDefinition$s","slug","length","categories","subcategories","reduce","acc","subcategoryDefinition","subcategoryExamples","title","blocksToInclude","blocks","blocksToExclude","exclude","categoryExamples","filter","example","includes","name","category","getTopLevelStyleBookCategories","reservedCategories","map","extraCategories","extraCategoriesFiltered"],"sources":["@wordpress/edit-site/src/components/style-book/categories.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\n// @wordpress/blocks imports are not typed.\n// @ts-expect-error\nimport { getCategories } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlockExample,\n\tStyleBookCategory,\n\tCategoryExamples,\n} from './types';\nimport {\n\tSTYLE_BOOK_CATEGORIES,\n\tSTYLE_BOOK_THEME_SUBCATEGORIES,\n} from './constants';\n\n/**\n * Returns category examples for a given category definition and list of examples.\n * @param {StyleBookCategory} categoryDefinition The category definition.\n * @param {BlockExample[]} examples An array of block examples.\n * @return {CategoryExamples|undefined} An object containing the category examples.\n */\nexport function getExamplesByCategory(\n\tcategoryDefinition: StyleBookCategory,\n\texamples: BlockExample[]\n): CategoryExamples | undefined {\n\tif ( ! categoryDefinition?.slug || ! examples?.length ) {\n\t\treturn;\n\t}\n\tconst categories: CategoryExamples[] =\n\t\tcategoryDefinition?.subcategories ?? [];\n\tif ( categories.length ) {\n\t\treturn categories.reduce(\n\t\t\t( acc, subcategoryDefinition ) => {\n\t\t\t\tconst subcategoryExamples = getExamplesByCategory(\n\t\t\t\t\tsubcategoryDefinition,\n\t\t\t\t\texamples\n\t\t\t\t);\n\t\t\t\tif ( subcategoryExamples ) {\n\t\t\t\t\tif ( ! acc.subcategories ) {\n\t\t\t\t\t\tacc.subcategories = [];\n\t\t\t\t\t}\n\t\t\t\t\tacc.subcategories = [\n\t\t\t\t\t\t...acc.subcategories,\n\t\t\t\t\t\tsubcategoryExamples,\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: categoryDefinition.title,\n\t\t\t\tslug: categoryDefinition.slug,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst blocksToInclude = categoryDefinition?.blocks || [];\n\tconst blocksToExclude = categoryDefinition?.exclude || [];\n\tconst categoryExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\t! blocksToExclude.includes( example.name ) &&\n\t\t\t( example.category === categoryDefinition.slug ||\n\t\t\t\tblocksToInclude.includes( example.name ) )\n\t\t);\n\t} );\n\n\tif ( ! categoryExamples.length ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\ttitle: categoryDefinition.title,\n\t\tslug: categoryDefinition.slug,\n\t\texamples: categoryExamples,\n\t};\n}\n\n/**\n * Returns category examples for a given category definition and list of examples.\n *\n * @return {StyleBookCategory[]} An array of top-level category definitions.\n */\nexport function getTopLevelStyleBookCategories(): StyleBookCategory[] {\n\tconst reservedCategories = [\n\t\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t\t...STYLE_BOOK_CATEGORIES,\n\t].map( ( { slug } ) => slug );\n\tconst extraCategories: StyleBookCategory[] = getCategories();\n\tconst extraCategoriesFiltered = extraCategories.filter(\n\t\t( { slug } ) => ! reservedCategories.includes( slug )\n\t);\n\treturn [ ...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered ];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getCategories","STYLE_BOOK_CATEGORIES","STYLE_BOOK_THEME_SUBCATEGORIES","getExamplesByCategory","categoryDefinition","examples","_categoryDefinition$s","slug","length","categories","subcategories","reduce","acc","subcategoryDefinition","subcategoryExamples","title","blocksToInclude","blocks","blocksToExclude","exclude","categoryExamples","filter","example","includes","name","category","getTopLevelStyleBookCategories","reservedCategories","map","extraCategories","extraCategoriesFiltered"],"sources":["@wordpress/edit-site/src/components/style-book/categories.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\n// @wordpress/blocks imports are not typed.\n// @ts-expect-error\nimport { getCategories } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlockExample,\n\tStyleBookCategory,\n\tCategoryExamples,\n} from './types';\nimport {\n\tSTYLE_BOOK_CATEGORIES,\n\tSTYLE_BOOK_THEME_SUBCATEGORIES,\n} from './constants';\n\n/**\n * Returns category examples for a given category definition and list of examples.\n * @param {StyleBookCategory} categoryDefinition The category definition.\n * @param {BlockExample[]} examples An array of block examples.\n * @return {CategoryExamples|undefined} An object containing the category examples.\n */\nexport function getExamplesByCategory(\n\tcategoryDefinition: StyleBookCategory,\n\texamples: BlockExample[]\n): CategoryExamples | undefined {\n\tif ( ! categoryDefinition?.slug || ! examples?.length ) {\n\t\treturn;\n\t}\n\tconst categories: CategoryExamples[] =\n\t\tcategoryDefinition?.subcategories ?? [];\n\tif ( categories.length ) {\n\t\treturn categories.reduce(\n\t\t\t( acc, subcategoryDefinition ) => {\n\t\t\t\tconst subcategoryExamples = getExamplesByCategory(\n\t\t\t\t\tsubcategoryDefinition,\n\t\t\t\t\texamples\n\t\t\t\t);\n\t\t\t\tif ( subcategoryExamples ) {\n\t\t\t\t\tif ( ! acc.subcategories ) {\n\t\t\t\t\t\tacc.subcategories = [];\n\t\t\t\t\t}\n\t\t\t\t\tacc.subcategories = [\n\t\t\t\t\t\t...acc.subcategories,\n\t\t\t\t\t\tsubcategoryExamples,\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: categoryDefinition.title,\n\t\t\t\tslug: categoryDefinition.slug,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst blocksToInclude = categoryDefinition?.blocks || [];\n\tconst blocksToExclude = categoryDefinition?.exclude || [];\n\tconst categoryExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\t! blocksToExclude.includes( example.name ) &&\n\t\t\t( example.category === categoryDefinition.slug ||\n\t\t\t\tblocksToInclude.includes( example.name ) )\n\t\t);\n\t} );\n\n\tif ( ! categoryExamples.length ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\ttitle: categoryDefinition.title,\n\t\tslug: categoryDefinition.slug,\n\t\texamples: categoryExamples,\n\t};\n}\n\n/**\n * Returns category examples for a given category definition and list of examples.\n *\n * @return {StyleBookCategory[]} An array of top-level category definitions.\n */\nexport function getTopLevelStyleBookCategories(): StyleBookCategory[] {\n\tconst reservedCategories = [\n\t\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t\t...STYLE_BOOK_CATEGORIES,\n\t].map( ( { slug } ) => slug );\n\tconst extraCategories: StyleBookCategory[] = getCategories();\n\tconst extraCategoriesFiltered = extraCategories.filter(\n\t\t( { slug } ) => ! reservedCategories.includes( slug )\n\t);\n\treturn [ ...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,mBAAmB;;AAEjD;AACA;AACA;;AAMA,SACCC,qBAAqB,EACrBC,8BAA8B,QACxB,aAAa;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACpCC,kBAAqC,EACrCC,QAAwB,EACO;EAAA,IAAAC,qBAAA;EAC/B,IAAK,CAAEF,kBAAkB,EAAEG,IAAI,IAAI,CAAEF,QAAQ,EAAEG,MAAM,EAAG;IACvD;EACD;EACA,MAAMC,UAA8B,IAAAH,qBAAA,GACnCF,kBAAkB,EAAEM,aAAa,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI,EAAE;EACxC,IAAKG,UAAU,CAACD,MAAM,EAAG;IACxB,OAAOC,UAAU,CAACE,MAAM,CACvB,CAAEC,GAAG,EAAEC,qBAAqB,KAAM;MACjC,MAAMC,mBAAmB,GAAGX,qBAAqB,CAChDU,qBAAqB,EACrBR,QACD,CAAC;MAC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ACrD,CAAE;IAAEd;EAAK,CAAC,KAAM,CAAEoB,kBAAkB,CAACJ,QAAQ,CAAEhB,IAAK,CACrD,CAAC;EACD,OAAO,CAAE,GAAGN,qBAAqB,EAAE,GAAG6B,uBAAuB,CAAE;AAChE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__experimentalGrid","Grid","View","getColorClassName","__experimentalGetGradientClass","jsx","_jsx","ColorExamples","colors","type","templateColumns","itemHeight","rowGap","columnGap","children","map","color","className","slug","classes","style","height"],"sources":["@wordpress/edit-site/src/components/style-book/color-examples.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\nimport {\n\tgetColorClassName,\n\t__experimentalGetGradientClass,\n\t// @wordpress/block-editor imports are not typed.\n\t// @ts-expect-error\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport type { Color, Gradient, ColorExampleProps } from './types';\n\nconst ColorExamples = ( {\n\tcolors,\n\ttype,\n\ttemplateColumns = '1fr 1fr',\n\titemHeight = '52px',\n}: ColorExampleProps ): JSX.Element | null => {\n\tif ( ! colors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid templateColumns={ templateColumns } rowGap={ 8 } columnGap={ 16 }>\n\t\t\t{ colors.map( ( color: Color | Gradient ) => {\n\t\t\t\tconst className =\n\t\t\t\t\ttype === 'gradients'\n\t\t\t\t\t\t? __experimentalGetGradientClass( color.slug )\n\t\t\t\t\t\t: getColorClassName( 'background-color', color.slug );\n\t\t\t\tconst classes = clsx(\n\t\t\t\t\t'edit-site-style-book__color-example',\n\t\t\t\t\tclassName\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<View\n\t\t\t\t\t\tkey={ color.slug }\n\t\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t\tstyle={ { height: itemHeight } }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Grid>\n\t);\n};\n\nexport default ColorExamples;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalGrid","Grid","View","getColorClassName","__experimentalGetGradientClass","jsx","_jsx","ColorExamples","colors","type","templateColumns","itemHeight","rowGap","columnGap","children","map","color","className","slug","classes","style","height"],"sources":["@wordpress/edit-site/src/components/style-book/color-examples.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\nimport {\n\tgetColorClassName,\n\t__experimentalGetGradientClass,\n\t// @wordpress/block-editor imports are not typed.\n\t// @ts-expect-error\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport type { Color, Gradient, ColorExampleProps } from './types';\n\nconst ColorExamples = ( {\n\tcolors,\n\ttype,\n\ttemplateColumns = '1fr 1fr',\n\titemHeight = '52px',\n}: ColorExampleProps ): JSX.Element | null => {\n\tif ( ! colors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid templateColumns={ templateColumns } rowGap={ 8 } columnGap={ 16 }>\n\t\t\t{ colors.map( ( color: Color | Gradient ) => {\n\t\t\t\tconst className =\n\t\t\t\t\ttype === 'gradients'\n\t\t\t\t\t\t? __experimentalGetGradientClass( color.slug )\n\t\t\t\t\t\t: getColorClassName( 'background-color', color.slug );\n\t\t\t\tconst classes = clsx(\n\t\t\t\t\t'edit-site-style-book__color-example',\n\t\t\t\t\tclassName\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<View\n\t\t\t\t\t\tkey={ color.slug }\n\t\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t\tstyle={ { height: itemHeight } }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Grid>\n\t);\n};\n\nexport default ColorExamples;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,kBAAkB,IAAIC,IAAI,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SACCC,iBAAiB,EACjBC;AACA;AACA;AAAA,OACM,yBAAyB;;AAEhC;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,aAAa,GAAGA,CAAE;EACvBC,MAAM;EACNC,IAAI;EACJC,eAAe,GAAG,SAAS;EAC3BC,UAAU,GAAG;AACK,CAAC,KAA0B;EAC7C,IAAK,CAAEH,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;EAEA,oBACCF,IAAA,CAACL,IAAI;IAACS,eAAe,EAAGA,eAAiB;IAACE,MAAM,EAAG,CAAG;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EACpEN,MAAM,CAACO,GAAG,CAAIC,KAAuB,IAAM;MAC5C,MAAMC,SAAS,GACdR,IAAI,KAAK,WAAW,GACjBL,8BAA8B,CAAEY,KAAK,CAACE,IAAK,CAAC,GAC5Cf,iBAAiB,CAAE,kBAAkB,EAAEa,KAAK,CAACE,IAAK,CAAC;MACvD,MAAMC,OAAO,GAAGpB,IAAI,CACnB,qCAAqC,EACrCkB,SACD,CAAC;MAED,oBACCX,IAAA,CAACJ,IAAI;QAEJe,SAAS,EAAGE,OAAS;QACrBC,KAAK,EAAG;UAAEC,MAAM,EAAEV;QAAW;MAAG,GAF1BK,KAAK,CAACE,IAGZ,CAAC;IAEJ,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAED,eAAeX,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalGrid","Grid","View","jsx","_jsx","jsxs","_jsxs","DuotoneExamples","duotones","columns","rowGap","columnGap","children","map","duotone","className","alt","slug","src","style","filter","colors","color","backgroundColor"],"sources":["@wordpress/edit-site/src/components/style-book/duotone-examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport type { Duotone } from './types';\n\nconst DuotoneExamples = ( {\n\tduotones,\n}: {\n\tduotones: Duotone[];\n} ): JSX.Element | null => {\n\tif ( ! duotones ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid columns={ 2 } rowGap={ 16 } columnGap={ 16 }>\n\t\t\t{ duotones.map( ( duotone: Duotone ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Grid\n\t\t\t\t\t\tkey={ duotone.slug }\n\t\t\t\t\t\tclassName=\"edit-site-style-book__duotone-example\"\n\t\t\t\t\t\tcolumns={ 2 }\n\t\t\t\t\t\trowGap={ 8 }\n\t\t\t\t\t\tcolumnGap={ 8 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\talt={ `Duotone example: ${ duotone.slug }` }\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/core/5.3/MtBlanc1.jpg\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfilter: `url(#wp-duotone-${ duotone.slug })`,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t{ duotone.colors.map( ( color ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tkey={ color }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-style-book__color-example\"\n\t\t\t\t\t\t\t\t\tstyle={ { backgroundColor: color } }\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\t\t\t\t\t</Grid>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Grid>\n\t);\n};\n\nexport default DuotoneExamples;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["__experimentalGrid","Grid","View","jsx","_jsx","jsxs","_jsxs","DuotoneExamples","duotones","columns","rowGap","columnGap","children","map","duotone","className","alt","slug","src","style","filter","colors","color","backgroundColor"],"sources":["@wordpress/edit-site/src/components/style-book/duotone-examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport type { Duotone } from './types';\n\nconst DuotoneExamples = ( {\n\tduotones,\n}: {\n\tduotones: Duotone[];\n} ): JSX.Element | null => {\n\tif ( ! duotones ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid columns={ 2 } rowGap={ 16 } columnGap={ 16 }>\n\t\t\t{ duotones.map( ( duotone: Duotone ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Grid\n\t\t\t\t\t\tkey={ duotone.slug }\n\t\t\t\t\t\tclassName=\"edit-site-style-book__duotone-example\"\n\t\t\t\t\t\tcolumns={ 2 }\n\t\t\t\t\t\trowGap={ 8 }\n\t\t\t\t\t\tcolumnGap={ 8 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\talt={ `Duotone example: ${ duotone.slug }` }\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/core/5.3/MtBlanc1.jpg\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfilter: `url(#wp-duotone-${ duotone.slug })`,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t{ duotone.colors.map( ( color ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tkey={ color }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-style-book__color-example\"\n\t\t\t\t\t\t\t\t\tstyle={ { backgro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,OAAO,CAACG,IAwBT,CAAC;IAET,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAED,eAAeV,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","ColorExamples","DuotoneExamples","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","getColorExamples","colors","examples","forEach","group","palette","type","paletteFiltered","Array","isArray","find","origin","slug","undefined","example","name","title","category","content","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","templateColumns","itemHeight","typographyBlockExamples","headingBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","attributes","getExamples","nonHeadingBlockExamples","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n\t// @wordpress/blocks imports are not typed.\n\t// @ts-expect-error\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlockExample,\n\tColorOrigin,\n\tMultiOriginPalettes,\n\tBlockType,\n} from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type as keyof MultiOriginPalettes ];\n\t\tconst paletteFiltered = Array.isArray( palette )\n\t\t\t? palette.find(\n\t\t\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t\t )\n\t\t\t: undefined;\n\n\t\tif ( paletteFiltered?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples\n\t\t\t\t\t\tduotones={ paletteFiltered[ group.type ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ paletteFiltered[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns examples for the overview page.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of block examples.\n */\nfunction getOverviewBlockExamples(\n\tcolors: MultiOriginPalettes\n): BlockExample[] {\n\tconst examples: BlockExample[] = [];\n\n\t// Get theme palette from colors if they exist.\n\tconst themePalette = Array.isArray( colors?.colors )\n\t\t? colors.colors.find(\n\t\t\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t\t )\n\t\t: undefined;\n\n\tif ( themePalette ) {\n\t\tconst themeColorexample: BlockExample = {\n\t\t\tname: 'theme-colors',\n\t\t\ttitle: __( 'Colors' ),\n\t\t\tcategory: 'overview',\n\t\t\tcontent: (\n\t\t\t\t<ColorExamples\n\t\t\t\t\tcolors={ themePalette.colors }\n\t\t\t\t\ttype=\"colors\"\n\t\t\t\t\ttemplateColumns=\"repeat(auto-fill, minmax( 200px, 1fr ))\"\n\t\t\t\t\titemHeight=\"32px\"\n\t\t\t\t/>\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\t// Get examples for typography blocks.\n\tconst typographyBlockExamples: BlockType[] = [];\n\n\tif ( getBlockType( 'core/heading' ) ) {\n\t\tconst headingBlock = createBlock( 'core/heading', {\n\t\t\tcontent: __(\n\t\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t\t),\n\t\t\tlevel: 1,\n\t\t} );\n\t\ttypographyBlockExamples.push( headingBlock );\n\t}\n\n\tif ( getBlockType( 'core/paragraph' ) ) {\n\t\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`\n\t\t\t),\n\t\t} );\n\t\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`\n\t\t\t),\n\t\t} );\n\n\t\tif ( getBlockType( 'core/group' ) ) {\n\t\t\tconst groupBlock = createBlock(\n\t\t\t\t'core/group',\n\t\t\t\t{\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t\tminimumColumnWidth: '12rem',\n\t\t\t\t\t},\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\tblockGap: '1.5rem',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[ firstParagraphBlock, secondParagraphBlock ]\n\t\t\t);\n\t\t\ttypographyBlockExamples.push( groupBlock );\n\t\t} else {\n\t\t\ttypographyBlockExamples.push( firstParagraphBlock );\n\t\t}\n\t}\n\n\tif ( !! typographyBlockExamples.length ) {\n\t\texamples.push( {\n\t\t\tname: 'typography',\n\t\t\ttitle: __( 'Typography' ),\n\t\t\tcategory: 'overview',\n\t\t\tblocks: typographyBlockExamples,\n\t\t} );\n\t}\n\n\tconst otherBlockExamples = [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/buttons',\n\t\t'core/pullquote',\n\t\t'core/search',\n\t];\n\n\t// Get examples for other blocks and put them in order of above array.\n\totherBlockExamples.forEach( ( blockName ) => {\n\t\tconst blockType = getBlockType( blockName );\n\t\tif ( blockType && blockType.example ) {\n\t\t\tconst blockExample: BlockExample = {\n\t\t\t\tname: blockName,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\tcategory: 'overview',\n\t\t\t\t/*\n\t\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t\t * demonstrates changes to global styles.\n\t\t\t\t */\n\t\t\t\tblocks: getBlockFromExample( blockName, {\n\t\t\t\t\t...blockType.example,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t};\n\t\t\texamples.push( blockExample );\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType: BlockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType: BlockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\t/*\n\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t * demonstrates changes to global styles.\n\t\t\t */\n\t\t\tblocks: getBlockFromExample( blockType.name, {\n\t\t\t\t...blockType.example,\n\t\t\t\tattributes: {\n\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\tstyle: undefined,\n\t\t\t\t},\n\t\t\t} ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YA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AAe,GAAG;IACvBrC,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE3B,EAAE,CAAE,UAAW,CAAC;IACvB4B,QAAQ,EAAE,MAAM;IAChBsB,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACW,GAAG,CAAItB,KAAK,IAAM;MAC9C,OAAOlC,WAAW,CAAE,cAAc,EAAE;QACnCwB,OAAO,EAAE5B,OAAO;QACf;QACAD,EAAE,CAAE,YAAa,CAAC,EAClBuC,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAMyB,aAAa,GAAGrD,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAMqD,qBAAqB,GAAGjC,wBAAwB,CAAEpB,MAAO,CAAC;EAEhE,OAAO,CACNmD,eAAe,EACf,GAAGC,aAAa,EAChB,GAAGP,uBAAuB,EAC1B,GAAGQ,qBAAqB,CACxB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","ColorExamples","DuotoneExamples","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","getColorExamples","colors","examples","forEach","group","palette","type","paletteFiltered","Array","isArray","find","origin","slug","undefined","example","name","title","category","content","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","templateColumns","itemHeight","typographyBlockExamples","headingBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","attributes","getExamples","nonHeadingBlockExamples","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n\t// @wordpress/blocks imports are not typed.\n\t// @ts-expect-error\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlockExample,\n\tColorOrigin,\n\tMultiOriginPalettes,\n\tBlockType,\n} from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type as keyof MultiOriginPalettes ];\n\t\tconst paletteFiltered = Array.isArray( palette )\n\t\t\t? palette.find(\n\t\t\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t\t )\n\t\t\t: undefined;\n\n\t\tif ( paletteFiltered?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples\n\t\t\t\t\t\tduotones={ paletteFiltered[ group.type ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ paletteFiltered[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns examples for the overview page.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of block examples.\n */\nfunction getOverviewBlockExamples(\n\tcolors: MultiOriginPalettes\n): BlockExample[] {\n\tconst examples: BlockExample[] = [];\n\n\t// Get theme palette from colors if they exist.\n\tconst themePalette = Array.isArray( colors?.colors )\n\t\t? colors.colors.find(\n\t\t\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t\t )\n\t\t: undefined;\n\n\tif ( themePalette ) {\n\t\tconst themeColorexample: BlockExample = {\n\t\t\tname: 'theme-colors',\n\t\t\ttitle: __( 'Colors' ),\n\t\t\tcategory: 'overview',\n\t\t\tcontent: (\n\t\t\t\t<ColorExamples\n\t\t\t\t\tcolors={ themePalette.colors }\n\t\t\t\t\ttype=\"colors\"\n\t\t\t\t\ttemplateColumns=\"repeat(auto-fill, minmax( 200px, 1fr ))\"\n\t\t\t\t\titemHeight=\"32px\"\n\t\t\t\t/>\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\t// Get examples for typography blocks.\n\tconst typographyBlockExamples: BlockType[] = [];\n\n\tif ( getBlockType( 'core/heading' ) ) {\n\t\tconst headingBlock = createBlock( 'core/heading', {\n\t\t\tcontent: __(\n\t\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t\t),\n\t\t\tlevel: 1,\n\t\t} );\n\t\ttypographyBlockExamples.push( headingBlock );\n\t}\n\n\tif ( getBlockType( 'core/paragraph' ) ) {\n\t\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`\n\t\t\t),\n\t\t} );\n\t\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`\n\t\t\t),\n\t\t} );\n\n\t\tif ( getBlockType( 'core/group' ) ) {\n\t\t\tconst groupBlock = createBlock(\n\t\t\t\t'core/group',\n\t\t\t\t{\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t\tminimumColumnWidth: '12rem',\n\t\t\t\t\t},\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\tblockGap: '1.5rem',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[ firstParagraphBlock, secondParagraphBlock ]\n\t\t\t);\n\t\t\ttypographyBlockExamples.push( groupBlock );\n\t\t} else {\n\t\t\ttypographyBlockExamples.push( firstParagraphBlock );\n\t\t}\n\t}\n\n\tif ( !! typographyBlockExamples.length ) {\n\t\texamples.push( {\n\t\t\tname: 'typography',\n\t\t\ttitle: __( 'Typography' ),\n\t\t\tcategory: 'overview',\n\t\t\tblocks: typographyBlockExamples,\n\t\t} );\n\t}\n\n\tconst otherBlockExamples = [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/buttons',\n\t\t'core/pullquote',\n\t\t'core/search',\n\t];\n\n\t// Get examples for other blocks and put them in order of above array.\n\totherBlockExamples.forEach( ( blockName ) => {\n\t\tconst blockType = getBlockType( blockName );\n\t\tif ( blockType && blockType.example ) {\n\t\t\tconst blockExample: BlockExample = {\n\t\t\t\tname: blockName,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\tcategory: 'overview',\n\t\t\t\t/*\n\t\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t\t * demonstrates changes to global styles.\n\t\t\t\t */\n\t\t\t\tblocks: getBlockFromExample( blockName, {\n\t\t\t\t\t...blockType.example,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t};\n\t\t\texamples.push( blockExample );\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType: BlockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType: BlockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\t/*\n\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t * demonstrates changes to global styles.\n\t\t\t */\n\t\t\tblocks: getBlockFromExample( blockType.name, {\n\t\t\t\t...blockType.example,\n\t\t\t\tattributes: {\n\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\tstyle: undefined,\n\t\t\t\t},\n\t\t\t} ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,aAAa,EACbC,mBAAmB,EACnBC;AACA;AACA;AAAA,OACM,mBAAmB;;AAE1B;AACA;AACA;;AAOA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,eAAe,MAAM,oBAAoB;AAChD,SAASC,uBAAuB,QAAQ,aAAa;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,SAASC,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCL,uBAAuB,CAACM,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGJ,MAAM,CAAEG,KAAK,CAACE,IAAI,CAA+B;IACjE,MAAMC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAAEJ,OAAQ,CAAC,GAC7CA,OAAO,CAACK,IAAI,CACVC,MAAmB,IAAMA,MAAM,CAACC,IAAI,KAAKR,KAAK,CAACO,MACjD,CAAC,GACDE,SAAS;IAEZ,IAAKN,eAAe,GAAIH,KAAK,CA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
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -12,7 +11,6 @@ import { __, _x, sprintf } from '@wordpress/i18n';
|
|
|
12
11
|
import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, useSettings, BlockEditorProvider, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from '@wordpress/block-editor';
|
|
13
12
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
14
13
|
import { useSelect, dispatch } from '@wordpress/data';
|
|
15
|
-
import { useResizeObserver } from '@wordpress/compose';
|
|
16
14
|
import { useMemo, useState, memo, useContext, useRef, useLayoutEffect, useEffect } from '@wordpress/element';
|
|
17
15
|
import { ENTER, SPACE } from '@wordpress/keycodes';
|
|
18
16
|
import { uploadMedia } from '@wordpress/media-utils';
|
|
@@ -158,7 +156,6 @@ function StyleBook({
|
|
|
158
156
|
userConfig = {},
|
|
159
157
|
path = ''
|
|
160
158
|
}) {
|
|
161
|
-
const [resizeObserver, sizes] = useResizeObserver();
|
|
162
159
|
const [textColor] = useGlobalStyle('color.text');
|
|
163
160
|
const [backgroundColor] = useGlobalStyle('color.background');
|
|
164
161
|
const colors = useMultiOriginPalettes();
|
|
@@ -189,16 +186,15 @@ function StyleBook({
|
|
|
189
186
|
onClose: onClose,
|
|
190
187
|
enableResizing: enableResizing,
|
|
191
188
|
closeButtonLabel: showCloseButton ? __('Close') : null,
|
|
192
|
-
children: /*#__PURE__*/
|
|
189
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
193
190
|
className: clsx('edit-site-style-book', {
|
|
194
|
-
'is-wide': sizes.width > 600,
|
|
195
191
|
'is-button': !!onClick
|
|
196
192
|
}),
|
|
197
193
|
style: {
|
|
198
194
|
color: textColor,
|
|
199
195
|
background: backgroundColor
|
|
200
196
|
},
|
|
201
|
-
children:
|
|
197
|
+
children: showTabs ? /*#__PURE__*/_jsxs(Tabs, {
|
|
202
198
|
children: [/*#__PURE__*/_jsx("div", {
|
|
203
199
|
className: "edit-site-style-book__tablist-container",
|
|
204
200
|
children: /*#__PURE__*/_jsx(Tabs.TabList, {
|
|
@@ -222,7 +218,6 @@ function StyleBook({
|
|
|
222
218
|
isSelected: isSelected,
|
|
223
219
|
onSelect: onSelect,
|
|
224
220
|
settings: settings,
|
|
225
|
-
sizes: sizes,
|
|
226
221
|
title: tab.title,
|
|
227
222
|
goTo: goTo
|
|
228
223
|
})
|
|
@@ -236,9 +231,8 @@ function StyleBook({
|
|
|
236
231
|
onClick: onClick,
|
|
237
232
|
onSelect: onSelect,
|
|
238
233
|
settings: settings,
|
|
239
|
-
sizes: sizes,
|
|
240
234
|
goTo: goTo
|
|
241
|
-
})
|
|
235
|
+
})
|
|
242
236
|
})
|
|
243
237
|
});
|
|
244
238
|
}
|
|
@@ -290,7 +284,6 @@ export const StyleBookPreview = ({
|
|
|
290
284
|
// Now go to the selected block.
|
|
291
285
|
onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
|
|
292
286
|
};
|
|
293
|
-
const [resizeObserver, sizes] = useResizeObserver();
|
|
294
287
|
const colors = useMultiOriginPalettes();
|
|
295
288
|
const examples = getExamples(colors);
|
|
296
289
|
const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
|
|
@@ -335,9 +328,9 @@ export const StyleBookPreview = ({
|
|
|
335
328
|
styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles,
|
|
336
329
|
isPreviewMode: true
|
|
337
330
|
}), [globalStyles, siteEditorSettings, userConfig]);
|
|
338
|
-
return /*#__PURE__*/
|
|
331
|
+
return /*#__PURE__*/_jsx("div", {
|
|
339
332
|
className: "edit-site-style-book",
|
|
340
|
-
children:
|
|
333
|
+
children: /*#__PURE__*/_jsxs(BlockEditorProvider, {
|
|
341
334
|
settings: settings,
|
|
342
335
|
children: [/*#__PURE__*/_jsx(GlobalStylesRenderer, {
|
|
343
336
|
disableRootPadding: true
|
|
@@ -345,11 +338,10 @@ export const StyleBookPreview = ({
|
|
|
345
338
|
examples: displayedExamples,
|
|
346
339
|
settings: settings,
|
|
347
340
|
goTo: goTo,
|
|
348
|
-
sizes: sizes,
|
|
349
341
|
isSelected: !isStatic ? isSelected : null,
|
|
350
342
|
onSelect: !isStatic ? onSelect : null
|
|
351
343
|
})]
|
|
352
|
-
})
|
|
344
|
+
})
|
|
353
345
|
});
|
|
354
346
|
};
|
|
355
347
|
export const StyleBookBody = ({
|
|
@@ -358,7 +350,6 @@ export const StyleBookBody = ({
|
|
|
358
350
|
onClick,
|
|
359
351
|
onSelect,
|
|
360
352
|
settings,
|
|
361
|
-
sizes,
|
|
362
353
|
title,
|
|
363
354
|
goTo
|
|
364
355
|
}) => {
|
|
@@ -417,9 +408,7 @@ export const StyleBookBody = ({
|
|
|
417
408
|
}), /*#__PURE__*/_jsxs("style", {
|
|
418
409
|
children: [STYLE_BOOK_IFRAME_STYLES, !!onClick && 'body { cursor: pointer; } body * { pointer-events: none; }']
|
|
419
410
|
}), /*#__PURE__*/_jsx(Examples, {
|
|
420
|
-
className:
|
|
421
|
-
'is-wide': sizes.width > 600
|
|
422
|
-
}),
|
|
411
|
+
className: "edit-site-style-book__examples",
|
|
423
412
|
filteredExamples: examples,
|
|
424
413
|
label: title ? sprintf(
|
|
425
414
|
// translators: %s: Category of blocks, e.g. Text.
|