@wordpress/edit-site 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-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 -0
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +29 -20
- 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 +23 -10
- 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 +2 -2
- 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 +2 -2
- 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 +9 -10
- 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 +7 -0
- 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-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/index.js +22 -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/use-pattern-settings.js +1 -1
- package/build/components/page-patterns/use-pattern-settings.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 +8 -4
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +6 -52
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +1 -1
- 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-dataviews/default-views.js +2 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- 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 +30 -10
- package/build/components/sidebar-navigation-screen-global-styles/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 +28 -0
- package/build/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build/components/site-editor-routes/styles-view.js +27 -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 +3 -2
- 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 +75 -10
- 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 +46 -3
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +92 -36
- 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 +6 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +46 -30
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +10 -6
- package/build/hooks/commands/use-edit-mode-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/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 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
- 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 +23 -10
- 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 +3 -3
- 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 +2 -2
- 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 +9 -10
- 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 +7 -0
- 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-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/index.js +22 -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/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/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 +8 -4
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -51
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +1 -1
- 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-dataviews/default-views.js +2 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- 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 +30 -10
- package/build-module/components/sidebar-navigation-screen-global-styles/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 +20 -0
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-view.js +19 -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 +3 -2
- 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 +74 -9
- 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 +47 -3
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +94 -38
- 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 +6 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +46 -30
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +10 -6
- package/build-module/hooks/commands/use-edit-mode-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/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 +10 -13
- package/build-style/posts.css +10 -13
- package/build-style/style-rtl.css +127 -26
- package/build-style/style.css +127 -26
- package/package.json +43 -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 -2
- package/src/components/block-editor/use-editor-iframe-props.js +22 -18
- package/src/components/block-editor/use-site-editor-settings.js +12 -10
- package/src/components/editor/index.js +34 -13
- package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
- package/src/components/editor/use-editor-title.js +3 -3
- 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 +2 -2
- 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 +12 -13
- 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 +11 -0
- 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-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/index.js +16 -34
- 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/use-pattern-settings.js +1 -1
- package/src/components/page-templates/index.js +0 -1
- package/src/components/pagination/index.js +1 -1
- package/src/components/post-edit/index.js +35 -4
- package/src/components/post-fields/index.js +7 -54
- package/src/components/post-fields/style.scss +3 -0
- package/src/components/post-list/index.js +1 -1
- package/src/components/post-list/style.scss +1 -1
- 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-dataviews/default-views.js +2 -5
- package/src/components/sidebar-navigation-screen/index.js +2 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
- 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 +17 -0
- package/src/components/site-editor-routes/styles-view.js +16 -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 +2 -2
- package/src/components/site-hub/style.scss +4 -0
- package/src/components/style-book/color-examples.tsx +44 -0
- package/src/components/style-book/constants.ts +83 -10
- package/src/components/style-book/duotone-examples.tsx +53 -0
- package/src/components/style-book/examples.tsx +113 -0
- package/src/components/style-book/index.js +149 -52
- 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 +11 -1
- package/src/hooks/commands/use-common-commands.js +60 -40
- package/src/hooks/commands/use-edit-mode-commands.js +14 -18
- package/src/hooks/commands/use-set-command-context.js +7 -9
- 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 -0
- 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-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/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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _components = require("@wordpress/components");
|
|
10
|
+
var _primitives = require("@wordpress/primitives");
|
|
11
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* WordPress dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Internal dependencies
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const ColorExamples = ({
|
|
26
|
+
colors,
|
|
27
|
+
type
|
|
28
|
+
}) => {
|
|
29
|
+
if (!colors) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalGrid, {
|
|
33
|
+
columns: 2,
|
|
34
|
+
rowGap: 8,
|
|
35
|
+
columnGap: 16,
|
|
36
|
+
children: colors.map(color => {
|
|
37
|
+
const className = type === 'gradients' ? (0, _blockEditor.__experimentalGetGradientClass)(color.slug) : (0, _blockEditor.getColorClassName)('background-color', color.slug);
|
|
38
|
+
const classes = (0, _clsx.default)('edit-site-style-book__color-example', className);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.View, {
|
|
40
|
+
className: classes
|
|
41
|
+
}, color.slug);
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var _default = exports.default = ColorExamples;
|
|
46
|
+
//# sourceMappingURL=color-examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_primitives","_blockEditor","_jsxRuntime","ColorExamples","colors","type","jsx","__experimentalGrid","columns","rowGap","columnGap","children","map","color","className","__experimentalGetGradientClass","slug","getColorClassName","classes","clsx","View","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/style-book/color-examples.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\nimport {\n\tgetColorClassName,\n\t__experimentalGetGradientClass,\n} 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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAGiC,IAAAI,WAAA,GAAAJ,OAAA;AAbjC;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMK,aAAa,GAAGA,CAAE;EAAEC,MAAM;EAAEC;AAAK,CAAC,KAA0B;EACjE,IAAK,CAAED,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAF,WAAA,CAAAI,GAAA,EAACP,WAAA,CAAAQ,kBAAI;IAACC,OAAO,EAAG,CAAG;IAACC,MAAM,EAAG,CAAG;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EAC9CP,MAAM,CAACQ,GAAG,CAAIC,KAAuB,IAAM;MAC5C,MAAMC,SAAS,GACdT,IAAI,KAAK,WAAW,GACjB,IAAAU,2CAA8B,EAAEF,KAAK,CAACG,IAAK,CAAC,GAC5C,IAAAC,8BAAiB,EAAE,kBAAkB,EAAEJ,KAAK,CAACG,IAAK,CAAC;MACvD,MAAME,OAAO,GAAG,IAAAC,aAAI,EACnB,qCAAqC,EACrCL,SACD,CAAC;MAED,oBAAO,IAAAZ,WAAA,CAAAI,GAAA,EAACN,WAAA,CAAAoB,IAAI;QAAoBN,SAAS,EAAGI;MAAS,GAAlCL,KAAK,CAACG,IAA8B,CAAC;IACzD,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEapB,aAAa","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.STYLE_BOOK_THEME_SUBCATEGORIES = exports.STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_CATEGORIES = void 0;
|
|
6
|
+
exports.STYLE_BOOK_THEME_SUBCATEGORIES = exports.STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_COLOR_GROUPS = exports.STYLE_BOOK_CATEGORIES = void 0;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
/**
|
|
9
9
|
* WordPress dependencies
|
|
@@ -13,6 +13,43 @@ var _i18n = require("@wordpress/i18n");
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
const STYLE_BOOK_COLOR_GROUPS = exports.STYLE_BOOK_COLOR_GROUPS = [{
|
|
17
|
+
slug: 'theme-colors',
|
|
18
|
+
title: (0, _i18n.__)('Theme Colors'),
|
|
19
|
+
origin: 'theme',
|
|
20
|
+
type: 'colors'
|
|
21
|
+
}, {
|
|
22
|
+
slug: 'theme-gradients',
|
|
23
|
+
title: (0, _i18n.__)('Theme Gradients'),
|
|
24
|
+
origin: 'theme',
|
|
25
|
+
type: 'gradients'
|
|
26
|
+
}, {
|
|
27
|
+
slug: 'custom-colors',
|
|
28
|
+
title: (0, _i18n.__)('Custom Colors'),
|
|
29
|
+
origin: 'custom',
|
|
30
|
+
type: 'colors'
|
|
31
|
+
}, {
|
|
32
|
+
slug: 'custom-gradients',
|
|
33
|
+
title: (0, _i18n.__)('Custom Gradients'),
|
|
34
|
+
origin: 'custom',
|
|
35
|
+
// User.
|
|
36
|
+
type: 'gradients'
|
|
37
|
+
}, {
|
|
38
|
+
slug: 'duotones',
|
|
39
|
+
title: (0, _i18n.__)('Duotones'),
|
|
40
|
+
origin: 'theme',
|
|
41
|
+
type: 'duotones'
|
|
42
|
+
}, {
|
|
43
|
+
slug: 'default-colors',
|
|
44
|
+
title: (0, _i18n.__)('Default Colors'),
|
|
45
|
+
origin: 'default',
|
|
46
|
+
type: 'colors'
|
|
47
|
+
}, {
|
|
48
|
+
slug: 'default-gradients',
|
|
49
|
+
title: (0, _i18n.__)('Default Gradients'),
|
|
50
|
+
origin: 'default',
|
|
51
|
+
type: 'gradients'
|
|
52
|
+
}];
|
|
16
53
|
const STYLE_BOOK_THEME_SUBCATEGORIES = exports.STYLE_BOOK_THEME_SUBCATEGORIES = [{
|
|
17
54
|
slug: 'site-identity',
|
|
18
55
|
title: (0, _i18n.__)('Site Identity'),
|
|
@@ -38,7 +75,7 @@ const STYLE_BOOK_CATEGORIES = exports.STYLE_BOOK_CATEGORIES = [{
|
|
|
38
75
|
}, {
|
|
39
76
|
slug: 'colors',
|
|
40
77
|
title: (0, _i18n.__)('Colors'),
|
|
41
|
-
blocks: [
|
|
78
|
+
blocks: []
|
|
42
79
|
}, {
|
|
43
80
|
slug: 'theme',
|
|
44
81
|
title: (0, _i18n.__)('Theme'),
|
|
@@ -57,6 +94,13 @@ const STYLE_BOOK_CATEGORIES = exports.STYLE_BOOK_CATEGORIES = [{
|
|
|
57
94
|
include: []
|
|
58
95
|
}];
|
|
59
96
|
|
|
97
|
+
// Forming a "block formatting context" to prevent margin collapsing.
|
|
98
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
99
|
+
const ROOT_CONTAINER = `
|
|
100
|
+
.is-root-container {
|
|
101
|
+
display: flow-root;
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
60
104
|
// The content area of the Style Book is rendered within an iframe so that global styles
|
|
61
105
|
// are applied to elements within the entire content area. To support elements that are
|
|
62
106
|
// not part of the block previews, such as headings and layout for the block previews,
|
|
@@ -65,17 +109,13 @@ const STYLE_BOOK_CATEGORIES = exports.STYLE_BOOK_CATEGORIES = [{
|
|
|
65
109
|
// applied to the `button` element, targeted via `.edit-site-style-book__example`.
|
|
66
110
|
// This is to ensure that browser default styles for buttons are not applied to the previews.
|
|
67
111
|
const STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_IFRAME_STYLES = `
|
|
68
|
-
// Forming a "block formatting context" to prevent margin collapsing.
|
|
69
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
70
|
-
.is-root-container {
|
|
71
|
-
display: flow-root;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
112
|
body {
|
|
75
113
|
position: relative;
|
|
76
114
|
padding: 32px !important;
|
|
77
115
|
}
|
|
78
116
|
|
|
117
|
+
${ROOT_CONTAINER}
|
|
118
|
+
|
|
79
119
|
.edit-site-style-book__examples {
|
|
80
120
|
max-width: 1200px;
|
|
81
121
|
margin: 0 auto;
|
|
@@ -100,15 +140,40 @@ const STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_IFRAME_STYLES = `
|
|
|
100
140
|
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
101
141
|
}
|
|
102
142
|
|
|
143
|
+
.edit-site-style-book__example.is-disabled-example {
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
103
147
|
.edit-site-style-book__example:focus:not(:disabled) {
|
|
104
148
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
105
149
|
outline: 3px solid transparent;
|
|
106
150
|
}
|
|
107
151
|
|
|
152
|
+
.edit-site-style-book__duotone-example > div:first-child {
|
|
153
|
+
display: flex;
|
|
154
|
+
aspect-ratio: 16 / 9;
|
|
155
|
+
grid-row: span 1;
|
|
156
|
+
grid-column: span 2;
|
|
157
|
+
}
|
|
158
|
+
.edit-site-style-book__duotone-example img {
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 100%;
|
|
161
|
+
object-fit: cover;
|
|
162
|
+
}
|
|
163
|
+
.edit-site-style-book__duotone-example > div:not(:first-child) {
|
|
164
|
+
height: 20px;
|
|
165
|
+
border: 1px solid #ddd;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.edit-site-style-book__color-example {
|
|
169
|
+
height: 52px;
|
|
170
|
+
border: 1px solid #ddd;
|
|
171
|
+
}
|
|
172
|
+
|
|
108
173
|
.edit-site-style-book__examples.is-wide .edit-site-style-book__example {
|
|
109
174
|
flex-direction: row;
|
|
110
175
|
}
|
|
111
|
-
|
|
176
|
+
|
|
112
177
|
.edit-site-style-book__subcategory-title,
|
|
113
178
|
.edit-site-style-book__example-title {
|
|
114
179
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
@@ -119,7 +184,7 @@ const STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_IFRAME_STYLES = `
|
|
|
119
184
|
text-align: left;
|
|
120
185
|
text-transform: uppercase;
|
|
121
186
|
}
|
|
122
|
-
|
|
187
|
+
|
|
123
188
|
.edit-site-style-book__subcategory-title {
|
|
124
189
|
font-size: 16px;
|
|
125
190
|
margin-bottom: 40px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","STYLE_BOOK_THEME_SUBCATEGORIES","exports","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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,8BAGV,GAAAC,OAAA,CAAAD,8BAAA,GAAG,CACL;EACCE,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,MAAM,EAAE,CAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB;AACnE,CAAC,EACD;EACCH,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBC,MAAM,EAAE,CAAE,iBAAiB,EAAE,aAAa,EAAE,wBAAwB,CAAE;EACtEC,OAAO,EAAE,CAAE,gBAAgB,EAAE,sBAAsB;AACpD,CAAC,EACD;EACCJ,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,MAAM,EAAE,CACP,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB;AAEtB,CAAC,EACD;EACCH,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,IAAAC,QAAE,EAAE,UAAW,CAAC;EACvBC,MAAM,EAAE,CACP,qBAAqB,EACrB,0BAA0B,EAC1B,kCAAkC,EAClC,eAAe,EACf,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB;AAE3B,CAAC,CACD;AAEM,MAAME,qBAA0C,GAAAN,OAAA,CAAAM,qBAAA,GAAG,CACzD;EACCL,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EACnBC,MAAM,EAAE,CACP,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB;AAExB,CAAC,EACD;EACCH,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBC,MAAM,EAAE,CAAE,eAAe;AAC1B,CAAC,EACD;EACCH,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBI,aAAa,EAAER;AAChB,CAAC,EACD;EACCE,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,MAAM,EAAE,CAAE,0BAA0B;AACrC,CAAC,EACD;EACCH,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EACtBC,MAAM,EAAE;AACT,CAAC,EACD;EACCH,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBK,OAAO,EAAE;AACV,CAAC,CACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAAT,OAAA,CAAAS,wBAAA,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":["_i18n","require","STYLE_BOOK_COLOR_GROUPS","exports","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: '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\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":"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CD;EACCN,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBQ,OAAO,EAAE;AACV,CAAC,CACD;;AAED;AACA;AACA,MAAMC,cAAc,GAAG;AACvB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAAb,OAAA,CAAAa,wBAAA,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _components = require("@wordpress/components");
|
|
8
|
+
var _primitives = require("@wordpress/primitives");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const DuotoneExamples = ({
|
|
19
|
+
duotones
|
|
20
|
+
}) => {
|
|
21
|
+
if (!duotones) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalGrid, {
|
|
25
|
+
columns: 2,
|
|
26
|
+
rowGap: 16,
|
|
27
|
+
columnGap: 16,
|
|
28
|
+
children: duotones.map(duotone => {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalGrid, {
|
|
30
|
+
className: "edit-site-style-book__duotone-example",
|
|
31
|
+
columns: 2,
|
|
32
|
+
rowGap: 8,
|
|
33
|
+
columnGap: 8,
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.View, {
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
36
|
+
alt: `Duotone example: ${duotone.slug}`,
|
|
37
|
+
src: "https://s.w.org/images/core/5.3/MtBlanc1.jpg",
|
|
38
|
+
style: {
|
|
39
|
+
filter: `url(#wp-duotone-${duotone.slug})`
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}), duotone.colors.map(color => {
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.View, {
|
|
44
|
+
className: "edit-site-style-book__color-example",
|
|
45
|
+
style: {
|
|
46
|
+
backgroundColor: color
|
|
47
|
+
}
|
|
48
|
+
}, color);
|
|
49
|
+
})]
|
|
50
|
+
}, duotone.slug);
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var _default = exports.default = DuotoneExamples;
|
|
55
|
+
//# sourceMappingURL=duotone-examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_components","require","_primitives","_jsxRuntime","DuotoneExamples","duotones","jsx","__experimentalGrid","columns","rowGap","columnGap","children","map","duotone","jsxs","className","View","alt","slug","src","style","filter","colors","color","backgroundColor","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/style-book/duotone-examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { View } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport type { Duotone } from './types';\n\nconst DuotoneExamples = ( { 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":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAA6C,IAAAE,WAAA,GAAAF,OAAA;AAJ7C;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAMG,eAAe,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAA0B;EAC/D,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACN,WAAA,CAAAO,kBAAI;IAACC,OAAO,EAAG,CAAG;IAACC,MAAM,EAAG,EAAI;IAACC,SAAS,EAAG,EAAI;IAAAC,QAAA,EAC/CN,QAAQ,CAACO,GAAG,CAAIC,OAAgB,IAAM;MACvC,oBACC,IAAAV,WAAA,CAAAW,IAAA,EAACd,WAAA,CAAAO,kBAAI;QAEJQ,SAAS,EAAC,uCAAuC;QACjDP,OAAO,EAAG,CAAG;QACbC,MAAM,EAAG,CAAG;QACZC,SAAS,EAAG,CAAG;QAAAC,QAAA,gBAEf,IAAAR,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAc,IAAI;UAAAL,QAAA,eACJ,IAAAR,WAAA,CAAAG,GAAA;YACCW,GAAG,EAAG,oBAAqBJ,OAAO,CAACK,IAAI,EAAK;YAC5CC,GAAG,EAAC,8CAA8C;YAClDC,KAAK,EAAG;cACPC,MAAM,EAAE,mBAAoBR,OAAO,CAACK,IAAI;YACzC;UAAG,CACH;QAAC,CACG,CAAC,EACLL,OAAO,CAACS,MAAM,CAACV,GAAG,CAAIW,KAAK,IAAM;UAClC,oBACC,IAAApB,WAAA,CAAAG,GAAA,EAACJ,WAAA,CAAAc,IAAI;YAEJD,SAAS,EAAC,qCAAqC;YAC/CK,KAAK,EAAG;cAAEI,eAAe,EAAED;YAAM;UAAG,GAF9BA,KAGN,CAAC;QAEJ,CAAE,CAAC;MAAA,GAvBGV,OAAO,CAACK,IAwBT,CAAC;IAET,CAAE;EAAC,CACE,CAAC;AAET,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavB,eAAe","ignoreList":[]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.getExamples = getExamples;
|
|
7
8
|
var _i18n = require("@wordpress/i18n");
|
|
8
9
|
var _blocks = require("@wordpress/blocks");
|
|
10
|
+
var _colorExamples = _interopRequireDefault(require("./color-examples"));
|
|
11
|
+
var _duotoneExamples = _interopRequireDefault(require("./duotone-examples"));
|
|
12
|
+
var _constants = require("./constants");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
14
|
/**
|
|
10
15
|
* WordPress dependencies
|
|
11
16
|
*/
|
|
@@ -14,19 +19,56 @@ var _blocks = require("@wordpress/blocks");
|
|
|
14
19
|
* Internal dependencies
|
|
15
20
|
*/
|
|
16
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Returns examples color examples for each origin
|
|
24
|
+
* e.g. Core (Default), Theme, and User.
|
|
25
|
+
*
|
|
26
|
+
* @param {MultiOriginPalettes} colors Global Styles color palettes per origin.
|
|
27
|
+
* @return {BlockExample[]} An array of color block examples.
|
|
28
|
+
*/function getColorExamples(colors) {
|
|
29
|
+
if (!colors) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
const examples = [];
|
|
33
|
+
_constants.STYLE_BOOK_COLOR_GROUPS.forEach(group => {
|
|
34
|
+
const palette = colors[group.type].find(origin => origin.slug === group.origin);
|
|
35
|
+
if (palette?.[group.type]) {
|
|
36
|
+
const example = {
|
|
37
|
+
name: group.slug,
|
|
38
|
+
title: group.title,
|
|
39
|
+
category: 'colors'
|
|
40
|
+
};
|
|
41
|
+
if (group.type === 'duotones') {
|
|
42
|
+
example.content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_duotoneExamples.default, {
|
|
43
|
+
duotones: palette[group.type]
|
|
44
|
+
});
|
|
45
|
+
examples.push(example);
|
|
46
|
+
} else {
|
|
47
|
+
example.content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorExamples.default, {
|
|
48
|
+
colors: palette[group.type],
|
|
49
|
+
type: group.type
|
|
50
|
+
});
|
|
51
|
+
examples.push(example);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return examples;
|
|
56
|
+
}
|
|
57
|
+
|
|
17
58
|
/**
|
|
18
59
|
* Returns a list of examples for registered block types.
|
|
19
60
|
*
|
|
61
|
+
* @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.
|
|
20
62
|
* @return {BlockExample[]} An array of block examples.
|
|
21
63
|
*/
|
|
22
|
-
function getExamples() {
|
|
64
|
+
function getExamples(colors) {
|
|
23
65
|
const nonHeadingBlockExamples = (0, _blocks.getBlockTypes)().filter(blockType => {
|
|
24
66
|
const {
|
|
25
67
|
name,
|
|
26
68
|
example,
|
|
27
69
|
supports
|
|
28
70
|
} = blockType;
|
|
29
|
-
return name !== 'core/heading' && !!example && supports
|
|
71
|
+
return name !== 'core/heading' && !!example && supports?.inserter !== false;
|
|
30
72
|
}).map(blockType => ({
|
|
31
73
|
name: blockType.name,
|
|
32
74
|
title: blockType.title,
|
|
@@ -53,6 +95,7 @@ function getExamples() {
|
|
|
53
95
|
});
|
|
54
96
|
})
|
|
55
97
|
};
|
|
56
|
-
|
|
98
|
+
const colorExamples = getColorExamples(colors);
|
|
99
|
+
return [headingsExample, ...colorExamples, ...nonHeadingBlockExamples];
|
|
57
100
|
}
|
|
58
101
|
//# sourceMappingURL=examples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blocks","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","jsx","default","duotones","push","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","blockType","supports","inserter","map","blocks","getBlockFromExample","isHeadingBlockRegistered","getBlockType","headingsExample","__","level","createBlock","sprintf","colorExamples"],"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 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\treturn [ headingsExample, ...colorExamples, ...nonHeadingBlockExamples ];\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -47,6 +47,53 @@ const {
|
|
|
47
47
|
function isObjectEmpty(object) {
|
|
48
48
|
return !object || Object.keys(object).length === 0;
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves colors, gradients, and duotone filters from Global Styles.
|
|
53
|
+
* The inclusion of default (Core) palettes is controlled by the relevant
|
|
54
|
+
* theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone.
|
|
55
|
+
*
|
|
56
|
+
* @return {Object} Object containing properties for each type of palette.
|
|
57
|
+
*/
|
|
58
|
+
function useMultiOriginPalettes() {
|
|
59
|
+
const {
|
|
60
|
+
colors,
|
|
61
|
+
gradients
|
|
62
|
+
} = (0, _blockEditor.__experimentalUseMultipleOriginColorsAndGradients)();
|
|
63
|
+
|
|
64
|
+
// Add duotone filters to the palettes data.
|
|
65
|
+
const [shouldDisplayDefaultDuotones, customDuotones, themeDuotones, defaultDuotones] = (0, _blockEditor.useSettings)('color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default');
|
|
66
|
+
const palettes = (0, _element.useMemo)(() => {
|
|
67
|
+
const result = {
|
|
68
|
+
colors,
|
|
69
|
+
gradients,
|
|
70
|
+
duotones: []
|
|
71
|
+
};
|
|
72
|
+
if (themeDuotones && themeDuotones.length) {
|
|
73
|
+
result.duotones.push({
|
|
74
|
+
name: (0, _i18n._x)('Theme', 'Indicates these duotone filters come from the theme.'),
|
|
75
|
+
slug: 'theme',
|
|
76
|
+
duotones: themeDuotones
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (shouldDisplayDefaultDuotones && defaultDuotones && defaultDuotones.length) {
|
|
80
|
+
result.duotones.push({
|
|
81
|
+
name: (0, _i18n._x)('Default', 'Indicates these duotone filters come from WordPress.'),
|
|
82
|
+
slug: 'default',
|
|
83
|
+
duotones: defaultDuotones
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (customDuotones && customDuotones.length) {
|
|
87
|
+
result.duotones.push({
|
|
88
|
+
name: (0, _i18n._x)('Custom', 'Indicates these doutone filters are created by the user.'),
|
|
89
|
+
slug: 'custom',
|
|
90
|
+
duotones: customDuotones
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}, [colors, gradients, customDuotones, themeDuotones, defaultDuotones, shouldDisplayDefaultDuotones]);
|
|
95
|
+
return palettes;
|
|
96
|
+
}
|
|
50
97
|
function StyleBook({
|
|
51
98
|
enableResizing = true,
|
|
52
99
|
isSelected,
|
|
@@ -60,7 +107,8 @@ function StyleBook({
|
|
|
60
107
|
const [resizeObserver, sizes] = (0, _compose.useResizeObserver)();
|
|
61
108
|
const [textColor] = useGlobalStyle('color.text');
|
|
62
109
|
const [backgroundColor] = useGlobalStyle('color.background');
|
|
63
|
-
const
|
|
110
|
+
const colors = useMultiOriginPalettes();
|
|
111
|
+
const examples = (0, _element.useMemo)(() => (0, _examples.getExamples)(colors), [colors]);
|
|
64
112
|
const tabs = (0, _element.useMemo)(() => (0, _categories.getTopLevelStyleBookCategories)().filter(category => examples.some(example => example.category === category.slug)), [examples]);
|
|
65
113
|
const {
|
|
66
114
|
base: baseConfig
|
|
@@ -75,12 +123,12 @@ function StyleBook({
|
|
|
75
123
|
// Copied from packages/edit-site/src/components/revisions/index.js
|
|
76
124
|
// could we create a shared hook?
|
|
77
125
|
const originalSettings = (0, _data.useSelect)(select => select(_blockEditor.store).getSettings(), []);
|
|
126
|
+
const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
|
|
78
127
|
const settings = (0, _element.useMemo)(() => ({
|
|
79
128
|
...originalSettings,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
settings.styles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles;
|
|
129
|
+
styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : originalSettings.styles,
|
|
130
|
+
isPreviewMode: true
|
|
131
|
+
}), [globalStyles, originalSettings, userConfig]);
|
|
84
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorCanvasContainer.default, {
|
|
85
133
|
onClose: onClose,
|
|
86
134
|
enableResizing: enableResizing,
|
|
@@ -94,31 +142,29 @@ function StyleBook({
|
|
|
94
142
|
color: textColor,
|
|
95
143
|
background: backgroundColor
|
|
96
144
|
},
|
|
97
|
-
children: [resizeObserver, showTabs ? /*#__PURE__*/(0, _jsxRuntime.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
children:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}, tab.slug))]
|
|
121
|
-
})
|
|
145
|
+
children: [resizeObserver, showTabs ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tabs, {
|
|
146
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
147
|
+
className: "edit-site-style-book__tablist-container",
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabList, {
|
|
149
|
+
children: tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.Tab, {
|
|
150
|
+
tabId: tab.slug,
|
|
151
|
+
children: tab.title
|
|
152
|
+
}, tab.slug))
|
|
153
|
+
})
|
|
154
|
+
}), tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabPanel, {
|
|
155
|
+
tabId: tab.slug,
|
|
156
|
+
focusable: false,
|
|
157
|
+
className: "edit-site-style-book__tabpanel",
|
|
158
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyleBookBody, {
|
|
159
|
+
category: tab.slug,
|
|
160
|
+
examples: examples,
|
|
161
|
+
isSelected: isSelected,
|
|
162
|
+
onSelect: onSelect,
|
|
163
|
+
settings: settings,
|
|
164
|
+
sizes: sizes,
|
|
165
|
+
title: tab.title
|
|
166
|
+
})
|
|
167
|
+
}, tab.slug))]
|
|
122
168
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(StyleBookBody, {
|
|
123
169
|
examples: examples,
|
|
124
170
|
isSelected: isSelected,
|
|
@@ -217,6 +263,7 @@ const Examples = (0, _element.memo)(({
|
|
|
217
263
|
children: [!!filteredExamples?.examples?.length && filteredExamples.examples.map(example => /*#__PURE__*/(0, _jsxRuntime.jsx)(Example, {
|
|
218
264
|
id: `example-${example.name}`,
|
|
219
265
|
title: example.title,
|
|
266
|
+
content: example.content,
|
|
220
267
|
blocks: example.blocks,
|
|
221
268
|
isSelected: isSelected(example.name),
|
|
222
269
|
onClick: () => {
|
|
@@ -245,6 +292,7 @@ const Subcategory = ({
|
|
|
245
292
|
return !!examples?.length && examples.map(example => /*#__PURE__*/(0, _jsxRuntime.jsx)(Example, {
|
|
246
293
|
id: `example-${example.name}`,
|
|
247
294
|
title: example.title,
|
|
295
|
+
content: example.content,
|
|
248
296
|
blocks: example.blocks,
|
|
249
297
|
isSelected: isSelected(example.name),
|
|
250
298
|
onClick: () => {
|
|
@@ -252,30 +300,37 @@ const Subcategory = ({
|
|
|
252
300
|
}
|
|
253
301
|
}, example.name));
|
|
254
302
|
};
|
|
303
|
+
const disabledExamples = ['example-duotones'];
|
|
255
304
|
const Example = ({
|
|
256
305
|
id,
|
|
257
306
|
title,
|
|
258
307
|
blocks,
|
|
259
308
|
isSelected,
|
|
260
|
-
onClick
|
|
309
|
+
onClick,
|
|
310
|
+
content
|
|
261
311
|
}) => {
|
|
262
312
|
const originalSettings = (0, _data.useSelect)(select => select(_blockEditor.store).getSettings(), []);
|
|
263
313
|
const settings = (0, _element.useMemo)(() => ({
|
|
264
314
|
...originalSettings,
|
|
265
315
|
focusMode: false,
|
|
266
316
|
// Disable "Spotlight mode".
|
|
267
|
-
|
|
317
|
+
isPreviewMode: true
|
|
268
318
|
}), [originalSettings]);
|
|
269
319
|
|
|
270
320
|
// Cache the list of blocks to avoid additional processing when the component is re-rendered.
|
|
271
321
|
const renderedBlocks = (0, _element.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
|
|
322
|
+
const disabledProps = disabledExamples.includes(id) ? {
|
|
323
|
+
disabled: true,
|
|
324
|
+
accessibleWhenDisabled: true
|
|
325
|
+
} : {};
|
|
272
326
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
273
327
|
role: "row",
|
|
274
328
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
275
329
|
role: "gridcell",
|
|
276
330
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Composite.Item, {
|
|
277
331
|
className: (0, _clsx.default)('edit-site-style-book__example', {
|
|
278
|
-
'is-selected': isSelected
|
|
332
|
+
'is-selected': isSelected,
|
|
333
|
+
'is-disabled-example': !!disabledProps?.disabled
|
|
279
334
|
}),
|
|
280
335
|
id: id,
|
|
281
336
|
"aria-label": (0, _i18n.sprintf)(
|
|
@@ -284,6 +339,7 @@ const Example = ({
|
|
|
284
339
|
render: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {}),
|
|
285
340
|
role: "button",
|
|
286
341
|
onClick: onClick,
|
|
342
|
+
...disabledProps,
|
|
287
343
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
288
344
|
className: "edit-site-style-book__example-title",
|
|
289
345
|
children: title
|
|
@@ -292,12 +348,12 @@ const Example = ({
|
|
|
292
348
|
"aria-hidden": true,
|
|
293
349
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Disabled, {
|
|
294
350
|
className: "edit-site-style-book__example-preview__content",
|
|
295
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
351
|
+
children: content ? content : /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExperimentalBlockEditorProvider, {
|
|
296
352
|
value: renderedBlocks,
|
|
297
353
|
settings: settings,
|
|
298
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
|
|
354
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableEditorStyles, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
|
|
299
355
|
renderAppender: false
|
|
300
|
-
})
|
|
356
|
+
})]
|
|
301
357
|
})
|
|
302
358
|
})
|
|
303
359
|
})]
|