@wordpress/edit-site 6.13.1-next.cd6172eb0.0 → 6.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +1 -1
- package/build/components/add-new-pattern/index.js +7 -10
- 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/index.js +1 -9
- package/build/components/editor/index.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/confirm-reset-shadow-dialog.js +39 -0
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
- 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 +2 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +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 +18 -14
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +18 -20
- 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-block.js +1 -1
- package/build/components/global-styles/screen-block.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 +36 -34
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +44 -5
- 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 +24 -8
- 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 +8 -82
- 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 +7 -39
- 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 +40 -21
- 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 +6 -7
- 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 +10 -26
- 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 +40 -71
- 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 +38 -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 +37 -0
- package/build/components/site-editor-routes/stylebook.js.map +1 -0
- package/build/components/site-editor-routes/styles.js +7 -1
- package/build/components/site-editor-routes/styles.js.map +1 -1
- 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 +36 -3
- 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 +185 -61
- 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 +7 -10
- 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/index.js +1 -9
- package/build-module/components/editor/index.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/confirm-reset-shadow-dialog.js +32 -0
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
- 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 +2 -1
- 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 +18 -14
- 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 +25 -27
- 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-block.js +1 -1
- package/build-module/components/global-styles/screen-block.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 +37 -35
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +47 -8
- 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 +25 -9
- 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 +10 -84
- 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 +6 -38
- 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 +41 -22
- 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 +6 -7
- 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 +10 -26
- 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 +41 -74
- 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 +40 -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 +29 -0
- package/build-module/components/site-editor-routes/stylebook.js.map +1 -0
- package/build-module/components/site-editor-routes/styles.js +7 -1
- package/build-module/components/site-editor-routes/styles.js.map +1 -1
- 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 +35 -2
- 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 +185 -64
- 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 +151 -182
- package/build-style/posts.css +151 -182
- package/build-style/style-rtl.css +343 -354
- package/build-style/style.css +343 -354
- package/package.json +42 -41
- package/src/components/add-new-pattern/index.js +10 -7
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/canvas-loader/style.scss +4 -3
- package/src/components/editor/index.js +1 -7
- package/src/components/editor/style.scss +4 -2
- package/src/components/editor-canvas-container/style.scss +7 -1
- package/src/components/global-styles/confirm-reset-shadow-dialog.js +37 -0
- package/src/components/global-styles/font-library-modal/index.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +4 -2
- package/src/components/global-styles/font-sizes/font-size.js +28 -19
- package/src/components/global-styles/font-sizes/font-sizes.js +37 -35
- 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/screen-block.js +3 -2
- package/src/components/global-styles/shadows-edit-panel.js +58 -49
- package/src/components/global-styles/shadows-panel.js +64 -5
- package/src/components/global-styles/style.scss +40 -18
- package/src/components/global-styles/typography-example.js +12 -1
- package/src/components/global-styles/variations/style.scss +4 -3
- package/src/components/layout/index.js +20 -7
- package/src/components/layout/style.scss +8 -3
- package/src/components/maybe-editor/index.js +58 -0
- package/src/components/page/style.scss +8 -5
- package/src/components/page-patterns/fields.js +13 -100
- package/src/components/page-patterns/index.js +23 -11
- package/src/components/page-patterns/style.scss +4 -53
- package/src/components/page-templates/fields.js +6 -33
- package/src/components/page-templates/index.js +38 -55
- package/src/components/page-templates/style.scss +4 -20
- package/src/components/post-edit/index.js +22 -18
- package/src/components/post-list/index.js +59 -44
- package/src/components/post-list/style.scss +0 -36
- package/src/components/resizable-frame/index.js +10 -1
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +7 -6
- package/src/components/sidebar-dataviews/default-views.js +10 -26
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-dataviews/style.scss +9 -1
- package/src/components/sidebar-global-styles-wrapper/index.js +37 -83
- package/src/components/sidebar-global-styles-wrapper/style.scss +22 -0
- package/src/components/sidebar-navigation-item/style.scss +6 -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 +67 -38
- 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/styles.js +5 -1
- 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/site-hub/style.scss +4 -2
- package/src/components/style-book/color-examples.tsx +21 -3
- package/src/components/style-book/constants.ts +49 -2
- package/src/components/style-book/examples.tsx +55 -31
- package/src/components/style-book/index.js +268 -87
- 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","_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,CAAAD,wBAAA,GAAG,IAAAE,sBAAa,EAAE,MAAM,CAAC,CAAE,CAAC;AACjE;AACA;AACA;AACA,SAASC,mBAAmBA,CAAEC,EAAE,EAAEC,SAAS,EAAEC,aAAa,EAAG;EAC5D,IAAIC,cAAc;EAClB,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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,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -26,7 +27,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
const {
|
|
29
|
-
useHistory
|
|
30
|
+
useHistory,
|
|
31
|
+
useLocation
|
|
30
32
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
31
33
|
const EMPTY_ARRAY = [];
|
|
32
34
|
function RenameItemModalContent({
|
|
@@ -81,6 +83,7 @@ function CustomDataViewItem({
|
|
|
81
83
|
isActive
|
|
82
84
|
}) {
|
|
83
85
|
const history = useHistory();
|
|
86
|
+
const location = useLocation();
|
|
84
87
|
const {
|
|
85
88
|
dataview
|
|
86
89
|
} = (0, _data.useSelect)(select => {
|
|
@@ -131,13 +134,8 @@ function CustomDataViewItem({
|
|
|
131
134
|
force: true
|
|
132
135
|
});
|
|
133
136
|
if (isActive) {
|
|
134
|
-
const {
|
|
135
|
-
params: {
|
|
136
|
-
postType
|
|
137
|
-
}
|
|
138
|
-
} = history.getLocationWithParams();
|
|
139
137
|
history.replace({
|
|
140
|
-
postType
|
|
138
|
+
postType: location.query.postType
|
|
141
139
|
});
|
|
142
140
|
}
|
|
143
141
|
onClose();
|
|
@@ -199,6 +197,7 @@ function CustomDataViewsList({
|
|
|
199
197
|
children: (0, _i18n.__)('Custom Views')
|
|
200
198
|
})
|
|
201
199
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
200
|
+
className: "edit-site-sidebar-navigation-screen-dataviews__custom-items",
|
|
202
201
|
children: [customDataViews.map(customViewRecord => {
|
|
203
202
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomDataViewItem, {
|
|
204
203
|
dataviewId: customViewRecord.id,
|
|
@@ -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,OAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,WAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAA2C,IAAAW,WAAA,GAAAX,OAAA;AA3B3C;AACA;AACA;;AAoB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WAAW;IACnB;IACA,OAAO+E,SAAS;EACjB,CAAE,CAAC;EACH,OAAOL,eAAe;AACvB;AAEe,SAASS,mBAAmBA,CAAE;EAAElD,IAAI;EAAEmD,UAAU;EAAElC;AAAS,CAAC,EAAG;EAC7E,MAAMwB,eAAe,GAAGD,kBAAkB,CAAExC,IAAK,CAAC;EAClD,oBACC,IAAArC,WAAA,CAAAoB,IAAA,EAAApB,WAAA,CAAAoD,QAAA;IAAAjC,QAAA,gBACC,IAAAnB,WAAA,CAAAe,GAAA;MAAKgB,SAAS,EAAC,6DAA6D;MAAAZ,QAAA,eAC3E,IAAAnB,WAAA,CAAAe,GAAA,EAACxB,WAAA,CAAAkG,qBAAO;QAACC,KAAK,EAAG,CAAG;QAAAvE,QAAA,EAAG,IAAAQ,QAAE,EAAE,cAAe;MAAC,CAAW;IAAC,CACnD,CAAC,eACN,IAAA3B,WAAA,CAAAoB,IAAA,EAAC7B,WAAA,CAAAoG,uBAAS;MAAAxE,QAAA,GACP2D,eAAe,CAACc,GAAG,CAAIC,gBAAgB,IAAM;QAC9C,oBACC,IAAA7F,WAAA,CAAAe,GAAA,EAACuB,kBAAkB;UAElBhC,UAAU,EAAGuF,gBAAgB,CAAC1B,EAAI;UAClC5B,QAAQ,EACPe,QAAQ,IACRwC,MAAM,CAAEN,UAAW,CAAC,KAAKK,gBAAgB,CAAC1B;QAC1C,GALK0B,gBAAgB,CAAC1B,EAMvB,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
|
+
{"version":3,"names":["_data","require","_coreData","_components","_element","_icons","_i18n","_router","_dataviewItem","_interopRequireDefault","_addNewView","_lockUnlock","_jsxRuntime","useHistory","useLocation","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","location","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","replace","postType","query","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, useLocation } = 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 location = useLocation();\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\thistory.replace( {\n\t\t\t\t\t\t\t\t\t\t\t\tpostType:\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocation.query.postType,\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\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 className=\"edit-site-sidebar-navigation-screen-dataviews__custom-items\">\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,OA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AAM,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,
|
|
@@ -50,11 +31,14 @@ const DEFAULT_POST_BASE = {
|
|
|
50
31
|
page: 1,
|
|
51
32
|
perPage: 20,
|
|
52
33
|
sort: {
|
|
53
|
-
field: '
|
|
54
|
-
direction: '
|
|
34
|
+
field: 'title',
|
|
35
|
+
direction: 'asc'
|
|
55
36
|
},
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
showLevels: true,
|
|
38
|
+
titleField: 'title',
|
|
39
|
+
mediaField: 'featured_media',
|
|
40
|
+
fields: ['author', 'status'],
|
|
41
|
+
...defaultLayouts[_constants.LAYOUT_LIST]
|
|
58
42
|
};
|
|
59
43
|
function useDefaultViews({
|
|
60
44
|
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","showLevels","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: 'title',\n\t\tdirection: 'asc',\n\t},\n\tshowLevels: true,\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 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AiB;MACvBG,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfsB,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,GAAG3B,iBAAiB;QACpBC,IAAI,EAAEJ,uBAAY;QAClBwC,MAAM,EAAE1C,cAAc,CAAEE,uBAAY,CAAE,CAACwC;MACxC,CAAC;MACDlC,OAAO,EAAE,CACR;QACCI,KAAK,EAAE,QAAQ;QACfsB,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\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CAAAuB,OAAY;UAEZC,IAAI,EAAGF,QAAQ,CAACE,IAAM;UACtBC,KAAK,EAAGH,QAAQ,CAACG,KAAO;UACxBC,IAAI,EAAGJ,QAAQ,CAACI,IAAM;UACtBC,IAAI,EAAGL,QAAQ,CAACM,IAAI,CAACD,IAAM;UAC3BE,QAAQ,EACP,CAAEf,eAAe,IACjBQ,QAAQ,CAACE,IAAI,KAAKd,UAClB;UACDC,QAAQ,EAAG;QAAO,GATZW,QAAQ,CAACE,IAUf,CAAC;MAEJ,CAAE;IAAC,CACO,CAAC,EACVM,MAAM,EAAEC,yBAAyB,iBAClC,IAAA5B,WAAA,CAAAe,GAAA,EAAChB,oBAAA,CAAAqB,OAAmB;MACnBb,UAAU,EAAGA,UAAY;MACzBiB,IAAI,EAAGnB,QAAU;MACjBG,QAAQ;IAAA,CACR,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = GlobalStylesUIWrapper;
|
|
8
|
+
exports.useSection = void 0;
|
|
8
9
|
var _i18n = require("@wordpress/i18n");
|
|
9
10
|
var _element = require("@wordpress/element");
|
|
10
11
|
var _router = require("@wordpress/router");
|
|
11
12
|
var _compose = require("@wordpress/compose");
|
|
12
13
|
var _components = require("@wordpress/components");
|
|
13
14
|
var _url = require("@wordpress/url");
|
|
15
|
+
var _icons = require("@wordpress/icons");
|
|
14
16
|
var _ui = _interopRequireDefault(require("../global-styles/ui"));
|
|
15
17
|
var _page = _interopRequireDefault(require("../page"));
|
|
16
18
|
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
-
var _styleBook = _interopRequireDefault(require("../style-book"));
|
|
18
|
-
var _constants = require("../style-book/constants");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
/**
|
|
21
21
|
* WordPress dependencies
|
|
@@ -29,56 +29,40 @@ const {
|
|
|
29
29
|
useLocation,
|
|
30
30
|
useHistory
|
|
31
31
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
32
|
-
const {
|
|
33
|
-
Menu
|
|
34
|
-
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
35
32
|
const GlobalStylesPageActions = ({
|
|
36
33
|
isStyleBookOpened,
|
|
37
|
-
setIsStyleBookOpened
|
|
34
|
+
setIsStyleBookOpened,
|
|
35
|
+
path
|
|
38
36
|
}) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children: (0, _i18n.__)('Style book')
|
|
54
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
|
|
55
|
-
children: (0, _i18n.__)('Preview blocks and styles.')
|
|
56
|
-
})]
|
|
57
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu.RadioItem, {
|
|
58
|
-
value: false,
|
|
59
|
-
checked: !isStyleBookOpened,
|
|
60
|
-
name: "styles-preview-actions",
|
|
61
|
-
onChange: () => setIsStyleBookOpened(false),
|
|
62
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemLabel, {
|
|
63
|
-
children: (0, _i18n.__)('Site')
|
|
64
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
|
|
65
|
-
children: (0, _i18n.__)('Preview your site.')
|
|
66
|
-
})]
|
|
67
|
-
})]
|
|
37
|
+
const history = useHistory();
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
39
|
+
isPressed: isStyleBookOpened,
|
|
40
|
+
icon: _icons.seen,
|
|
41
|
+
label: (0, _i18n.__)('Style Book'),
|
|
42
|
+
onClick: () => {
|
|
43
|
+
setIsStyleBookOpened(!isStyleBookOpened);
|
|
44
|
+
const updatedPath = !isStyleBookOpened ? (0, _url.addQueryArgs)(path, {
|
|
45
|
+
preview: 'stylebook'
|
|
46
|
+
}) : (0, _url.removeQueryArgs)(path, 'preview');
|
|
47
|
+
// Navigate to the updated path.
|
|
48
|
+
history.navigate(updatedPath);
|
|
49
|
+
},
|
|
50
|
+
size: "compact"
|
|
68
51
|
});
|
|
69
52
|
};
|
|
70
|
-
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Hook to deal with navigation and location state.
|
|
56
|
+
*
|
|
57
|
+
* @return {Array} The current section and a function to update it.
|
|
58
|
+
*/
|
|
59
|
+
const useSection = () => {
|
|
71
60
|
const {
|
|
72
61
|
path,
|
|
73
62
|
query
|
|
74
63
|
} = useLocation();
|
|
75
64
|
const history = useHistory();
|
|
76
|
-
|
|
77
|
-
canvas = 'view'
|
|
78
|
-
} = query;
|
|
79
|
-
const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(false);
|
|
80
|
-
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
81
|
-
const [section, onChangeSection] = (0, _element.useMemo)(() => {
|
|
65
|
+
return (0, _element.useMemo)(() => {
|
|
82
66
|
var _query$section;
|
|
83
67
|
return [(_query$section = query.section) !== null && _query$section !== void 0 ? _query$section : '/', updatedSection => {
|
|
84
68
|
history.navigate((0, _url.addQueryArgs)(path, {
|
|
@@ -86,11 +70,21 @@ function GlobalStylesUIWrapper() {
|
|
|
86
70
|
}));
|
|
87
71
|
}];
|
|
88
72
|
}, [path, query.section, history]);
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
};
|
|
74
|
+
exports.useSection = useSection;
|
|
75
|
+
function GlobalStylesUIWrapper() {
|
|
76
|
+
const {
|
|
77
|
+
path
|
|
78
|
+
} = useLocation();
|
|
79
|
+
const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(path.includes('preview=stylebook'));
|
|
80
|
+
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
81
|
+
const [section, onChangeSection] = useSection();
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
|
|
91
84
|
actions: !isMobileViewport ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesPageActions, {
|
|
92
85
|
isStyleBookOpened: isStyleBookOpened,
|
|
93
|
-
setIsStyleBookOpened: setIsStyleBookOpened
|
|
86
|
+
setIsStyleBookOpened: setIsStyleBookOpened,
|
|
87
|
+
path: path
|
|
94
88
|
}) : null,
|
|
95
89
|
className: "edit-site-styles",
|
|
96
90
|
title: (0, _i18n.__)('Styles'),
|
|
@@ -98,32 +92,7 @@ function GlobalStylesUIWrapper() {
|
|
|
98
92
|
path: section,
|
|
99
93
|
onPathChange: onChangeSection
|
|
100
94
|
})
|
|
101
|
-
})
|
|
102
|
-
enableResizing: false,
|
|
103
|
-
showCloseButton: false,
|
|
104
|
-
showTabs: false,
|
|
105
|
-
isSelected: blockName =>
|
|
106
|
-
// Match '/blocks/core%2Fbutton' and
|
|
107
|
-
// '/blocks/core%2Fbutton/typography', but not
|
|
108
|
-
// '/blocks/core%2Fbuttons'.
|
|
109
|
-
section === `/blocks/${encodeURIComponent(blockName)}` || section.startsWith(`/blocks/${encodeURIComponent(blockName)}/`),
|
|
110
|
-
path: section,
|
|
111
|
-
onSelect: blockName => {
|
|
112
|
-
if (_constants.STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
|
|
113
|
-
// Go to color palettes Global Styles.
|
|
114
|
-
onChangeSection('/colors/palette');
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (blockName === 'typography') {
|
|
118
|
-
// Go to typography Global Styles.
|
|
119
|
-
onChangeSection('/typography');
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Now go to the selected block.
|
|
124
|
-
onChangeSection(`/blocks/${encodeURIComponent(blockName)}`);
|
|
125
|
-
}
|
|
126
|
-
})]
|
|
95
|
+
})
|
|
127
96
|
});
|
|
128
97
|
}
|
|
129
98
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_url","_ui","_interopRequireDefault","_page","_lockUnlock","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_url","_icons","_ui","_interopRequireDefault","_page","_lockUnlock","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","path","history","jsx","Button","isPressed","icon","seen","label","__","onClick","updatedPath","addQueryArgs","preview","removeQueryArgs","navigate","size","useSection","query","useMemo","_query$section","section","updatedSection","exports","GlobalStylesUIWrapper","useState","includes","isMobileViewport","useViewportMatch","onChangeSection","Fragment","children","default","actions","className","title","onPathChange"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button } from '@wordpress/components';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { seen } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n\tpath,\n} ) => {\n\tconst history = useHistory();\n\treturn (\n\t\t<Button\n\t\t\tisPressed={ isStyleBookOpened }\n\t\t\ticon={ seen }\n\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tsetIsStyleBookOpened( ! isStyleBookOpened );\n\t\t\t\tconst updatedPath = ! isStyleBookOpened\n\t\t\t\t\t? addQueryArgs( path, { preview: 'stylebook' } )\n\t\t\t\t\t: removeQueryArgs( path, 'preview' );\n\t\t\t\t// Navigate to the updated path.\n\t\t\t\thistory.navigate( updatedPath );\n\t\t\t} }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n};\n\n/**\n * Hook to deal with navigation and location state.\n *\n * @return {Array} The current section and a function to update it.\n */\nexport const useSection = () => {\n\tconst { path, query } = useLocation();\n\tconst history = useHistory();\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\tquery.section ?? '/',\n\t\t\t( updatedSection ) => {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tsection: updatedSection,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t];\n\t}, [ path, query.section, history ] );\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { path } = useLocation();\n\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState(\n\t\tpath.includes( 'preview=stylebook' )\n\t);\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ section, onChangeSection ] = useSection();\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI\n\t\t\t\t\tpath={ section }\n\t\t\t\t\tonPathChange={ onChangeSection }\n\t\t\t\t/>\n\t\t\t</Page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,oBAAsB;QAC7CC,IAAI,EAAGA;MAAM,CACb,CAAC,GACC,IACJ;MACDiC,SAAS,EAAC,kBAAkB;MAC5BC,KAAK,EAAG,IAAA1B,QAAE,EAAE,QAAS,CAAG;MAAAsB,QAAA,eAExB,IAAAtC,WAAA,CAAAU,GAAA,EAACd,GAAA,CAAA2C,OAAc;QACd/B,IAAI,EAAGoB,OAAS;QAChBe,YAAY,EAAGP;MAAiB,CAChC;IAAC,CACG;EAAC,CACN,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,12 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenGlobalStylesContent;
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
9
|
var _components = require("@wordpress/components");
|
|
11
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
12
10
|
var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
|
|
13
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
14
|
-
var _store = require("../../store");
|
|
15
11
|
var _variationsColor = _interopRequireDefault(require("../global-styles/variations/variations-color"));
|
|
16
12
|
var _variationsTypography = _interopRequireDefault(require("../global-styles/variations/variations-typography"));
|
|
17
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -23,42 +19,20 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
19
|
* Internal dependencies
|
|
24
20
|
*/
|
|
25
21
|
|
|
26
|
-
const noop = () => {};
|
|
27
22
|
function SidebarNavigationScreenGlobalStylesContent() {
|
|
28
|
-
const {
|
|
29
|
-
storedSettings
|
|
30
|
-
} = (0, _data.useSelect)(select => {
|
|
31
|
-
const {
|
|
32
|
-
getSettings
|
|
33
|
-
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
34
|
-
return {
|
|
35
|
-
storedSettings: getSettings()
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
23
|
const gap = 3;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className: "edit-site-global-styles-variation-container",
|
|
52
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
|
|
53
|
-
gap: gap
|
|
54
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
|
|
55
|
-
title: (0, _i18n.__)('Palettes'),
|
|
56
|
-
gap: gap
|
|
57
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
|
|
58
|
-
title: (0, _i18n.__)('Typography'),
|
|
59
|
-
gap: gap
|
|
60
|
-
})]
|
|
61
|
-
})
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
25
|
+
spacing: 10,
|
|
26
|
+
className: "edit-site-global-styles-variation-container",
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styleVariationsContainer.default, {
|
|
28
|
+
gap: gap
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsColor.default, {
|
|
30
|
+
title: (0, _i18n.__)('Palettes'),
|
|
31
|
+
gap: gap
|
|
32
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_variationsTypography.default, {
|
|
33
|
+
title: (0, _i18n.__)('Typography'),
|
|
34
|
+
gap: gap
|
|
35
|
+
})]
|
|
62
36
|
});
|
|
63
37
|
}
|
|
64
38
|
//# sourceMappingURL=content.js.map
|