@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
|
@@ -10,7 +10,7 @@ import { useState, useRef } from '@wordpress/element';
|
|
|
10
10
|
import { ResizableBox, Tooltip, __unstableMotion as motion } from '@wordpress/components';
|
|
11
11
|
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
|
|
12
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
+
import { __, isRTL } from '@wordpress/i18n';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -19,9 +19,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
19
19
|
import { store as editSiteStore } from '../../store';
|
|
20
20
|
|
|
21
21
|
// Removes the inline styles in the drag handles.
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
23
|
const HANDLE_STYLES_OVERRIDE = {
|
|
26
24
|
position: undefined,
|
|
27
25
|
userSelect: undefined,
|
|
@@ -140,7 +138,7 @@ function ResizableFrame({
|
|
|
140
138
|
}
|
|
141
139
|
event.preventDefault();
|
|
142
140
|
const step = 20 * (event.shiftKey ? 5 : 1);
|
|
143
|
-
const delta = step * (event.key === 'ArrowLeft' ? 1 : -1);
|
|
141
|
+
const delta = step * (event.key === 'ArrowLeft' ? 1 : -1) * (isRTL() ? -1 : 1);
|
|
144
142
|
const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta), defaultSize.width);
|
|
145
143
|
setFrameSize({
|
|
146
144
|
width: newWidth,
|
|
@@ -160,16 +158,29 @@ function ResizableFrame({
|
|
|
160
158
|
const resizeHandleVariants = {
|
|
161
159
|
hidden: {
|
|
162
160
|
opacity: 0,
|
|
163
|
-
|
|
161
|
+
...(isRTL() ? {
|
|
162
|
+
right: 0
|
|
163
|
+
} : {
|
|
164
|
+
left: 0
|
|
165
|
+
})
|
|
164
166
|
},
|
|
165
167
|
visible: {
|
|
166
168
|
opacity: 1,
|
|
167
|
-
|
|
169
|
+
// Account for the handle's width.
|
|
170
|
+
...(isRTL() ? {
|
|
171
|
+
right: -14
|
|
172
|
+
} : {
|
|
173
|
+
left: -14
|
|
174
|
+
})
|
|
168
175
|
},
|
|
169
176
|
active: {
|
|
170
177
|
opacity: 1,
|
|
171
|
-
left: -14,
|
|
172
178
|
// Account for the handle's width.
|
|
179
|
+
...(isRTL() ? {
|
|
180
|
+
right: -14
|
|
181
|
+
} : {
|
|
182
|
+
left: -14
|
|
183
|
+
}),
|
|
173
184
|
scaleY: 1.3
|
|
174
185
|
}
|
|
175
186
|
};
|
|
@@ -204,10 +215,15 @@ function ResizableFrame({
|
|
|
204
215
|
size: frameSize,
|
|
205
216
|
enable: {
|
|
206
217
|
top: false,
|
|
207
|
-
right: false,
|
|
208
218
|
bottom: false,
|
|
209
219
|
// Resizing will be disabled until the editor content is loaded.
|
|
210
|
-
|
|
220
|
+
...(isRTL() ? {
|
|
221
|
+
right: isReady,
|
|
222
|
+
left: false
|
|
223
|
+
} : {
|
|
224
|
+
left: isReady,
|
|
225
|
+
right: false
|
|
226
|
+
}),
|
|
211
227
|
topRight: false,
|
|
212
228
|
bottomRight: false,
|
|
213
229
|
bottomLeft: false,
|
|
@@ -227,7 +243,7 @@ function ResizableFrame({
|
|
|
227
243
|
onMouseOver: () => setShouldShowHandle(true),
|
|
228
244
|
onMouseOut: () => setShouldShowHandle(false),
|
|
229
245
|
handleComponent: {
|
|
230
|
-
left: canvasMode === 'view' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
246
|
+
[isRTL() ? 'right' : 'left']: canvasMode === 'view' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
231
247
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
232
248
|
text: __('Drag to resize'),
|
|
233
249
|
children: /*#__PURE__*/_jsx(motion.button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useState","useRef","ResizableBox","Tooltip","__unstableMotion","motion","useInstanceId","useReducedMotion","useDispatch","useSelect","__","unlock","store","editSiteStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","FRAME_MIN_WIDTH","FRAME_REFERENCE_WIDTH","FRAME_TARGET_ASPECT_RATIO","SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD","INITIAL_FRAME_SIZE","calculateNewHeight","initialAspectRatio","lerp","a","b","amount","lerpFactor","Math","max","min","intermediateAspectRatio","ResizableFrame","isFullWidth","isOversized","setIsOversized","isReady","children","defaultSize","innerContentStyle","disableMotion","frameSize","setFrameSize","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","canvasMode","select","getCanvasMode","setCanvasMode","FRAME_TRANSITION","type","duration","frameRef","resizableHandleHelpId","defaultAspectRatio","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","as","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","transition","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","text","button","role","className","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style"],"sources":["@wordpress/edit-site/src/components/resizable-frame/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tResizableBox,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\n// The minimum width of the frame (in px) while resizing.\nconst FRAME_MIN_WIDTH = 320;\n// The reference width of the frame (in px) used to calculate the aspect ratio.\nconst FRAME_REFERENCE_WIDTH = 1300;\n// 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.\nconst FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;\n// The minimum distance (in px) between the frame resize handle and the\n// viewport's edge. If the frame is resized to be closer to the viewport's edge\n// than this distance, then \"canvas mode\" will be enabled.\nconst SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;\n// Default size for the `frameSize` state.\nconst INITIAL_FRAME_SIZE = { width: '100%', height: '100%' };\n\nfunction calculateNewHeight( width, initialAspectRatio ) {\n\tconst lerp = ( a, b, amount ) => {\n\t\treturn a + ( b - a ) * amount;\n\t};\n\n\t// Calculate the intermediate aspect ratio based on the current width.\n\tconst lerpFactor =\n\t\t1 -\n\t\tMath.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\t1,\n\t\t\t\t( width - FRAME_MIN_WIDTH ) /\n\t\t\t\t\t( FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH )\n\t\t\t)\n\t\t);\n\n\t// Calculate the height based on the intermediate aspect ratio\n\t// ensuring the frame arrives at the target aspect ratio.\n\tconst intermediateAspectRatio = lerp(\n\t\tinitialAspectRatio,\n\t\tFRAME_TARGET_ASPECT_RATIO,\n\t\tlerpFactor\n\t);\n\n\treturn width / intermediateAspectRatio;\n}\n\nfunction ResizableFrame( {\n\tisFullWidth,\n\tisOversized,\n\tsetIsOversized,\n\tisReady,\n\tchildren,\n\t/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */\n\tdefaultSize,\n\tinnerContentStyle,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );\n\t// The width of the resizable frame when a new resize gesture starts.\n\tconst [ startingWidth, setStartingWidth ] = useState();\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst [ shouldShowHandle, setShouldShowHandle ] = useState( false );\n\tconst [ resizeRatio, setResizeRatio ] = useState( 1 );\n\tconst canvasMode = useSelect(\n\t\t( select ) => unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t[]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };\n\tconst frameRef = useRef( null );\n\tconst resizableHandleHelpId = useInstanceId(\n\t\tResizableFrame,\n\t\t'edit-site-resizable-frame-handle-help'\n\t);\n\tconst defaultAspectRatio = defaultSize.width / defaultSize.height;\n\n\tconst handleResizeStart = ( _event, _direction, ref ) => {\n\t\t// Remember the starting width so we don't have to get `ref.offsetWidth` on\n\t\t// every resize event thereafter, which will cause layout thrashing.\n\t\tsetStartingWidth( ref.offsetWidth );\n\t\tsetIsResizing( true );\n\t};\n\n\t// Calculate the frame size based on the window width as its resized.\n\tconst handleResize = ( _event, _direction, _ref, delta ) => {\n\t\tconst normalizedDelta = delta.width / resizeRatio;\n\t\tconst deltaAbs = Math.abs( normalizedDelta );\n\t\tconst maxDoubledDelta =\n\t\t\tdelta.width < 0 // is shrinking\n\t\t\t\t? deltaAbs\n\t\t\t\t: ( defaultSize.width - startingWidth ) / 2;\n\t\tconst deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );\n\t\tconst doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;\n\t\tconst singleSegment = 1 - doubleSegment;\n\n\t\tsetResizeRatio( singleSegment + doubleSegment * 2 );\n\n\t\tconst updatedWidth = startingWidth + delta.width;\n\n\t\tsetIsOversized( updatedWidth > defaultSize.width );\n\n\t\t// Width will be controlled by the library (via `resizeRatio`),\n\t\t// so we only need to update the height.\n\t\tsetFrameSize( {\n\t\t\theight: isOversized\n\t\t\t\t? '100%'\n\t\t\t\t: calculateNewHeight( updatedWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst handleResizeStop = ( _event, _direction, ref ) => {\n\t\tsetIsResizing( false );\n\n\t\tif ( ! isOversized ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsOversized( false );\n\n\t\tconst remainingWidth =\n\t\t\tref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;\n\n\t\tif ( remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ) {\n\t\t\t// Reset the initial aspect ratio if the frame is resized slightly\n\t\t\t// above the sidebar but not far enough to trigger full screen.\n\t\t\tsetFrameSize( INITIAL_FRAME_SIZE );\n\t\t} else {\n\t\t\t// Trigger full screen if the frame is resized far enough to the left.\n\t\t\tsetCanvasMode( 'edit' );\n\t\t}\n\t};\n\n\t// Handle resize by arrow keys\n\tconst handleResizableHandleKeyDown = ( event ) => {\n\t\tif ( ! [ 'ArrowLeft', 'ArrowRight' ].includes( event.key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tconst step = 20 * ( event.shiftKey ? 5 : 1 );\n\t\tconst delta = step * ( event.key === 'ArrowLeft' ? 1 : -1 );\n\t\tconst newWidth = Math.min(\n\t\t\tMath.max(\n\t\t\t\tFRAME_MIN_WIDTH,\n\t\t\t\tframeRef.current.resizable.offsetWidth + delta\n\t\t\t),\n\t\t\tdefaultSize.width\n\t\t);\n\n\t\tsetFrameSize( {\n\t\t\twidth: newWidth,\n\t\t\theight: calculateNewHeight( newWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst frameAnimationVariants = {\n\t\tdefault: {\n\t\t\tflexGrow: 0,\n\t\t\theight: frameSize.height,\n\t\t},\n\t\tfullWidth: {\n\t\t\tflexGrow: 1,\n\t\t\theight: frameSize.height,\n\t\t},\n\t};\n\n\tconst resizeHandleVariants = {\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t\tleft: 0,\n\t\t},\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\tleft: -14, // Account for the handle's width.\n\t\t},\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\tleft: -14, // Account for the handle's width.\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\tconst currentResizeHandleVariant = ( () => {\n\t\tif ( isResizing ) {\n\t\t\treturn 'active';\n\t\t}\n\t\treturn shouldShowHandle ? 'visible' : 'hidden';\n\t} )();\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tas={ motion.div }\n\t\t\tref={ frameRef }\n\t\t\tinitial={ false }\n\t\t\tvariants={ frameAnimationVariants }\n\t\t\tanimate={ isFullWidth ? 'fullWidth' : 'default' }\n\t\t\tonAnimationComplete={ ( definition ) => {\n\t\t\t\tif ( definition === 'fullWidth' ) {\n\t\t\t\t\tsetFrameSize( { width: '100%', height: '100%' } );\n\t\t\t\t}\n\t\t\t} }\n\t\t\twhileHover={\n\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.5,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}\n\t\t\t}\n\t\t\ttransition={ FRAME_TRANSITION }\n\t\t\tsize={ frameSize }\n\t\t\tenable={ {\n\t\t\t\ttop: false,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\t// Resizing will be disabled until the editor content is loaded.\n\t\t\t\tleft: isReady,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t} }\n\t\t\tresizeRatio={ resizeRatio }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t\tminWidth={ FRAME_MIN_WIDTH }\n\t\t\tmaxWidth={ isFullWidth ? '100%' : '150%' }\n\t\t\tmaxHeight=\"100%\"\n\t\t\tonFocus={ () => setShouldShowHandle( true ) }\n\t\t\tonBlur={ () => setShouldShowHandle( false ) }\n\t\t\tonMouseOver={ () => setShouldShowHandle( true ) }\n\t\t\tonMouseOut={ () => setShouldShowHandle( false ) }\n\t\t\thandleComponent={ {\n\t\t\t\tleft: canvasMode === 'view' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t{ /* Disable reason: role=\"separator\" does in fact support aria-valuenow */ }\n\t\t\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */ }\n\t\t\t\t\t\t\t<motion.button\n\t\t\t\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'edit-site-resizable-frame__handle',\n\t\t\t\t\t\t\t\t\t{ 'is-resizing': isResizing }\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\t\t\t\tanimate={ currentResizeHandleVariant }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\t\t\t\taria-valuenow={\n\t\t\t\t\t\t\t\t\tframeRef.current?.resizable?.offsetWidth ||\n\t\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-valuemin={ FRAME_MIN_WIDTH }\n\t\t\t\t\t\t\t\taria-valuemax={ defaultSize.width }\n\t\t\t\t\t\t\t\tonKeyDown={ handleResizableHandleKeyDown }\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<div hidden id={ resizableHandleHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t} }\n\t\t\tonResizeStart={ handleResizeStart }\n\t\t\tonResize={ handleResize }\n\t\t\tonResizeStop={ handleResizeStop }\n\t\t\tclassName={ clsx( 'edit-site-resizable-frame__inner', {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tshowHandle={ false } // Do not show the default handle, as we're using a custom one.\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-resizable-frame__inner-content\"\n\t\t\t\tstyle={ innerContentStyle }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableFrame;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,OAAO,EACPC,gBAAgB,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uB;YAC1C,iBACCD,QAAQ,CAAC+B,OAAO,EAAEC,SAAS,EAAEzB,WAAW,IACxC1D,SACA;YACD,iBAAgBS,eAAiB;YACjC,iBAAgBsB,WAAW,CAAC5B,KAAO;YACnC2H,SAAS,EAAGpD,4BAA8B;YAC1CuB,OAAO,EAAC,QAAQ;YAChB8B,IAAI,EAAC,QAAQ;YACbC,UAAU,EAAC,QAAQ;YACnB1B,UAAU,EAAC;UAAQ,GArBf,QAsBJ;QAAC,CACM,CAAC,eACV7G,IAAA;UAAKgG,MAAM;UAACwC,EAAE,EAAG7E,qBAAuB;UAAAtB,QAAA,EACrC1C,EAAE,CACH,gGACD;QAAC,CACG,CAAC;MAAA,CACL;IAEJ,CAAG;IACH8I,aAAa,EAAG5E,iBAAmB;IACnC6E,QAAQ,EAAGxE,YAAc;IACzByE,YAAY,EAAG9D,gBAAkB;IACjCuD,SAAS,EAAGpJ,IAAI,CAAE,kCAAkC,EAAE;MACrD,aAAa,EAAE6D;IAChB,CAAE,CAAG;IACL+F,UAAU,EAAG,KAAO,CAAC;IAAA;IAAAvG,QAAA,eAErBrC,IAAA;MACCoI,SAAS,EAAC,0CAA0C;MACpDS,KAAK,EAAGtG,iBAAmB;MAAAF,QAAA,EAEzBA;IAAQ,CACN;EAAC,CACO,CAAC;AAEjB;AAEA,eAAeL,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useState","useRef","ResizableBox","Tooltip","__unstableMotion","motion","useInstanceId","useReducedMotion","useDispatch","useSelect","__","isRTL","unlock","store","editSiteStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","FRAME_MIN_WIDTH","FRAME_REFERENCE_WIDTH","FRAME_TARGET_ASPECT_RATIO","SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD","INITIAL_FRAME_SIZE","calculateNewHeight","initialAspectRatio","lerp","a","b","amount","lerpFactor","Math","max","min","intermediateAspectRatio","ResizableFrame","isFullWidth","isOversized","setIsOversized","isReady","children","defaultSize","innerContentStyle","disableMotion","frameSize","setFrameSize","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","canvasMode","select","getCanvasMode","setCanvasMode","FRAME_TRANSITION","type","duration","frameRef","resizableHandleHelpId","defaultAspectRatio","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","as","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","transition","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","text","button","role","className","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style"],"sources":["@wordpress/edit-site/src/components/resizable-frame/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tResizableBox,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\n// The minimum width of the frame (in px) while resizing.\nconst FRAME_MIN_WIDTH = 320;\n// The reference width of the frame (in px) used to calculate the aspect ratio.\nconst FRAME_REFERENCE_WIDTH = 1300;\n// 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.\nconst FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;\n// The minimum distance (in px) between the frame resize handle and the\n// viewport's edge. If the frame is resized to be closer to the viewport's edge\n// than this distance, then \"canvas mode\" will be enabled.\nconst SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;\n// Default size for the `frameSize` state.\nconst INITIAL_FRAME_SIZE = { width: '100%', height: '100%' };\n\nfunction calculateNewHeight( width, initialAspectRatio ) {\n\tconst lerp = ( a, b, amount ) => {\n\t\treturn a + ( b - a ) * amount;\n\t};\n\n\t// Calculate the intermediate aspect ratio based on the current width.\n\tconst lerpFactor =\n\t\t1 -\n\t\tMath.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\t1,\n\t\t\t\t( width - FRAME_MIN_WIDTH ) /\n\t\t\t\t\t( FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH )\n\t\t\t)\n\t\t);\n\n\t// Calculate the height based on the intermediate aspect ratio\n\t// ensuring the frame arrives at the target aspect ratio.\n\tconst intermediateAspectRatio = lerp(\n\t\tinitialAspectRatio,\n\t\tFRAME_TARGET_ASPECT_RATIO,\n\t\tlerpFactor\n\t);\n\n\treturn width / intermediateAspectRatio;\n}\n\nfunction ResizableFrame( {\n\tisFullWidth,\n\tisOversized,\n\tsetIsOversized,\n\tisReady,\n\tchildren,\n\t/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */\n\tdefaultSize,\n\tinnerContentStyle,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );\n\t// The width of the resizable frame when a new resize gesture starts.\n\tconst [ startingWidth, setStartingWidth ] = useState();\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst [ shouldShowHandle, setShouldShowHandle ] = useState( false );\n\tconst [ resizeRatio, setResizeRatio ] = useState( 1 );\n\tconst canvasMode = useSelect(\n\t\t( select ) => unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t[]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };\n\tconst frameRef = useRef( null );\n\tconst resizableHandleHelpId = useInstanceId(\n\t\tResizableFrame,\n\t\t'edit-site-resizable-frame-handle-help'\n\t);\n\tconst defaultAspectRatio = defaultSize.width / defaultSize.height;\n\n\tconst handleResizeStart = ( _event, _direction, ref ) => {\n\t\t// Remember the starting width so we don't have to get `ref.offsetWidth` on\n\t\t// every resize event thereafter, which will cause layout thrashing.\n\t\tsetStartingWidth( ref.offsetWidth );\n\t\tsetIsResizing( true );\n\t};\n\n\t// Calculate the frame size based on the window width as its resized.\n\tconst handleResize = ( _event, _direction, _ref, delta ) => {\n\t\tconst normalizedDelta = delta.width / resizeRatio;\n\t\tconst deltaAbs = Math.abs( normalizedDelta );\n\t\tconst maxDoubledDelta =\n\t\t\tdelta.width < 0 // is shrinking\n\t\t\t\t? deltaAbs\n\t\t\t\t: ( defaultSize.width - startingWidth ) / 2;\n\t\tconst deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );\n\t\tconst doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;\n\t\tconst singleSegment = 1 - doubleSegment;\n\n\t\tsetResizeRatio( singleSegment + doubleSegment * 2 );\n\n\t\tconst updatedWidth = startingWidth + delta.width;\n\n\t\tsetIsOversized( updatedWidth > defaultSize.width );\n\n\t\t// Width will be controlled by the library (via `resizeRatio`),\n\t\t// so we only need to update the height.\n\t\tsetFrameSize( {\n\t\t\theight: isOversized\n\t\t\t\t? '100%'\n\t\t\t\t: calculateNewHeight( updatedWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst handleResizeStop = ( _event, _direction, ref ) => {\n\t\tsetIsResizing( false );\n\n\t\tif ( ! isOversized ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsOversized( false );\n\n\t\tconst remainingWidth =\n\t\t\tref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;\n\n\t\tif ( remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ) {\n\t\t\t// Reset the initial aspect ratio if the frame is resized slightly\n\t\t\t// above the sidebar but not far enough to trigger full screen.\n\t\t\tsetFrameSize( INITIAL_FRAME_SIZE );\n\t\t} else {\n\t\t\t// Trigger full screen if the frame is resized far enough to the left.\n\t\t\tsetCanvasMode( 'edit' );\n\t\t}\n\t};\n\n\t// Handle resize by arrow keys\n\tconst handleResizableHandleKeyDown = ( event ) => {\n\t\tif ( ! [ 'ArrowLeft', 'ArrowRight' ].includes( event.key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tconst step = 20 * ( event.shiftKey ? 5 : 1 );\n\t\tconst delta =\n\t\t\tstep *\n\t\t\t( event.key === 'ArrowLeft' ? 1 : -1 ) *\n\t\t\t( isRTL() ? -1 : 1 );\n\t\tconst newWidth = Math.min(\n\t\t\tMath.max(\n\t\t\t\tFRAME_MIN_WIDTH,\n\t\t\t\tframeRef.current.resizable.offsetWidth + delta\n\t\t\t),\n\t\t\tdefaultSize.width\n\t\t);\n\n\t\tsetFrameSize( {\n\t\t\twidth: newWidth,\n\t\t\theight: calculateNewHeight( newWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst frameAnimationVariants = {\n\t\tdefault: {\n\t\t\tflexGrow: 0,\n\t\t\theight: frameSize.height,\n\t\t},\n\t\tfullWidth: {\n\t\t\tflexGrow: 1,\n\t\t\theight: frameSize.height,\n\t\t},\n\t};\n\n\tconst resizeHandleVariants = {\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t\t...( isRTL() ? { right: 0 } : { left: 0 } ),\n\t\t},\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t},\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\tconst currentResizeHandleVariant = ( () => {\n\t\tif ( isResizing ) {\n\t\t\treturn 'active';\n\t\t}\n\t\treturn shouldShowHandle ? 'visible' : 'hidden';\n\t} )();\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tas={ motion.div }\n\t\t\tref={ frameRef }\n\t\t\tinitial={ false }\n\t\t\tvariants={ frameAnimationVariants }\n\t\t\tanimate={ isFullWidth ? 'fullWidth' : 'default' }\n\t\t\tonAnimationComplete={ ( definition ) => {\n\t\t\t\tif ( definition === 'fullWidth' ) {\n\t\t\t\t\tsetFrameSize( { width: '100%', height: '100%' } );\n\t\t\t\t}\n\t\t\t} }\n\t\t\twhileHover={\n\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.5,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}\n\t\t\t}\n\t\t\ttransition={ FRAME_TRANSITION }\n\t\t\tsize={ frameSize }\n\t\t\tenable={ {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t\t// Resizing will be disabled until the editor content is loaded.\n\t\t\t\t...( isRTL()\n\t\t\t\t\t? { right: isReady, left: false }\n\t\t\t\t\t: { left: isReady, right: false } ),\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t} }\n\t\t\tresizeRatio={ resizeRatio }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t\tminWidth={ FRAME_MIN_WIDTH }\n\t\t\tmaxWidth={ isFullWidth ? '100%' : '150%' }\n\t\t\tmaxHeight=\"100%\"\n\t\t\tonFocus={ () => setShouldShowHandle( true ) }\n\t\t\tonBlur={ () => setShouldShowHandle( false ) }\n\t\t\tonMouseOver={ () => setShouldShowHandle( true ) }\n\t\t\tonMouseOut={ () => setShouldShowHandle( false ) }\n\t\t\thandleComponent={ {\n\t\t\t\t[ isRTL() ? 'right' : 'left' ]: canvasMode === 'view' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t{ /* Disable reason: role=\"separator\" does in fact support aria-valuenow */ }\n\t\t\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */ }\n\t\t\t\t\t\t\t<motion.button\n\t\t\t\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'edit-site-resizable-frame__handle',\n\t\t\t\t\t\t\t\t\t{ 'is-resizing': isResizing }\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\t\t\t\tanimate={ currentResizeHandleVariant }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\t\t\t\taria-valuenow={\n\t\t\t\t\t\t\t\t\tframeRef.current?.resizable?.offsetWidth ||\n\t\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-valuemin={ FRAME_MIN_WIDTH }\n\t\t\t\t\t\t\t\taria-valuemax={ defaultSize.width }\n\t\t\t\t\t\t\t\tonKeyDown={ handleResizableHandleKeyDown }\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<div hidden id={ resizableHandleHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t} }\n\t\t\tonResizeStart={ handleResizeStart }\n\t\t\tonResize={ handleResize }\n\t\t\tonResizeStop={ handleResizeStop }\n\t\t\tclassName={ clsx( 'edit-site-resizable-frame__inner', {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tshowHandle={ false } // Do not show the default handle, as we're using a custom one.\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-resizable-frame__inner-content\"\n\t\t\t\tstyle={ innerContentStyle }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableFrame;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,OAAO,EACPC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,gBAAgB,QAAQ,oBAAoB;AACpE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK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|
|
|
14
14
|
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
16
|
import EditorCanvasContainer from '../editor-canvas-container';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const {
|
|
20
19
|
ExperimentalBlockEditorProvider,
|
|
21
20
|
GlobalStylesContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","editorPrivateApis","useSelect","useContext","useMemo","unlock","EditorCanvasContainer","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","__unstableBlockStyleVariationOverridesWithConfig","mergeBaseAndUserConfigs","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","title","closeButtonLabel","enableResizing","children","className","name","tabIndex","value","renderAppender","config"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t * Styles are printed inside the block editor provider,\n\t\t\t\t\t\t * so they can access any registered style overrides.\n\t\t\t\t\t\t */ }\n\t\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t\t<__unstableBlockStyleVariationOverridesWithConfig\n\t\t\t\t\t\t\tconfig={ mergedConfig }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,QACpB,yBAAyB;AAChC,SAASP,WAAW,IAAIQ,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;;AAEA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","editorPrivateApis","useSelect","useContext","useMemo","unlock","EditorCanvasContainer","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","__unstableBlockStyleVariationOverridesWithConfig","mergeBaseAndUserConfigs","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","title","closeButtonLabel","enableResizing","children","className","name","tabIndex","value","renderAppender","config"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t{ /*\n\t\t\t\t\t\t * Styles are printed inside the block editor provider,\n\t\t\t\t\t\t * so they can access any registered style overrides.\n\t\t\t\t\t\t */ }\n\t\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t\t<__unstableBlockStyleVariationOverridesWithConfig\n\t\t\t\t\t\t\tconfig={ mergedConfig }\n\t\t\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,+BAA+B;UAC/BkC,KAAK,EAAGlB,mBAAqB;UAC7BM,QAAQ,EAAGA,QAAU;UAAAQ,QAAA,gBAErBjC,IAAA,CAAChB,SAAS;YAACsD,cAAc,EAAG;UAAO,CAAE,CAAC,eAKtCtC,IAAA,CAACV,YAAY;YAACuC,MAAM,EAAGD;UAAc,CAAE,CAAC,eACxC5B,IAAA,CAACM,gDAAgD;YAChDiC,MAAM,EAAGrB;UAAc,CACvB,CAAC;QAAA,CAC8B;MAAC,CACzB,CAAC;IAAA,CACJ;EAAC,CACa,CAAC;AAE1B;AAEA,eAAeL,SAAS","ignoreList":[]}
|
|
@@ -25,13 +25,16 @@ export function useLink(params, state, shouldReplace = false) {
|
|
|
25
25
|
}
|
|
26
26
|
const currentArgs = getQueryArgs(window.location.href);
|
|
27
27
|
const currentUrlWithoutArgs = removeQueryArgs(window.location.href, ...Object.keys(currentArgs));
|
|
28
|
+
let extraParams = {};
|
|
28
29
|
if (isPreviewingTheme()) {
|
|
29
|
-
|
|
30
|
-
...params,
|
|
30
|
+
extraParams = {
|
|
31
31
|
wp_theme_preview: currentlyPreviewingTheme()
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
const newUrl = addQueryArgs(currentUrlWithoutArgs,
|
|
34
|
+
const newUrl = addQueryArgs(currentUrlWithoutArgs, {
|
|
35
|
+
...params,
|
|
36
|
+
...extraParams
|
|
37
|
+
});
|
|
35
38
|
return {
|
|
36
39
|
href: newUrl,
|
|
37
40
|
onClick
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","jsx","_jsx","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","wp_theme_preview","newUrl","Link","children","props"],"sources":["@wordpress/edit-site/src/components/routes/link.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\tfunction onClick( event ) {\n\t\tevent?.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\
|
|
1
|
+
{"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","jsx","_jsx","useHistory","useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","extraParams","wp_theme_preview","newUrl","Link","children","props"],"sources":["@wordpress/edit-site/src/components/routes/link.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function useLink( params, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\tfunction onClick( event ) {\n\t\tevent?.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tlet extraParams = {};\n\tif ( isPreviewingTheme() ) {\n\t\textraParams = {\n\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, {\n\t\t...params,\n\t\t...extraParams,\n\t} );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,MAAM;EAAEC;AAAW,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAElD,OAAO,SAASO,OAAOA,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAa,GAAG,KAAK,EAAG;EAC/D,MAAMC,OAAO,GAAGL,UAAU,CAAC,CAAC;EAC5B,SAASM,OAAOA,CAAEC,KAAK,EAAG;IACzBA,KAAK,EAAEC,cAAc,CAAC,CAAC;IAEvB,IAAKJ,aAAa,EAAG;MACpBC,OAAO,CAACI,OAAO,CAAEP,MAAM,EAAEC,KAAM,CAAC;IACjC,CAAC,MAAM;MACNE,OAAO,CAACK,IAAI,CAAER,MAAM,EAAEC,KAAM,CAAC;IAC9B;EACD;EAEA,MAAMQ,WAAW,GAAGpB,YAAY,CAAEqB,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EACxD,MAAMC,qBAAqB,GAAGvB,eAAe,CAC5CoB,MAAM,CAACC,QAAQ,CAACC,IAAI,EACpB,GAAGE,MAAM,CAACC,IAAI,CAAEN,WAAY,CAC7B,CAAC;EAED,IAAIO,WAAW,GAAG,CAAC,CAAC;EACpB,IAAKtB,iBAAiB,CAAC,CAAC,EAAG;IAC1BsB,WAAW,GAAG;MACbC,gBAAgB,EAAEtB,wBAAwB,CAAC;IAC5C,CAAC;EACF;EAEA,MAAMuB,MAAM,GAAG9B,YAAY,CAAEyB,qBAAqB,EAAE;IACnD,GAAGb,MAAM;IACT,GAAGgB;EACJ,CAAE,CAAC;EAEH,OAAO;IACNJ,IAAI,EAAEM,MAAM;IACZd;EACD,CAAC;AACF;AAEA,eAAe,SAASe,IAAIA,CAAE;EAC7BnB,MAAM,GAAG,CAAC,CAAC;EACXC,KAAK;EACLM,OAAO,EAAEL,aAAa,GAAG,KAAK;EAC9BkB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAET,IAAI;IAAER;EAAQ,CAAC,GAAGL,OAAO,CAAEC,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,oBACCL,IAAA;IAAGe,IAAI,EAAGA,IAAM;IAACR,OAAO,EAAGA,OAAS;IAAA,GAAMiB,KAAK;IAAAD,QAAA,EAC5CA;EAAQ,CACR,CAAC;AAEN","ignoreList":[]}
|
|
@@ -30,7 +30,7 @@ export default function useTitle(title) {
|
|
|
30
30
|
}
|
|
31
31
|
if (title && siteTitle) {
|
|
32
32
|
// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68
|
|
33
|
-
const formattedTitle = sprintf(
|
|
33
|
+
const formattedTitle = sprintf(/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */
|
|
34
34
|
__('%1$s ‹ %2$s ‹ Editor — WordPress'), decodeEntities(title), decodeEntities(siteTitle));
|
|
35
35
|
document.title = formattedTitle;
|
|
36
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useSelect","store","coreStore","__","sprintf","speak","decodeEntities","privateApis","routerPrivateApis","unlock","useLocation","useTitle","title","location","siteTitle","select","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s ‹ Editor — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak( title, 'assertive' );\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAY,CAAC,GAAGD,MAAM,CAAED,iBAAkB,CAAC;AAEnD,eAAe,SAASG,QAAQA,CAAEC,KAAK,EAAG;EACzC,MAAMC,QAAQ,GAAGH,WAAW,CAAC,CAAC;EAC9B,MAAMI,SAAS,GAAGd,SAAS,CACxBe,MAAM,IACPA,MAAM,CAAEb,SAAU,CAAC,CAACc,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC,EAAEJ,KAAK,EAC7D,EACD,CAAC;EACD,MAAMK,oBAAoB,GAAGlB,MAAM,CAAE,IAAK,CAAC;EAE3CD,SAAS,CAAE,MAAM;IAChBmB,oBAAoB,CAACC,OAAO,GAAG,KAAK;EACrC,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjBf,SAAS,CAAE,MAAM;IAChB;IACA,IAAKmB,oBAAoB,CAACC,OAAO,EAAG;MACnC;IACD;IAEA,IAAKN,KAAK,IAAIE,SAAS,EAAG;MACzB;MACA,MAAMK,cAAc,GAAGf,OAAO,
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useSelect","store","coreStore","__","sprintf","speak","decodeEntities","privateApis","routerPrivateApis","unlock","useLocation","useTitle","title","location","siteTitle","select","getEntityRecord","isInitialLocationRef","current","formattedTitle","document"],"sources":["@wordpress/edit-site/src/components/routes/use-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function useTitle( title ) {\n\tconst location = useLocation();\n\tconst siteTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', 'site' )?.title,\n\t\t[]\n\t);\n\tconst isInitialLocationRef = useRef( true );\n\n\tuseEffect( () => {\n\t\tisInitialLocationRef.current = false;\n\t}, [ location ] );\n\n\tuseEffect( () => {\n\t\t// Don't update or announce the title for initial page load.\n\t\tif ( isInitialLocationRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( title && siteTitle ) {\n\t\t\t// @see https://github.com/WordPress/wordpress-develop/blob/94849898192d271d533e09756007e176feb80697/src/wp-admin/admin-header.php#L67-L68\n\t\t\tconst formattedTitle = sprintf(\n\t\t\t\t/* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */\n\t\t\t\t__( '%1$s ‹ %2$s ‹ Editor — WordPress' ),\n\t\t\t\tdecodeEntities( title ),\n\t\t\t\tdecodeEntities( siteTitle )\n\t\t\t);\n\n\t\t\tdocument.title = formattedTitle;\n\n\t\t\t// Announce title on route change for screen readers.\n\t\t\tspeak( title, 'assertive' );\n\t\t}\n\t}, [ title, siteTitle, location ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SA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,15 +78,15 @@ export default function SaveButton({
|
|
|
78
78
|
const getLabel = () => {
|
|
79
79
|
if (isPreviewingTheme()) {
|
|
80
80
|
if (isSaving) {
|
|
81
|
-
return sprintf(
|
|
81
|
+
return sprintf(/* translators: %s: The name of theme to be activated. */
|
|
82
82
|
__('Activating %s'), previewingThemeName);
|
|
83
83
|
} else if (disabled) {
|
|
84
84
|
return __('Saved');
|
|
85
85
|
} else if (hasDirtyEntities) {
|
|
86
|
-
return sprintf(
|
|
86
|
+
return sprintf(/* translators: %s: The name of theme to be activated. */
|
|
87
87
|
__('Activate %s & Save'), previewingThemeName);
|
|
88
88
|
}
|
|
89
|
-
return sprintf(
|
|
89
|
+
return sprintf(/* translators: %s: The name of theme to be activated. */
|
|
90
90
|
__('Activate %s'), previewingThemeName);
|
|
91
91
|
}
|
|
92
92
|
if (isSaving) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","Button","__","_n","sprintf","store","coreStore","displayShortcut","privateApis","routerPrivateApis","useEntitiesSavedStatesIsDirty","editorStore","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","unlock","jsx","_jsx","useLocation","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","saveDirtyEntities","dirtyEntityRecords","isSaving","isSaveViewOpen","previewingThemeName","select","isSavingEntityRecord","isResolving","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","getLabel","label","onClick","isBusy","shortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,WAAW,IAAIC,iBAAiB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AACC,IAAI,EACXD,MAAM,CAACE,IAAI,EACXF,MAAM,CAACG,GACR,CACD,CAAC,IAAIN,iBAAiB;MACvBN,cAAc,EAAEK,gBAAgB,CAAC,CAAC;MAClC;MACA;MACAJ,mBAAmB,EAAEM,0BAA0B,GAC5CL,MAAM,CAAE5B,SAAU,CAAC,CAACuC,QAAQ,CAAEN,0BAA2B,CAAC,EACxDI,IAAI,EAAEG,QAAQ,GAChBC;IACJ,CAAC;EACF,CAAC,EACD,CAAEjB,kBAAkB,CACrB,CAAC;EACD,MAAMkB,gBAAgB,GAAG,CAAC,CAAElB,kBAAkB,CAACmB,MAAM;EACrD,IAAIC,wBAAwB;EAC5B;EACA;EACA;EACA,IAAKpB,kBAAkB,CAACmB,MAAM,KAAK,CAAC,EAAG;IACtC,IAAKtB,MAAM,CAACwB,MAAM,EAAG;MACpBD,wBAAwB,
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","Button","__","_n","sprintf","store","coreStore","displayShortcut","privateApis","routerPrivateApis","useEntitiesSavedStatesIsDirty","editorStore","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","unlock","jsx","_jsx","useLocation","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","saveDirtyEntities","dirtyEntityRecords","isSaving","isSaveViewOpen","previewingThemeName","select","isSavingEntityRecord","isResolving","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","getLabel","label","onClick","isBusy","shortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mB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EAAGA,IAAM;IAAAqC,QAAA,EAEXL;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
|
|
@@ -20,8 +20,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
20
20
|
import { useActivateTheme } from '../../utils/use-activate-theme';
|
|
21
21
|
import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
|
|
22
22
|
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
24
|
const {
|
|
26
25
|
EntitiesSavedStatesExtensible,
|
|
27
26
|
NavigableRegion
|
|
@@ -40,7 +39,7 @@ const EntitiesSavedStatesForPreview = ({
|
|
|
40
39
|
const currentTheme = useActualCurrentTheme();
|
|
41
40
|
const previewingTheme = useSelect(select => select(coreStore).getCurrentTheme(), []);
|
|
42
41
|
const additionalPrompt = /*#__PURE__*/_jsx("p", {
|
|
43
|
-
children: sprintf(
|
|
42
|
+
children: sprintf(/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */
|
|
44
43
|
__('Saving your changes will change your active theme from %1$s to %2$s.'), (_currentTheme$name$re = currentTheme?.name?.rendered) !== null && _currentTheme$name$re !== void 0 ? _currentTheme$name$re : '...', (_previewingTheme$name = previewingTheme?.name?.rendered) !== null && _previewingTheme$name !== void 0 ? _previewingTheme$name : '...')
|
|
45
44
|
});
|
|
46
45
|
const activateTheme = useActivateTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","jsx","_jsx","jsxs","_jsxs","EntitiesSavedStatesExtensible","NavigableRegion","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","children","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,qBAAqB,QAAQ,sCAAsC;AAC5E,SAASC,iBAAiB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["clsx","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","jsx","_jsx","jsxs","_jsxs","EntitiesSavedStatesExtensible","NavigableRegion","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","children","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }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AAG9D,EAAE,CAAE,YAAa,CAAG;IAAA2B,QAAA,gBAEhCjB,IAAA;MACC8C,SAAS,EAAGhE,IAAI,CAAE,qCAAqC,EAAE;QACxD,oBAAoB,EAAEgD;MACvB,CAAE,CAAG;MAAAb,QAAA,eAELjB,IAAA,CAACjB,MAAM;QACNsE,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBR,SAAS,EAAC,4CAA4C;QACtDS,OAAO,EAAGA,CAAA,KAAMV,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBM,QAAQ,EAAGA,QAAU;QACrBK,sBAAsB;QAAAvC,QAAA,EAEpB3B,EAAE,CAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJwC,cAAc,iBACf9B,IAAA,CAAC0B,oBAAoB;MAACpB,OAAO,EAAGA,OAAS;MAACqB,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ import { Button } from '@wordpress/components';
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export default function SidebarButton(props) {
|
|
12
12
|
return /*#__PURE__*/_jsx(Button, {
|
|
13
|
-
|
|
13
|
+
size: "compact",
|
|
14
14
|
...props,
|
|
15
15
|
className: clsx('edit-site-sidebar-button', props.className)
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","Button","jsx","_jsx","SidebarButton","props","
|
|
1
|
+
{"version":3,"names":["clsx","Button","jsx","_jsx","SidebarButton","props","size","className"],"sources":["@wordpress/edit-site/src/components/sidebar-button/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\n\nexport default function SidebarButton( props ) {\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'edit-site-sidebar-button', props.className ) }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,oBACCF,IAAA,CAACF,MAAM;IACNK,IAAI,EAAC,SAAS;IAAA,GACTD,KAAK;IACVE,SAAS,EAAGP,IAAI,CAAE,0BAA0B,EAAEK,KAAK,CAACE,SAAU;EAAG,CACjE,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -15,9 +15,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
15
15
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
16
16
|
import { useDefaultViews } from './default-views';
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
19
|
const {
|
|
22
20
|
useHistory
|
|
23
21
|
} = unlock(routerPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","useDefaultViews","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","AddNewItemModalContent","type","setIsAdding","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","defaultViews","postType","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","params","getLocationWithParams","push","activeView","isCustom","children","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst defaultViews = useDefaultViews( { postType: type } );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify( defaultViews[ 0 ].view ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst {\n\t\t\t\t\tparams: { postType },\n\t\t\t\t} = history.getLocationWithParams();\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<AddNewItemModalContent\n\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\tsetIsAdding={ setIsAdding }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,KAAK,EACLC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","useDefaultViews","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useHistory","AddNewItemModalContent","type","setIsAdding","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","defaultViews","postType","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","params","getLocationWithParams","push","activeView","isCustom","children","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\tconst defaultViews = useDefaultViews( { postType: type } );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify( defaultViews[ 0 ].view ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst {\n\t\t\t\t\tparams: { postType },\n\t\t\t\t} = history.getLocationWithParams();\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostType,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<Add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ElDrD,EAAE,CAAE,UAAW;IAAC,CACI,CAAC,EACtBmE,QAAQ,iBACTtD,IAAA,CAACpB,KAAK;MACL+B,KAAK,EAAGxB,EAAE,CAAE,cAAe,CAAG;MAC9BqE,cAAc,EAAGA,CAAA,KAAM;QACtBhD,WAAW,CAAE,KAAM,CAAC;MACrB,CAAG;MAAAgC,QAAA,eAEHxC,IAAA,CAACM,sBAAsB;QACtBC,IAAI,EAAGA,IAAM;QACbC,WAAW,EAAGA;MAAa,CAC3B;IAAC,CACI,CACP;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -15,9 +15,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
15
15
|
import DataViewItem from './dataview-item';
|
|
16
16
|
import AddNewItem from './add-new-view';
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
19
|
const {
|
|
22
20
|
useHistory
|
|
23
21
|
} = unlock(routerPrivateApis);
|