@wordpress/edit-site 6.17.0 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +0 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +0 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +0 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +0 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/editor/index.js +7 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/{maybe-editor/index.js → editor/site-preview.js} +9 -25
- package/build/components/editor/site-preview.js.map +1 -0
- package/build/components/editor-canvas-container/index.js +0 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +0 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -5
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +0 -1
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +0 -1
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +0 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +0 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +1 -5
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +0 -1
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +0 -1
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +0 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +0 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +0 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +0 -1
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/preview-wrapper.js +0 -1
- package/build/components/global-styles/preview-wrapper.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +9 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-css.js +9 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +1 -0
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js +0 -1
- package/build/components/global-styles/shadow-utils.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +0 -1
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +0 -1
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +0 -1
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typeset.js +0 -1
- package/build/components/global-styles/typeset.js.map +1 -1
- package/build/components/global-styles/ui.js +0 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +0 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +0 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +0 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +0 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +0 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/media/index.js +2 -3
- package/build/components/media/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +0 -1
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +0 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +6 -7
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +0 -1
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +0 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +0 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +5 -6
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +0 -1
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +0 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +0 -1
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +1 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-button/index.js +0 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +0 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +0 -1
- package/build/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build/components/save-panel/index.js +0 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +0 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +0 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +0 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +0 -6
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +12 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +0 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/site-editor-routes/home.js +3 -3
- package/build/components/site-editor-routes/home.js.map +1 -1
- package/build/components/site-editor-routes/index.js +2 -2
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/notfound.js +33 -0
- package/build/components/site-editor-routes/notfound.js.map +1 -0
- package/build/components/site-editor-routes/template-item.js +3 -3
- package/build/components/site-editor-routes/template-item.js.map +1 -1
- package/build/components/site-editor-routes/template-part-item.js +3 -3
- package/build/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build/components/style-book/categories.js +0 -1
- package/build/components/style-book/categories.js.map +1 -1
- package/build/components/style-book/color-examples.js +0 -1
- package/build/components/style-book/color-examples.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +0 -1
- package/build/components/style-book/duotone-examples.js.map +1 -1
- package/build/components/style-book/examples.js +0 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +7 -18
- package/build/components/style-book/index.js.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/posts.js +0 -1
- package/build/posts.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js +0 -1
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build/utils/set-nested-value.js +0 -1
- package/build/utils/set-nested-value.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +0 -1
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +0 -1
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +0 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/editor/index.js +7 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/{maybe-editor/index.js → editor/site-preview.js} +8 -25
- package/build-module/components/editor/site-preview.js.map +1 -0
- package/build-module/components/editor-canvas-container/index.js +0 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +0 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +3 -6
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +0 -1
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +3 -7
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +0 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +0 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +0 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +0 -1
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/preview-wrapper.js +0 -1
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +10 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +9 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js +0 -1
- package/build-module/components/global-styles/shadow-utils.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +0 -1
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +0 -1
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +0 -1
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset.js +0 -1
- package/build-module/components/global-styles/typeset.js.map +1 -1
- package/build-module/components/global-styles/ui.js +0 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +0 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +0 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +0 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +0 -1
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +0 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/media/index.js +2 -3
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +0 -1
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +0 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +2 -3
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +0 -1
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +0 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +0 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -3
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +0 -1
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +0 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +0 -1
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +1 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-button/index.js +0 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +0 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +0 -1
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +0 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +0 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +0 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +0 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +0 -6
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +12 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +0 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/site-editor-routes/home.js +3 -3
- package/build-module/components/site-editor-routes/home.js.map +1 -1
- package/build-module/components/site-editor-routes/index.js +2 -2
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/notfound.js +25 -0
- package/build-module/components/site-editor-routes/notfound.js.map +1 -0
- package/build-module/components/site-editor-routes/template-item.js +3 -3
- package/build-module/components/site-editor-routes/template-item.js.map +1 -1
- package/build-module/components/site-editor-routes/template-part-item.js +3 -3
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build-module/components/style-book/categories.js +0 -1
- package/build-module/components/style-book/categories.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +0 -1
- package/build-module/components/style-book/color-examples.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +0 -1
- package/build-module/components/style-book/duotone-examples.js.map +1 -1
- package/build-module/components/style-book/examples.js +0 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +7 -18
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +0 -1
- package/build-module/posts.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js +0 -1
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/utils/set-nested-value.js +0 -1
- package/build-module/utils/set-nested-value.js.map +1 -1
- package/build-style/posts-rtl.css +8 -4
- package/build-style/posts.css +8 -4
- package/build-style/style-rtl.css +17 -24
- package/build-style/style.css +17 -24
- package/package.json +42 -42
- package/src/components/editor/index.js +12 -6
- package/src/components/{maybe-editor/index.js → editor/site-preview.js} +7 -20
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +3 -11
- package/src/components/global-styles/font-library-modal/library-font-variant.js +3 -12
- package/src/components/global-styles/screen-block-list.js +15 -6
- package/src/components/global-styles/screen-css.js +9 -0
- package/src/components/global-styles/screen-root.js +1 -0
- package/src/components/global-styles/style.scss +5 -0
- package/src/components/layout/style.scss +4 -0
- package/src/components/media/index.js +2 -2
- package/src/components/page-patterns/index.js +1 -2
- package/src/components/page-patterns/style.scss +2 -0
- package/src/components/page-templates/index.js +1 -2
- package/src/components/page-templates/style.scss +2 -0
- package/src/components/resizable-frame/index.js +1 -1
- package/src/components/sidebar-navigation-screen/index.js +0 -9
- package/src/components/sidebar-navigation-screen/style.scss +0 -23
- package/src/components/sidebar-navigation-screen-main/index.js +15 -10
- package/src/components/site-editor-routes/home.js +2 -2
- package/src/components/site-editor-routes/index.js +2 -0
- package/src/components/site-editor-routes/notfound.js +27 -0
- package/src/components/site-editor-routes/template-item.js +3 -3
- package/src/components/site-editor-routes/template-part-item.js +3 -3
- package/src/components/style-book/index.js +1 -13
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/maybe-editor/index.js.map +0 -1
- package/build-module/components/maybe-editor/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_useDefaultPatternCategories","_interopRequireDefault","_useThemePatterns","_usePatterns","_constants","usePatternCategories","defaultCategories","useDefaultPatternCategories","push","name","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","label","__","themePatterns","useThemePatterns","patterns","userPatterns","categories","userPatternCategories","usePatterns","PATTERN_TYPES","user","patternCategories","useMemo","categoryMap","categoriesWithCounts","forEach","category","count","pattern","length","uncategorized","wp_pattern_category","catId","find","cat","id","some","sortedCategories","sort","a","b","localeCompare","unshift","PATTERN_USER_CATEGORY","PATTERN_DEFAULT_CATEGORY","description","hasPatterns"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDefaultPatternCategories from './use-default-pattern-categories';\nimport useThemePatterns from './use-theme-patterns';\nimport usePatterns from '../page-patterns/use-patterns';\nimport {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../utils/constants';\n\nexport default function usePatternCategories() {\n\tconst defaultCategories = useDefaultPatternCategories();\n\tdefaultCategories.push( {\n\t\tname: TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\t\tlabel: __( 'Uncategorized' ),\n\t} );\n\tconst themePatterns = useThemePatterns();\n\tconst { patterns: userPatterns, categories: userPatternCategories } =\n\t\tusePatterns( PATTERN_TYPES.user );\n\n\tconst patternCategories = useMemo( () => {\n\t\tconst categoryMap = {};\n\t\tconst categoriesWithCounts = [];\n\n\t\t// Create a map for easier counting of patterns in categories.\n\t\tdefaultCategories.forEach( ( category ) => {\n\t\t\tif ( ! categoryMap[ category.name ] ) {\n\t\t\t\tcategoryMap[ category.name ] = { ...category, count: 0 };\n\t\t\t}\n\t\t} );\n\t\tuserPatternCategories.forEach( ( category ) => {\n\t\t\tif ( ! categoryMap[ category.name ] ) {\n\t\t\t\tcategoryMap[ category.name ] = { ...category, count: 0 };\n\t\t\t}\n\t\t} );\n\n\t\t// Update the category counts to reflect theme registered patterns.\n\t\tthemePatterns.forEach( ( pattern ) => {\n\t\t\tpattern.categories?.forEach( ( category ) => {\n\t\t\t\tif ( categoryMap[ category ] ) {\n\t\t\t\t\tcategoryMap[ category ].count += 1;\n\t\t\t\t}\n\t\t\t} );\n\t\t\t// If the pattern has no categories, add it to uncategorized.\n\t\t\tif ( ! pattern.categories?.length ) {\n\t\t\t\tcategoryMap.uncategorized.count += 1;\n\t\t\t}\n\t\t} );\n\n\t\t// Update the category counts to reflect user registered patterns.\n\t\tuserPatterns.forEach( ( pattern ) => {\n\t\t\tpattern.wp_pattern_category?.forEach( ( catId ) => {\n\t\t\t\tconst category = userPatternCategories.find(\n\t\t\t\t\t( cat ) => cat.id === catId\n\t\t\t\t)?.name;\n\t\t\t\tif ( categoryMap[ category ] ) {\n\t\t\t\t\tcategoryMap[ category ].count += 1;\n\t\t\t\t}\n\t\t\t} );\n\t\t\t// If the pattern has no categories, add it to uncategorized.\n\t\t\tif (\n\t\t\t\t! pattern.wp_pattern_category?.length ||\n\t\t\t\t! pattern.wp_pattern_category?.some( ( catId ) =>\n\t\t\t\t\tuserPatternCategories.find( ( cat ) => cat.id === catId )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcategoryMap.uncategorized.count += 1;\n\t\t\t}\n\t\t} );\n\n\t\t// Filter categories so we only have those containing patterns.\n\t\t[ ...defaultCategories, ...userPatternCategories ].forEach(\n\t\t\t( category ) => {\n\t\t\t\tif (\n\t\t\t\t\tcategoryMap[ category.name ].count &&\n\t\t\t\t\t! categoriesWithCounts.find(\n\t\t\t\t\t\t( cat ) => cat.name === category.name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tcategoriesWithCounts.push( categoryMap[ category.name ] );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tconst sortedCategories = categoriesWithCounts.sort( ( a, b ) =>\n\t\t\ta.label.localeCompare( b.label )\n\t\t);\n\n\t\tsortedCategories.unshift( {\n\t\t\tname: PATTERN_USER_CATEGORY,\n\t\t\tlabel: __( 'My patterns' ),\n\t\t\tcount: userPatterns.length,\n\t\t} );\n\n\t\tsortedCategories.unshift( {\n\t\t\tname: PATTERN_DEFAULT_CATEGORY,\n\t\t\tlabel: __( 'All patterns' ),\n\t\t\tdescription: __( 'A list of all patterns from all sources.' ),\n\t\t\tcount: themePatterns.length + userPatterns.length,\n\t\t} );\n\n\t\treturn sortedCategories;\n\t}, [\n\t\tdefaultCategories,\n\t\tthemePatterns,\n\t\tuserPatternCategories,\n\t\tuserPatterns,\n\t] );\n\n\treturn { patternCategories, hasPatterns: !! patternCategories.length };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_useDefaultPatternCategories","_interopRequireDefault","_useThemePatterns","_usePatterns","_constants","usePatternCategories","defaultCategories","useDefaultPatternCategories","push","name","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","label","__","themePatterns","useThemePatterns","patterns","userPatterns","categories","userPatternCategories","usePatterns","PATTERN_TYPES","user","patternCategories","useMemo","categoryMap","categoriesWithCounts","forEach","category","count","pattern","length","uncategorized","wp_pattern_category","catId","find","cat","id","some","sortedCategories","sort","a","b","localeCompare","unshift","PATTERN_USER_CATEGORY","PATTERN_DEFAULT_CATEGORY","description","hasPatterns"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDefaultPatternCategories from './use-default-pattern-categories';\nimport useThemePatterns from './use-theme-patterns';\nimport usePatterns from '../page-patterns/use-patterns';\nimport {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../utils/constants';\n\nexport default function usePatternCategories() {\n\tconst defaultCategories = useDefaultPatternCategories();\n\tdefaultCategories.push( {\n\t\tname: TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\t\tlabel: __( 'Uncategorized' ),\n\t} );\n\tconst themePatterns = useThemePatterns();\n\tconst { patterns: userPatterns, categories: userPatternCategories } =\n\t\tusePatterns( PATTERN_TYPES.user );\n\n\tconst patternCategories = useMemo( () => {\n\t\tconst categoryMap = {};\n\t\tconst categoriesWithCounts = [];\n\n\t\t// Create a map for easier counting of patterns in categories.\n\t\tdefaultCategories.forEach( ( category ) => {\n\t\t\tif ( ! categoryMap[ category.name ] ) {\n\t\t\t\tcategoryMap[ category.name ] = { ...category, count: 0 };\n\t\t\t}\n\t\t} );\n\t\tuserPatternCategories.forEach( ( category ) => {\n\t\t\tif ( ! categoryMap[ category.name ] ) {\n\t\t\t\tcategoryMap[ category.name ] = { ...category, count: 0 };\n\t\t\t}\n\t\t} );\n\n\t\t// Update the category counts to reflect theme registered patterns.\n\t\tthemePatterns.forEach( ( pattern ) => {\n\t\t\tpattern.categories?.forEach( ( category ) => {\n\t\t\t\tif ( categoryMap[ category ] ) {\n\t\t\t\t\tcategoryMap[ category ].count += 1;\n\t\t\t\t}\n\t\t\t} );\n\t\t\t// If the pattern has no categories, add it to uncategorized.\n\t\t\tif ( ! pattern.categories?.length ) {\n\t\t\t\tcategoryMap.uncategorized.count += 1;\n\t\t\t}\n\t\t} );\n\n\t\t// Update the category counts to reflect user registered patterns.\n\t\tuserPatterns.forEach( ( pattern ) => {\n\t\t\tpattern.wp_pattern_category?.forEach( ( catId ) => {\n\t\t\t\tconst category = userPatternCategories.find(\n\t\t\t\t\t( cat ) => cat.id === catId\n\t\t\t\t)?.name;\n\t\t\t\tif ( categoryMap[ category ] ) {\n\t\t\t\t\tcategoryMap[ category ].count += 1;\n\t\t\t\t}\n\t\t\t} );\n\t\t\t// If the pattern has no categories, add it to uncategorized.\n\t\t\tif (\n\t\t\t\t! pattern.wp_pattern_category?.length ||\n\t\t\t\t! pattern.wp_pattern_category?.some( ( catId ) =>\n\t\t\t\t\tuserPatternCategories.find( ( cat ) => cat.id === catId )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcategoryMap.uncategorized.count += 1;\n\t\t\t}\n\t\t} );\n\n\t\t// Filter categories so we only have those containing patterns.\n\t\t[ ...defaultCategories, ...userPatternCategories ].forEach(\n\t\t\t( category ) => {\n\t\t\t\tif (\n\t\t\t\t\tcategoryMap[ category.name ].count &&\n\t\t\t\t\t! categoriesWithCounts.find(\n\t\t\t\t\t\t( cat ) => cat.name === category.name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tcategoriesWithCounts.push( categoryMap[ category.name ] );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tconst sortedCategories = categoriesWithCounts.sort( ( a, b ) =>\n\t\t\ta.label.localeCompare( b.label )\n\t\t);\n\n\t\tsortedCategories.unshift( {\n\t\t\tname: PATTERN_USER_CATEGORY,\n\t\t\tlabel: __( 'My patterns' ),\n\t\t\tcount: userPatterns.length,\n\t\t} );\n\n\t\tsortedCategories.unshift( {\n\t\t\tname: PATTERN_DEFAULT_CATEGORY,\n\t\t\tlabel: __( 'All patterns' ),\n\t\t\tdescription: __( 'A list of all patterns from all sources.' ),\n\t\t\tcount: themePatterns.length + userPatterns.length,\n\t\t} );\n\n\t\treturn sortedCategories;\n\t}, [\n\t\tdefaultCategories,\n\t\tthemePatterns,\n\t\tuserPatternCategories,\n\t\tuserPatterns,\n\t] );\n\n\treturn { patternCategories, hasPatterns: !! patternCategories.length };\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,4BAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAWe,SAASO,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBA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,KAAK,CAAC+B,aAAa,CAAED,CAAC,CAAC9B,KAAM,CAChC,CAAC;IAED2B,gBAAgB,CAACK,OAAO,CAAE;MACzBlC,IAAI,EAAEmC,gCAAqB;MAC3BjC,KAAK,EAAE,IAAAC,QAAE,EAAE,aAAc,CAAC;MAC1BgB,KAAK,EAAEZ,YAAY,CAACc;IACrB,CAAE,CAAC;IAEHQ,gBAAgB,CAACK,OAAO,CAAE;MACzBlC,IAAI,EAAEoC,mCAAwB;MAC9BlC,KAAK,EAAE,IAAAC,QAAE,EAAE,cAAe,CAAC;MAC3BkC,WAAW,EAAE,IAAAlC,QAAE,EAAE,0CAA2C,CAAC;MAC7DgB,KAAK,EAAEf,aAAa,CAACiB,MAAM,GAAGd,YAAY,CAACc;IAC5C,CAAE,CAAC;IAEH,OAAOQ,gBAAgB;EACxB,CAAC,EAAE,CACFhC,iBAAiB,EACjBO,aAAa,EACbK,qBAAqB,EACrBF,YAAY,CACX,CAAC;EAEH,OAAO;IAAEM,iBAAiB;IAAEyB,WAAW,EAAE,CAAC,CAAEzB,iBAAiB,CAACQ;EAAO,CAAC;AACvE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_data","_constants","useTemplatePartsGroupedByArea","items","allItems","templatePartAreas","useSelect","select","coreStore","getEntityRecord","default_template_part_areas","knownAreas","header","footer","sidebar","uncategorized","forEach","templatePartArea","area","templateParts","groupedByArea","reduce","accumulator","item","key","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","push","useTemplatePartAreas","records","isResolving","isLoading","useEntityRecords","TEMPLATE_PART_POST_TYPE","per_page","hasTemplateParts","length"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\n\nconst useTemplatePartsGroupedByArea = ( items ) => {\n\tconst allItems = items || [];\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t\t?.default_template_part_areas || [],\n\t\t[]\n\t);\n\n\t// Create map of template areas ensuring that default areas are displayed before\n\t// any custom registered template part areas.\n\tconst knownAreas = {\n\t\theader: {},\n\t\tfooter: {},\n\t\tsidebar: {},\n\t\tuncategorized: {},\n\t};\n\n\ttemplatePartAreas.forEach(\n\t\t( templatePartArea ) =>\n\t\t\t( knownAreas[ templatePartArea.area ] = {\n\t\t\t\t...templatePartArea,\n\t\t\t\ttemplateParts: [],\n\t\t\t} )\n\t);\n\n\tconst groupedByArea = allItems.reduce( ( accumulator, item ) => {\n\t\tconst key = accumulator[ item.area ]\n\t\t\t? item.area\n\t\t\t: TEMPLATE_PART_AREA_DEFAULT_CATEGORY;\n\t\taccumulator[ key ]?.templateParts?.push( item );\n\t\treturn accumulator;\n\t}, knownAreas );\n\n\treturn groupedByArea;\n};\n\nexport default function useTemplatePartAreas() {\n\tconst { records: templateParts, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tTEMPLATE_PART_POST_TYPE,\n\t\t{ per_page: -1 }\n\t);\n\n\treturn {\n\t\thasTemplateParts: templateParts ? !! templateParts.length : false,\n\t\tisLoading,\n\t\ttemplatePartAreas: useTemplatePartsGroupedByArea( templateParts ),\n\t};\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_coreData","require","_data","_constants","useTemplatePartsGroupedByArea","items","allItems","templatePartAreas","useSelect","select","coreStore","getEntityRecord","default_template_part_areas","knownAreas","header","footer","sidebar","uncategorized","forEach","templatePartArea","area","templateParts","groupedByArea","reduce","accumulator","item","key","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","push","useTemplatePartAreas","records","isResolving","isLoading","useEntityRecords","TEMPLATE_PART_POST_TYPE","per_page","hasTemplateParts","length"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\n\nconst useTemplatePartsGroupedByArea = ( items ) => {\n\tconst allItems = items || [];\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t\t?.default_template_part_areas || [],\n\t\t[]\n\t);\n\n\t// Create map of template areas ensuring that default areas are displayed before\n\t// any custom registered template part areas.\n\tconst knownAreas = {\n\t\theader: {},\n\t\tfooter: {},\n\t\tsidebar: {},\n\t\tuncategorized: {},\n\t};\n\n\ttemplatePartAreas.forEach(\n\t\t( templatePartArea ) =>\n\t\t\t( knownAreas[ templatePartArea.area ] = {\n\t\t\t\t...templatePartArea,\n\t\t\t\ttemplateParts: [],\n\t\t\t} )\n\t);\n\n\tconst groupedByArea = allItems.reduce( ( accumulator, item ) => {\n\t\tconst key = accumulator[ item.area ]\n\t\t\t? item.area\n\t\t\t: TEMPLATE_PART_AREA_DEFAULT_CATEGORY;\n\t\taccumulator[ key ]?.templateParts?.push( item );\n\t\treturn accumulator;\n\t}, knownAreas );\n\n\treturn groupedByArea;\n};\n\nexport default function useTemplatePartAreas() {\n\tconst { records: templateParts, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tTEMPLATE_PART_POST_TYPE,\n\t\t{ per_page: -1 }\n\t);\n\n\treturn {\n\t\thasTemplateParts: templateParts ? !! templateParts.length : false,\n\t\tisLoading,\n\t\ttemplatePartAreas: useTemplatePartsGroupedByArea( templateParts ),\n\t};\n}\n"],"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AEC,QAAQ,EAAE,CAAC;EAAE,CAChB,CAAC;EAED,OAAO;IACNC,gBAAgB,EAAEf,aAAa,GAAG,CAAC,CAAEA,aAAa,CAACgB,MAAM,GAAG,KAAK;IACjEL,SAAS;IACTzB,iBAAiB,EAAEH,6BAA6B,CAAEiB,aAAc;EACjE,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_data","_element","_utils","_constants","_lockUnlock","_store","useThemePatterns","blockPatterns","useSelect","select","_getSettings$__experi","getSettings","unlock","editSiteStore","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","restBlockPatterns","coreStore","getBlockPatterns","patterns","useMemo","filter","pattern","EXCLUDED_PATTERN_SOURCES","includes","source","filterOutDuplicatesByName","inserter"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { filterOutDuplicatesByName } from '../page-patterns/utils';\nimport { EXCLUDED_PATTERN_SOURCES } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport default function useThemePatterns() {\n\tconst blockPatterns = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn (\n\t\t\tgetSettings().__experimentalAdditionalBlockPatterns ??\n\t\t\tgetSettings().__experimentalBlockPatterns\n\t\t);\n\t} );\n\n\tconst restBlockPatterns = useSelect( ( select ) =>\n\t\tselect( coreStore ).getBlockPatterns()\n\t);\n\n\tconst patterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( blockPatterns || [] ), ...( restBlockPatterns || [] ) ]\n\t\t\t\t.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\t! EXCLUDED_PATTERN_SOURCES.includes( pattern.source )\n\t\t\t\t)\n\t\t\t\t.filter( filterOutDuplicatesByName )\n\t\t\t\t.filter( ( pattern ) => pattern.inserter !== false ),\n\t\t[ blockPatterns, restBlockPatterns ]\n\t);\n\n\treturn patterns;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_coreData","require","_data","_element","_utils","_constants","_lockUnlock","_store","useThemePatterns","blockPatterns","useSelect","select","_getSettings$__experi","getSettings","unlock","editSiteStore","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","restBlockPatterns","coreStore","getBlockPatterns","patterns","useMemo","filter","pattern","EXCLUDED_PATTERN_SOURCES","includes","source","filterOutDuplicatesByName","inserter"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { filterOutDuplicatesByName } from '../page-patterns/utils';\nimport { EXCLUDED_PATTERN_SOURCES } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport default function useThemePatterns() {\n\tconst blockPatterns = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn (\n\t\t\tgetSettings().__experimentalAdditionalBlockPatterns ??\n\t\t\tgetSettings().__experimentalBlockPatterns\n\t\t);\n\t} );\n\n\tconst restBlockPatterns = useSelect( ( select ) =>\n\t\tselect( coreStore ).getBlockPatterns()\n\t);\n\n\tconst patterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( blockPatterns || [] ), ...( restBlockPatterns || [] ) ]\n\t\t\t\t.filter(\n\t\t\t\t\t( pattern ) =>\n\t\t\t\t\t\t! EXCLUDED_PATTERN_SOURCES.includes( pattern.source )\n\t\t\t\t)\n\t\t\t\t.filter( filterOutDuplicatesByName )\n\t\t\t\t.filter( (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B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_element","_components","_i18n","_router","_url","_sidebarNavigationItem","_interopRequireDefault","_hooks","_icons","_constants","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","EMPTY_ARRAY","TemplateDataviewItem","template","isActive","text","icon","useAddedBy","type","id","jsx","default","to","addQueryArgs","activeView","children","DataviewsTemplatesSidebarContent","query","records","useEntityRecords","TEMPLATE_POST_TYPE","per_page","firstItemPerAuthorText","useMemo","_ref","firstItemPerAuthor","reduce","acc","author","author_text","Object","values","jsxs","__experimentalItemGroup","className","layout","__","map"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useAddedBy } from '../page-templates/hooks';\nimport { layout } from '@wordpress/icons';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction TemplateDataviewItem( { template, isActive } ) {\n\tconst { text, icon } = useAddedBy( template.type, template.id );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ addQueryArgs( '/template', { activeView: text } ) }\n\t\t\ticon={ icon }\n\t\t\taria-current={ isActive }\n\t\t>\n\t\t\t{ text }\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function DataviewsTemplatesSidebarContent() {\n\tconst {\n\t\tquery: { activeView = 'all' },\n\t} = useLocation();\n\tconst { records } = useEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\tper_page: -1,\n\t} );\n\tconst firstItemPerAuthorText = useMemo( () => {\n\t\tconst firstItemPerAuthor = records?.reduce( ( acc, template ) => {\n\t\t\tconst author = template.author_text;\n\t\t\tif ( author && ! acc[ author ] ) {\n\t\t\t\tacc[ author ] = template;\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn (\n\t\t\t( firstItemPerAuthor && Object.values( firstItemPerAuthor ) ) ??\n\t\t\tEMPTY_ARRAY\n\t\t);\n\t}, [ records ] );\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-templates-browse\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto=\"/template\"\n\t\t\t\ticon={ layout }\n\t\t\t\taria-current={ activeView === 'all' }\n\t\t\t>\n\t\t\t\t{ __( 'All templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ firstItemPerAuthorText.map( ( template ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<TemplateDataviewItem\n\t\t\t\t\t\tkey={ template.author_text }\n\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\tisActive={ activeView === template.author_text }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_coreData","require","_element","_components","_i18n","_router","_url","_sidebarNavigationItem","_interopRequireDefault","_hooks","_icons","_constants","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","EMPTY_ARRAY","TemplateDataviewItem","template","isActive","text","icon","useAddedBy","type","id","jsx","default","to","addQueryArgs","activeView","children","DataviewsTemplatesSidebarContent","query","records","useEntityRecords","TEMPLATE_POST_TYPE","per_page","firstItemPerAuthorText","useMemo","_ref","firstItemPerAuthor","reduce","acc","author","author_text","Object","values","jsxs","__experimentalItemGroup","className","layout","__","map"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useAddedBy } from '../page-templates/hooks';\nimport { layout } from '@wordpress/icons';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction TemplateDataviewItem( { template, isActive } ) {\n\tconst { text, icon } = useAddedBy( template.type, template.id );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ addQueryArgs( '/template', { activeView: text } ) }\n\t\t\ticon={ icon }\n\t\t\taria-current={ isActive }\n\t\t>\n\t\t\t{ text }\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function DataviewsTemplatesSidebarContent() {\n\tconst {\n\t\tquery: { activeView = 'all' },\n\t} = useLocation();\n\tconst { records } = useEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\tper_page: -1,\n\t} );\n\tconst firstItemPerAuthorText = useMemo( () => {\n\t\tconst firstItemPerAuthor = records?.reduce( ( acc, template ) => {\n\t\t\tconst author = template.author_text;\n\t\t\tif ( author && ! acc[ author ] ) {\n\t\t\t\tacc[ author ] = template;\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn (\n\t\t\t( firstItemPerAuthor && Object.values( firstItemPerAuthor ) ) ??\n\t\t\tEMPTY_ARRAY\n\t\t);\n\t}, [ records ] );\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-templates-browse\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto=\"/template\"\n\t\t\t\ticon={ layout }\n\t\t\t\taria-current={ activeView === 'all' }\n\t\t\t>\n\t\t\t\t{ __( 'All templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ firstItemPerAuthorText.map( ( template ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<TemplateDataviewItem\n\t\t\t\t\t\tkey={ template.author_text }\n\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\tisActive={ activeView === template.author_text }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,sBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAA2C,IAAAY,WAAA,GAAAZ,OAAA;AAjB3C;AACA;AACA;;AAQA;AACA;AACA;;AAOA,MAAM;EAAEa;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnD,MAAMC,WAAW,GAAG,EAAE;AAEtB,SAASC,oBAAoBA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAU,EAAEJ,QAAQ,CAACK,IAAI,EAAEL,QAAQ,CAACM,EAAG,CAAC;EAE/D,oBACC,IAAAZ,WAAA,CAAAa,GAAA,EAACnB,sBAAA,CAAAoB,OAAqB;IACrBC,EAAE,EAAG,IAAAC,iBAAY,EAAE,WAAW,EAAE;MAAEC,UAAU,EAAET;IAAK,C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,CACD,CAAC,EACtBd,sBAAsB,CAACe,GAAG,CAAIlC,QAAQ,IAAM;MAC7C,oBACC,IAAAN,WAAA,CAAAa,GAAA,EAACR,oBAAoB;QAEpBC,QAAQ,EAAGA,QAAU;QACrBC,QAAQ,EAAGU,UAAU,KAAKX,QAAQ,CAAC0B;MAAa,GAF1C1B,QAAQ,CAAC0B,WAGf,CAAC;IAEJ,CAAE,CAAC;EAAA,CACO,CAAC;AAEd","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.homeRoute = void 0;
|
|
8
8
|
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
9
|
-
var
|
|
9
|
+
var _editor = _interopRequireDefault(require("../editor"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
@@ -17,8 +17,8 @@ const homeRoute = exports.homeRoute = {
|
|
|
17
17
|
path: '/',
|
|
18
18
|
areas: {
|
|
19
19
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
|
|
20
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
21
|
-
|
|
20
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
21
|
+
isHomeRoute: true
|
|
22
22
|
}),
|
|
23
23
|
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {})
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sidebarNavigationScreenMain","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_sidebarNavigationScreenMain","_interopRequireDefault","require","_editor","_jsxRuntime","homeRoute","exports","name","path","areas","sidebar","jsx","default","preview","isHomeRoute","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/home.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport Editor from '../editor';\n\nexport const homeRoute = {\n\tname: 'home',\n\tpath: '/',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tpreview: <Editor isHomeRoute />,\n\t\tmobile: <SidebarNavigationScreenMain />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,4BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA+B,IAAAE,WAAA,GAAAF,OAAA;AAJ/B;AACA;AACA;;AAIO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxBE,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,GAAG;EACTC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAN,WAAA,CAAAO,GAAA,EAACX,4BAAA,CAAAY,OAA2B,IAAE,CAAC;IACxCC,OAAO,eAAE,IAAAT,WAAA,CAAAO,GAAA,EAACR,OAAA,CAAAS,OAAM;MAACE,WAAW;IAAA,CAAE,CAAC;IAC/BC,MAAM,eAAE,IAAAX,WAAA,CAAAO,GAAA,EAACX,4BAAA,CAAAY,OAA2B,IAAE;EACvC;AACD,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* wp:polyfill */
|
|
2
1
|
"use strict";
|
|
3
2
|
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -21,6 +20,7 @@ var _templateItem = require("./template-item");
|
|
|
21
20
|
var _pages = require("./pages");
|
|
22
21
|
var _pageItem = require("./page-item");
|
|
23
22
|
var _stylebook = require("./stylebook");
|
|
23
|
+
var _notfound = require("./notfound");
|
|
24
24
|
/**
|
|
25
25
|
* WordPress dependencies
|
|
26
26
|
*/
|
|
@@ -29,7 +29,7 @@ var _stylebook = require("./stylebook");
|
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
const routes = [_pageItem.pageItemRoute, _pages.pagesRoute, _templateItem.templateItemRoute, _templates.templatesRoute, _templatePartItem.templatePartItemRoute, _patternItem.patternItemRoute, _patterns.patternsRoute, _navigationItem.navigationItemRoute, _navigation.navigationRoute, _styles.stylesRoute, _home.homeRoute, _stylebook.stylebookRoute];
|
|
32
|
+
const routes = [_pageItem.pageItemRoute, _pages.pagesRoute, _templateItem.templateItemRoute, _templates.templatesRoute, _templatePartItem.templatePartItemRoute, _patternItem.patternItemRoute, _patterns.patternsRoute, _navigationItem.navigationItemRoute, _navigation.navigationRoute, _styles.stylesRoute, _home.homeRoute, _stylebook.stylebookRoute, _notfound.notFoundRoute];
|
|
33
33
|
function useRegisterSiteEditorRoutes() {
|
|
34
34
|
const registry = (0, _data.useRegistry)();
|
|
35
35
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_lockUnlock","_store","_home","_styles","_navigation","_navigationItem","_patterns","_patternItem","_templatePartItem","_templates","_templateItem","_pages","_pageItem","_stylebook","routes","pageItemRoute","pagesRoute","templateItemRoute","templatesRoute","templatePartItemRoute","patternItemRoute","patternsRoute","navigationItemRoute","navigationRoute","stylesRoute","homeRoute","stylebookRoute","useRegisterSiteEditorRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { homeRoute } from './home';\nimport { stylesRoute } from './styles';\nimport { navigationRoute } from './navigation';\nimport { navigationItemRoute } from './navigation-item';\nimport { patternsRoute } from './patterns';\nimport { patternItemRoute } from './pattern-item';\nimport { templatePartItemRoute } from './template-part-item';\nimport { templatesRoute } from './templates';\nimport { templateItemRoute } from './template-item';\nimport { pagesRoute } from './pages';\nimport { pageItemRoute } from './page-item';\nimport { stylebookRoute } from './stylebook';\n\nconst routes = [\n\tpageItemRoute,\n\tpagesRoute,\n\ttemplateItemRoute,\n\ttemplatesRoute,\n\ttemplatePartItemRoute,\n\tpatternItemRoute,\n\tpatternsRoute,\n\tnavigationItemRoute,\n\tnavigationRoute,\n\tstylesRoute,\n\thomeRoute,\n\tstylebookRoute,\n];\n\nexport function useRegisterSiteEditorRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_lockUnlock","_store","_home","_styles","_navigation","_navigationItem","_patterns","_patternItem","_templatePartItem","_templates","_templateItem","_pages","_pageItem","_stylebook","_notfound","routes","pageItemRoute","pagesRoute","templateItemRoute","templatesRoute","templatePartItemRoute","patternItemRoute","patternsRoute","navigationItemRoute","navigationRoute","stylesRoute","homeRoute","stylebookRoute","notFoundRoute","useRegisterSiteEditorRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { homeRoute } from './home';\nimport { stylesRoute } from './styles';\nimport { navigationRoute } from './navigation';\nimport { navigationItemRoute } from './navigation-item';\nimport { patternsRoute } from './patterns';\nimport { patternItemRoute } from './pattern-item';\nimport { templatePartItemRoute } from './template-part-item';\nimport { templatesRoute } from './templates';\nimport { templateItemRoute } from './template-item';\nimport { pagesRoute } from './pages';\nimport { pageItemRoute } from './page-item';\nimport { stylebookRoute } from './stylebook';\nimport { notFoundRoute } from './notfound';\n\nconst routes = [\n\tpageItemRoute,\n\tpagesRoute,\n\ttemplateItemRoute,\n\ttemplatesRoute,\n\ttemplatePartItemRoute,\n\tpatternItemRoute,\n\tpatternsRoute,\n\tnavigationItemRoute,\n\tnavigationRoute,\n\tstylesRoute,\n\thomeRoute,\n\tstylebookRoute,\n\tnotFoundRoute,\n];\n\nexport function useRegisterSiteEditorRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,SAAA,GAAAhB,OAAA;AAvBA;AACA;AACA;;AAIA;AACA;AACA;;AAiBA,MAAMiB,MAAM,GAAG,CACdC,uBAAa,EACbC,iBAAU,EACVC,+BAAiB,EACjBC,yBAAc,EACdC,uCAAqB,EACrBC,6BAAgB,EAChBC,uBAAa,EACbC,mCAAmB,EACnBC,2BAAe,EACfC,mBAAW,EACXC,eAAS,EACTC,yBAAc,EACdC,uBAAa,CACb;AAEM,SAASC,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBtB,MAAM,CAACuB,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.notFoundRoute = void 0;
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const notFoundRoute = exports.notFoundRoute = {
|
|
20
|
+
name: 'notfound',
|
|
21
|
+
path: '*',
|
|
22
|
+
areas: {
|
|
23
|
+
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
|
|
24
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {
|
|
25
|
+
customDescription: (0, _i18n.__)('404 (Not Found)')
|
|
26
|
+
}),
|
|
27
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
28
|
+
className: "edit-site-layout__area__404",
|
|
29
|
+
children: (0, _i18n.__)('404 (Not Found)')
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=notfound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_sidebarNavigationScreenMain","_interopRequireDefault","_jsxRuntime","notFoundRoute","exports","name","path","areas","sidebar","jsx","default","mobile","customDescription","__","content","className","children"],"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 SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\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={ __( '404 (Not Found)' ) }\n\t\t\t/>\n\t\t),\n\t\tcontent: (\n\t\t\t<p className=\"edit-site-layout__area__404\">\n\t\t\t\t{ __( '404 (Not Found)' ) }\n\t\t\t</p>\n\t\t),\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,4BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4E,IAAAG,WAAA,GAAAH,OAAA;AAR5E;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMI,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,GAAG;EACTC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAN,WAAA,CAAAO,GAAA,EAACT,4BAAA,CAAAU,OAA2B,IAAE,CAAC;IACxCC,MAAM,eACL,IAAAT,WAAA,CAAAO,GAAA,EAACT,4BAAA,CAAAU,OAA2B;MAC3BE,iBAAiB,EAAG,IAAAC,QAAE,EAAE,iBAAkB;IAAG,CAC7C,CACD;IACDC,OAAO,eACN,IAAAZ,WAAA,CAAAO,GAAA;MAAGM,SAAS,EAAC,6BAA6B;MAAAC,QAAA,EACvC,IAAAH,QAAE,EAAE,iBAAkB;IAAC,CACvB;EAEL;AACD,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.templateItemRoute = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
9
|
var _sidebarNavigationScreenTemplatesBrowse = _interopRequireDefault(require("../sidebar-navigation-screen-templates-browse"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
/**
|
|
@@ -19,8 +19,8 @@ const templateItemRoute = exports.templateItemRoute = {
|
|
|
19
19
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenTemplatesBrowse.default, {
|
|
20
20
|
backPath: "/"
|
|
21
21
|
}),
|
|
22
|
-
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
23
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
22
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
23
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=template-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenTemplatesBrowse","_jsxRuntime","templateItemRoute","exports","name","path","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uCAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAmG,IAAAE,WAAA,GAAAF,OAAA;AAJnG;AACA;AACA;;AAIO,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAChCE,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,sBAAsB;EAC5BC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAN,WAAA,CAAAO,GAAA,EAACR,uCAAA,CAAAS,OAAsC;MAACC,QAAQ,EAAC;IAAG,CAAE,CAAC;IAChEC,MAAM,eAAE,IAAAV,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC;IAClBG,OAAO,eAAE,IAAAX,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.templatePartItemRoute = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
9
|
var _sidebarNavigationScreenPatterns = _interopRequireDefault(require("../sidebar-navigation-screen-patterns"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
/**
|
|
@@ -19,8 +19,8 @@ const templatePartItemRoute = exports.templatePartItemRoute = {
|
|
|
19
19
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenPatterns.default, {
|
|
20
20
|
backPath: "/"
|
|
21
21
|
}),
|
|
22
|
-
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
23
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
22
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
23
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=template-part-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenPatterns","_jsxRuntime","templatePartItemRoute","exports","name","path","areas","sidebar","jsx","default","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":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAoF,IAAAE,WAAA,GAAAF,OAAA;AAJpF;AACA;AACA;;AAIO,MAAMG,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACpCE,IAAI,EAAE,oBAAoB;EAC1BC,IAAI,EAAE,2BAA2B;EACjCC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAN,WAAA,CAAAO,GAAA,EAACR,gCAAA,CAAAS,OAA+B;MAACC,QAAQ,EAAC;IAAG,CAAE,CAAC;IACzDC,MAAM,eAAE,IAAAV,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC;IAClBG,OAAO,eAAE,IAAAX,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_constants","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","STYLE_BOOK_THEME_SUBCATEGORIES","STYLE_BOOK_CATEGORIES","map","extraCategories","getCategories","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":["_blocks","require","_constants","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","STYLE_BOOK_THEME_SUBCATEGORIES","STYLE_BOOK_CATEGORIES","map","extraCategories","getCategories","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":";;;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AAUA,IAAAC,UAAA,GAAAD,OAAA;AAfA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,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,qBAA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GC,yCAA8B,EACjC,GAAGC,gCAAqB,CACxB,CAACC,GAAG,CAAE,CAAE;IAAEvB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC7B,MAAMwB,eAAoC,GAAG,IAAAC,qBAAa,EAAC,CAAC;EAC5D,MAAMC,uBAAuB,GAAGF,eAAe,CAACV,MAAM,CACrD,CAAE;IAAEd;EAAK,CAAC,KAAM,CAAEoB,kBAAkB,CAACJ,QAAQ,CAAEhB,IAAK,CACrD,CAAC;EACD,OAAO,CAAE,GAAGsB,gCAAqB,EAAE,GAAGI,uBAAuB,CAAE;AAChE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_primitives","_blockEditor","_jsxRuntime","ColorExamples","colors","type","templateColumns","itemHeight","jsx","__experimentalGrid","rowGap","columnGap","children","map","color","className","__experimentalGetGradientClass","slug","getColorClassName","classes","clsx","View","style","height","_default","exports","default"],"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","_interopRequireDefault","require","_components","_primitives","_blockEditor","_jsxRuntime","ColorExamples","colors","type","templateColumns","itemHeight","jsx","__experimentalGrid","rowGap","columnGap","children","map","color","className","__experimentalGetGradientClass","slug","getColorClassName","classes","clsx","View","style","height","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKiC,IAAAI,WAAA,GAAAJ,OAAA;AAfjC;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMK,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,oBACC,IAAAF,WAAA,CAAAM,GAAA,EAACT,WAAA,CAAAU,kBAAI;IAACH,eAAe,EAAGA,eAAiB;IAACI,MAAM,EAAG,CAAG;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EACpER,MAAM,CAACS,GAAG,CAAIC,KAAuB,IAAM;MAC5C,MAAMC,SAAS,GACdV,IAAI,KAAK,WAAW,GACjB,IAAAW,2CAA8B,EAAEF,KAAK,CAACG,IAAK,CAAC,GAC5C,IAAAC,8BAAiB,EAAE,kBAAkB,EAAEJ,KAAK,CAACG,IAAK,CAAC;MACvD,MAAME,OAAO,GAAG,IAAAC,aAAI,EACnB,qCAAqC,EACrCL,SACD,CAAC;MAED,oBACC,IAAAb,WAAA,CAAAM,GAAA,EAACR,WAAA,CAAAqB,IAAI;QAEJN,SAAS,EAAGI,OAAS;QACrBG,KAAK,EAAG;UAAEC,MAAM,EAAEhB;QAAW;MAAG,GAF1BO,KAAK,CAACG,IAGZ,CAAC;IAEJ,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavB,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_primitives","_jsxRuntime","DuotoneExamples","duotones","jsx","__experimentalGrid","columns","rowGap","columnGap","children","map","duotone","jsxs","className","View","alt","slug","src","style","filter","colors","color","backgroundColor","_default","exports","default"],"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":["_components","require","_primitives","_jsxRuntime","DuotoneExamples","duotones","jsx","__experimentalGrid","columns","rowGap","columnGap","children","map","duotone","jsxs","className","View","alt","slug","src","style","filter","colors","color","backgroundColor","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA6C,IAAAE,WAAA,GAAAF,OAAA;AAJ7C;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,eAAe,GAAGA,CAAE;EACzBC;AAGD,CAAC,KAA0B;EAC1B,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACN,WAAA,CAAAO,kBAAI;IAACC,OAAO,EAAG,CAAG;IAACC,MAAM,EAAG,EAAI;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EAC/CN,QAAQ,CAACO,GAAG,CAAIC,OAAgB,IAAM;MACvC,oBACC,IAAAV,WAAA,CAAAW,IAAA,EAACd,WAAA,CAAAO,kBAAI;QAEJQ,SAAS,EAAC,uCAAuC;QACjDP,OAAO,EAAG,CAAG;QACbC,MAAM,EAAG,CAAG;QACZC,SAAS,EAAG,CAAG;QAAAC,QAAA,gBAEf,IAAAR,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAc,IAAI;UAAAL,QAAA,eACJ,IAAAR,WAAA,CAAAG,GAAA;YACCW,GAAG,EAAG,oBAAqBJ,OAAO,CAACK,IAAI,EAAK;YAC5CC,GAAG,EAAC,8CAA8C;YAClDC,KAAK,EAAG;cACPC,MAAM,EAAE,mBAAoBR,OAAO,CAACK,IAAI;YACzC;UAAG,CACH;QAAC,CACG,CAAC,EACLL,OAAO,CAACS,MAAM,CAACV,GAAG,CAAIW,KAAK,IAAM;UAClC,oBACC,IAAApB,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAc,IAAI;YAEJD,SAAS,EAAC,qCAAqC;YAC/CK,KAAK,EAAG;cAAEI,eAAe,EAAED;YAAM;UAAG,GAF9BA,KAGN,CAAC;QAEJ,CAAE,CAAC;MAAA,GAvBGV,OAAO,CAACK,IAwBT,CAAC;IAET,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavB,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","paletteFiltered","Array","isArray","find","origin","slug","undefined","example","name","title","category","content","jsx","default","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","__","templateColumns","itemHeight","typographyBlockExamples","getBlockType","headingBlock","createBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","getBlockFromExample","attributes","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","sprintf","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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAkBA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,IAAAM,WAAA,GAAAN,OAAA;AAxBtD;AACA;AACA;;AAWA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCC,kCAAuB,CAACC,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGL,MAAM,CAAEI,KAAK,CAACE,IAAI,CAA+B;IACjE,MAAMC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAAEJ,OAAQ,CAAC,GAC7CA,OAAO,CAACK,IAAI,CACVC,MAAmB,IAAMA,MAAM,CAACC,IAA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AAgB,CAAEC,MAAO,CAAC;EAEhD,MAAM8D,qBAAqB,GAAGvC,wBAAwB,CAAEvB,MAAO,CAAC;EAEhE,OAAO,CACN2D,eAAe,EACf,GAAGE,aAAa,EAChB,GAAGT,uBAAuB,EAC1B,GAAGU,qBAAqB,CACxB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","paletteFiltered","Array","isArray","find","origin","slug","undefined","example","name","title","category","content","jsx","default","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","__","templateColumns","itemHeight","typographyBlockExamples","getBlockType","headingBlock","createBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","getBlockFromExample","attributes","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","sprintf","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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SAAS,CAACjC,OAAO,CAACoC,UAAU;QAC/BV,KAAK,EAAE3B;MACR;IACD,CAAE;EACH,CAAC,CAAG,CAAC;EACN,MAAM6C,wBAAwB,GAAG,CAAC,CAAE,IAAA5B,oBAAY,EAAE,cAAe,CAAC;EAElE,IAAK,CAAE4B,wBAAwB,EAAG;IACjC,OAAON,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAMO,eAAe,GAAG;IACvB5C,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE,IAAAU,QAAE,EAAE,UAAW,CAAC;IACvBT,QAAQ,EAAE,MAAM;IAChB2B,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACa,GAAG,CAAIxB,KAAK,IAAM;MAC9C,OAAO,IAAAD,mBAAW,EAAE,cAAc,EAAE;QACnCd,OAAO,EAAE,IAAA0C,aAAO;QACf;QACA,IAAAlC,QAAE,EAAE,YAAa,CAAC,EAClBO,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAM4B,aAAa,GAAG9D,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAM8D,qBAAqB,GAAGvC,wBAAwB,CAAEvB,MAAO,CAAC;EAEhE,OAAO,CACN2D,eAAe,EACf,GAAGE,aAAa,EAChB,GAAGT,uBAAuB,EAC1B,GAAGU,qBAAqB,CACxB;AACF","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* wp:polyfill */
|
|
2
1
|
"use strict";
|
|
3
2
|
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -13,7 +12,6 @@ var _i18n = require("@wordpress/i18n");
|
|
|
13
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
14
13
|
var _editor = require("@wordpress/editor");
|
|
15
14
|
var _data = require("@wordpress/data");
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
17
15
|
var _element = require("@wordpress/element");
|
|
18
16
|
var _keycodes = require("@wordpress/keycodes");
|
|
19
17
|
var _mediaUtils = require("@wordpress/media-utils");
|
|
@@ -167,7 +165,6 @@ function StyleBook({
|
|
|
167
165
|
userConfig = {},
|
|
168
166
|
path = ''
|
|
169
167
|
}) {
|
|
170
|
-
const [resizeObserver, sizes] = (0, _compose.useResizeObserver)();
|
|
171
168
|
const [textColor] = useGlobalStyle('color.text');
|
|
172
169
|
const [backgroundColor] = useGlobalStyle('color.background');
|
|
173
170
|
const colors = useMultiOriginPalettes();
|
|
@@ -198,16 +195,15 @@ function StyleBook({
|
|
|
198
195
|
onClose: onClose,
|
|
199
196
|
enableResizing: enableResizing,
|
|
200
197
|
closeButtonLabel: showCloseButton ? (0, _i18n.__)('Close') : null,
|
|
201
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
198
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
199
|
className: (0, _clsx.default)('edit-site-style-book', {
|
|
203
|
-
'is-wide': sizes.width > 600,
|
|
204
200
|
'is-button': !!onClick
|
|
205
201
|
}),
|
|
206
202
|
style: {
|
|
207
203
|
color: textColor,
|
|
208
204
|
background: backgroundColor
|
|
209
205
|
},
|
|
210
|
-
children:
|
|
206
|
+
children: showTabs ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tabs, {
|
|
211
207
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
212
208
|
className: "edit-site-style-book__tablist-container",
|
|
213
209
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabList, {
|
|
@@ -231,7 +227,6 @@ function StyleBook({
|
|
|
231
227
|
isSelected: isSelected,
|
|
232
228
|
onSelect: onSelect,
|
|
233
229
|
settings: settings,
|
|
234
|
-
sizes: sizes,
|
|
235
230
|
title: tab.title,
|
|
236
231
|
goTo: goTo
|
|
237
232
|
})
|
|
@@ -245,9 +240,8 @@ function StyleBook({
|
|
|
245
240
|
onClick: onClick,
|
|
246
241
|
onSelect: onSelect,
|
|
247
242
|
settings: settings,
|
|
248
|
-
sizes: sizes,
|
|
249
243
|
goTo: goTo
|
|
250
|
-
})
|
|
244
|
+
})
|
|
251
245
|
})
|
|
252
246
|
});
|
|
253
247
|
}
|
|
@@ -299,7 +293,6 @@ const StyleBookPreview = ({
|
|
|
299
293
|
// Now go to the selected block.
|
|
300
294
|
onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
|
|
301
295
|
};
|
|
302
|
-
const [resizeObserver, sizes] = (0, _compose.useResizeObserver)();
|
|
303
296
|
const colors = useMultiOriginPalettes();
|
|
304
297
|
const examples = (0, _examples.getExamples)(colors);
|
|
305
298
|
const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
|
|
@@ -344,9 +337,9 @@ const StyleBookPreview = ({
|
|
|
344
337
|
styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles,
|
|
345
338
|
isPreviewMode: true
|
|
346
339
|
}), [globalStyles, siteEditorSettings, userConfig]);
|
|
347
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
340
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
348
341
|
className: "edit-site-style-book",
|
|
349
|
-
children:
|
|
342
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockEditorProvider, {
|
|
350
343
|
settings: settings,
|
|
351
344
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_globalStylesRenderer.GlobalStylesRenderer, {
|
|
352
345
|
disableRootPadding: true
|
|
@@ -354,11 +347,10 @@ const StyleBookPreview = ({
|
|
|
354
347
|
examples: displayedExamples,
|
|
355
348
|
settings: settings,
|
|
356
349
|
goTo: goTo,
|
|
357
|
-
sizes: sizes,
|
|
358
350
|
isSelected: !isStatic ? isSelected : null,
|
|
359
351
|
onSelect: !isStatic ? onSelect : null
|
|
360
352
|
})]
|
|
361
|
-
})
|
|
353
|
+
})
|
|
362
354
|
});
|
|
363
355
|
};
|
|
364
356
|
exports.StyleBookPreview = StyleBookPreview;
|
|
@@ -368,7 +360,6 @@ const StyleBookBody = ({
|
|
|
368
360
|
onClick,
|
|
369
361
|
onSelect,
|
|
370
362
|
settings,
|
|
371
|
-
sizes,
|
|
372
363
|
title,
|
|
373
364
|
goTo
|
|
374
365
|
}) => {
|
|
@@ -427,9 +418,7 @@ const StyleBookBody = ({
|
|
|
427
418
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("style", {
|
|
428
419
|
children: [_constants.STYLE_BOOK_IFRAME_STYLES, !!onClick && 'body { cursor: pointer; } body * { pointer-events: none; }']
|
|
429
420
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Examples, {
|
|
430
|
-
className:
|
|
431
|
-
'is-wide': sizes.width > 600
|
|
432
|
-
}),
|
|
421
|
+
className: "edit-site-style-book__examples",
|
|
433
422
|
filteredExamples: examples,
|
|
434
423
|
label: title ? (0, _i18n.sprintf)(
|
|
435
424
|
// translators: %s: Category of blocks, e.g. Text.
|