@wordpress/edit-site 6.10.0 → 6.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-post/index.js +1 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +8 -8
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +29 -22
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +10 -8
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +32 -14
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build/components/editor/use-editor-title.js +30 -13
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +6 -6
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/palette.js +16 -13
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/root-menu.js +0 -4
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +0 -4
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -24
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-root.js +0 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +5 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +11 -13
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +0 -3
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +1 -4
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/ui.js +49 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +2 -2
- package/build/components/global-styles/variations/variation.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-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +43 -30
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/animation.js +1 -3
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +23 -35
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +17 -140
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +3 -3
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +3 -7
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -2
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +1 -2
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +1 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/post-edit/index.js +15 -5
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +4 -244
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +12 -2
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app/router.js +4 -4
- package/build/components/posts-app/router.js.map +1 -1
- package/build/components/resizable-frame/index.js +21 -9
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +78 -0
- package/build/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build/components/save-panel/index.js +17 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +11 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +2 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +33 -71
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/site-editor-routes/home-edit.js +26 -0
- package/build/components/site-editor-routes/home-edit.js.map +1 -0
- package/build/components/site-editor-routes/home-view.js +25 -0
- package/build/components/site-editor-routes/home-view.js.map +1 -0
- package/build/components/site-editor-routes/index.js +49 -0
- package/build/components/site-editor-routes/index.js.map +1 -0
- package/build/components/site-editor-routes/navigation-edit.js +29 -0
- package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
- package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-view.js +30 -0
- package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build/components/site-editor-routes/navigation-view.js +28 -0
- package/build/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-edit.js +43 -0
- package/build/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view.js +47 -0
- package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-view.js +42 -0
- package/build/components/site-editor-routes/pages-view.js.map +1 -0
- package/build/components/site-editor-routes/patterns-edit.js +31 -0
- package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build/components/site-editor-routes/patterns-view.js +29 -0
- package/build/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build/components/site-editor-routes/styles-edit.js +33 -0
- package/build/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build/components/site-editor-routes/styles-view.js +33 -0
- package/build/components/site-editor-routes/styles-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-edit.js +31 -0
- package/build/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build/components/site-editor-routes/templates-list-view.js +34 -0
- package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-view.js +29 -0
- package/build/components/site-editor-routes/templates-view.js.map +1 -0
- package/build/components/site-hub/index.js +22 -8
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/color-examples.js +46 -0
- package/build/components/style-book/color-examples.js.map +1 -0
- package/build/components/style-book/constants.js +85 -13
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +55 -0
- package/build/components/style-book/duotone-examples.js.map +1 -0
- package/build/components/style-book/examples.js +116 -3
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +161 -46
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +38 -33
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +61 -45
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +12 -15
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build/store/private-actions.js +8 -60
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +4 -12
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +9 -18
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -1
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +9 -9
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +4 -4
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +30 -23
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +32 -14
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build-module/components/editor/use-editor-title.js +31 -14
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +6 -6
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -4
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/palette.js +17 -14
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +0 -4
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +0 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -25
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +0 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +5 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +11 -13
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +0 -3
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +2 -5
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/ui.js +50 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +3 -3
- package/build-module/components/global-styles/variations/variation.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-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +44 -31
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/animation.js +1 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +23 -35
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +17 -139
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +4 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +4 -8
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +1 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +15 -5
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -246
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +12 -2
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +2 -2
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app/router.js +3 -3
- package/build-module/components/posts-app/router.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +21 -10
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +71 -0
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build-module/components/save-panel/index.js +17 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +2 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +34 -72
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/site-editor-routes/home-edit.js +18 -0
- package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/home-view.js +17 -0
- package/build-module/components/site-editor-routes/home-view.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +42 -0
- package/build-module/components/site-editor-routes/index.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
- package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-view.js +20 -0
- package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-edit.js +35 -0
- package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
- package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view.js +34 -0
- package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
- package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-view.js +21 -0
- package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-edit.js +25 -0
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-view.js +25 -0
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-edit.js +23 -0
- package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
- package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-view.js +21 -0
- package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
- package/build-module/components/site-hub/index.js +22 -8
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +38 -0
- package/build-module/components/style-book/color-examples.js.map +1 -0
- package/build-module/components/style-book/constants.js +84 -12
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +48 -0
- package/build-module/components/style-book/duotone-examples.js.map +1 -0
- package/build-module/components/style-book/examples.js +117 -3
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +164 -49
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +38 -33
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +61 -45
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +12 -15
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-module/store/private-actions.js +6 -58
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -11
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/posts-rtl.css +60 -14
- package/build-style/posts.css +60 -14
- package/build-style/style-rtl.css +232 -50
- package/build-style/style.css +232 -50
- package/package.json +42 -41
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +1 -1
- package/src/components/add-new-template/utils.js +12 -9
- package/src/components/app/index.js +4 -4
- package/src/components/block-editor/use-editor-iframe-props.js +23 -20
- package/src/components/block-editor/use-site-editor-settings.js +12 -10
- package/src/components/editor/index.js +50 -17
- package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
- package/src/components/editor/use-editor-title.js +40 -16
- package/src/components/editor-canvas-container/style.scss +0 -1
- package/src/components/global-styles/font-sizes/font-size.js +11 -15
- package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
- package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
- package/src/components/global-styles/palette.js +21 -18
- package/src/components/global-styles/root-menu.js +3 -16
- package/src/components/global-styles/screen-block-list.js +0 -7
- package/src/components/global-styles/screen-css.js +1 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +30 -33
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- package/src/components/global-styles/screen-root.js +3 -12
- package/src/components/global-styles/screen-style-variations.js +4 -1
- package/src/components/global-styles/shadows-edit-panel.js +16 -15
- package/src/components/global-styles/shadows-panel.js +0 -4
- package/src/components/global-styles/typography-elements.js +3 -11
- package/src/components/global-styles/ui.js +53 -2
- package/src/components/global-styles/variations/variation.js +3 -3
- package/src/components/global-styles/variations/variations-panel.js +0 -1
- package/src/components/global-styles-renderer/index.js +4 -10
- package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/src/components/global-styles-sidebar/index.js +86 -65
- package/src/components/global-styles-sidebar/style.scss +6 -0
- package/src/components/layout/animation.js +0 -1
- package/src/components/layout/hooks.js +1 -7
- package/src/components/layout/index.js +22 -35
- package/src/components/layout/router.js +18 -133
- package/src/components/layout/style.scss +2 -2
- package/src/components/page-patterns/delete-category-menu-item.js +4 -4
- package/src/components/page-patterns/fields.js +6 -12
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-patterns/use-pattern-settings.js +1 -1
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/page-templates/index.js +0 -1
- package/src/components/pagination/index.js +1 -1
- package/src/components/post-edit/index.js +45 -6
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-fields/index.js +22 -323
- package/src/components/post-fields/style.scss +3 -0
- package/src/components/post-list/index.js +10 -4
- package/src/components/post-list/style.scss +30 -4
- package/src/components/posts-app/index.js +2 -2
- package/src/components/posts-app/router.js +3 -3
- package/src/components/resizable-frame/index.js +19 -10
- package/src/components/revisions/index.js +4 -1
- package/src/components/save-keyboard-shortcut/index.js +69 -0
- package/src/components/save-panel/index.js +30 -32
- package/src/components/sidebar/index.js +23 -7
- package/src/components/sidebar-dataviews/default-views.js +2 -5
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +42 -99
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
- package/src/components/site-editor-routes/README.md +20 -0
- package/src/components/site-editor-routes/home-edit.js +17 -0
- package/src/components/site-editor-routes/home-view.js +16 -0
- package/src/components/site-editor-routes/index.js +60 -0
- package/src/components/site-editor-routes/navigation-edit.js +22 -0
- package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
- package/src/components/site-editor-routes/navigation-item-view.js +25 -0
- package/src/components/site-editor-routes/navigation-view.js +21 -0
- package/src/components/site-editor-routes/pages-edit.js +35 -0
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/src/components/site-editor-routes/pages-list-view.js +44 -0
- package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/src/components/site-editor-routes/pages-view.js +39 -0
- package/src/components/site-editor-routes/patterns-edit.js +24 -0
- package/src/components/site-editor-routes/patterns-view.js +22 -0
- package/src/components/site-editor-routes/styles-edit.js +26 -0
- package/src/components/site-editor-routes/styles-view.js +26 -0
- package/src/components/site-editor-routes/templates-edit.js +22 -0
- package/src/components/site-editor-routes/templates-list-view.js +28 -0
- package/src/components/site-editor-routes/templates-view.js +22 -0
- package/src/components/site-hub/index.js +35 -18
- package/src/components/site-hub/style.scss +4 -0
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/color-examples.tsx +44 -0
- package/src/components/style-book/constants.ts +94 -13
- package/src/components/style-book/duotone-examples.tsx +53 -0
- package/src/components/style-book/examples.tsx +217 -0
- package/src/components/style-book/index.js +235 -60
- package/src/components/style-book/style.scss +12 -14
- package/src/components/style-book/test/categories.js +0 -5
- package/src/components/style-book/types.ts +34 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +65 -65
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +257 -230
- package/src/hooks/commands/use-set-command-context.js +7 -9
- package/src/index.js +1 -0
- package/src/posts.js +1 -0
- package/src/store/private-actions.js +7 -79
- package/src/store/private-selectors.js +4 -11
- package/src/store/reducer.js +10 -18
- package/src/style.scss +3 -1
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- package/build/components/keyboard-shortcuts/global.js +0 -53
- package/build/components/keyboard-shortcuts/global.js.map +0 -1
- package/build/components/keyboard-shortcuts/register.js +0 -34
- package/build/components/keyboard-shortcuts/register.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/build/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -175
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/global.js +0 -46
- package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -27
- package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -167
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- package/src/components/keyboard-shortcuts/global.js +0 -47
- package/src/components/keyboard-shortcuts/register.js +0 -27
- package/src/components/style-book/examples.ts +0 -63
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -172
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","VisuallyHidden","__","store","coreStore","decodeEntities","memo","forwardRef","useContext","search","commandsStore","displayShortcut","filterURLForDisplay","privateApis","routerPrivateApis","editSiteStore","SiteIcon","unlock","useHistory","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getEntityRecord","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","__next40pxDefaultSize","href","label","style","transform","borderRadius","variant","target","as","expanded","icon","onClick","shortcut","primary","SiteHubMobile","history","navigate","push"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tlabel={ __( 'Go to Site Editor' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( {} );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASN,KAAK,IAAIO,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAClD,SAASK,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtD,MAAMC,OAAO,G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AC,CAAE,CAAC;YAClBD,QAAQ,CAAE,MAAO,CAAC;UACnB,CAAG;UAAAnB,QAAA,eAEHpB,IAAA,CAACL,QAAQ;YAACwB,SAAS,EAAC;UAAyC,CAAE;QAAC,CACzD;MAAC,CACL,CAAC,eAENjB,KAAA,CAACvB,MAAM;QAAAyC,QAAA,gBACNpB,IAAA;UAAKmB,SAAS,EAAC,2BAA2B;UAAAC,QAAA,eACzCpB,IAAA,CAACvB,MAAM;YACN8C,qBAAqB;YACrBM,OAAO,EAAC,MAAM;YACdL,IAAI,EAAGjB,OAAS;YAChBuB,MAAM,EAAC,QAAQ;YACfL,KAAK,EAAG5C,EAAE,CAAE,gCAAiC,CAAG;YAAAuC,QAAA,EAE9CpC,cAAc,CAAEwB,SAAU;UAAC,CACtB;QAAC,CACL,CAAC,eACNR,IAAA,CAACrB,MAAM;UACN2C,OAAO,EAAG,CAAG;UACbU,QAAQ,EAAG,KAAO;UAClBb,SAAS,EAAC,6BAA6B;UAAAC,QAAA,eAEvCpB,IAAA,CAACvB,MAAM;YACN8C,qBAAqB;YACrBJ,SAAS,EAAC,0CAA0C;YACpDc,IAAI,EAAG7C,MAAQ;YACf8C,OAAO,EAAGA,CAAA,KAAMhB,iBAAiB,CAAC,CAAG;YACrCO,KAAK,EAAG5C,EAAE,CAAE,sBAAuB,CAAG;YACtCsD,QAAQ,EAAG7C,eAAe,CAAC8C,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","VisuallyHidden","__","store","coreStore","decodeEntities","memo","forwardRef","useContext","search","commandsStore","displayShortcut","filterURLForDisplay","privateApis","routerPrivateApis","editSiteStore","SiteIcon","unlock","useHistory","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getEntityRecord","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","__next40pxDefaultSize","href","label","style","transform","borderRadius","variant","target","as","expanded","size","icon","onClick","shortcut","primary","SiteHubMobile","history","navigate","isBlockTheme","getCurrentTheme","is_block_theme","push"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { dashboardLink, isBlockTheme, homeUrl, siteTitle } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\t\tconst { getEntityRecord, getCurrentTheme } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\t\treturn {\n\t\t\t\t\tdashboardLink:\n\t\t\t\t\t\tgetSettings().__experimentalDashboardLink ||\n\t\t\t\t\t\t'index.php',\n\t\t\t\t\tisBlockTheme: getCurrentTheme()?.is_block_theme,\n\t\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\t\tsiteTitle:\n\t\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t\t: _site?.title,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t{ ...( ! isBlockTheme\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\thref: dashboardLink,\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {} );\n\t\t\t\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to Site Editor' ),\n\t\t\t\t\t\t\t\t } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc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eACzCpB,IAAA,CAACvB,MAAM;YACN8C,qBAAqB;YACrBM,OAAO,EAAC,MAAM;YACdL,IAAI,EAAGjB,OAAS;YAChBuB,MAAM,EAAC,QAAQ;YACfL,KAAK,EAAG5C,EAAE,CAAE,gCAAiC,CAAG;YAAAuC,QAAA,EAE9CpC,cAAc,CAAEwB,SAAU;UAAC,CACtB;QAAC,CACL,CAAC,eACNR,IAAA,CAACrB,MAAM;UACN2C,OAAO,EAAG,CAAG;UACbU,QAAQ,EAAG,KAAO;UAClBb,SAAS,EAAC,6BAA6B;UAAAC,QAAA,eAEvCpB,IAAA,CAACvB,MAAM;YACN8C,qBAAqB;YACrBJ,SAAS,EAAC,0CAA0C;YACpDe,IAAI,EAAG9C,MAAQ;YACf+C,OAAO,EAAGA,CAAA,KAAMjB,iBAAiB,CAAC,CAAG;YACrCO,KAAK,EAAG5C,EAAE,CAAE,sBAAuB,CAAG;YACtCuD,QAAQ,EAAG9C,eAAe,CAAC+C,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { __experimentalGrid as Grid } from '@wordpress/components';
|
|
10
|
+
import { View } from '@wordpress/primitives';
|
|
11
|
+
import { getColorClassName, __experimentalGetGradientClass } from '@wordpress/block-editor';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const ColorExamples = ({
|
|
18
|
+
colors,
|
|
19
|
+
type
|
|
20
|
+
}) => {
|
|
21
|
+
if (!colors) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
25
|
+
columns: 2,
|
|
26
|
+
rowGap: 8,
|
|
27
|
+
columnGap: 16,
|
|
28
|
+
children: colors.map(color => {
|
|
29
|
+
const className = type === 'gradients' ? __experimentalGetGradientClass(color.slug) : getColorClassName('background-color', color.slug);
|
|
30
|
+
const classes = clsx('edit-site-style-book__color-example', className);
|
|
31
|
+
return /*#__PURE__*/_jsx(View, {
|
|
32
|
+
className: classes
|
|
33
|
+
}, color.slug);
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export default ColorExamples;
|
|
38
|
+
//# sourceMappingURL=color-examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalGrid","Grid","View","getColorClassName","__experimentalGetGradientClass","jsx","_jsx","ColorExamples","colors","type","columns","rowGap","columnGap","children","map","color","className","slug","classes"],"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} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport type { Color, Gradient } from './types';\n\nconst ColorExamples = ( { colors, type } ): JSX.Element | null => {\n\tif ( ! colors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid columns={ 2 } 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 <View key={ color.slug } className={ classes } />;\n\t\t\t} ) }\n\t\t</Grid>\n\t);\n};\n\nexport default ColorExamples;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,kBAAkB,IAAIC,IAAI,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SACCC,iBAAiB,EACjBC,8BAA8B,QACxB,yBAAyB;;AAEhC;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAKA,MAAMC,aAAa,GAAGA,CAAE;EAAEC,MAAM;EAAEC;AAAK,CAAC,KAA0B;EACjE,IAAK,CAAED,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;EAEA,oBACCF,IAAA,CAACL,IAAI;IAACS,OAAO,EAAG,CAAG;IAACC,MAAM,EAAG,CAAG;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EAC9CL,MAAM,CAACM,GAAG,CAAIC,KAAuB,IAAM;MAC5C,MAAMC,SAAS,GACdP,IAAI,KAAK,WAAW,GACjBL,8BAA8B,CAAEW,KAAK,CAACE,IAAK,CAAC,GAC5Cd,iBAAiB,CAAE,kBAAkB,EAAEY,KAAK,CAACE,IAAK,CAAC;MACvD,MAAMC,OAAO,GAAGnB,IAAI,CACnB,qCAAqC,EACrCiB,SACD,CAAC;MAED,oBAAOV,IAAA,CAACJ,IAAI;QAAoBc,SAAS,EAAGE;MAAS,GAAlCH,KAAK,CAACE,IAA8B,CAAC;IACzD,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAED,eAAeV,aAAa","ignoreList":[]}
|
|
@@ -7,6 +7,43 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
export const STYLE_BOOK_COLOR_GROUPS = [{
|
|
11
|
+
slug: 'theme-colors',
|
|
12
|
+
title: __('Theme Colors'),
|
|
13
|
+
origin: 'theme',
|
|
14
|
+
type: 'colors'
|
|
15
|
+
}, {
|
|
16
|
+
slug: 'theme-gradients',
|
|
17
|
+
title: __('Theme Gradients'),
|
|
18
|
+
origin: 'theme',
|
|
19
|
+
type: 'gradients'
|
|
20
|
+
}, {
|
|
21
|
+
slug: 'custom-colors',
|
|
22
|
+
title: __('Custom Colors'),
|
|
23
|
+
origin: 'custom',
|
|
24
|
+
type: 'colors'
|
|
25
|
+
}, {
|
|
26
|
+
slug: 'custom-gradients',
|
|
27
|
+
title: __('Custom Gradients'),
|
|
28
|
+
origin: 'custom',
|
|
29
|
+
// User.
|
|
30
|
+
type: 'gradients'
|
|
31
|
+
}, {
|
|
32
|
+
slug: 'duotones',
|
|
33
|
+
title: __('Duotones'),
|
|
34
|
+
origin: 'theme',
|
|
35
|
+
type: 'duotones'
|
|
36
|
+
}, {
|
|
37
|
+
slug: 'default-colors',
|
|
38
|
+
title: __('Default Colors'),
|
|
39
|
+
origin: 'default',
|
|
40
|
+
type: 'colors'
|
|
41
|
+
}, {
|
|
42
|
+
slug: 'default-gradients',
|
|
43
|
+
title: __('Default Gradients'),
|
|
44
|
+
origin: 'default',
|
|
45
|
+
type: 'gradients'
|
|
46
|
+
}];
|
|
10
47
|
export const STYLE_BOOK_THEME_SUBCATEGORIES = [{
|
|
11
48
|
slug: 'site-identity',
|
|
12
49
|
title: __('Site Identity'),
|
|
@@ -26,13 +63,17 @@ export const STYLE_BOOK_THEME_SUBCATEGORIES = [{
|
|
|
26
63
|
blocks: ['core/comments-title', 'core/comments-pagination', 'core/comments-pagination-numbers', 'core/comments', 'core/comments-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link', 'core/comment-template', 'core/post-comments-count', 'core/post-comments-link']
|
|
27
64
|
}];
|
|
28
65
|
export const STYLE_BOOK_CATEGORIES = [{
|
|
66
|
+
slug: 'overview',
|
|
67
|
+
title: __('Overview'),
|
|
68
|
+
blocks: []
|
|
69
|
+
}, {
|
|
29
70
|
slug: 'text',
|
|
30
71
|
title: __('Text'),
|
|
31
72
|
blocks: ['core/post-content', 'core/home-link', 'core/navigation-link']
|
|
32
73
|
}, {
|
|
33
74
|
slug: 'colors',
|
|
34
75
|
title: __('Colors'),
|
|
35
|
-
blocks: [
|
|
76
|
+
blocks: []
|
|
36
77
|
}, {
|
|
37
78
|
slug: 'theme',
|
|
38
79
|
title: __('Theme'),
|
|
@@ -51,6 +92,13 @@ export const STYLE_BOOK_CATEGORIES = [{
|
|
|
51
92
|
include: []
|
|
52
93
|
}];
|
|
53
94
|
|
|
95
|
+
// Forming a "block formatting context" to prevent margin collapsing.
|
|
96
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
97
|
+
const ROOT_CONTAINER = `
|
|
98
|
+
.is-root-container {
|
|
99
|
+
display: flow-root;
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
54
102
|
// The content area of the Style Book is rendered within an iframe so that global styles
|
|
55
103
|
// are applied to elements within the entire content area. To support elements that are
|
|
56
104
|
// not part of the block previews, such as headings and layout for the block previews,
|
|
@@ -59,17 +107,13 @@ export const STYLE_BOOK_CATEGORIES = [{
|
|
|
59
107
|
// applied to the `button` element, targeted via `.edit-site-style-book__example`.
|
|
60
108
|
// This is to ensure that browser default styles for buttons are not applied to the previews.
|
|
61
109
|
export const STYLE_BOOK_IFRAME_STYLES = `
|
|
62
|
-
// Forming a "block formatting context" to prevent margin collapsing.
|
|
63
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
64
|
-
.is-root-container {
|
|
65
|
-
display: flow-root;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
110
|
body {
|
|
69
111
|
position: relative;
|
|
70
112
|
padding: 32px !important;
|
|
71
113
|
}
|
|
72
114
|
|
|
115
|
+
${ROOT_CONTAINER}
|
|
116
|
+
|
|
73
117
|
.edit-site-style-book__examples {
|
|
74
118
|
max-width: 1200px;
|
|
75
119
|
margin: 0 auto;
|
|
@@ -94,15 +138,40 @@ export const STYLE_BOOK_IFRAME_STYLES = `
|
|
|
94
138
|
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
95
139
|
}
|
|
96
140
|
|
|
141
|
+
.edit-site-style-book__example.is-disabled-example {
|
|
142
|
+
pointer-events: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
97
145
|
.edit-site-style-book__example:focus:not(:disabled) {
|
|
98
146
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
99
147
|
outline: 3px solid transparent;
|
|
100
148
|
}
|
|
101
149
|
|
|
150
|
+
.edit-site-style-book__duotone-example > div:first-child {
|
|
151
|
+
display: flex;
|
|
152
|
+
aspect-ratio: 16 / 9;
|
|
153
|
+
grid-row: span 1;
|
|
154
|
+
grid-column: span 2;
|
|
155
|
+
}
|
|
156
|
+
.edit-site-style-book__duotone-example img {
|
|
157
|
+
width: 100%;
|
|
158
|
+
height: 100%;
|
|
159
|
+
object-fit: cover;
|
|
160
|
+
}
|
|
161
|
+
.edit-site-style-book__duotone-example > div:not(:first-child) {
|
|
162
|
+
height: 20px;
|
|
163
|
+
border: 1px solid #ddd;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.edit-site-style-book__color-example {
|
|
167
|
+
height: 52px;
|
|
168
|
+
border: 1px solid #ddd;
|
|
169
|
+
}
|
|
170
|
+
|
|
102
171
|
.edit-site-style-book__examples.is-wide .edit-site-style-book__example {
|
|
103
172
|
flex-direction: row;
|
|
104
173
|
}
|
|
105
|
-
|
|
174
|
+
|
|
106
175
|
.edit-site-style-book__subcategory-title,
|
|
107
176
|
.edit-site-style-book__example-title {
|
|
108
177
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
@@ -113,7 +182,7 @@ export const STYLE_BOOK_IFRAME_STYLES = `
|
|
|
113
182
|
text-align: left;
|
|
114
183
|
text-transform: uppercase;
|
|
115
184
|
}
|
|
116
|
-
|
|
185
|
+
|
|
117
186
|
.edit-site-style-book__subcategory-title {
|
|
118
187
|
font-size: 16px;
|
|
119
188
|
margin-bottom: 40px;
|
|
@@ -129,16 +198,19 @@ export const STYLE_BOOK_IFRAME_STYLES = `
|
|
|
129
198
|
.edit-site-style-book__example-preview {
|
|
130
199
|
width: 100%;
|
|
131
200
|
}
|
|
201
|
+
|
|
202
|
+
.is-wide .edit-site-style-book__example-preview {
|
|
203
|
+
width: calc(100% - 120px);
|
|
204
|
+
}
|
|
132
205
|
|
|
133
206
|
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
|
|
134
207
|
.edit-site-style-book__example-preview .block-list-appender {
|
|
135
208
|
display: none;
|
|
136
209
|
}
|
|
137
|
-
|
|
138
|
-
.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {
|
|
210
|
+
:where(.is-root-container > .wp-block:first-child) {
|
|
139
211
|
margin-top: 0;
|
|
140
212
|
}
|
|
141
|
-
.
|
|
213
|
+
:where(.is-root-container > .wp-block:last-child) {
|
|
142
214
|
margin-bottom: 0;
|
|
143
215
|
}
|
|
144
216
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","STYLE_BOOK_THEME_SUBCATEGORIES","slug","title","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory } from './types';\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [ 'custom/colors' ],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n\t\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\t\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\t\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,8BAGV,GAAG,CACL;EACCC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAEH,EAAE,CAAE,eAAgB,CAAC;EAC5BI,MAAM,EAAE,CAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB;AACnE,CAAC,EACD;EACCF,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;EACrBI,MAAM,EAAE,CAAE,iBAAiB,EAAE,aAAa,EAAE,wBAAwB,CAAE;EACtEC,OAAO,EAAE,CAAE,gBAAgB,EAAE,sBAAsB;AACpD,CAAC,EACD;EACC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CAAE,QAAS,CAAC;EACrBQ,OAAO,EAAE;AACV,CAAC,CACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","STYLE_BOOK_COLOR_GROUPS","slug","title","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\theight: 52px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\t\n\t.is-wide .edit-site-style-book__example-preview {\n\t\twidth: calc(100% - 120px);\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAGA,OAAO,MAAMC,uBAA8C,GAAG,CAC7D;EACCC,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAEH,EAAE,CAAE,cAAe,CAAC;EAC3BI,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCH,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAEH,EAAE,CAAE,iBAAkB,CAAC;EAC9BI,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCH,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAEH,EAAE,CAAE,eAAgB,CAAC;EAC5BI,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE;AACP,CAAC,EACD;EACCH,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAEH,EAAE,CAAE,kBAAmB,CAAC;EAC/BI,MAAM,EAAE,QAAQ;EAAE;EAClBC,IAAI,EAAE;AACP,CAAC,EACD;EACCH,IAAI,EAAE,UAAU;EAChBC,KAAK,EA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalGrid as Grid } from '@wordpress/components';
|
|
5
|
+
import { View } from '@wordpress/primitives';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const DuotoneExamples = ({
|
|
12
|
+
duotones
|
|
13
|
+
}) => {
|
|
14
|
+
if (!duotones) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
18
|
+
columns: 2,
|
|
19
|
+
rowGap: 16,
|
|
20
|
+
columnGap: 16,
|
|
21
|
+
children: duotones.map(duotone => {
|
|
22
|
+
return /*#__PURE__*/_jsxs(Grid, {
|
|
23
|
+
className: "edit-site-style-book__duotone-example",
|
|
24
|
+
columns: 2,
|
|
25
|
+
rowGap: 8,
|
|
26
|
+
columnGap: 8,
|
|
27
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
28
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
29
|
+
alt: `Duotone example: ${duotone.slug}`,
|
|
30
|
+
src: "https://s.w.org/images/core/5.3/MtBlanc1.jpg",
|
|
31
|
+
style: {
|
|
32
|
+
filter: `url(#wp-duotone-${duotone.slug})`
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}), duotone.colors.map(color => {
|
|
36
|
+
return /*#__PURE__*/_jsx(View, {
|
|
37
|
+
className: "edit-site-style-book__color-example",
|
|
38
|
+
style: {
|
|
39
|
+
backgroundColor: color
|
|
40
|
+
}
|
|
41
|
+
}, color);
|
|
42
|
+
})]
|
|
43
|
+
}, duotone.slug);
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export default DuotoneExamples;
|
|
48
|
+
//# sourceMappingURL=duotone-examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalGrid","Grid","View","jsx","_jsx","jsxs","_jsxs","DuotoneExamples","duotones","columns","rowGap","columnGap","children","map","duotone","className","alt","slug","src","style","filter","colors","color","backgroundColor"],"sources":["@wordpress/edit-site/src/components/style-book/duotone-examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport type { Duotone } from './types';\n\nconst DuotoneExamples = ( { duotones } ): 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":"AAAA;AACA;AACA;AACA,SAASA,kBAAkB,IAAIC,IAAI,QAAQ,uBAAuB;AAClE,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,MAAMC,eAAe,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAA0B;EAC/D,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACH,IAAI;IAACQ,OAAO,EAAG,CAAG;IAACC,MAAM,EAAG,EAAI;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EAC/CJ,QAAQ,CAACK,GAAG,CAAIC,OAAgB,IAAM;MACvC,oBACCR,KAAA,CAACL,IAAI;QAEJc,SAAS,EAAC,uCAAuC;QACjDN,OAAO,EAAG,CAAG;QACbC,MAAM,EAAG,CAAG;QACZC,SAAS,EAAG,CAAG;QAAAC,QAAA,gBAEfR,IAAA,CAACF,IAAI;UAAAU,QAAA,eACJR,IAAA;YACCY,GAAG,EAAG,oBAAqBF,OAAO,CAACG,IAAI,EAAK;YAC5CC,GAAG,EAAC,8CAA8C;YAClDC,KAAK,EAAG;cACPC,MAAM,EAAE,mBAAoBN,OAAO,CAACG,IAAI;YACzC;UAAG,CACH;QAAC,CACG,CAAC,EACLH,OAAO,CAACO,MAAM,CAACR,GAAG,CAAIS,KAAK,IAAM;UAClC,oBACClB,IAAA,CAACF,IAAI;YAEJa,SAAS,EAAC,qCAAqC;YAC/CI,KAAK,EAAG;cAAEI,eAAe,EAAED;YAAM;UAAG,GAF9BA,KAGN,CAAC;QAEJ,CAAE,CAAC;MAAA,GAvBGR,OAAO,CAACG,IAwBT,CAAC;IAET,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAED,eAAeV,eAAe","ignoreList":[]}
|
|
@@ -8,19 +8,131 @@ import { getBlockType, getBlockTypes, getBlockFromExample, createBlock } from '@
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import ColorExamples from './color-examples';
|
|
12
|
+
import DuotoneExamples from './duotone-examples';
|
|
13
|
+
import { STYLE_BOOK_COLOR_GROUPS } from './constants';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns examples color examples for each origin
|
|
17
|
+
* e.g. Core (Default), Theme, and User.
|
|
18
|
+
*
|
|
19
|
+
* @param {MultiOriginPalettes} colors Global Styles color palettes per origin.
|
|
20
|
+
* @return {BlockExample[]} An array of color block examples.
|
|
21
|
+
*/
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
function getColorExamples(colors) {
|
|
24
|
+
if (!colors) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const examples = [];
|
|
28
|
+
STYLE_BOOK_COLOR_GROUPS.forEach(group => {
|
|
29
|
+
const palette = colors[group.type].find(origin => origin.slug === group.origin);
|
|
30
|
+
if (palette?.[group.type]) {
|
|
31
|
+
const example = {
|
|
32
|
+
name: group.slug,
|
|
33
|
+
title: group.title,
|
|
34
|
+
category: 'colors'
|
|
35
|
+
};
|
|
36
|
+
if (group.type === 'duotones') {
|
|
37
|
+
example.content = /*#__PURE__*/_jsx(DuotoneExamples, {
|
|
38
|
+
duotones: palette[group.type]
|
|
39
|
+
});
|
|
40
|
+
examples.push(example);
|
|
41
|
+
} else {
|
|
42
|
+
example.content = /*#__PURE__*/_jsx(ColorExamples, {
|
|
43
|
+
colors: palette[group.type],
|
|
44
|
+
type: group.type
|
|
45
|
+
});
|
|
46
|
+
examples.push(example);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return examples;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Returns examples for the overview page.
|
|
55
|
+
*
|
|
56
|
+
* @param {MultiOriginPalettes} colors Global Styles color palettes per origin.
|
|
57
|
+
* @return {BlockExample[]} An array of block examples.
|
|
58
|
+
*/
|
|
59
|
+
function getOverviewBlockExamples(colors) {
|
|
60
|
+
const examples = [];
|
|
61
|
+
|
|
62
|
+
// Get theme palette from colors.
|
|
63
|
+
const themePalette = colors.colors.find(origin => origin.slug === 'theme');
|
|
64
|
+
if (themePalette) {
|
|
65
|
+
const themeColorexample = {
|
|
66
|
+
name: 'theme-colors',
|
|
67
|
+
title: __('Colors'),
|
|
68
|
+
category: 'overview',
|
|
69
|
+
content: /*#__PURE__*/_jsx(ColorExamples, {
|
|
70
|
+
colors: themePalette.colors,
|
|
71
|
+
type: colors
|
|
72
|
+
})
|
|
73
|
+
};
|
|
74
|
+
examples.push(themeColorexample);
|
|
75
|
+
}
|
|
76
|
+
const headingBlock = createBlock('core/heading', {
|
|
77
|
+
content: __(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
|
|
78
|
+
level: 1
|
|
79
|
+
});
|
|
80
|
+
const firstParagraphBlock = createBlock('core/paragraph', {
|
|
81
|
+
content: __(`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.`)
|
|
82
|
+
});
|
|
83
|
+
const secondParagraphBlock = createBlock('core/paragraph', {
|
|
84
|
+
content: __(`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.`)
|
|
85
|
+
});
|
|
86
|
+
const textExample = {
|
|
87
|
+
name: 'typography',
|
|
88
|
+
title: __('Typography'),
|
|
89
|
+
category: 'overview',
|
|
90
|
+
blocks: [headingBlock, createBlock('core/group', {
|
|
91
|
+
layout: {
|
|
92
|
+
type: 'grid',
|
|
93
|
+
columnCount: 2,
|
|
94
|
+
minimumColumnWidth: '12rem'
|
|
95
|
+
},
|
|
96
|
+
style: {
|
|
97
|
+
spacing: {
|
|
98
|
+
blockGap: '1.5rem'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, [firstParagraphBlock, secondParagraphBlock])]
|
|
102
|
+
};
|
|
103
|
+
examples.push(textExample);
|
|
104
|
+
const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search'];
|
|
105
|
+
|
|
106
|
+
// Get examples for other blocks and put them in order of above array.
|
|
107
|
+
otherBlockExamples.forEach(blockName => {
|
|
108
|
+
const blockType = getBlockType(blockName);
|
|
109
|
+
if (blockType && blockType.example) {
|
|
110
|
+
const blockExample = {
|
|
111
|
+
name: blockName,
|
|
112
|
+
title: blockType.title,
|
|
113
|
+
category: 'overview',
|
|
114
|
+
blocks: getBlockFromExample(blockName, blockType.example)
|
|
115
|
+
};
|
|
116
|
+
examples.push(blockExample);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return examples;
|
|
120
|
+
}
|
|
121
|
+
|
|
11
122
|
/**
|
|
12
123
|
* Returns a list of examples for registered block types.
|
|
13
124
|
*
|
|
125
|
+
* @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.
|
|
14
126
|
* @return {BlockExample[]} An array of block examples.
|
|
15
127
|
*/
|
|
16
|
-
export function getExamples() {
|
|
128
|
+
export function getExamples(colors) {
|
|
17
129
|
const nonHeadingBlockExamples = getBlockTypes().filter(blockType => {
|
|
18
130
|
const {
|
|
19
131
|
name,
|
|
20
132
|
example,
|
|
21
133
|
supports
|
|
22
134
|
} = blockType;
|
|
23
|
-
return name !== 'core/heading' && !!example && supports
|
|
135
|
+
return name !== 'core/heading' && !!example && supports?.inserter !== false;
|
|
24
136
|
}).map(blockType => ({
|
|
25
137
|
name: blockType.name,
|
|
26
138
|
title: blockType.title,
|
|
@@ -47,6 +159,8 @@ export function getExamples() {
|
|
|
47
159
|
});
|
|
48
160
|
})
|
|
49
161
|
};
|
|
50
|
-
|
|
162
|
+
const colorExamples = getColorExamples(colors);
|
|
163
|
+
const overviewBlockExamples = getOverviewBlockExamples(colors);
|
|
164
|
+
return [headingsExample, ...colorExamples, ...nonHeadingBlockExamples, ...overviewBlockExamples];
|
|
51
165
|
}
|
|
52
166
|
//# sourceMappingURL=examples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","getExamples","nonHeadingBlockExamples","filter","blockType","name","example","supports","inserter","map","title","category","blocks","isHeadingBlockRegistered","headingsExample","level","content"],"sources":["@wordpress/edit-site/src/components/style-book/examples.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type { BlockExample } from './types';\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples(): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( 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 ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\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\n\treturn [ headingsExample, ...nonHeadingBlockExamples ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,aAAa,EACbC,mBAAmB,EACnBC,WAAW,QACL,mBAAmB;;AAE1B;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAAA,EAAmB;EAC7C,MAAMC,uBAAuB,GAAGJ,aAAa,CAAC,CAAC,CAC7CK,MAAM,CAAIC,SAAS,IAAM;IACzB,MAAM;MAAEC,IAAI;MAAEC,OAAO;MAAEC;IAAS,CAAC,GAAGH,SAAS;IAC7C,OACCC,IAAI,KAAK,cAAc,IACvB,CAAC,CAAEC,OAAO,IACVC,QAAQ,CAACC,QAAQ,KAAK,KAAK;EAE7B,CAAE,CAAC,CACFC,GAAG,CAAIL,SAAS,KAAQ;IACxBC,IAAI,EAAED,SAAS,CAACC,IAAI;IACpBK,KAAK,EAAEN,SAAS,CAACM,KAAK;IACtBC,QAAQ,EAAEP,SAAS,CAACO,QAAQ;IAC5BC,MAAM,EAAEb,mBAAmB,CAAEK,SAAS,CAACC,IAAI,EAAED,SAAS,CAACE,OAAQ;EAChE,CAAC,CAAG,CAAC;EACN,MAAMO,wBAAwB,GAAG,CAAC,CAAEhB,YAAY,CAAE,cAAe,CAAC;EAElE,IAAK,CAAEgB,wBAAwB,EAAG;IACjC,OAAOX,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAMY,eAAe,GAAG;IACvBT,IAAI,EAAE,cAAc;IACpBK,KAAK,EAAEf,EAAE,CAAE,UAAW,CAAC;IACvBgB,QAAQ,EAAE,MAAM;IAChBC,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACH,GAAG,CAAIM,KAAK,IAAM;MAC9C,OAAOf,WAAW,CAAE,cAAc,EAAE;QACnCgB,OAAO,EAAEpB,OAAO;QACf;QACAD,EAAE,CAAE,YAAa,CAAC,EAClBoB,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EAED,OAAO,CAAED,eAAe,EAAE,GAAGZ,uBAAuB,CAAE;AACvD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","ColorExamples","DuotoneExamples","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","getColorExamples","colors","examples","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","headingBlock","level","firstParagraphBlock","secondParagraphBlock","textExample","blocks","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","otherBlockExamples","blockName","blockType","blockExample","getExamples","nonHeadingBlockExamples","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type { BlockExample, ColorOrigin, MultiOriginPalettes } 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 ].find(\n\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t);\n\n\t\tif ( palette?.[ 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 duotones={ palette[ group.type ] } />\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={ palette[ 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.\n\tconst themePalette = colors.colors.find(\n\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t);\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 colors={ themePalette.colors } type={ colors } />\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\tconst headingBlock = createBlock( 'core/heading', {\n\t\tcontent: __(\n\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t),\n\t\tlevel: 1,\n\t} );\n\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\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),\n\t} );\n\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\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),\n\t} );\n\n\tconst textExample = {\n\t\tname: 'typography',\n\t\ttitle: __( 'Typography' ),\n\t\tcategory: 'overview',\n\t\tblocks: [\n\t\t\theadingBlock,\n\t\t\tcreateBlock(\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],\n\t};\n\texamples.push( textExample );\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\tblocks: getBlockFromExample( blockName, blockType.example ),\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 ) => {\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 ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,aAAa,EACbC,mBAAmB,EACnBC,WAAW,QACL,mBAAmB;;AAE1B;AACA;AACA;;AAEA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,eAAe,MAAM,oBAAoB;AAChD,SAASC,uBAAuB,QAAQ,aAAa;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,SAASC,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCL,uBAAuB,CAACM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