@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","authorizedPostTypes","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","postsPageId","url","frontPageTemplateId","select","getEntityRecord","getEntityRecords","siteData","base","templates","per_page","_homepageId","show_on_front","includes","page_on_front","toString","_postsPageId","page_for_posts","_frontPageTemplateId","frontPageTemplate","find","t","slug","id","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","link","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst {\n\t\thasLoadedAllDependencies,\n\t\thomepageId,\n\t\tpostsPageId,\n\t\turl,\n\t\tfrontPageTemplateId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, getEntityRecords } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', 'site' );\n\t\tconst base = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst templates = getEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\t\tconst _homepageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_on_front ) &&\n\t\t\t!! +siteData.page_on_front // We also need to check if it's not zero(`0`).\n\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t: null;\n\t\tconst _postsPageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_for_posts )\n\t\t\t\t? siteData.page_for_posts.toString()\n\t\t\t\t: null;\n\t\tlet _frontPageTemplateId;\n\t\tif ( templates ) {\n\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t);\n\t\t\t_frontPageTemplateId = frontPageTemplate\n\t\t\t\t? frontPageTemplate.id\n\t\t\t\t: false;\n\t\t}\n\t\treturn {\n\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\thomepageId: _homepageId,\n\t\t\tpostsPageId: _postsPageId,\n\t\t\turl: base?.home,\n\t\t\tfrontPageTemplateId: _frontPageTemplateId,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// Check if the current page is the posts page.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\tpostsPageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\treturn __experimentalGetTemplateForLink( editedEntity.link )\n\t\t\t\t\t\t?.id;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\tpostsPageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OA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0C;IAAQ,CAAC;EACpD;EAEA,IAAKxC,wBAAwB,EAAG;IAC/B,OAAO;MACNyC,OAAO,EAAEf,kBAAkB,KAAKC,SAAS;MACzC5B,QAAQ,EAAEV,kBAAkB;MAC5BS,MAAM,EAAE4B,kBAAkB;MAC1Bc;IACD,CAAC;EACF;EAEA,OAAO;IAAEC,OAAO,EAAE;EAAM,CAAC;AAC1B;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD,MAAM;IAAEC,MAAM,GAAG,CAAC;EAAE,CAAC,GAAGlD,WAAW,CAAC,CAAC;EACrC,MAAM;IAAEM,QAAQ;IAAED,MAAM;IAAE0C,OAAO;IAAEC;EAAQ,CAAC,GAC3C5C,gCAAgC,CAAE8C,MAAO,CAAC;EAE3C,MAAM;IAAEC;EAAgB,CAAC,GAAG9D,WAAW,CAAEK,aAAc,CAAC;EAExDR,SAAS,CAAE,MAAM;IAChB,IAAK8D,OAAO,EAAG;MACdG,eAAe,CAAE7C,QAAQ,EAAED,MAAM,EAAE0C,OAAQ,CAAC;IAC7C;EACD,CAAC,EAAE,CAAEC,OAAO,EAAE1C,QAAQ,EAAED,MAAM,EAAE0C,OAAO,EAAEI,eAAe,CAAG,CAAC;AAC7D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","authorizedPostTypes","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","postsPageId","url","frontPageTemplateId","select","getEntityRecord","getEntityRecords","siteData","base","templates","per_page","_homepageId","show_on_front","includes","page_on_front","toString","_postsPageId","page_for_posts","_frontPageTemplateId","frontPageTemplate","find","t","slug","id","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","link","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst {\n\t\thasLoadedAllDependencies,\n\t\thomepageId,\n\t\tpostsPageId,\n\t\turl,\n\t\tfrontPageTemplateId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, getEntityRecords } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', 'site' );\n\t\tconst base = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst templates = getEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\t\tconst _homepageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_on_front ) &&\n\t\t\t!! +siteData.page_on_front // We also need to check if it's not zero(`0`).\n\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t: null;\n\t\tconst _postsPageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_for_posts )\n\t\t\t\t? siteData.page_for_posts.toString()\n\t\t\t\t: null;\n\t\tlet _frontPageTemplateId;\n\t\tif ( templates ) {\n\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t);\n\t\t\t_frontPageTemplateId = frontPageTemplate\n\t\t\t\t? frontPageTemplate.id\n\t\t\t\t: false;\n\t\t}\n\t\treturn {\n\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\thomepageId: _homepageId,\n\t\t\tpostsPageId: _postsPageId,\n\t\t\turl: base?.home,\n\t\t\tfrontPageTemplateId: _frontPageTemplateId,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// Check if the current page is the posts page.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\tpostsPageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\treturn __experimentalGetTemplateForLink( editedEntity.link )\n\t\t\t\t\t\t?.id;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\tpostsPageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEF,iBAAkB,CAAC;AAEnD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;IAAEC;EAAQ,CAAC,GAC3C5C,gCAAgC,CAAE8C,MAAO,CAAC;EAE3C,MAAM;IAAEC;EAAgB,CAAC,GAAG9D,WAAW,CAAEK,aAAc,CAAC;EAExDR,SAAS,CAAE,MAAM;IAChB,IAAK8D,OAAO,EAAG;MACdG,eAAe,CAAE7C,QAAQ,EAAED,MAAM,EAAE0C,OAAQ,CAAC;IAC7C;EACD,CAAC,EAAE,CAAEC,OAAO,EAAE1C,QAAQ,EAAED,MAAM,EAAE0C,OAAO,EAAEI,eAAe,CAAG,CAAC;AAC7D","ignoreList":[]}
|
|
@@ -12,9 +12,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import WelcomeGuideImage from './image';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
16
|
export default function WelcomeGuideEditor() {
|
|
19
17
|
const {
|
|
20
18
|
toggle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","Guide","__","createInterpolateElement","store","preferencesStore","coreStore","WelcomeGuideImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuideEditor","toggle","isActive","isBlockBasedTheme","select","get","getCurrentTheme","is_block_theme","className","contentLabel","finishButtonText","onFinish","pages","image","nonAnimatedSrc","animatedSrc","content","children","StylesIconImage","alt","src"],"sources":["@wordpress/edit-site/src/components/welcome-guide/editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isBlockBasedTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t\tisBlockBasedTheme:\n\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isBlockBasedTheme ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-editor\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","Guide","__","createInterpolateElement","store","preferencesStore","coreStore","WelcomeGuideImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuideEditor","toggle","isActive","isBlockBasedTheme","select","get","getCurrentTheme","is_block_theme","className","contentLabel","finishButtonText","onFinish","pages","image","nonAnimatedSrc","animatedSrc","content","children","StylesIconImage","alt","src"],"sources":["@wordpress/edit-site/src/components/welcome-guide/editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isBlockBasedTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t\tisBlockBasedTheme:\n\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isBlockBasedTheme ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-editor\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAi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,CAAAF,SAAA;QAAAoB,QAAA,gBACCtB,IAAA;UAAIa,SAAS,EAAC,kCAAkC;UAAAS,QAAA,EAC7C7B,EAAE,CAAE,gBAAiB;QAAC,CACrB,CAAC,eACLO,IAAA;UAAGa,SAAS,EAAC,+BAA+B;UAAAS,QAAA,EACzC7B,EAAE,CACH,2FACD;QAAC,CACC,CAAC,eACJO,IAAA;UAAGa,SAAS,EAAC,+BAA+B;UAAAS,QAAA,EACzC5B,wBAAwB,CACzBD,EAAE,CACD,2GACD,CAAC,EACD;YACC8B,eAAe,eACdvB,IAAA;cACCwB,GAAG,EAAG/B,EAAE,CAAE,QAAS,CAAG;cACtBgC,GAAG,EAAC;YAAuR,CAC3R;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WelcomeGuideImage","nonAnimatedSrc","animatedSrc","_jsxs","className","children","_jsx","srcSet","media","src","width","height","alt"],"sources":["@wordpress/edit-site/src/components/welcome-guide/image.js"],"sourcesContent":["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-site-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WelcomeGuideImage","nonAnimatedSrc","animatedSrc","_jsxs","className","children","_jsx","srcSet","media","src","width","height","alt"],"sources":["@wordpress/edit-site/src/components/welcome-guide/image.js"],"sourcesContent":["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-site-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";AAAA,eAAe,SAASA,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC5E,oBACCC,KAAA;IAASC,SAAS,EAAC,gCAAgC;IAAAC,QAAA,gBAClDC,IAAA;MACCC,MAAM,EAAGN,cAAgB;MACzBO,KAAK,EAAC;IAAkC,CACxC,CAAC,eACFF,IAAA;MAAKG,GAAG,EAAGP,WAAa;MAACQ,KAAK,EAAC,KAAK;MAACC,MAAM,EAAC,KAAK;MAACC,GAAG,EAAC;IAAE,CAAE,CAAC;EAAA,CACnD,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -5,9 +5,7 @@ import WelcomeGuideEditor from './editor';
|
|
|
5
5
|
import WelcomeGuideStyles from './styles';
|
|
6
6
|
import WelcomeGuidePage from './page';
|
|
7
7
|
import WelcomeGuideTemplate from './template';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
9
|
export default function WelcomeGuide() {
|
|
12
10
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
13
11
|
children: [/*#__PURE__*/_jsx(WelcomeGuideEditor, {}), /*#__PURE__*/_jsx(WelcomeGuideStyles, {}), /*#__PURE__*/_jsx(WelcomeGuidePage, {}), /*#__PURE__*/_jsx(WelcomeGuideTemplate, {})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuidePage","WelcomeGuideTemplate","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","children"],"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport WelcomeGuidePage from './page';\nimport WelcomeGuideTemplate from './template';\n\nexport default function WelcomeGuide() {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t\t<WelcomeGuidePage />\n\t\t\t<WelcomeGuideTemplate />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAkB,MAAM,UAAU;AACzC,OAAOC,kBAAkB,MAAM,UAAU;AACzC,OAAOC,gBAAgB,MAAM,QAAQ;AACrC,OAAOC,oBAAoB,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuidePage","WelcomeGuideTemplate","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","children"],"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport WelcomeGuidePage from './page';\nimport WelcomeGuideTemplate from './template';\n\nexport default function WelcomeGuide() {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t\t<WelcomeGuidePage />\n\t\t\t<WelcomeGuideTemplate />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAkB,MAAM,UAAU;AACzC,OAAOC,kBAAkB,MAAM,UAAU;AACzC,OAAOC,gBAAgB,MAAM,QAAQ;AACrC,OAAOC,oBAAoB,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,oBACCD,KAAA,CAAAF,SAAA;IAAAI,QAAA,gBACCN,IAAA,CAACL,kBAAkB,IAAE,CAAC,eACtBK,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,gBAAgB,IAAE,CAAC,eACpBG,IAAA,CAACF,oBAAoB,IAAE,CAAC;EAAA,CACvB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -10,9 +10,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { store as editSiteStore } from '../../store';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
14
|
export default function WelcomeGuidePage() {
|
|
17
15
|
const {
|
|
18
16
|
toggle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","isPage","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","type","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && isPage();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editSiteStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","isPage","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","type","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\tconst { isPage } = select( editSiteStore );\n\t\treturn isPageActive && ! isEditorActive && isPage();\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;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AAA,CAAAF,SAAA;QAAAuB,QAAA,gBACCzB,IAAA;UAAIc,SAAS,EAAC,kCAAkC;UAAAW,QAAA,EAC7CZ;QAAO,CACN,CAAC,eACLb,IAAA;UAAGc,SAAS,EAAC,+BAA+B;UAAAW,QAAA,EACzC9B,EAAE,CACH,uLACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -12,9 +12,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
|
12
12
|
*/
|
|
13
13
|
import WelcomeGuideImage from './image';
|
|
14
14
|
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
16
|
const {
|
|
19
17
|
interfaceStore
|
|
20
18
|
} = unlock(editorPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","ExternalLink","Guide","__","store","preferencesStore","privateApis","editorPrivateApis","WelcomeGuideImage","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceStore","WelcomeGuideStyles","toggle","isActive","isStylesOpen","select","sidebar","getActiveComplementaryArea","get","welcomeLabel","className","contentLabel","finishButtonText","onFinish","pages","image","nonAnimatedSrc","animatedSrc","content","children","href"],"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function WelcomeGuideStyles() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isStylesOpen } = useSelect( ( select ) => {\n\t\tconst sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuideStyles'\n\t\t\t),\n\t\t\tisStylesOpen: sidebar === 'edit-site/global-styles',\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isStylesOpen ) {\n\t\treturn null;\n\t}\n\n\tconst welcomeLabel = __( 'Welcome to Styles' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-styles\"\n\t\t\tcontentLabel={ welcomeLabel }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuideStyles' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ welcomeLabel }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Set the design' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Personalize blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to block themes and styling your site?'\n\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/styles-overview/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Here’s a detailed guide to learn how to make the most of it.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,SAAS;AACvC,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","ExternalLink","Guide","__","store","preferencesStore","privateApis","editorPrivateApis","WelcomeGuideImage","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceStore","WelcomeGuideStyles","toggle","isActive","isStylesOpen","select","sidebar","getActiveComplementaryArea","get","welcomeLabel","className","contentLabel","finishButtonText","onFinish","pages","image","nonAnimatedSrc","animatedSrc","content","children","href"],"sources":["@wordpress/edit-site/src/components/welcome-guide/styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function WelcomeGuideStyles() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isStylesOpen } = useSelect( ( select ) => {\n\t\tconst sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuideStyles'\n\t\t\t),\n\t\t\tisStylesOpen: sidebar === 'edit-site/global-styles',\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isStylesOpen ) {\n\t\treturn null;\n\t}\n\n\tconst welcomeLabel = __( 'Welcome to Styles' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-styles\"\n\t\t\tcontentLabel={ welcomeLabel }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuideStyles' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-to-styles.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ welcomeLabel }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/set-the-design.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Set the design' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/personalize-blocks.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Personalize blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to block themes and styling your site?'\n\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/styles-overview/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Here’s a detailed guide to learn how to make the most of it.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,SAAS;AACvC,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAe,CAAC,GAAGP,MAAM,CAAEF,iBAAkB,CAAC;AAEtD,eAAe,SAASU,kBAAkBA,CAAA,EAAG;EAC5C,MAAM;IAAEC;EAAO,CAAC,GAAGnB,WAAW,CAAEM,gBAAiB,CAAC;EAElD,MAAM;IAAEc,QAAQ;IAAEC;EAAa,CAAC,GAAGpB,SAAS,CAAIqB,MAAM,IAAM;IAC3D,MAAMC,OAAO,GACZD,MAAM,CAAEL,cAAe,CAAC,C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AAA;UAAGe,SAAS,EAAC,+BAA+B;UAAAS,QAAA,EACzChC,EAAE,CACH,6JACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC,EACD;MACC4B,KAAK,eACJpB,IAAA,CAACH,iBAAiB;QACjBwB,cAAc,EAAC,8DAA8D;QAC7EC,WAAW,EAAC;MAA8D,CAC1E,CACD;MACDC,OAAO,eACNnB,KAAA,CAAAF,SAAA;QAAAsB,QAAA,gBACCxB,IAAA;UAAIe,SAAS,EAAC,kCAAkC;UAAAS,QAAA,EAC7ChC,EAAE,CAAE,oBAAqB;QAAC,CACzB,CAAC,eACLQ,IAAA;UAAGe,SAAS,EAAC,+BAA+B;UAAAS,QAAA,EACzChC,EAAE,CACH,qLACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC,EACD;MACC4B,KAAK,eACJpB,IAAA,CAACH,iBAAiB;QACjBwB,cAAc,EAAC,+DAA+D;QAC9EC,WAAW,EAAC;MAA+D,CAC3E,CACD;MACDC,OAAO,eACNnB,KAAA,CAAAF,SAAA;QAAAsB,QAAA,gBACCxB,IAAA;UAAIe,SAAS,EAAC,kCAAkC;UAAAS,QAAA,EAC7ChC,EAAE,CAAE,YAAa;QAAC,CACjB,CAAC,eACLY,KAAA;UAAGW,SAAS,EAAC,+BAA+B;UAAAS,QAAA,GACzChC,EAAE,CACH,4CACD,CAAC,EAAI,GAAG,eACRQ,IAAA,CAACV,YAAY;YACZmC,IAAI,EAAGjC,EAAE,CACR,8DACD,CAAG;YAAAgC,QAAA,EAEDhC,EAAE,CACH,8DACD;UAAC,CACY,CAAC;QAAA,CACb,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -11,9 +11,7 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
15
|
export default function WelcomeGuideTemplate() {
|
|
18
16
|
const {
|
|
19
17
|
toggle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editorStore","useEditedEntityRecord","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuideTemplate","toggle","isLoaded","record","isPostTypeTemplate","type","isActive","hasPreviousEntity","select","getEditorSettings","get","onNavigateToPreviousEntityRecord","isVisible","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isLoaded, record } = useEditedEntityRecord();\n\tconst isPostTypeTemplate = isLoaded && record.type === 'wp_template';\n\tconst { isActive, hasPreviousEntity } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),\n\t\t\thasPreviousEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst isVisible = isActive && isPostTypeTemplate && hasPreviousEntity;\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editorStore","useEditedEntityRecord","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuideTemplate","toggle","isLoaded","record","isPostTypeTemplate","type","isActive","hasPreviousEntity","select","getEditorSettings","get","onNavigateToPreviousEntityRecord","isVisible","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isLoaded, record } = useEditedEntityRecord();\n\tconst isPostTypeTemplate = isLoaded && record.type === 'wp_template';\n\tconst { isActive, hasPreviousEntity } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),\n\t\t\thasPreviousEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst isVisible = isActive && isPostTypeTemplate && hasPreviousEntity;\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,S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P;MACCC,KAAK,eACJxB,IAAA;QACCmB,SAAS,EAAC,gCAAgC;QAC1CM,QAAQ;QACRC,IAAI;QACJC,KAAK;QACLC,KAAK,EAAC,KAAK;QACXC,MAAM,EAAC,KAAK;QAAAC,QAAA,eAEZ9B,IAAA;UACC+B,GAAG,EAAC,+DAA+D;UACnErB,IAAI,EAAC;QAAW,CAChB;MAAC,CACI,CACP;MACDsB,OAAO,eACN5B,KAAA,CAAAF,SAAA;QAAA4B,QAAA,gBACC9B,IAAA;UAAImB,SAAS,EAAC,kCAAkC;UAAAW,QAAA,EAC7CZ;QAAO,CACN,CAAC,eACLlB,IAAA;UAAGmB,SAAS,EAAC,+BAA+B;UAAAW,QAAA,EACzCpC,EAAE,CACH,4MACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PluginMoreMenuItem","EditorPluginMoreMenuItem","PluginSidebar","EditorPluginSidebar","PluginSidebarMoreMenuItem","EditorPluginSidebarMoreMenuItem","getPath","deprecated","jsx","_jsx","isSiteEditor","window","location","href","includes","deprecateSlot","name","since","alternative","props"],"sources":["@wordpress/edit-site/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,wBAAwB,EAC9CC,aAAa,IAAIC,mBAAmB,EACpCC,yBAAyB,IAAIC,+BAA+B,QACtD,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,YAAY,GAAGJ,OAAO,CAAEK,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC,EAAEC,QAAQ,CAC7D,iBACD,CAAC;AAED,MAAMC,aAAa,GAAKC,IAAI,IAAM;EACjCT,UAAU,
|
|
1
|
+
{"version":3,"names":["PluginMoreMenuItem","EditorPluginMoreMenuItem","PluginSidebar","EditorPluginSidebar","PluginSidebarMoreMenuItem","EditorPluginSidebarMoreMenuItem","getPath","deprecated","jsx","_jsx","isSiteEditor","window","location","href","includes","deprecateSlot","name","since","alternative","props"],"sources":["@wordpress/edit-site/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,wBAAwB,EAC9CC,aAAa,IAAIC,mBAAmB,EACpCC,yBAAyB,IAAIC,+BAA+B,QACtD,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,YAAY,GAAGJ,OAAO,CAAEK,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC,EAAEC,QAAQ,CAC7D,iBACD,CAAC;AAED,MAAMC,aAAa,GAAKC,IAAI,IAAM;EACjCT,UAAU,CAAE,eAAgBS,IAAI,EAAG,EAAE;IACpCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,aAAcF,IAAI;EAChC,CAAE,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAAShB,kBAAkBA,CAAEmB,KAAK,EAAG;EAC3C,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,oBAAqB,CAAC;EACrC,oBAAON,IAAA,CAACR,wBAAwB;IAAA,GAAMkB;EAAK,CAAI,CAAC;AACjD;;AAEA;AACA;AACA;AACA,OAAO,SAASjB,aAAaA,CAAEiB,KAAK,EAAG;EACtC,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,eAAgB,CAAC;EAChC,oBAAON,IAAA,CAACN,mBAAmB;IAAA,GAAMgB;EAAK,CAAI,CAAC;AAC5C;;AAEA;AACA;AACA;AACA,OAAO,SAASf,yBAAyBA,CAAEe,KAAK,EAAG;EAClD,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,2BAA4B,CAAC;EAC5C,oBAAON,IAAA,CAACJ,+BAA+B;IAAA,GAAMc;EAAK,CAAI,CAAC;AACxD;AACA","ignoreList":[]}
|
|
@@ -66,7 +66,7 @@ function usePageContentFocusCommands() {
|
|
|
66
66
|
if (currentPostType !== 'wp_template') {
|
|
67
67
|
commands.push({
|
|
68
68
|
name: 'core/switch-to-template-focus',
|
|
69
|
-
label: sprintf(
|
|
69
|
+
label: sprintf(/* translators: %s: template title */
|
|
70
70
|
__('Edit template: %s'), decodeEntities(template.title)),
|
|
71
71
|
icon: layout,
|
|
72
72
|
callback: ({
|
|
@@ -113,8 +113,8 @@ function useManipulateDocumentCommands() {
|
|
|
113
113
|
}
|
|
114
114
|
const commands = [];
|
|
115
115
|
if (isTemplateRevertable(template) && !isEditingPage) {
|
|
116
|
-
const label = template.type === TEMPLATE_POST_TYPE ? sprintf(
|
|
117
|
-
__('Reset template: %s'), decodeEntities(template.title)) : sprintf(
|
|
116
|
+
const label = template.type === TEMPLATE_POST_TYPE ? sprintf(/* translators: %s: template title */
|
|
117
|
+
__('Reset template: %s'), decodeEntities(template.title)) : sprintf(/* translators: %s: template part title */
|
|
118
118
|
__('Reset template part: %s'), decodeEntities(template.title));
|
|
119
119
|
commands.push({
|
|
120
120
|
name: 'core/reset-template',
|
|
@@ -129,8 +129,8 @@ function useManipulateDocumentCommands() {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
if (isTemplateRemovable(template) && !isEditingPage) {
|
|
132
|
-
const label = template.type === TEMPLATE_POST_TYPE ? sprintf(
|
|
133
|
-
__('Delete template: %s'), decodeEntities(template.title)) : sprintf(
|
|
132
|
+
const label = template.type === TEMPLATE_POST_TYPE ? sprintf(/* translators: %s: template title */
|
|
133
|
+
__('Delete template: %s'), decodeEntities(template.title)) : sprintf(/* translators: %s: template part title */
|
|
134
134
|
__('Delete template part: %s'), decodeEntities(template.title));
|
|
135
135
|
commands.push({
|
|
136
136
|
name: 'core/remove-template',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","trash","rotateLeft","rotateRight","layout","page","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","editorStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","unlock","TEMPLATE_POST_TYPE","useLink","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","useEditModeCommands","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport { trash, rotateLeft, rotateRight, layout, page } from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: sprintf(\n\t\t\t\t/* translators: %s: template title */\n\t\t\t\t__( 'Edit template: %s' ),\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\teditTemplate();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getCurrentPostType() !== 'wp_template',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Reset template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Reset template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Delete template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Delete template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: template.type,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SAASC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC/E,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBA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AAS,EAAE,KAAK;MAAEC,QAAQ,EAAE;IAAG,CAAC;EAC1C;EAEA,MAAMA,QAAQ,GAAG,EAAE;EAEnB,IAAKZ,eAAe,KAAK,aAAa,EAAG;IACxCY,QAAQ,CAACC,IAAI,CAAE;MACdC,IAAI,EAAE,+BAA+B;MACrCC,KAAK,EAAE1C,OAAO,
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","trash","rotateLeft","rotateRight","layout","page","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","editorStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","unlock","TEMPLATE_POST_TYPE","useLink","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","useEditModeCommands","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport { trash, rotateLeft, rotateRight, layout, page } from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: sprintf(\n\t\t\t\t/* translators: %s: template title */\n\t\t\t\t__( 'Edit template: %s' ),\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\teditTemplate();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getCurrentPostType() !== 'wp_template',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Reset template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Reset template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Delete template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Delete template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType: template.type,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SAASC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAEC,IAAI,QAAQ,kBAAkB;AAC/E,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,2CAA2C;AAC7E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,OAAO,QAAQ,8BAA8B;AAEtD,MAAM;EAAEC;AAAW,CAAC,GAAGH,MAAM,CAAEP,iBAAkB,CAAC;AAElD,SAASW,2BAA2BA,CAAA,EAAG;EACtC,MAAM;IAAEC,MAAM,EAAEC;EAAS,CAAC,GAAGT,qBAAqB,CAAC,CAAC;EACpD,MAAM;IAAEU,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAgB,CAAC,GAAG9B,SAAS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I,EAAER;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -19,9 +19,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
19
19
|
import { useSupportedStyles } from '../../components/global-styles/hooks';
|
|
20
20
|
import { unlock } from '../../lock-unlock';
|
|
21
21
|
import setNestedValue from '../../utils/set-nested-value';
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
23
|
const {
|
|
26
24
|
cleanEmptyObject,
|
|
27
25
|
GlobalStylesContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addFilter","createHigherOrderComponent","InspectorAdvancedControls","store","blockEditorStore","privateApis","blockEditorPrivateApis","useBlockEditingMode","BaseControl","Button","__","sprintf","__EXPERIMENTAL_STYLE_PROPERTY","getBlockType","hasBlockSupport","useContext","useMemo","useCallback","useDispatch","useSelect","noticesStore","coreStore","useSupportedStyles","unlock","setNestedValue","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","cleanEmptyObject","GlobalStylesContext","STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","blockUserConfig","styles","blocks","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","__unstableMarkNextChangeAsNotPersistent","createSuccessNotice","pushChanges","length","blockStyles","newBlockStyles","structuredClone","newUserConfig","undefined","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","title","type","actions","label","onClick","__nextHasNoMarginBottom","className","help","children","VisualLabel","__next40pxDefaultSize","variant","accessibleWhenDisabled","disabled","PushChangesToGlobalStyles","props","blockEditingMode","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","supportsStyles","some","feature","isDisplayed","withPushChangesToGlobalStyles","BlockEdit","isSelected"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAAS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AACY,UAAU,iBAAIvG,IAAA,CAAC0F,yBAAyB;IAAA,GAAMC;EAAK,CAAI,CAAC;AAAA,CAC/D,CAEJ,CAAC;AAEDrH,SAAS,CACR,kBAAkB,EAClB,8CAA8C,EAC9C+H,6BACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["addFilter","createHigherOrderComponent","InspectorAdvancedControls","store","blockEditorStore","privateApis","blockEditorPrivateApis","useBlockEditingMode","BaseControl","Button","__","sprintf","__EXPERIMENTAL_STYLE_PROPERTY","getBlockType","hasBlockSupport","useContext","useMemo","useCallback","useDispatch","useSelect","noticesStore","coreStore","useSupportedStyles","unlock","setNestedValue","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","cleanEmptyObject","GlobalStylesContext","STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","blockUserConfig","styles","blocks","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","__unstableMarkNextChangeAsNotPersistent","createSuccessNotice","pushChanges","length","blockStyles","newBlockStyles","structuredClone","newUserConfig","undefined","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","title","type","actions","label","onClick","__nextHasNoMarginBottom","className","help","children","VisualLabel","__next40pxDefaultSize","variant","accessibleWhenDisabled","disabled","PushChangesToGlobalStyles","props","blockEditingMode","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","supportsStyles","some","feature","isDisplayed","withPushChangesToGlobalStyles","BlockEdit","isSelected"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SACCC,yBAAyB,EACzBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,EACrCC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,6BAA6B,EAC7BC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,UAAU,EAAEC,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A,EAErBpG,EAAE,CAAE,gBAAiB;IAAC,CACjB,CAAC;EAAA,CACG,CAAC;AAEhB;AAEA,SAAS0G,yBAAyBA,CAAEC,KAAK,EAAG;EAC3C,MAAMC,gBAAgB,GAAG/G,mBAAmB,CAAC,CAAC;EAC9C,MAAMgH,iBAAiB,GAAGpG,SAAS,CAChCqG,MAAM,IAAMA,MAAM,CAAEnG,SAAU,CAAC,CAACoG,eAAe,CAAC,CAAC,EAAEC,cAAc,EACnE,EACD,CAAC;EACD,MAAMC,cAAc,GAAGrF,gBAAgB,CAACsF,IAAI,CAAIC,OAAO,IACtD/G,eAAe,CAAEuG,KAAK,CAACxD,IAAI,EAAEgE,OAAQ,CACtC,CAAC;EACD,MAAMC,WAAW,GAChBR,gBAAgB,KAAK,SAAS,IAAIK,cAAc,IAAIJ,iBAAiB;EAEtE,IAAK,CAAEO,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,oBACCpG,IAAA,CAACxB,yBAAyB;IAAA4G,QAAA,eACzBpF,IAAA,CAACwD,gCAAgC;MAAA,GAAMmC;IAAK,CAAI;EAAC,CACvB,CAAC;AAE9B;AAEA,MAAMU,6BAA6B,GAAG9H,0BAA0B,CAC7D+H,SAAS,IAAQX,KAAK,iBACvBzF,KAAA,CAAAE,SAAA;EAAAgF,QAAA,gBACCpF,IAAA,CAACsG,SAAS;IAAA,GAAiBX;EAAK,GAAjB,MAAqB,CAAC,EACnCA,KAAK,CAACY,UAAU,iBAAIvG,IAAA,CAAC0F,yBAAyB;IAAA,GAAMC;EAAK,CAAI,CAAC;AAAA,CAC/D,CAEJ,CAAC;AAEDrH,SAAS,CACR,kBAAkB,EAClB,8CAA8C,EAC9C+H,6BACD,CAAC","ignoreList":[]}
|
package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js
CHANGED
|
@@ -13,6 +13,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
|
+
const EMPTY_ARRAY = [];
|
|
16
17
|
const {
|
|
17
18
|
GlobalStylesContext,
|
|
18
19
|
areGlobalStyleConfigsEqual
|
|
@@ -77,7 +78,7 @@ export function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = [
|
|
|
77
78
|
} = useSelect(select => {
|
|
78
79
|
const _variationsFromTheme = select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
79
80
|
return {
|
|
80
|
-
variationsFromTheme: _variationsFromTheme ||
|
|
81
|
+
variationsFromTheme: _variationsFromTheme || EMPTY_ARRAY
|
|
81
82
|
};
|
|
82
83
|
}, []);
|
|
83
84
|
const {
|