@wordpress/edit-site 6.13.1-next.cd6172eb0.0 → 6.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +1 -0
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +1 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +1 -0
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -0
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +1 -0
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -0
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -0
- package/build/components/global-styles/font-families.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-collection.js +1 -0
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +1 -0
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -0
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- 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 +1 -0
- package/build/components/global-styles/font-library-modal/library-font-details.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/filter-fonts.js +1 -0
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
- 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 +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +1 -0
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +1 -0
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +1 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -0
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -0
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +1 -0
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +3 -2
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +2 -2
- package/build/components/global-styles/preview-typography.js.map +1 -1
- package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +11 -29
- package/build/components/global-styles/preview-wrapper.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -0
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js +1 -0
- package/build/components/global-styles/shadow-utils.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +15 -21
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +1 -0
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +1 -0
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typeset.js +1 -0
- package/build/components/global-styles/typeset.js.map +1 -1
- package/build/components/global-styles/typography-example.js +8 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/ui.js +1 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +1 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +1 -0
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +1 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +1 -0
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/layout/index.js +14 -7
- package/build/components/layout/index.js.map +1 -1
- package/build/components/maybe-editor/index.js +65 -0
- package/build/components/maybe-editor/index.js.map +1 -0
- package/build/components/media/index.js +1 -0
- package/build/components/media/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +2 -47
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -0
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +18 -14
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +1 -0
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +1 -0
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +1 -0
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/fields.js +2 -21
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +38 -41
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +16 -8
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +30 -19
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +1 -0
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +9 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-button/index.js +1 -0
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +1 -0
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +1 -0
- package/build/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build/components/save-panel/index.js +1 -0
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -0
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +1 -0
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +7 -24
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +2 -0
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +1 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +37 -23
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -4
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/site-editor-routes/home.js +4 -2
- package/build/components/site-editor-routes/home.js.map +1 -1
- package/build/components/site-editor-routes/index.js +3 -1
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/stylebook.js +33 -0
- package/build/components/site-editor-routes/stylebook.js.map +1 -0
- package/build/components/site-editor-routes/template-item.js +3 -3
- package/build/components/site-editor-routes/template-item.js.map +1 -1
- package/build/components/site-editor-routes/template-part-item.js +3 -3
- package/build/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build/components/style-book/categories.js +1 -0
- package/build/components/style-book/categories.js.map +1 -1
- package/build/components/style-book/color-examples.js +9 -3
- package/build/components/style-book/color-examples.js.map +1 -1
- package/build/components/style-book/constants.js +0 -1
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +1 -0
- package/build/components/style-book/duotone-examples.js.map +1 -1
- package/build/components/style-book/examples.js +48 -30
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +103 -24
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build/store/reducer.js +1 -0
- package/build/store/reducer.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js +1 -0
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build/utils/set-nested-value.js +1 -0
- package/build/utils/set-nested-value.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +1 -0
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -0
- 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 -0
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +1 -0
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -0
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -0
- package/build-module/components/global-styles/font-families.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-collection.js +1 -0
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -0
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +1 -0
- 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 +1 -0
- 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 -0
- 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/upload-fonts.js +1 -0
- 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/filter-fonts.js +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
- 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 +1 -0
- 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/make-families-from-faces.js +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +1 -0
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +1 -0
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +1 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -0
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -0
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +1 -0
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +3 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +2 -2
- package/build-module/components/global-styles/preview-typography.js.map +1 -1
- package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +13 -31
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -0
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js +1 -0
- package/build-module/components/global-styles/shadow-utils.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +16 -22
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +1 -0
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +1 -0
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset.js +1 -0
- package/build-module/components/global-styles/typeset.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +8 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/ui.js +1 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +1 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +1 -0
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -0
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/layout/index.js +14 -7
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/maybe-editor/index.js +59 -0
- package/build-module/components/maybe-editor/index.js.map +1 -0
- package/build-module/components/media/index.js +1 -0
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +3 -48
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -0
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +16 -12
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +1 -0
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +1 -0
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -20
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +37 -40
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +16 -8
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +31 -20
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +1 -0
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +9 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-button/index.js +1 -0
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +1 -0
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +1 -0
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +1 -0
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -0
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +1 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +7 -24
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -0
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +1 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +39 -25
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -4
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/site-editor-routes/home.js +4 -2
- package/build-module/components/site-editor-routes/home.js.map +1 -1
- package/build-module/components/site-editor-routes/index.js +3 -1
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/stylebook.js +25 -0
- package/build-module/components/site-editor-routes/stylebook.js.map +1 -0
- package/build-module/components/site-editor-routes/template-item.js +3 -3
- package/build-module/components/site-editor-routes/template-item.js.map +1 -1
- package/build-module/components/site-editor-routes/template-part-item.js +3 -3
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build-module/components/style-book/categories.js +1 -0
- package/build-module/components/style-book/categories.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +9 -3
- package/build-module/components/style-book/color-examples.js.map +1 -1
- package/build-module/components/style-book/constants.js +0 -1
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +1 -0
- package/build-module/components/style-book/duotone-examples.js.map +1 -1
- package/build-module/components/style-book/examples.js +48 -30
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +102 -26
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-module/store/reducer.js +1 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js +1 -0
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/utils/set-nested-value.js +1 -0
- package/build-module/utils/set-nested-value.js.map +1 -1
- package/build-style/posts-rtl.css +92 -117
- package/build-style/posts.css +92 -117
- package/build-style/style-rtl.css +205 -195
- package/build-style/style.css +205 -195
- package/package.json +40 -40
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/global-styles/preview-colors.js +3 -3
- package/src/components/global-styles/preview-styles.js +3 -3
- package/src/components/global-styles/preview-typography.js +3 -3
- package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
- package/src/components/global-styles/shadows-edit-panel.js +20 -21
- package/src/components/global-styles/style.scss +32 -18
- package/src/components/global-styles/typography-example.js +12 -1
- package/src/components/layout/index.js +8 -6
- package/src/components/maybe-editor/index.js +58 -0
- package/src/components/page-patterns/fields.js +2 -59
- package/src/components/page-patterns/index.js +23 -11
- package/src/components/page-patterns/style.scss +0 -28
- package/src/components/page-templates/fields.js +1 -18
- package/src/components/page-templates/index.js +38 -55
- package/src/components/post-edit/index.js +22 -18
- package/src/components/post-list/index.js +49 -43
- package/src/components/post-list/style.scss +0 -36
- package/src/components/resizable-frame/index.js +10 -1
- package/src/components/sidebar-dataviews/default-views.js +7 -24
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-dataviews/style.scss +5 -0
- package/src/components/sidebar-navigation-screen/style.scss +0 -5
- package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
- package/src/components/sidebar-navigation-screen-main/index.js +66 -37
- package/src/components/sidebar-navigation-screen-main/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
- package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/style.scss +4 -0
- package/src/components/site-editor-routes/home.js +2 -2
- package/src/components/site-editor-routes/index.js +2 -0
- package/src/components/site-editor-routes/stylebook.js +28 -0
- package/src/components/site-editor-routes/template-item.js +3 -3
- package/src/components/site-editor-routes/template-part-item.js +3 -3
- package/src/components/style-book/color-examples.tsx +21 -3
- package/src/components/style-book/constants.ts +0 -1
- package/src/components/style-book/examples.tsx +55 -31
- package/src/components/style-book/index.js +145 -38
- package/src/components/style-book/style.scss +4 -0
- package/src/components/style-book/types.ts +1 -1
- package/src/style.scss +4 -1
- package/build/components/error-boundary/index.js +0 -47
- package/build/components/error-boundary/index.js.map +0 -1
- package/build/components/error-boundary/warning.js +0 -42
- package/build/components/error-boundary/warning.js.map +0 -1
- package/build/components/global-styles/preview-iframe.js.map +0 -1
- package/build-module/components/error-boundary/index.js +0 -38
- package/build-module/components/error-boundary/index.js.map +0 -1
- package/build-module/components/error-boundary/warning.js +0 -35
- package/build-module/components/error-boundary/warning.js.map +0 -1
- package/build-module/components/global-styles/preview-iframe.js.map +0 -1
- package/src/components/error-boundary/index.js +0 -44
- package/src/components/error-boundary/test/error-boundary.js +0 -40
- package/src/components/error-boundary/warning.js +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_compose","_i18n","_router","_lockUnlock","_url","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","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","history","path","query","canvas","disableMotion","useReducedMotion","frameSize","setFrameSize","useState","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","FRAME_TRANSITION","type","duration","frameRef","useRef","resizableHandleHelpId","useInstanceId","defaultAspectRatio","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","navigate","addQueryArgs","transition","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","isRTL","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","jsx","ResizableBox","as","motion","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","jsxs","Fragment","Tooltip","text","__","__unstableMotion","button","role","className","clsx","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style","_default","exports"],"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 { __, isRTL } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\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 history = useHistory();\n\tconst { path, query } = useLocation();\n\tconst { canvas = 'view' } = query;\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\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\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} ),\n\t\t\t\t{\n\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t}\n\t\t\t);\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\tcanvas === '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' ]: canvas === '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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAA8C,IAAAQ,WAAA,GAAAR,OAAA;AAtB9C;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAES,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAAK,EAAEN,SAAS;EAChBO,MAAM,EAAEP,SAAS;EACjBQ,IAAI,EAAER;AACP,CAAC;;AAED;AACA,MAAMS,eAAe,GAAG,GA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B;YACjCc,OAAO,EAAGR,0BAA4B;YACtC,cAAa,IAAAkC,QAAE,EAAE,gBAAiB,CAAG;YACrC,oBAAmBjF,qBAAuB;YAC1C,iBACCF,QAAQ,CAACqC,OAAO,EAAEC,SAAS,EAAE7B,WAAW,IACxC9D,SACA;YACD,iBAAgBS,eAAiB;YACjC,iBAAgBsB,WAAW,CAAC5B,KAAO;YACnC2I,SAAS,EAAG7D,4BAA8B;YAC1C2B,OAAO,EAAC,QAAQ;YAChBmC,IAAI,EAAC,QAAQ;YACbC,UAAU,EAAC,QAAQ;YACnB/B,UAAU,EAAC;UAAQ,GArBf,QAsBJ;QAAC,CACM,CAAC,eACV,IAAAxH,WAAA,CAAA8G,GAAA;UAAKN,MAAM;UAACgD,EAAE,EAAG1F,qBAAuB;UAAAzB,QAAA,EACrC,IAAA0G,QAAE,EACH,gGACD;QAAC,CACG,CAAC;MAAA,CACL;IAEJ,CAAG;IACHU,aAAa,EAAGxF,iBAAmB;IACnCyF,QAAQ,EAAGpF,YAAc;IACzBqF,YAAY,EAAG1E,gBAAkB;IACjCkE,SAAS,EAAG,IAAAC,aAAI,EAAE,kCAAkC,EAAE;MACrD,aAAa,EAAEjG;IAChB,CAAE,CAAG;IACLyG,UAAU,EAAG,KAAO,CAAC;IAAA;IAAAvH,QAAA,eAErB,IAAArC,WAAA,CAAA8G,GAAA;MACCqC,SAAS,EAAC,0CAA0C;MACpDU,KAAK,EAAGtH,iBAAmB;MAAAF,QAAA,EAEzBA;IAAQ,CACN;EAAC,CACO,CAAC;AAEjB;AAAC,IAAAyH,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAEcpE,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_compose","_i18n","_router","_data","_coreData","_lockUnlock","_url","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","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","history","path","query","canvas","disableMotion","useReducedMotion","frameSize","setFrameSize","useState","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","FRAME_TRANSITION","type","duration","frameRef","useRef","resizableHandleHelpId","useInstanceId","defaultAspectRatio","isBlockTheme","useSelect","select","getCurrentTheme","coreStore","is_block_theme","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","navigate","addQueryArgs","transition","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","isRTL","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","jsx","ResizableBox","as","motion","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","jsxs","Fragment","Tooltip","text","__","__unstableMotion","button","role","className","clsx","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style","_default","exports"],"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 { __, isRTL } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\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 history = useHistory();\n\tconst { path, query } = useLocation();\n\tconst { canvas = 'view' } = query;\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\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\tconst isBlockTheme = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme } = select( coreStore );\n\t\treturn getCurrentTheme()?.is_block_theme;\n\t}, [] );\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 (\n\t\t\tremainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ||\n\t\t\t! isBlockTheme\n\t\t) {\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\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} ),\n\t\t\t\t{\n\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t}\n\t\t\t);\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\tcanvas === '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' ]: canvas === '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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAxB9C;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAIA,MAAM;EAAEW,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAAK,EAAEN,SAAS;EAChBO,MAAM,EAAEP,SAAS;EACjBQ,IAAI,EAAER;AACP,CAAC;;AAED;AACA,MAAMS,eAAe,GAAG,GAAG;AAC3B;AACA,MAAMC,qBAAqB,GAAG,IAAI;AAClC;AACA,MAAMC,yBAAyB,GAAG,CAAC,GAAG,IAAI;AAC1C;AACA;AACA;AACA,MA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AC,aAAI,EACf,mCAAmC,EACnC;cAAE,aAAa,EAAEvG;YAAW,CAC7B,CAAG;YACHuE,QAAQ,EAAGb,oBAAsB;YACjCc,OAAO,EAAGR,0BAA4B;YACtC,cAAa,IAAAkC,QAAE,EAAE,gBAAiB,CAAG;YACrC,oBAAmBvF,qBAAuB;YAC1C,iBACCF,QAAQ,CAAC2C,OAAO,EAAEC,SAAS,EAAE7B,WAAW,IACxCpE,SACA;YACD,iBAAgBS,eAAiB;YACjC,iBAAgBsB,WAAW,CAAC5B,KAAO;YACnCiJ,SAAS,EAAG7D,4BAA8B;YAC1C2B,OAAO,EAAC,QAAQ;YAChBmC,IAAI,EAAC,QAAQ;YACbC,UAAU,EAAC,QAAQ;YACnB/B,UAAU,EAAC;UAAQ,GArBf,QAsBJ;QAAC,CACM,CAAC,eACV,IAAA9H,WAAA,CAAAoH,GAAA;UAAKN,MAAM;UAACgD,EAAE,EAAGhG,qBAAuB;UAAAzB,QAAA,EACrC,IAAAgH,QAAE,EACH,gGACD;QAAC,CACG,CAAC;MAAA,CACL;IAEJ,CAAG;IACHU,aAAa,EAAGxF,iBAAmB;IACnCyF,QAAQ,EAAGpF,YAAc;IACzBqF,YAAY,EAAG1E,gBAAkB;IACjCkE,SAAS,EAAG,IAAAC,aAAI,EAAE,kCAAkC,EAAE;MACrD,aAAa,EAAEvG;IAChB,CAAE,CAAG;IACL+G,UAAU,EAAG,KAAO,CAAC;IAAA;IAAA7H,QAAA,eAErB,IAAArC,WAAA,CAAAoH,GAAA;MACCqC,SAAS,EAAC,0CAA0C;MACpDU,KAAK,EAAG5H,iBAAmB;MAAAF,QAAA,EAEzBA;IAAQ,CACN;EAAC,CACO,CAAC;AAEjB;AAAC,IAAA+H,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAEc1E,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","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":"
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3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-1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","_jsxRuntime","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","jsx","__experimentalHStack","className","alignment","spacing","children","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","_jsxRuntime","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","jsx","__experimentalHStack","className","alignment","spacing","children","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\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AI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;MAChDC,iBAAiB;MACjBC,qBAAqB;IAAA,CACrB;EAAC,CACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_keyboardShortcuts","_i18n","_data","_coreData","_editor","_store","shortcutName","SaveKeyboardShortcut","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","useSelect","coreStore","hasNonPostEntityChanges","isPostSavingLocked","editorStore","savePost","useDispatch","setIsSaveViewOpened","editSiteStore","registerShortcut","unregisterShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","event","preventDefault","dirtyEntityRecords","hasDirtyEntities","length","isSaving","some","record","kind","key"],"sources":["@wordpress/edit-site/src/components/save-keyboard-shortcut/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nconst shortcutName = 'core/edit-site/save';\n\n/**\n * Register the save keyboard shortcut in view mode.\n *\n * @return {null} Returns null.\n */\nexport default function SaveKeyboardShortcut() {\n\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\tuseSelect( coreStore );\n\tconst { hasNonPostEntityChanges, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\n\tconst { savePost } = useDispatch( editorStore );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: shortcutName,\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( shortcutName );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\tif ( ! hasDirtyEntities || isSaving ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasNonPostEntityChanges() ) {\n\t\t\tsetIsSaveViewOpened( true );\n\t\t} else if ( ! isPostSavingLocked() ) {\n\t\t\tsavePost();\n\t\t}\n\t} );\n\n\treturn null;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_keyboardShortcuts","_i18n","_data","_coreData","_editor","_store","shortcutName","SaveKeyboardShortcut","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","useSelect","coreStore","hasNonPostEntityChanges","isPostSavingLocked","editorStore","savePost","useDispatch","setIsSaveViewOpened","editSiteStore","registerShortcut","unregisterShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","event","preventDefault","dirtyEntityRecords","hasDirtyEntities","length","isSaving","some","record","kind","key"],"sources":["@wordpress/edit-site/src/components/save-keyboard-shortcut/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nconst shortcutName = 'core/edit-site/save';\n\n/**\n * Register the save keyboard shortcut in view mode.\n *\n * @return {null} Returns null.\n */\nexport default function SaveKeyboardShortcut() {\n\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\tuseSelect( coreStore );\n\tconst { hasNonPostEntityChanges, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\n\tconst { savePost } = useDispatch( editorStore );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: shortcutName,\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( shortcutName );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\tif ( ! hasDirtyEntities || isSaving ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasNonPostEntityChanges() ) {\n\t\t\tsetIsSaveViewOpened( true );\n\t\t} else if ( ! isPostSavingLocked() ) {\n\t\t\tsavePost();\n\t\t}\n\t} );\n\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KA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D,MAAMC,QAAQ,GAAGH,kBAAkB,CAACI,IAAI,CAAIC,MAAM,IACjD7B,oBAAoB,CAAE6B,MAAM,CAACC,IAAI,EAAED,MAAM,CAACf,IAAI,EAAEe,MAAM,CAACE,GAAI,CAC5D,CAAC;IACD,IAAK,CAAEN,gBAAgB,IAAIE,QAAQ,EAAG;MACrC;IACD;IACA,IAAKxB,uBAAuB,CAAC,CAAC,EAAG;MAChCK,mBAAmB,CAAE,IAAK,CAAC;IAC5B,CAAC,MAAM,IAAK,CAAEJ,kBAAkB,CAAC,CAAC,EAAG;MACpCE,QAAQ,CAAC,CAAC;IACX;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_router","_element","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","useLocation","routerPrivateApis","EntitiesSavedStatesForPreview","onClose","renderDialog","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","isPreviewingTheme","EntitiesSavedStates","SavePanel","query","canvas","isSaveViewOpen","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","useEffect","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__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';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\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 );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose, renderDialog } ) => {\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: The name of active theme, 2: 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\trenderDialog,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === '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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,O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EAAGA;MAAS,CAAE;IAAC,CACtC,CAAC,GACL,IAAI;EACT;EACA,MAAMyD,mBAAmB,GAAG,IAAA3B,oCAAiB,EAAC,CAAC,IAAIvB,OAAO;EAC1D,MAAMmD,QAAQ,GAAGtB,QAAQ,IAAI,CAAEqB,mBAAmB;EAClD,oBACC,IAAAjE,WAAA,CAAAmE,IAAA,EAACjE,eAAe;IACf2D,SAAS,EAAG,IAAAO,aAAI,EAAE,2BAA2B,EAAE;MAC9C,0BAA0B,EAAEzB;IAC7B,CAAE,CAAG;IACL0B,SAAS,EAAG,IAAArD,QAAE,EAAE,YAAa,CAAG;IAAAU,QAAA,gBAEhC,IAAA1B,WAAA,CAAAyB,GAAA;MACCoC,SAAS,EAAG,IAAAO,aAAI,EAAE,qCAAqC,EAAE;QACxD,oBAAoB,EAAEzB;MACvB,CAAE,CAAG;MAAAjB,QAAA,eAEL,IAAA1B,WAAA,CAAAyB,GAAA,EAACrC,WAAA,CAAAkF,MAAM;QACNC,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBX,SAAS,EAAC,4CAA4C;QACtDY,OAAO,EAAGA,CAAA,KAAMhB,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBS,QAAQ,EAAGA,QAAU;QACrBQ,sBAAsB;QAAAhD,QAAA,EAEpB,IAAAV,QAAE,EAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJ2B,cAAc,iBACf,IAAA3C,WAAA,CAAAyB,GAAA,EAACY,oBAAoB;MAAC7B,OAAO,EAAGA,OAAS;MAACC,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_router","_element","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","useLocation","routerPrivateApis","EntitiesSavedStatesForPreview","onClose","renderDialog","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","isPreviewingTheme","EntitiesSavedStates","SavePanel","query","canvas","isSaveViewOpen","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","useEffect","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__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';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\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 );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose, renderDialog } ) => {\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: The name of active theme, 2: 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\trenderDialog,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === '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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AAAoE,IAAAa,WAAA,GAAAb,OAAA;AA3BpE;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAOA,MAAM;EAAEc,6BAA6B;EAAEC;AAAgB,CAAC,GACvD,IAAAC,kBAAM,EAAEC,mBAAY,CAAC;AACtB,MAAM;EAAEC;AAAY,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEnD,MAAMC,6BAA6B,GAAGA,CAAE;EAAEC,OAAO;EAAEC;AAAa,CAAC,KAAM;EA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,SAAS,EAAC,4CAA4C;QACtDY,OAAO,EAAGA,CAAA,KAAMhB,mBAAmB,CAAE,IAAK,CAAG;QAC7C,iBAAc,QAAQ;QACtBS,QAAQ,EAAGA,QAAU;QACrBQ,sBAAsB;QAAAhD,QAAA,EAEpB,IAAAV,QAAE,EAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CAAC,EACJ2B,cAAc,iBACf,IAAA3C,WAAA,CAAAyB,GAAA,EAACY,oBAAoB;MAAC7B,OAAO,EAAGA,OAAS;MAACC,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_dom","_jsxRuntime","SidebarNavigationContext","exports","createContext","focusSidebarElement","el","direction","focusSelector","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","createNavState","state","get","navigate","SidebarContentWrapper","children","shouldAnimate","navState","useContext","wrapperRef","useRef","navAnimation","setNavAnimation","useState","useLayoutEffect","current","wrapperCls","clsx","jsx","ref","className","SidebarContent","routeKey","Provider","value"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n// Focus a sidebar element after a navigation. The element to focus is either\n// specified by `focusSelector` (when navigating back) or it is the first\n// tabbable element (usually the \"Back\" button).\nfunction focusSidebarElement( el, direction, focusSelector ) {\n\tlet elementToFocus;\n\tif ( direction === 'back' && focusSelector ) {\n\t\telementToFocus = el.querySelector( focusSelector );\n\t}\n\tif ( direction !== null && ! elementToFocus ) {\n\t\tconst [ firstTabbable ] = focus.tabbable.find( el );\n\t\telementToFocus = firstTabbable ?? el;\n\t}\n\telementToFocus?.focus();\n}\n\n// Navigation state that is updated when navigating back or forward. Helps us\n// manage the animations and also focus.\nfunction createNavState() {\n\tlet state = {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t};\n\n\treturn {\n\t\tget() {\n\t\t\treturn state;\n\t\t},\n\t\tnavigate( direction, focusSelector = null ) {\n\t\t\tstate = {\n\t\t\t\tdirection,\n\t\t\t\tfocusSelector:\n\t\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t\t? focusSelector\n\t\t\t\t\t\t: state.focusSelector,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction SidebarContentWrapper( { children, shouldAnimate } ) {\n\tconst navState = useContext( SidebarNavigationContext );\n\tconst wrapperRef = useRef();\n\tconst [ navAnimation, setNavAnimation ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tconst { direction, focusSelector } = navState.get();\n\t\tfocusSidebarElement( wrapperRef.current, direction, focusSelector );\n\t\tsetNavAnimation( direction );\n\t}, [ navState ] );\n\n\tconst wrapperCls = clsx(\n\t\t'edit-site-sidebar__screen-wrapper',\n\t\t/*\n\t\t * Some panes do not have sub-panes and therefore\n\t\t * should not animate when clicked on.\n\t\t */\n\t\tshouldAnimate\n\t\t\t? {\n\t\t\t\t\t'slide-from-left': navAnimation === 'back',\n\t\t\t\t\t'slide-from-right': navAnimation === 'forward',\n\t\t\t }\n\t\t\t: {}\n\t);\n\n\treturn (\n\t\t<div ref={ wrapperRef } className={ wrapperCls }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default function SidebarContent( {\n\trouteKey,\n\tshouldAnimate,\n\tchildren,\n} ) {\n\tconst [ navState ] = useState( createNavState );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navState }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<SidebarContentWrapper\n\t\t\t\t\tshouldAnimate={ shouldAnimate }\n\t\t\t\t\tkey={ routeKey }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</SidebarContentWrapper>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_dom","_jsxRuntime","SidebarNavigationContext","exports","createContext","focusSidebarElement","el","direction","focusSelector","elementToFocus","querySelector","firstTabbable","focus","tabbable","find","createNavState","state","get","navigate","SidebarContentWrapper","children","shouldAnimate","navState","useContext","wrapperRef","useRef","navAnimation","setNavAnimation","useState","useLayoutEffect","current","wrapperCls","clsx","jsx","ref","className","SidebarContent","routeKey","Provider","value"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nexport const SidebarNavigationContext = createContext( () => {} );\n// Focus a sidebar element after a navigation. The element to focus is either\n// specified by `focusSelector` (when navigating back) or it is the first\n// tabbable element (usually the \"Back\" button).\nfunction focusSidebarElement( el, direction, focusSelector ) {\n\tlet elementToFocus;\n\tif ( direction === 'back' && focusSelector ) {\n\t\telementToFocus = el.querySelector( focusSelector );\n\t}\n\tif ( direction !== null && ! elementToFocus ) {\n\t\tconst [ firstTabbable ] = focus.tabbable.find( el );\n\t\telementToFocus = firstTabbable ?? el;\n\t}\n\telementToFocus?.focus();\n}\n\n// Navigation state that is updated when navigating back or forward. Helps us\n// manage the animations and also focus.\nfunction createNavState() {\n\tlet state = {\n\t\tdirection: null,\n\t\tfocusSelector: null,\n\t};\n\n\treturn {\n\t\tget() {\n\t\t\treturn state;\n\t\t},\n\t\tnavigate( direction, focusSelector = null ) {\n\t\t\tstate = {\n\t\t\t\tdirection,\n\t\t\t\tfocusSelector:\n\t\t\t\t\tdirection === 'forward' && focusSelector\n\t\t\t\t\t\t? focusSelector\n\t\t\t\t\t\t: state.focusSelector,\n\t\t\t};\n\t\t},\n\t};\n}\n\nfunction SidebarContentWrapper( { children, shouldAnimate } ) {\n\tconst navState = useContext( SidebarNavigationContext );\n\tconst wrapperRef = useRef();\n\tconst [ navAnimation, setNavAnimation ] = useState( null );\n\n\tuseLayoutEffect( () => {\n\t\tconst { direction, focusSelector } = navState.get();\n\t\tfocusSidebarElement( wrapperRef.current, direction, focusSelector );\n\t\tsetNavAnimation( direction );\n\t}, [ navState ] );\n\n\tconst wrapperCls = clsx(\n\t\t'edit-site-sidebar__screen-wrapper',\n\t\t/*\n\t\t * Some panes do not have sub-panes and therefore\n\t\t * should not animate when clicked on.\n\t\t */\n\t\tshouldAnimate\n\t\t\t? {\n\t\t\t\t\t'slide-from-left': navAnimation === 'back',\n\t\t\t\t\t'slide-from-right': navAnimation === 'forward',\n\t\t\t }\n\t\t\t: {}\n\t);\n\n\treturn (\n\t\t<div ref={ wrapperRef } className={ wrapperCls }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default function SidebarContent( {\n\trouteKey,\n\tshouldAnimate,\n\tchildren,\n} ) {\n\tconst [ navState ] = useState( createNavState );\n\n\treturn (\n\t\t<SidebarNavigationContext.Provider value={ navState }>\n\t\t\t<div className=\"edit-site-sidebar__content\">\n\t\t\t\t<SidebarContentWrapper\n\t\t\t\t\tshouldAnimate={ shouldAnimate }\n\t\t\t\t\tkey={ routeKey }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</SidebarContentWrapper>\n\t\t\t</div>\n\t\t</SidebarNavigationContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,IAAA,GAAAF,OAAA;AAAuC,IAAAG,WAAA,GAAAH,OAAA;AAfvC;AACA;AACA;;AAGA;AACA;AACA;;AAUO,MAAMI,wBAAwB,GAAAC,OAAA,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AM;IACtB,MAAM;MAAEtB,SAAS;MAAEC;IAAc,CAAC,GAAGc,QAAQ,CAACL,GAAG,CAAC,CAAC;IACnDZ,mBAAmB,CAAEmB,UAAU,CAACM,OAAO,EAAEvB,SAAS,EAAEC,aAAc,CAAC;IACnEmB,eAAe,CAAEpB,SAAU,CAAC;EAC7B,CAAC,EAAE,CAAEe,QAAQ,CAAG,CAAC;EAEjB,MAAMS,UAAU,GAAG,IAAAC,aAAI,EACtB,mCAAmC;EACnC;AACF;AACA;AACA;EACEX,aAAa,GACV;IACA,iBAAiB,EAAEK,YAAY,KAAK,MAAM;IAC1C,kBAAkB,EAAEA,YAAY,KAAK;EACrC,CAAC,GACD,CAAC,CACL,CAAC;EAED,oBACC,IAAAzB,WAAA,CAAAgC,GAAA;IAAKC,GAAG,EAAGV,UAAY;IAACW,SAAS,EAAGJ,UAAY;IAAAX,QAAA,EAC7CA;EAAQ,CACN,CAAC;AAER;AAEe,SAASgB,cAAcA,CAAE;EACvCC,QAAQ;EACRhB,aAAa;EACbD;AACD,CAAC,EAAG;EACH,MAAM,CAAEE,QAAQ,CAAE,GAAG,IAAAM,iBAAQ,EAAEb,cAAe,CAAC;EAE/C,oBACC,IAAAd,WAAA,CAAAgC,GAAA,EAAC/B,wBAAwB,CAACoC,QAAQ;IAACC,KAAK,EAAGjB,QAAU;IAAAF,QAAA,eACpD,IAAAnB,WAAA,CAAAgC,GAAA;MAAKE,SAAS,EAAC,4BAA4B;MAAAf,QAAA,eAC1C,IAAAnB,WAAA,CAAAgC,GAAA,EAACd,qBAAqB;QACrBE,aAAa,EAAGA,aAAe;QAAAD,QAAA,EAG7BA;MAAQ,GAFJiB,QAGgB;IAAC,CACpB;EAAC,CAC4B,CAAC;AAEtC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_coreData","_components","_element","_icons","_i18n","_router","_dataviewItem","_interopRequireDefault","_addNewView","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","EMPTY_ARRAY","RenameItemModalContent","dataviewId","currentTitle","setIsRenaming","editEntityRecord","useDispatch","coreStore","title","setTitle","useState","jsx","onSubmit","event","preventDefault","children","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","__","value","onChange","placeholder","className","__experimentalHStack","justify","Button","variant","onClick","type","CustomDataViewItem","isActive","history","dataview","useSelect","select","getEditedEntityRecord","deleteEntityRecord","useMemo","viewContent","JSON","parse","content","isRenaming","Fragment","default","isCustom","customViewId","suffix","DropdownMenu","icon","moreVertical","toggleProps","style","color","size","onClose","MenuGroup","MenuItem","id","force","params","postType","getLocationWithParams","replace","isDestructive","Modal","onRequestClose","focusOnMount","useCustomDataViews","customDataViews","getEntityRecords","dataViewTypeRecords","slug","length","dataViews","wp_dataviews_type","orderby","order","CustomDataViewsList","activeView","__experimentalHeading","level","__experimentalItemGroup","map","customViewRecord","Number"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/custom-dataviews-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHeading as Heading,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport DataViewItem from './dataview-item';\nimport AddNewItem from './add-new-view';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( currentTitle );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId,\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tsetIsRenaming( 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\tvariant=\"tertiary\"\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsRenaming( 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\t\t\t\t\t<Button\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 }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\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\nfunction CustomDataViewItem( { dataviewId, isActive } ) {\n\tconst history = useHistory();\n\tconst { dataview } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tdataview: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ dataviewId ]\n\t);\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst type = useMemo( () => {\n\t\tconst viewContent = JSON.parse( dataview.content );\n\t\treturn viewContent.type;\n\t}, [ dataview.content ] );\n\tconst [ isRenaming, setIsRenaming ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<DataViewItem\n\t\t\t\ttitle={ dataview.title }\n\t\t\t\ttype={ type }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tisCustom\n\t\t\t\tcustomViewId={ dataviewId }\n\t\t\t\tsuffix={\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-dataviews-dataview-item__dropdown-menu\"\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tcolor: 'inherit',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsRenaming( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\t\t\t\tawait deleteEntityRecord(\n\t\t\t\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t\t\t\t\t\t\tdataview.id,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( isActive ) {\n\t\t\t\t\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\t\t\t\t\tparams: { postType },\n\t\t\t\t\t\t\t\t\t\t\t} = history.getLocationWithParams();\n\t\t\t\t\t\t\t\t\t\t\thistory.replace( { postType } );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isRenaming && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t} }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenameItemModalContent\n\t\t\t\t\t\tdataviewId={ dataviewId }\n\t\t\t\t\t\tsetIsRenaming={ setIsRenaming }\n\t\t\t\t\t\tcurrentTitle={ dataview.title }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport function useCustomDataViews( type ) {\n\tconst customDataViews = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst dataViewTypeRecords = getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_dataviews_type',\n\t\t\t{ slug: type }\n\t\t);\n\t\tif ( ! dataViewTypeRecords || dataViewTypeRecords.length === 0 ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst dataViews = getEntityRecords( 'postType', 'wp_dataviews', {\n\t\t\twp_dataviews_type: dataViewTypeRecords[ 0 ].id,\n\t\t\torderby: 'date',\n\t\t\torder: 'asc',\n\t\t} );\n\t\tif ( ! dataViews ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn dataViews;\n\t} );\n\treturn customDataViews;\n}\n\nexport default function CustomDataViewsList( { type, activeView, isCustom } ) {\n\tconst customDataViews = useCustomDataViews( type );\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-dataviews__group-header\">\n\t\t\t\t<Heading level={ 2 }>{ __( 'Custom Views' ) }</Heading>\n\t\t\t</div>\n\t\t\t<ItemGroup>\n\t\t\t\t{ customDataViews.map( ( customViewRecord ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CustomDataViewItem\n\t\t\t\t\t\t\tkey={ customViewRecord.id }\n\t\t\t\t\t\t\tdataviewId={ customViewRecord.id }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tisCustom &&\n\t\t\t\t\t\t\t\tNumber( activeView ) === customViewRecord.id\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<AddNewItem type={ type } />\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAYA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,O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,CACX,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_coreData","_components","_element","_icons","_i18n","_router","_dataviewItem","_interopRequireDefault","_addNewView","_lockUnlock","_jsxRuntime","useHistory","unlock","routerPrivateApis","EMPTY_ARRAY","RenameItemModalContent","dataviewId","currentTitle","setIsRenaming","editEntityRecord","useDispatch","coreStore","title","setTitle","useState","jsx","onSubmit","event","preventDefault","children","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","__","value","onChange","placeholder","className","__experimentalHStack","justify","Button","variant","onClick","type","CustomDataViewItem","isActive","history","dataview","useSelect","select","getEditedEntityRecord","deleteEntityRecord","useMemo","viewContent","JSON","parse","content","isRenaming","Fragment","default","isCustom","customViewId","suffix","DropdownMenu","icon","moreVertical","toggleProps","style","color","size","onClose","MenuGroup","MenuItem","id","force","params","postType","getLocationWithParams","replace","isDestructive","Modal","onRequestClose","focusOnMount","useCustomDataViews","customDataViews","getEntityRecords","dataViewTypeRecords","slug","length","dataViews","wp_dataviews_type","orderby","order","CustomDataViewsList","activeView","__experimentalHeading","level","__experimentalItemGroup","map","customViewRecord","Number"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/custom-dataviews-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHeading as Heading,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport DataViewItem from './dataview-item';\nimport AddNewItem from './add-new-view';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( currentTitle );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId,\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tsetIsRenaming( 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\tvariant=\"tertiary\"\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsRenaming( 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\t\t\t\t\t<Button\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 }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Save' ) }\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\nfunction CustomDataViewItem( { dataviewId, isActive } ) {\n\tconst history = useHistory();\n\tconst { dataview } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tdataview: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\tdataviewId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ dataviewId ]\n\t);\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst type = useMemo( () => {\n\t\tconst viewContent = JSON.parse( dataview.content );\n\t\treturn viewContent.type;\n\t}, [ dataview.content ] );\n\tconst [ isRenaming, setIsRenaming ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<DataViewItem\n\t\t\t\ttitle={ dataview.title }\n\t\t\t\ttype={ type }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tisCustom\n\t\t\t\tcustomViewId={ dataviewId }\n\t\t\t\tsuffix={\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-dataviews-dataview-item__dropdown-menu\"\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tcolor: 'inherit',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsRenaming( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\t\t\t\tawait deleteEntityRecord(\n\t\t\t\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t\t\t\t\t\t\tdataview.id,\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tif ( isActive ) {\n\t\t\t\t\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\t\t\t\t\tparams: { postType },\n\t\t\t\t\t\t\t\t\t\t\t} = history.getLocationWithParams();\n\t\t\t\t\t\t\t\t\t\t\thistory.replace( { postType } );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isRenaming && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsRenaming( false );\n\t\t\t\t\t} }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenameItemModalContent\n\t\t\t\t\t\tdataviewId={ dataviewId }\n\t\t\t\t\t\tsetIsRenaming={ setIsRenaming }\n\t\t\t\t\t\tcurrentTitle={ dataview.title }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport function useCustomDataViews( type ) {\n\tconst customDataViews = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst dataViewTypeRecords = getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\t'wp_dataviews_type',\n\t\t\t{ slug: type }\n\t\t);\n\t\tif ( ! dataViewTypeRecords || dataViewTypeRecords.length === 0 ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst dataViews = getEntityRecords( 'postType', 'wp_dataviews', {\n\t\t\twp_dataviews_type: dataViewTypeRecords[ 0 ].id,\n\t\t\torderby: 'date',\n\t\t\torder: 'asc',\n\t\t} );\n\t\tif ( ! dataViews ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn dataViews;\n\t} );\n\treturn customDataViews;\n}\n\nexport default function CustomDataViewsList( { type, activeView, isCustom } ) {\n\tconst customDataViews = useCustomDataViews( type );\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-dataviews__group-header\">\n\t\t\t\t<Heading level={ 2 }>{ __( 'Custom Views' ) }</Heading>\n\t\t\t</div>\n\t\t\t<ItemGroup>\n\t\t\t\t{ customDataViews.map( ( customViewRecord ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CustomDataViewItem\n\t\t\t\t\t\t\tkey={ customViewRecord.id }\n\t\t\t\t\t\t\tdataviewId={ customViewRecord.id }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tisCustom &&\n\t\t\t\t\t\t\t\tNumber( activeView ) === customViewRecord.id\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t<AddNewItem type={ type } />\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GA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MvB,CAAC;MAEJ,CAAE,CAAC,eACH,IAAAnE,WAAA,CAAAe,GAAA,EAACjB,WAAA,CAAAuD,OAAU;QAAChB,IAAI,EAAGA;MAAM,CAAE,CAAC;IAAA,CAClB,CAAC;EAAA,CACX,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_url","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","path","iconToUse","VIEW_LAYOUTS","find","v","activeView","undefined","query","layout","jsxs","__experimentalHStack","justify","className","clsx","children","jsx","default","to","addQueryArgs"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst { path } = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tlet activeView = isCustom ? customViewId : slug;\n\tif ( activeView === 'all' ) {\n\t\tactiveView = undefined;\n\t}\n\tconst query = {\n\t\tlayout: type,\n\t\tactiveView,\n\t\tisCustom: isCustom ? 'true' : undefined,\n\t};\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\tto={ addQueryArgs( path, query ) }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_router","_components","_dataviews","_url","_sidebarNavigationItem","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewItem","title","slug","customViewId","type","icon","isActive","isCustom","suffix","path","iconToUse","VIEW_LAYOUTS","find","v","activeView","undefined","query","layout","jsxs","__experimentalHStack","justify","className","clsx","children","jsx","default","to","addQueryArgs"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/dataview-item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { VIEW_LAYOUTS } from '@wordpress/dataviews';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewItem( {\n\ttitle,\n\tslug,\n\tcustomViewId,\n\ttype,\n\ticon,\n\tisActive,\n\tisCustom,\n\tsuffix,\n} ) {\n\tconst { path } = useLocation();\n\n\tconst iconToUse =\n\t\ticon || VIEW_LAYOUTS.find( ( v ) => v.type === type ).icon;\n\n\tlet activeView = isCustom ? customViewId : slug;\n\tif ( activeView === 'all' ) {\n\t\tactiveView = undefined;\n\t}\n\tconst query = {\n\t\tlayout: type,\n\t\tactiveView,\n\t\tisCustom: isCustom ? 'true' : undefined,\n\t};\n\treturn (\n\t\t<HStack\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ clsx( 'edit-site-sidebar-dataviews-dataview-item', {\n\t\t\t\t'is-selected': isActive,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ iconToUse }\n\t\t\t\tto={ addQueryArgs( path, query ) }\n\t\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ suffix }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAKA,IAAAK,sBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAjB3C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAK,CAAC,GAAGZ,WAAW,CAAC,CAAC;EAE9B,MAAMa,SAAS,GACdL,IAAI,IAAIM,uBAAY,CAACC,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACT,IAAI,KAAKA,IAAK,CAAC,CAACC,IAAI;EAE3D,IAAIS,UAAU,GAAGP,QAAQ,GAAGJ,YAAY,GAAGD,IAAI;EAC/C,IAAKY,UAAU,KAAK,KAAK,EAAG;IAC3BA,UAAU,GAAGC,SAAS;EACvB;EACA,MAAMC,KAAK,GAAG;IACbC,MAAM,EAAEb,IAAI;IACZU,UAAU;IACVP,QAAQ,EAAEA,QAAQ,GAAG,MAAM,GAAGQ;EAC/B,CAAC;EACD,oBACC,IAAAnB,WAAA,CAAAsB,IAAA,EAAC3B,WAAA,CAAA4B,oBAAM;IACNC,OAAO,EAAC,YAAY;IACpBC,SAAS,EAAG,IAAAC,aAAI,EAAE,2CAA2C,EAAE;MAC9D,aAAa,EAAEhB;IAChB,CAAE,CAAG;IAAAiB,QAAA,gBAEL,IAAA3B,WAAA,CAAA4B,GAAA,EAAC9B,sBAAA,CAAA+B,OAAqB;MACrBpB,IAAI,EAAGK,SAAW;MAClBgB,EAAE,EAAG,IAAAC,iBAAY,EAAElB,IAAI,EAAEO,KAAM,CAAG;MAClC,gBAAeV,QAAQ,GAAG,MAAM,GAAGS,SAAW;MAAAQ,QAAA,EAE5CtB;IAAK,CACe,CAAC,EACtBO,MAAM;EAAA,CACD,CAAC;AAEX","ignoreList":[]}
|
|
@@ -20,28 +20,9 @@ var _constants = require("../../utils/constants");
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
const defaultLayouts = exports.defaultLayouts = {
|
|
23
|
-
[_constants.LAYOUT_TABLE]: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
styles: {
|
|
27
|
-
title: {
|
|
28
|
-
maxWidth: 300
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
[_constants.LAYOUT_GRID]: {
|
|
34
|
-
layout: {
|
|
35
|
-
mediaField: 'featured_media',
|
|
36
|
-
primaryField: 'title'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
[_constants.LAYOUT_LIST]: {
|
|
40
|
-
layout: {
|
|
41
|
-
primaryField: 'title',
|
|
42
|
-
mediaField: 'featured_media'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
23
|
+
[_constants.LAYOUT_TABLE]: {},
|
|
24
|
+
[_constants.LAYOUT_GRID]: {},
|
|
25
|
+
[_constants.LAYOUT_LIST]: {}
|
|
45
26
|
};
|
|
46
27
|
const DEFAULT_POST_BASE = {
|
|
47
28
|
type: _constants.LAYOUT_LIST,
|
|
@@ -53,8 +34,10 @@ const DEFAULT_POST_BASE = {
|
|
|
53
34
|
field: 'date',
|
|
54
35
|
direction: 'desc'
|
|
55
36
|
},
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
titleField: 'title',
|
|
38
|
+
mediaField: 'featured_media',
|
|
39
|
+
fields: ['author', 'status'],
|
|
40
|
+
...defaultLayouts[_constants.LAYOUT_LIST]
|
|
58
41
|
};
|
|
59
42
|
function useDefaultViews({
|
|
60
43
|
postType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_element","_constants","defaultLayouts","exports","LAYOUT_TABLE","LAYOUT_GRID","LAYOUT_LIST","DEFAULT_POST_BASE","type","search","filters","page","perPage","sort","field","direction","titleField","mediaField","fields","useDefaultViews","postType","labels","useSelect","select","getPostType","coreStore","useMemo","title","all_items","__","slug","icon","pages","view","published","operator","OPERATOR_IS_ANY","value","scheduled","drafts","pending","notAllowed","trash","layout"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\ttrash,\n\tpages,\n\tdrafts,\n\tpublished,\n\tscheduled,\n\tpending,\n\tnotAllowed,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IS_ANY,\n} from '../../utils/constants';\n\nexport const defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {},\n\t[ LAYOUT_LIST ]: {},\n};\n\nconst DEFAULT_POST_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\ttitleField: 'title',\n\tmediaField: 'featured_media',\n\tfields: [ 'author', 'status' ],\n\t...defaultLayouts[ LAYOUT_LIST ],\n};\n\nexport function useDefaultViews( { postType } ) {\n\tconst labels = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( postType )?.labels;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: labels?.all_items || __( 'All items' ),\n\t\t\t\tslug: 'all',\n\t\t\t\ticon: pages,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Published' ),\n\t\t\t\tslug: 'published',\n\t\t\t\ticon: published,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'publish',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Scheduled' ),\n\t\t\t\tslug: 'future',\n\t\t\t\ticon: scheduled,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'future',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Drafts' ),\n\t\t\t\tslug: 'drafts',\n\t\t\t\ticon: drafts,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'draft',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Pending' ),\n\t\t\t\tslug: 'pending',\n\t\t\t\ticon: pending,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'pending',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Private' ),\n\t\t\t\tslug: 'private',\n\t\t\t\ticon: notAllowed,\n\t\t\t\tview: DEFAULT_POST_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'private',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: __( 'Trash' ),\n\t\t\t\tslug: 'trash',\n\t\t\t\ticon: trash,\n\t\t\t\tview: {\n\t\t\t\t\t...DEFAULT_POST_BASE,\n\t\t\t\t\ttype: LAYOUT_TABLE,\n\t\t\t\t\tlayout: defaultLayouts[ LAYOUT_TABLE ].layout,\n\t\t\t\t},\n\t\t\t\tfilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: 'status',\n\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\tvalue: 'trash',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}, [ labels ] );\n}\n"],"mappings":";;;;;;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AQ;QACfqB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,EACD;MACCV,KAAK,EAAE,IAAAE,QAAE,EAAE,OAAQ,CAAC;MACpBC,IAAI,EAAE,OAAO;MACbC,IAAI,EAAEW,YAAK;MACXT,IAAI,EAAE;QACL,GAAG1B,iBAAiB;QACpBC,IAAI,EAAEJ,uBAAY;QAClBuC,MAAM,EAAEzC,cAAc,CAAEE,uBAAY,CAAE,CAACuC;MACxC,CAAC;MACDjC,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfqB,QAAQ,EAAEC,0BAAe;QACzBC,KAAK,EAAE;MACR,CAAC;IAEH,CAAC,CACD;EACF,CAAC,EAAE,CAAEhB,MAAM,CAAG,CAAC;AAChB","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -41,6 +42,7 @@ function DataViewsSidebarContent({
|
|
|
41
42
|
const isCustomBoolean = isCustom === 'true';
|
|
42
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
43
44
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
|
|
45
|
+
className: "edit-site-sidebar-dataviews",
|
|
44
46
|
children: defaultViews.map(dataview => {
|
|
45
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataviewItem.default, {
|
|
46
48
|
slug: dataview.slug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_router","_defaultViews","_lockUnlock","_dataviewItem","_interopRequireDefault","_customDataviewsList","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewsSidebarContent","postType","query","activeView","isCustom","defaultViews","useDefaultViews","isCustomBoolean","jsxs","Fragment","children","jsx","__experimentalItemGroup","map","dataview","default","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent( { postType } ) {\n\tconst {\n\t\tquery: { activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t{ window?.__experimentalCustomViews && (\n\t\t\t\t<CustomDataViewsList\n\t\t\t\t\tactiveView={ activeView }\n\t\t\t\t\ttype={ postType }\n\t\t\t\t\tisCustom\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_components","require","_router","_defaultViews","_lockUnlock","_dataviewItem","_interopRequireDefault","_customDataviewsList","_jsxRuntime","useLocation","unlock","routerPrivateApis","DataViewsSidebarContent","postType","query","activeView","isCustom","defaultViews","useDefaultViews","isCustomBoolean","jsxs","Fragment","children","jsx","__experimentalItemGroup","className","map","dataview","default","slug","title","icon","type","view","isActive","window","__experimentalCustomViews"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useDefaultViews } from './default-views';\nimport { unlock } from '../../lock-unlock';\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function DataViewsSidebarContent( { postType } ) {\n\tconst {\n\t\tquery: { activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tconst defaultViews = useDefaultViews( { postType } );\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\tconst isCustomBoolean = isCustom === 'true';\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup className=\"edit-site-sidebar-dataviews\">\n\t\t\t\t{ defaultViews.map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\t! isCustomBoolean &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\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