@wordpress/edit-site 6.8.8 → 6.10.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-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +23 -17
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +1 -1
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +1 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +2 -2
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +4 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +9 -8
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +16 -19
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +1 -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.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +2 -2
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -2
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +3 -9
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +4 -1
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +1 -1
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +1 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +25 -19
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +1 -1
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +0 -6
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +1 -0
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/index.js +1 -0
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-fields/index.js +4 -4
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +25 -7
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -3
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +1 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +3 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-panel/index.js +1 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +1 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +4 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/style-book/categories.js +70 -0
- package/build/components/style-book/categories.js.map +1 -0
- package/build/components/style-book/constants.js +151 -0
- package/build/components/style-book/constants.js.map +1 -0
- package/build/components/style-book/examples.js +58 -0
- package/build/components/style-book/examples.js.map +1 -0
- package/build/components/style-book/index.js +52 -133
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js +6 -0
- package/build/components/style-book/types.js.map +1 -0
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +5 -5
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +2 -4
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -1
- package/build/posts.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +0 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +1 -3
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -2
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -2
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -3
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -3
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -3
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +2 -3
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +27 -23
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +2 -3
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +1 -0
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +3 -4
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +6 -8
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -2
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -3
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +10 -11
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -3
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +1 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +17 -22
- 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 +2 -3
- 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 +1 -3
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +1 -2
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +3 -4
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +4 -5
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -2
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +1 -3
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +1 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -3
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +1 -3
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +3 -5
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -3
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -3
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -3
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -3
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +5 -13
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -3
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +1 -3
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +1 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +5 -4
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +2 -4
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/size-control/index.js +1 -2
- package/build-module/components/global-styles/size-control/index.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +2 -6
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset.js +3 -5
- package/build-module/components/global-styles/typeset.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +1 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +1 -2
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +24 -20
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +1 -1
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +1 -2
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -2
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +1 -3
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -9
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/index.js +1 -3
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -2
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +1 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +2 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +1 -2
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -3
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +2 -2
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +1 -3
- package/build-module/components/page-patterns/rename-category-menu-item.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 -0
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +1 -2
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +1 -2
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +5 -6
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +1 -3
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +1 -2
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +27 -11
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -2
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +6 -3
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +2 -3
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +1 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -3
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -3
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +1 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +1 -2
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +1 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +4 -4
- 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/leaf-more-menu.js +3 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +1 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -2
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/categories.js +64 -0
- package/build-module/components/style-book/categories.js.map +1 -0
- package/build-module/components/style-book/constants.js +145 -0
- package/build-module/components/style-book/constants.js.map +1 -0
- package/build-module/components/style-book/examples.js +52 -0
- package/build-module/components/style-book/examples.js.map +1 -0
- package/build-module/components/style-book/index.js +52 -134
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js +2 -0
- package/build-module/components/style-book/types.js.map +1 -0
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -3
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +1 -2
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +1 -3
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -3
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -3
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +5 -5
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +2 -4
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -1
- package/build-module/posts.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +0 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-style/posts-rtl.css +62 -45
- package/build-style/posts.css +62 -45
- package/build-style/style-rtl.css +78 -56
- package/build-style/style.css +78 -56
- package/package.json +42 -42
- package/src/components/editor-canvas-container/index.js +1 -1
- package/src/components/editor-canvas-container/style.scss +2 -2
- package/src/components/global-styles/font-families.js +30 -21
- package/src/components/global-styles/font-library-modal/font-card.js +1 -1
- package/src/components/global-styles/font-library-modal/font-collection.js +8 -10
- package/src/components/global-styles/font-library-modal/index.js +1 -1
- package/src/components/global-styles/font-library-modal/installed-fonts.js +9 -11
- package/src/components/global-styles/font-library-modal/style.scss +5 -1
- package/src/components/global-styles/font-sizes/font-size.js +18 -16
- package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -1
- package/src/components/global-styles/header.js +2 -2
- package/src/components/global-styles/navigation-button.js +3 -4
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +2 -12
- package/src/components/global-styles/shadows-edit-panel.js +5 -1
- package/src/components/global-styles/style-variations-container.js +2 -7
- package/src/components/global-styles/ui.js +23 -18
- package/src/components/global-styles-sidebar/index.js +1 -11
- package/src/components/global-styles-sidebar/style.scss +1 -8
- package/src/components/layout/style.scss +7 -2
- package/src/components/resizable-frame/index.js +14 -8
- package/src/components/routes/link.js +6 -3
- package/src/components/sidebar-button/index.js +1 -1
- package/src/components/sidebar-button/style.scss +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +5 -1
- package/src/components/style-book/categories.ts +91 -0
- package/src/components/style-book/constants.ts +191 -0
- package/src/components/style-book/examples.ts +63 -0
- package/src/components/style-book/index.js +76 -163
- package/src/components/style-book/style.scss +9 -5
- package/src/components/style-book/test/categories.js +171 -0
- package/src/components/style-book/types.ts +27 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/src/index.js +1 -5
- package/src/store/private-actions.js +0 -3
- package/src/store/selectors.js +1 -1
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
__experimentalUseNavigator as useNavigator,
|
|
5
|
+
Navigator,
|
|
6
|
+
useNavigator,
|
|
8
7
|
createSlotFill,
|
|
9
8
|
DropdownMenu,
|
|
10
9
|
MenuGroup,
|
|
@@ -71,10 +70,8 @@ function GlobalStylesActionMenu() {
|
|
|
71
70
|
const { setEditorCanvasContainerView } = unlock(
|
|
72
71
|
useDispatch( editSiteStore )
|
|
73
72
|
);
|
|
74
|
-
const { goTo } = useNavigator();
|
|
75
73
|
const loadCustomCSS = () => {
|
|
76
74
|
setEditorCanvasContainerView( 'global-styles-css' );
|
|
77
|
-
goTo( '/css' );
|
|
78
75
|
};
|
|
79
76
|
|
|
80
77
|
return (
|
|
@@ -124,7 +121,7 @@ function GlobalStylesActionMenu() {
|
|
|
124
121
|
|
|
125
122
|
function GlobalStylesNavigationScreen( { className, ...props } ) {
|
|
126
123
|
return (
|
|
127
|
-
<
|
|
124
|
+
<Navigator.Screen
|
|
128
125
|
className={ [
|
|
129
126
|
'edit-site-global-styles-sidebar__navigator-screen',
|
|
130
127
|
className,
|
|
@@ -254,21 +251,29 @@ function GlobalStylesEditorCanvasContainerLink() {
|
|
|
254
251
|
switch ( editorCanvasContainerView ) {
|
|
255
252
|
case 'global-styles-revisions':
|
|
256
253
|
case 'global-styles-revisions:style-book':
|
|
257
|
-
|
|
254
|
+
if ( ! isRevisionsOpen ) {
|
|
255
|
+
goTo( '/revisions' );
|
|
256
|
+
}
|
|
258
257
|
break;
|
|
259
258
|
case 'global-styles-css':
|
|
260
259
|
goTo( '/css' );
|
|
261
260
|
break;
|
|
261
|
+
// The stand-alone style book is open
|
|
262
|
+
// and the revisions panel is open,
|
|
263
|
+
// close the revisions panel.
|
|
264
|
+
// Otherwise keep the style book open while
|
|
265
|
+
// browsing global styles panel.
|
|
266
|
+
//
|
|
267
|
+
// Falling through as it matches the default scenario.
|
|
262
268
|
case 'style-book':
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
*/
|
|
269
|
+
default:
|
|
270
|
+
// In general, if the revision screen is in view but the
|
|
271
|
+
// `editorCanvasContainerView` is not a revision view, close it.
|
|
272
|
+
// This also includes the scenario when the stand-alone style
|
|
273
|
+
// book is open, in which case we want the user to close the
|
|
274
|
+
// revisions screen and browse global styles.
|
|
270
275
|
if ( isRevisionsOpen ) {
|
|
271
|
-
goTo( '/' );
|
|
276
|
+
goTo( '/', { isBack: true } );
|
|
272
277
|
}
|
|
273
278
|
break;
|
|
274
279
|
}
|
|
@@ -283,7 +288,7 @@ function GlobalStylesUI() {
|
|
|
283
288
|
[]
|
|
284
289
|
);
|
|
285
290
|
return (
|
|
286
|
-
<
|
|
291
|
+
<Navigator
|
|
287
292
|
className="edit-site-global-styles-sidebar__navigator-provider"
|
|
288
293
|
initialPath="/"
|
|
289
294
|
>
|
|
@@ -303,7 +308,7 @@ function GlobalStylesUI() {
|
|
|
303
308
|
<ScreenTypography />
|
|
304
309
|
</GlobalStylesNavigationScreen>
|
|
305
310
|
|
|
306
|
-
<GlobalStylesNavigationScreen path="/typography/font-sizes
|
|
311
|
+
<GlobalStylesNavigationScreen path="/typography/font-sizes">
|
|
307
312
|
<FontSizes />
|
|
308
313
|
</GlobalStylesNavigationScreen>
|
|
309
314
|
|
|
@@ -385,7 +390,7 @@ function GlobalStylesUI() {
|
|
|
385
390
|
<GlobalStylesActionMenu />
|
|
386
391
|
<GlobalStylesBlockLink />
|
|
387
392
|
<GlobalStylesEditorCanvasContainerLink />
|
|
388
|
-
</
|
|
393
|
+
</Navigator>
|
|
389
394
|
);
|
|
390
395
|
}
|
|
391
396
|
export { GlobalStylesMenuSlot };
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
FlexItem,
|
|
6
|
-
FlexBlock,
|
|
7
|
-
Flex,
|
|
8
|
-
Button,
|
|
9
|
-
__experimentalUseNavigator as useNavigator,
|
|
10
|
-
} from '@wordpress/components';
|
|
4
|
+
import { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';
|
|
11
5
|
import { __ } from '@wordpress/i18n';
|
|
12
6
|
import { styles, seen, backup } from '@wordpress/icons';
|
|
13
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
@@ -86,21 +80,17 @@ export default function GlobalStylesSidebar() {
|
|
|
86
80
|
}, [ shouldClearCanvasContainerView ] );
|
|
87
81
|
|
|
88
82
|
const { setIsListViewOpened } = useDispatch( editorStore );
|
|
89
|
-
const { goTo } = useNavigator();
|
|
90
83
|
|
|
91
84
|
const toggleRevisions = () => {
|
|
92
85
|
setIsListViewOpened( false );
|
|
93
86
|
if ( isRevisionsStyleBookOpened ) {
|
|
94
|
-
goTo( '/' );
|
|
95
87
|
setEditorCanvasContainerView( 'style-book' );
|
|
96
88
|
return;
|
|
97
89
|
}
|
|
98
90
|
if ( isRevisionsOpened ) {
|
|
99
|
-
goTo( '/' );
|
|
100
91
|
setEditorCanvasContainerView( undefined );
|
|
101
92
|
return;
|
|
102
93
|
}
|
|
103
|
-
goTo( '/revisions' );
|
|
104
94
|
|
|
105
95
|
if ( isStyleBookOpened ) {
|
|
106
96
|
setEditorCanvasContainerView(
|
|
@@ -114,14 +114,18 @@
|
|
|
114
114
|
width: calc(100% - #{$canvas-padding});
|
|
115
115
|
|
|
116
116
|
.edit-site-resizable-frame__inner-content {
|
|
117
|
-
box-shadow:
|
|
118
|
-
transition: border-radius 0.4s;
|
|
117
|
+
box-shadow: $elevation-x-small;
|
|
118
|
+
transition: border-radius, box-shadow 0.4s;
|
|
119
119
|
// This ensure the radius work properly.
|
|
120
120
|
overflow: hidden;
|
|
121
121
|
|
|
122
122
|
.edit-site-layout:not(.is-full-canvas) & {
|
|
123
123
|
border-radius: $radius-large;
|
|
124
124
|
}
|
|
125
|
+
|
|
126
|
+
&:hover {
|
|
127
|
+
box-shadow: $elevation-large;
|
|
128
|
+
}
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
131
|
|
|
@@ -246,6 +250,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
246
250
|
flex-grow: 1;
|
|
247
251
|
margin: 0;
|
|
248
252
|
overflow: hidden;
|
|
253
|
+
box-shadow: $elevation-x-small;
|
|
249
254
|
@include break-medium() {
|
|
250
255
|
border-radius: 8px;
|
|
251
256
|
margin: $canvas-padding $canvas-padding $canvas-padding 0;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
|
|
16
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
|
-
import { __ } from '@wordpress/i18n';
|
|
17
|
+
import { __, isRTL } from '@wordpress/i18n';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
@@ -171,7 +171,10 @@ function ResizableFrame( {
|
|
|
171
171
|
event.preventDefault();
|
|
172
172
|
|
|
173
173
|
const step = 20 * ( event.shiftKey ? 5 : 1 );
|
|
174
|
-
const delta =
|
|
174
|
+
const delta =
|
|
175
|
+
step *
|
|
176
|
+
( event.key === 'ArrowLeft' ? 1 : -1 ) *
|
|
177
|
+
( isRTL() ? -1 : 1 );
|
|
175
178
|
const newWidth = Math.min(
|
|
176
179
|
Math.max(
|
|
177
180
|
FRAME_MIN_WIDTH,
|
|
@@ -200,15 +203,17 @@ function ResizableFrame( {
|
|
|
200
203
|
const resizeHandleVariants = {
|
|
201
204
|
hidden: {
|
|
202
205
|
opacity: 0,
|
|
203
|
-
left: 0,
|
|
206
|
+
...( isRTL() ? { right: 0 } : { left: 0 } ),
|
|
204
207
|
},
|
|
205
208
|
visible: {
|
|
206
209
|
opacity: 1,
|
|
207
|
-
|
|
210
|
+
// Account for the handle's width.
|
|
211
|
+
...( isRTL() ? { right: -14 } : { left: -14 } ),
|
|
208
212
|
},
|
|
209
213
|
active: {
|
|
210
214
|
opacity: 1,
|
|
211
|
-
|
|
215
|
+
// Account for the handle's width.
|
|
216
|
+
...( isRTL() ? { right: -14 } : { left: -14 } ),
|
|
212
217
|
scaleY: 1.3,
|
|
213
218
|
},
|
|
214
219
|
};
|
|
@@ -246,10 +251,11 @@ function ResizableFrame( {
|
|
|
246
251
|
size={ frameSize }
|
|
247
252
|
enable={ {
|
|
248
253
|
top: false,
|
|
249
|
-
right: false,
|
|
250
254
|
bottom: false,
|
|
251
255
|
// Resizing will be disabled until the editor content is loaded.
|
|
252
|
-
|
|
256
|
+
...( isRTL()
|
|
257
|
+
? { right: isReady, left: false }
|
|
258
|
+
: { left: isReady, right: false } ),
|
|
253
259
|
topRight: false,
|
|
254
260
|
bottomRight: false,
|
|
255
261
|
bottomLeft: false,
|
|
@@ -269,7 +275,7 @@ function ResizableFrame( {
|
|
|
269
275
|
onMouseOver={ () => setShouldShowHandle( true ) }
|
|
270
276
|
onMouseOut={ () => setShouldShowHandle( false ) }
|
|
271
277
|
handleComponent={ {
|
|
272
|
-
left: canvasMode === 'view' && (
|
|
278
|
+
[ isRTL() ? 'right' : 'left' ]: canvasMode === 'view' && (
|
|
273
279
|
<>
|
|
274
280
|
<Tooltip text={ __( 'Drag to resize' ) }>
|
|
275
281
|
{ /* Disable reason: role="separator" does in fact support aria-valuenow */ }
|
|
@@ -33,14 +33,17 @@ export function useLink( params, state, shouldReplace = false ) {
|
|
|
33
33
|
...Object.keys( currentArgs )
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
+
let extraParams = {};
|
|
36
37
|
if ( isPreviewingTheme() ) {
|
|
37
|
-
|
|
38
|
-
...params,
|
|
38
|
+
extraParams = {
|
|
39
39
|
wp_theme_preview: currentlyPreviewingTheme(),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const newUrl = addQueryArgs( currentUrlWithoutArgs,
|
|
43
|
+
const newUrl = addQueryArgs( currentUrlWithoutArgs, {
|
|
44
|
+
...params,
|
|
45
|
+
...extraParams,
|
|
46
|
+
} );
|
|
44
47
|
|
|
45
48
|
return {
|
|
46
49
|
href: newUrl,
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
outline: 3px solid transparent;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
&:hover,
|
|
17
|
+
&:hover:not(:disabled,[aria-disabled="true"]),
|
|
18
18
|
&:focus-visible,
|
|
19
19
|
&:focus,
|
|
20
|
-
&:not([aria-disabled="true"]):active,
|
|
20
|
+
&:not(:disabled,[aria-disabled="true"]):active,
|
|
21
21
|
&[aria-expanded="true"] {
|
|
22
22
|
color: $gray-100;
|
|
23
23
|
}
|
|
@@ -68,7 +68,11 @@
|
|
|
68
68
|
.edit-site-sidebar-navigation-screen__title {
|
|
69
69
|
flex-grow: 1;
|
|
70
70
|
overflow-wrap: break-word;
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
&#{&},
|
|
73
|
+
&#{&} .edit-site-sidebar-navigation-screen__title {
|
|
74
|
+
line-height: $font-line-height-x-large;
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
.edit-site-sidebar-navigation-screen__actions {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { getCategories } from '@wordpress/blocks';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type {
|
|
10
|
+
BlockExample,
|
|
11
|
+
StyleBookCategory,
|
|
12
|
+
CategoryExamples,
|
|
13
|
+
} from './types';
|
|
14
|
+
import {
|
|
15
|
+
STYLE_BOOK_CATEGORIES,
|
|
16
|
+
STYLE_BOOK_THEME_SUBCATEGORIES,
|
|
17
|
+
} from './constants';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns category examples for a given category definition and list of examples.
|
|
21
|
+
* @param {StyleBookCategory} categoryDefinition The category definition.
|
|
22
|
+
* @param {BlockExample[]} examples An array of block examples.
|
|
23
|
+
* @return {CategoryExamples|undefined} An object containing the category examples.
|
|
24
|
+
*/
|
|
25
|
+
export function getExamplesByCategory(
|
|
26
|
+
categoryDefinition: StyleBookCategory,
|
|
27
|
+
examples: BlockExample[]
|
|
28
|
+
): CategoryExamples | undefined {
|
|
29
|
+
if ( ! categoryDefinition?.slug || ! examples?.length ) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if ( categoryDefinition?.subcategories?.length ) {
|
|
34
|
+
return categoryDefinition.subcategories.reduce(
|
|
35
|
+
( acc, subcategoryDefinition ) => {
|
|
36
|
+
const subcategoryExamples = getExamplesByCategory(
|
|
37
|
+
subcategoryDefinition,
|
|
38
|
+
examples
|
|
39
|
+
);
|
|
40
|
+
if ( subcategoryExamples ) {
|
|
41
|
+
acc.subcategories = [
|
|
42
|
+
...acc.subcategories,
|
|
43
|
+
subcategoryExamples,
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
return acc;
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: categoryDefinition.title,
|
|
50
|
+
slug: categoryDefinition.slug,
|
|
51
|
+
subcategories: [],
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const blocksToInclude = categoryDefinition?.blocks || [];
|
|
57
|
+
const blocksToExclude = categoryDefinition?.exclude || [];
|
|
58
|
+
const categoryExamples = examples.filter( ( example ) => {
|
|
59
|
+
return (
|
|
60
|
+
! blocksToExclude.includes( example.name ) &&
|
|
61
|
+
( example.category === categoryDefinition.slug ||
|
|
62
|
+
blocksToInclude.includes( example.name ) )
|
|
63
|
+
);
|
|
64
|
+
} );
|
|
65
|
+
|
|
66
|
+
if ( ! categoryExamples.length ) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
title: categoryDefinition.title,
|
|
72
|
+
slug: categoryDefinition.slug,
|
|
73
|
+
examples: categoryExamples,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns category examples for a given category definition and list of examples.
|
|
79
|
+
*
|
|
80
|
+
* @return {StyleBookCategory[]} An array of top-level category definitions.
|
|
81
|
+
*/
|
|
82
|
+
export function getTopLevelStyleBookCategories(): StyleBookCategory[] {
|
|
83
|
+
const reservedCategories = [
|
|
84
|
+
...STYLE_BOOK_THEME_SUBCATEGORIES,
|
|
85
|
+
...STYLE_BOOK_CATEGORIES,
|
|
86
|
+
].map( ( { slug } ) => slug );
|
|
87
|
+
const extraCategories = getCategories().filter(
|
|
88
|
+
( { slug } ) => ! reservedCategories.includes( slug )
|
|
89
|
+
);
|
|
90
|
+
return [ ...STYLE_BOOK_CATEGORIES, ...extraCategories ];
|
|
91
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import type { StyleBookCategory } from './types';
|
|
10
|
+
|
|
11
|
+
export const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<
|
|
12
|
+
StyleBookCategory,
|
|
13
|
+
'subcategories'
|
|
14
|
+
>[] = [
|
|
15
|
+
{
|
|
16
|
+
slug: 'site-identity',
|
|
17
|
+
title: __( 'Site Identity' ),
|
|
18
|
+
blocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
slug: 'design',
|
|
22
|
+
title: __( 'Design' ),
|
|
23
|
+
blocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],
|
|
24
|
+
exclude: [ 'core/home-link', 'core/navigation-link' ],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
slug: 'posts',
|
|
28
|
+
title: __( 'Posts' ),
|
|
29
|
+
blocks: [
|
|
30
|
+
'core/post-title',
|
|
31
|
+
'core/post-excerpt',
|
|
32
|
+
'core/post-author',
|
|
33
|
+
'core/post-author-name',
|
|
34
|
+
'core/post-author-biography',
|
|
35
|
+
'core/post-date',
|
|
36
|
+
'core/post-terms',
|
|
37
|
+
'core/term-description',
|
|
38
|
+
'core/query-title',
|
|
39
|
+
'core/query-no-results',
|
|
40
|
+
'core/query-pagination',
|
|
41
|
+
'core/query-numbers',
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
slug: 'comments',
|
|
46
|
+
title: __( 'Comments' ),
|
|
47
|
+
blocks: [
|
|
48
|
+
'core/comments-title',
|
|
49
|
+
'core/comments-pagination',
|
|
50
|
+
'core/comments-pagination-numbers',
|
|
51
|
+
'core/comments',
|
|
52
|
+
'core/comments-author-name',
|
|
53
|
+
'core/comment-content',
|
|
54
|
+
'core/comment-date',
|
|
55
|
+
'core/comment-edit-link',
|
|
56
|
+
'core/comment-reply-link',
|
|
57
|
+
'core/comment-template',
|
|
58
|
+
'core/post-comments-count',
|
|
59
|
+
'core/post-comments-link',
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [
|
|
65
|
+
{
|
|
66
|
+
slug: 'text',
|
|
67
|
+
title: __( 'Text' ),
|
|
68
|
+
blocks: [
|
|
69
|
+
'core/post-content',
|
|
70
|
+
'core/home-link',
|
|
71
|
+
'core/navigation-link',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
slug: 'colors',
|
|
76
|
+
title: __( 'Colors' ),
|
|
77
|
+
blocks: [ 'custom/colors' ],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
slug: 'theme',
|
|
81
|
+
title: __( 'Theme' ),
|
|
82
|
+
subcategories: STYLE_BOOK_THEME_SUBCATEGORIES,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
slug: 'media',
|
|
86
|
+
title: __( 'Media' ),
|
|
87
|
+
blocks: [ 'core/post-featured-image' ],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
slug: 'widgets',
|
|
91
|
+
title: __( 'Widgets' ),
|
|
92
|
+
blocks: [],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
slug: 'embed',
|
|
96
|
+
title: __( 'Embeds' ),
|
|
97
|
+
include: [],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
// The content area of the Style Book is rendered within an iframe so that global styles
|
|
102
|
+
// are applied to elements within the entire content area. To support elements that are
|
|
103
|
+
// not part of the block previews, such as headings and layout for the block previews,
|
|
104
|
+
// additional CSS rules need to be passed into the iframe. These are hard-coded below.
|
|
105
|
+
// Note that button styles are unset, and then focus rules from the `Button` component are
|
|
106
|
+
// applied to the `button` element, targeted via `.edit-site-style-book__example`.
|
|
107
|
+
// This is to ensure that browser default styles for buttons are not applied to the previews.
|
|
108
|
+
export const STYLE_BOOK_IFRAME_STYLES = `
|
|
109
|
+
// Forming a "block formatting context" to prevent margin collapsing.
|
|
110
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
111
|
+
.is-root-container {
|
|
112
|
+
display: flow-root;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
body {
|
|
116
|
+
position: relative;
|
|
117
|
+
padding: 32px !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.edit-site-style-book__examples {
|
|
121
|
+
max-width: 1200px;
|
|
122
|
+
margin: 0 auto;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.edit-site-style-book__example {
|
|
126
|
+
max-width: 900px;
|
|
127
|
+
border-radius: 2px;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
gap: 40px;
|
|
132
|
+
padding: 16px;
|
|
133
|
+
width: 100%;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
scroll-margin-top: 32px;
|
|
136
|
+
scroll-margin-bottom: 32px;
|
|
137
|
+
margin: 0 auto 40px auto;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.edit-site-style-book__example.is-selected {
|
|
141
|
+
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.edit-site-style-book__example:focus:not(:disabled) {
|
|
145
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
146
|
+
outline: 3px solid transparent;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.edit-site-style-book__examples.is-wide .edit-site-style-book__example {
|
|
150
|
+
flex-direction: row;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.edit-site-style-book__subcategory-title,
|
|
154
|
+
.edit-site-style-book__example-title {
|
|
155
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
156
|
+
font-size: 11px;
|
|
157
|
+
font-weight: 500;
|
|
158
|
+
line-height: normal;
|
|
159
|
+
margin: 0;
|
|
160
|
+
text-align: left;
|
|
161
|
+
text-transform: uppercase;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.edit-site-style-book__subcategory-title {
|
|
165
|
+
font-size: 16px;
|
|
166
|
+
margin-bottom: 40px;
|
|
167
|
+
border-bottom: 1px solid #ddd;
|
|
168
|
+
padding-bottom: 8px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {
|
|
172
|
+
text-align: right;
|
|
173
|
+
width: 120px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.edit-site-style-book__example-preview {
|
|
177
|
+
width: 100%;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
|
|
181
|
+
.edit-site-style-book__example-preview .block-list-appender {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {
|
|
186
|
+
margin-top: 0;
|
|
187
|
+
}
|
|
188
|
+
.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {
|
|
189
|
+
margin-bottom: 0;
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
getBlockType,
|
|
7
|
+
getBlockTypes,
|
|
8
|
+
getBlockFromExample,
|
|
9
|
+
createBlock,
|
|
10
|
+
} from '@wordpress/blocks';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import type { BlockExample } from './types';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns a list of examples for registered block types.
|
|
19
|
+
*
|
|
20
|
+
* @return {BlockExample[]} An array of block examples.
|
|
21
|
+
*/
|
|
22
|
+
export function getExamples(): BlockExample[] {
|
|
23
|
+
const nonHeadingBlockExamples = getBlockTypes()
|
|
24
|
+
.filter( ( blockType ) => {
|
|
25
|
+
const { name, example, supports } = blockType;
|
|
26
|
+
return (
|
|
27
|
+
name !== 'core/heading' &&
|
|
28
|
+
!! example &&
|
|
29
|
+
supports.inserter !== false
|
|
30
|
+
);
|
|
31
|
+
} )
|
|
32
|
+
.map( ( blockType ) => ( {
|
|
33
|
+
name: blockType.name,
|
|
34
|
+
title: blockType.title,
|
|
35
|
+
category: blockType.category,
|
|
36
|
+
blocks: getBlockFromExample( blockType.name, blockType.example ),
|
|
37
|
+
} ) );
|
|
38
|
+
const isHeadingBlockRegistered = !! getBlockType( 'core/heading' );
|
|
39
|
+
|
|
40
|
+
if ( ! isHeadingBlockRegistered ) {
|
|
41
|
+
return nonHeadingBlockExamples;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Use our own example for the Heading block so that we can show multiple
|
|
45
|
+
// heading levels.
|
|
46
|
+
const headingsExample = {
|
|
47
|
+
name: 'core/heading',
|
|
48
|
+
title: __( 'Headings' ),
|
|
49
|
+
category: 'text',
|
|
50
|
+
blocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {
|
|
51
|
+
return createBlock( 'core/heading', {
|
|
52
|
+
content: sprintf(
|
|
53
|
+
// translators: %d: heading level e.g: "1", "2", "3"
|
|
54
|
+
__( 'Heading %d' ),
|
|
55
|
+
level
|
|
56
|
+
),
|
|
57
|
+
level,
|
|
58
|
+
} );
|
|
59
|
+
} ),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return [ headingsExample, ...nonHeadingBlockExamples ];
|
|
63
|
+
}
|