@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.a9f418477.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +3 -16
- 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/index.js +1 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +31 -29
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +4 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews-actions/index.js +1 -5
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +38 -22
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +5 -0
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +19 -4
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.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 +2 -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} +10 -29
- package/build/components/global-styles/preview-wrapper.js.map +1 -0
- 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-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +44 -19
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +6 -57
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +31 -30
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +6 -34
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +34 -46
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/header.js +83 -0
- package/build/components/post-edit/header.js.map +1 -0
- package/build/components/post-edit/index.js +42 -7
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +26 -40
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js +10 -16
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +3 -7
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
- package/build/components/posts-app-routes/post-item.js.map +1 -0
- package/build/components/posts-app-routes/posts.js +89 -0
- package/build/components/posts-app-routes/posts.js.map +1 -0
- package/build/components/resizable-frame/index.js +6 -5
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-panel/index.js +9 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +7 -24
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +8 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -2
- package/build/components/sidebar-navigation-screen/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-global-styles/index.js +8 -19
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
- package/build/components/site-editor-routes/home.js.map +1 -0
- package/build/components/site-editor-routes/index.js +12 -18
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +49 -0
- package/build/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
- package/build/components/site-editor-routes/navigation.js.map +1 -0
- package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
- package/build/components/site-editor-routes/page-item.js.map +1 -0
- package/build/components/site-editor-routes/pages.js +87 -0
- package/build/components/site-editor-routes/pages.js.map +1 -0
- package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
- package/build/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
- package/build/components/site-editor-routes/patterns.js.map +1 -0
- package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
- package/build/components/site-editor-routes/styles.js.map +1 -0
- package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
- package/build/components/site-editor-routes/template-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
- package/build/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
- package/build/components/site-editor-routes/templates.js.map +1 -0
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +8 -19
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +42 -27
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +21 -5
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -48
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +2 -2
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/store/private-actions.js +7 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +2 -0
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -8
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +3 -16
- 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/index.js +1 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +33 -31
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +1 -5
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +5 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -1
- 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 +37 -27
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.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 +2 -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} +12 -31
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
- 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-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +45 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +7 -58
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +29 -28
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +5 -31
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +33 -45
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/header.js +76 -0
- package/build-module/components/post-edit/header.js.map +1 -0
- package/build-module/components/post-edit/index.js +42 -7
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +26 -40
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +3 -7
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
- package/build-module/components/posts-app-routes/post-item.js.map +1 -0
- package/build-module/components/posts-app-routes/posts.js +81 -0
- package/build-module/components/posts-app-routes/posts.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +6 -5
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +9 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +7 -24
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +8 -5
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen/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-global-styles/index.js +9 -20
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
- package/build-module/components/site-editor-routes/home.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +12 -18
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +41 -0
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation.js +38 -0
- package/build-module/components/site-editor-routes/navigation.js.map +1 -0
- package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
- package/build-module/components/site-editor-routes/page-item.js.map +1 -0
- package/build-module/components/site-editor-routes/pages.js +79 -0
- package/build-module/components/site-editor-routes/pages.js.map +1 -0
- package/build-module/components/site-editor-routes/pattern-item.js +18 -0
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
- package/build-module/components/site-editor-routes/patterns.js.map +1 -0
- package/build-module/components/site-editor-routes/styles.js +44 -0
- package/build-module/components/site-editor-routes/styles.js.map +1 -0
- package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
- package/build-module/components/site-editor-routes/template-item.js.map +1 -0
- package/build-module/components/site-editor-routes/template-part-item.js +18 -0
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build-module/components/site-editor-routes/templates.js +33 -0
- package/build-module/components/site-editor-routes/templates.js.map +1 -0
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +8 -19
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +42 -27
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +21 -5
- 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/hooks/commands/use-common-commands.js +12 -48
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +2 -2
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/store/private-actions.js +6 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +2 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -8
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/posts-rtl.css +73 -107
- package/build-style/posts.css +73 -107
- package/build-style/style-rtl.css +201 -142
- package/build-style/style.css +201 -142
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +3 -5
- package/src/components/app/index.js +34 -35
- package/src/components/block-editor/use-editor-iframe-props.js +5 -4
- package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
- package/src/components/block-editor/use-site-editor-settings.js +6 -6
- package/src/components/dataviews-actions/index.js +1 -5
- package/src/components/editor/index.js +64 -29
- package/src/components/editor/use-editor-title.js +4 -0
- package/src/components/editor/use-resolve-edited-entity.js +17 -2
- package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
- package/src/components/global-styles/font-library-modal/style.scss +12 -5
- 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/style.scss +5 -1
- package/src/components/global-styles/typography-example.js +12 -1
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +43 -11
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +9 -65
- package/src/components/page-patterns/index.js +39 -25
- package/src/components/page-patterns/style.scss +0 -28
- package/src/components/page-templates/fields.js +3 -31
- package/src/components/page-templates/index.js +34 -51
- package/src/components/post-edit/header.js +88 -0
- package/src/components/post-edit/index.js +39 -7
- package/src/components/post-edit/style.scss +10 -0
- package/src/components/post-list/index.js +44 -40
- package/src/components/post-list/style.scss +0 -36
- package/src/components/posts-app/index.js +9 -18
- package/src/components/posts-app-routes/index.js +3 -14
- package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
- package/src/components/posts-app-routes/posts.js +66 -0
- package/src/components/resizable-frame/index.js +6 -7
- package/src/components/save-panel/index.js +11 -5
- package/src/components/sidebar-dataviews/add-new-view.js +9 -9
- package/src/components/sidebar-dataviews/dataview-item.js +5 -8
- package/src/components/sidebar-dataviews/default-views.js +7 -24
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-dataviews/style.scss +2 -2
- package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
- package/src/components/sidebar-navigation-item/index.js +7 -5
- package/src/components/sidebar-navigation-item/style.scss +1 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
- package/src/components/sidebar-navigation-screen-main/index.js +6 -10
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
- package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
- package/src/components/site-editor-routes/index.js +22 -34
- package/src/components/site-editor-routes/navigation-item.js +39 -0
- package/src/components/site-editor-routes/navigation.js +34 -0
- package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
- package/src/components/site-editor-routes/pages.js +66 -0
- package/src/components/site-editor-routes/pattern-item.js +15 -0
- package/src/components/site-editor-routes/patterns.js +15 -0
- package/src/components/site-editor-routes/styles.js +39 -0
- package/src/components/site-editor-routes/template-item.js +15 -0
- package/src/components/site-editor-routes/template-part-item.js +15 -0
- package/src/components/site-editor-routes/templates.js +26 -0
- package/src/components/site-hub/index.js +3 -6
- package/src/components/style-book/constants.ts +8 -19
- package/src/components/style-book/examples.tsx +47 -28
- package/src/components/style-book/index.js +28 -5
- package/src/components/style-book/types.ts +1 -1
- package/src/hooks/commands/use-common-commands.js +14 -72
- package/src/hooks/commands/use-set-command-context.js +2 -2
- package/src/store/private-actions.js +7 -0
- package/src/store/reducer.js +2 -0
- package/src/style.scss +1 -0
- package/src/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- 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/components/layout/router.js +0 -92
- package/build/components/layout/router.js.map +0 -1
- package/build/components/posts-app-routes/home.js.map +0 -1
- package/build/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view.js +0 -48
- package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
- package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-view.js +0 -41
- package/build/components/posts-app-routes/posts-view.js.map +0 -1
- package/build/components/routes/link.js +0 -69
- package/build/components/routes/link.js.map +0 -1
- package/build/components/site-editor-routes/home-edit.js.map +0 -1
- package/build/components/site-editor-routes/home-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-edit.js +0 -29
- package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
- package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-view.js +0 -30
- package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-view.js +0 -28
- package/build/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view.js +0 -47
- package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-view.js +0 -42
- package/build/components/site-editor-routes/pages-view.js.map +0 -1
- package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build/components/site-editor-routes/styles-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-view.js +0 -29
- package/build/components/site-editor-routes/templates-view.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/build-module/components/layout/router.js +0 -84
- package/build-module/components/layout/router.js.map +0 -1
- package/build-module/components/posts-app-routes/home.js +0 -40
- package/build-module/components/posts-app-routes/home.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
- package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view.js +0 -33
- package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
- package/build-module/components/routes/link.js +0 -61
- package/build-module/components/routes/link.js.map +0 -1
- package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/home-view.js +0 -17
- package/build-module/components/site-editor-routes/home-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
- package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-view.js +0 -20
- package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
- package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view.js +0 -34
- package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
- package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build-module/components/site-editor-routes/styles-view.js +0 -25
- package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
- package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-view.js +0 -21
- package/build-module/components/site-editor-routes/templates-view.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
- package/src/components/layout/router.js +0 -86
- package/src/components/posts-app-routes/home.js +0 -36
- package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
- package/src/components/posts-app-routes/posts-list-view.js +0 -40
- package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
- package/src/components/posts-app-routes/posts-view.js +0 -35
- package/src/components/routes/link.js +0 -68
- package/src/components/site-editor-routes/home-edit.js +0 -17
- package/src/components/site-editor-routes/navigation-edit.js +0 -22
- package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
- package/src/components/site-editor-routes/navigation-item-view.js +0 -25
- package/src/components/site-editor-routes/navigation-view.js +0 -21
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/src/components/site-editor-routes/pages-list-view.js +0 -44
- package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/src/components/site-editor-routes/pages-view.js +0 -39
- package/src/components/site-editor-routes/patterns-edit.js +0 -24
- package/src/components/site-editor-routes/patterns-view.js +0 -22
- package/src/components/site-editor-routes/styles-view.js +0 -26
- package/src/components/site-editor-routes/templates-edit.js +0 -22
- package/src/components/site-editor-routes/templates-list-view.js +0 -28
- package/src/components/site-editor-routes/templates-view.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_components","_data","_element","_i18n","_blockEditor","_router","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","useHistory","unlock","routerPrivateApis","LeafMoreMenu","props","history","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","useDispatch","blockEditorStore","removeLabel","sprintf","__","BlockTitle","maximumLength","goToLabel","rootClientId","useSelect","select","getBlockRootClientId","onGoToPage","useCallback","selectedBlock","attributes","name","kind","id","type","
|
|
1
|
+
{"version":3,"names":["_icons","require","_components","_data","_element","_i18n","_blockEditor","_router","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","useHistory","useLocation","unlock","routerPrivateApis","LeafMoreMenu","props","history","path","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","useDispatch","blockEditorStore","removeLabel","sprintf","__","BlockTitle","maximumLength","goToLabel","rootClientId","useSelect","select","getBlockRootClientId","onGoToPage","useCallback","selectedBlock","attributes","name","kind","id","type","navigate","state","backPath","jsx","DropdownMenu","icon","moreVertical","label","popoverProps","noIcons","children","onClose","jsxs","Fragment","MenuGroup","MenuItem","chevronUp","onClick","chevronDown"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nexport default function LeafMoreMenu( props ) {\n\tconst history = useHistory();\n\tconst { path } = useLocation();\n\tconst { block } = props;\n\tconst { clientId } = block;\n\tconst { moveBlocksDown, moveBlocksUp, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst removeLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst goToLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Go to %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onGoToPage = useCallback(\n\t\t( selectedBlock ) => {\n\t\t\tconst { attributes, name } = selectedBlock;\n\t\t\tif (\n\t\t\t\tattributes.kind === 'post-type' &&\n\t\t\t\tattributes.id &&\n\t\t\t\tattributes.type &&\n\t\t\t\thistory\n\t\t\t) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\t`/${ attributes.type }/${ attributes.id }?canvas=edit`,\n\t\t\t\t\t{\n\t\t\t\t\t\tstate: { backPath: path },\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( name === 'core/page-list-item' && attributes.id && history ) {\n\t\t\t\thistory.navigate( `/page/${ attributes.id }?canvas=edit`, {\n\t\t\t\t\tstate: { backPath: path },\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ path, history ]\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move up' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Move down' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t{ block.attributes?.type === 'page' &&\n\t\t\t\t\t\t\tblock.attributes?.id && (\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\tonGoToPage( block );\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{ goToLabel }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ removeLabel }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAUA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AApB3C;AACA;AACA;;AAUA,MAAMS,aAAa,GAAG;EACrBC,SAAS,EAAE,2CAA2C;EACtDC,SAAS,EAAE;AACZ,CAAC;;AAED;AACA;AACA;;AAGA,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEhD,SAASC,YAAYA,CAAEC,KAAK,EAAG;EAC7C,MAAMC,OAAO,GAAGN,UAAU,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGN,WAAW,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IAClCxB,KAAK,CAACoB,UAAU,EAAEG,EAAE,iBACnB,IAAAnC,WAAA,CAAAwC,GAAA,EAAC/C,WAAA,CAAA2D,QAAQ;UACRE,OAAO,EAAGA,CAAA,KAAM;YACfzB,UAAU,CAAEjB,KAAM,CAAC;YACnBoC,OAAO,CAAC,CAAC;UACV,CAAG;UAAAD,QAAA,EAEDvB;QAAS,CACF,CACV;MAAA,CACQ,CAAC,eACZ,IAAAxB,WAAA,CAAAwC,GAAA,EAAC/C,WAAA,CAAA0D,SAAS;QAAAJ,QAAA,eACT,IAAA/C,WAAA,CAAAwC,GAAA,EAAC/C,WAAA,CAAA2D,QAAQ;UACRE,OAAO,EAAGA,CAAA,KAAM;YACftC,YAAY,CAAE,CAAEH,QAAQ,CAAE,EAAE,KAAM,CAAC;YACnCmC,OAAO,CAAC,CAAC;UACV,CAAG;UAAAD,QAAA,EAED5B;QAAW,CACJ;MAAC,CACD,CAAC;IAAA,CACX;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = CategoryItem;
|
|
8
8
|
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
9
|
-
var _link = require("../routes/link");
|
|
10
|
-
var _constants = require("../../utils/constants");
|
|
11
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
10
|
/**
|
|
13
11
|
* Internal dependencies
|
|
@@ -21,20 +19,20 @@ function CategoryItem({
|
|
|
21
19
|
label,
|
|
22
20
|
type
|
|
23
21
|
}) {
|
|
24
|
-
const linkInfo = (0, _link.useLink)({
|
|
25
|
-
categoryId: id !== _constants.TEMPLATE_PART_ALL_AREAS_CATEGORY && id !== _constants.PATTERN_DEFAULT_CATEGORY ? id : undefined,
|
|
26
|
-
postType: type === _constants.TEMPLATE_PART_POST_TYPE ? _constants.TEMPLATE_PART_POST_TYPE : _constants.PATTERN_TYPES.user
|
|
27
|
-
});
|
|
28
22
|
if (!count) {
|
|
29
23
|
return;
|
|
30
24
|
}
|
|
25
|
+
const queryArgs = [`postType=${type}`];
|
|
26
|
+
if (id) {
|
|
27
|
+
queryArgs.push(`categoryId=${id}`);
|
|
28
|
+
}
|
|
31
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
32
|
-
...linkInfo,
|
|
33
30
|
icon: icon,
|
|
34
31
|
suffix: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
35
32
|
children: count
|
|
36
33
|
}),
|
|
37
34
|
"aria-current": isActive ? 'true' : undefined,
|
|
35
|
+
to: `/pattern?${queryArgs.join('&')}`,
|
|
38
36
|
children: label
|
|
39
37
|
});
|
|
40
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sidebarNavigationItem","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_sidebarNavigationItem","_interopRequireDefault","require","_jsxRuntime","CategoryItem","count","icon","id","isActive","label","type","queryArgs","push","jsx","default","suffix","children","undefined","to","join"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/category-item.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function CategoryItem( {\n\tcount,\n\ticon,\n\tid,\n\tisActive,\n\tlabel,\n\ttype,\n} ) {\n\tif ( ! count ) {\n\t\treturn;\n\t}\n\tconst queryArgs = [ `postType=${ type }` ];\n\tif ( id ) {\n\t\tqueryArgs.push( `categoryId=${ id }` );\n\t}\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\ticon={ icon }\n\t\t\tsuffix={ <span>{ count }</span> }\n\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t\tto={ `/pattern?${ queryArgs.join( '&' ) }` }\n\t\t>\n\t\t\t{ label }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+D,IAAAC,WAAA,GAAAD,OAAA;AAH/D;AACA;AACA;;AAGe,SAASE,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,EAAE;EACFC,QAAQ;EACRC,KAAK;EACLC;AACD,CAAC,EAAG;EACH,IAAK,CAAEL,KAAK,EAAG;IACd;EACD;EACA,MAAMM,SAAS,GAAG,CAAE,YAAaD,IAAI,EAAG,CAAE;EAC1C,IAAKH,EAAE,EAAG;IACTI,SAAS,CAACC,IAAI,CAAE,cAAeL,EAAE,EAAI,CAAC;EACvC;EAEA,oBACC,IAAAJ,WAAA,CAAAU,GAAA,EAACb,sBAAA,CAAAc,OAAqB;IACrBR,IAAI,EAAGA,IAAM;IACbS,MAAM,eAAG,IAAAZ,WAAA,CAAAU,GAAA;MAAAG,QAAA,EAAQX;IAAK,CAAQ,CAAG;IACjC,gBAAeG,QAAQ,GAAG,MAAM,GAAGS,SAAW;IAC9CC,EAAE,EAAG,YAAaP,SAAS,CAACQ,IAAI,CAAE,GAAI,CAAC,EAAK;IAAAH,QAAA,EAE1CP;EAAK,CACe,CAAC;AAE1B","ignoreList":[]}
|
|
@@ -81,13 +81,12 @@ function SidebarNavigationScreenPatterns({
|
|
|
81
81
|
backPath
|
|
82
82
|
}) {
|
|
83
83
|
const {
|
|
84
|
-
|
|
85
|
-
postType,
|
|
84
|
+
query: {
|
|
85
|
+
postType = 'wp_block',
|
|
86
86
|
categoryId
|
|
87
87
|
}
|
|
88
88
|
} = useLocation();
|
|
89
|
-
const
|
|
90
|
-
const currentCategory = categoryId || (currentType === _constants.PATTERN_TYPES.user ? _constants.PATTERN_DEFAULT_CATEGORY : _constants.TEMPLATE_PART_ALL_AREAS_CATEGORY);
|
|
89
|
+
const currentCategory = categoryId || (postType === _constants.PATTERN_TYPES.user ? _constants.PATTERN_DEFAULT_CATEGORY : _constants.TEMPLATE_PART_ALL_AREAS_CATEGORY);
|
|
91
90
|
const {
|
|
92
91
|
templatePartAreas,
|
|
93
92
|
hasTemplateParts,
|
|
@@ -114,7 +113,7 @@ function SidebarNavigationScreenPatterns({
|
|
|
114
113
|
templatePartAreas: templatePartAreas,
|
|
115
114
|
patternCategories: patternCategories,
|
|
116
115
|
currentCategory: currentCategory,
|
|
117
|
-
currentType:
|
|
116
|
+
currentType: postType
|
|
118
117
|
})]
|
|
119
118
|
})]
|
|
120
119
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","_i18n","_coreData","_data","_icons","_router","_sidebarNavigationScreen","_interopRequireDefault","_categoryItem","_constants","_usePatternCategories","_useTemplatePartAreas","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","jsxs","__experimentalItemGroup","className","children","jsx","default","count","Object","values","map","templateParts","length","reduce","acc","val","icon","getTemplatePartIcon","label","__","id","TEMPLATE_PART_ALL_AREAS_CATEGORY","type","TEMPLATE_PART_POST_TYPE","isActive","entries","area","file","name","PATTERN_TYPES","user","category","SidebarNavigationScreenPatterns","backPath","params","postType","categoryId","PATTERN_DEFAULT_CATEGORY","hasTemplateParts","isLoading","useTemplatePartAreas","hasPatterns","usePatternCategories","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","isRoot","title","description","content","Fragment","__experimentalItem"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tparams: { postType, categoryId },\n\t} = useLocation();\n\tconst currentType = postType || PATTERN_TYPES.user;\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( currentType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ currentType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAD,sBAAA,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B,IAAI,CAAEG,WAAW,iBACpC,IAAAnD,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA2B,uBAAS;UAACC,SAAS,EAAC,qDAAqD;UAAAC,QAAA,eACzE,IAAAd,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA+E,kBAAI;YAAAlD,QAAA,EAAG,IAAAe,QAAE,EAAE,gBAAiB;UAAC,CAAQ;QAAC,CAC7B,CACX,eACD,IAAA7B,WAAA,CAAAe,GAAA,EAACX,eAAe;UACfC,iBAAiB,EAAGA,iBAAmB;UACvCC,iBAAiB,EAAGA,iBAAmB;UACvCC,eAAe,EAAGA,eAAiB;UACnCC,WAAW,EAAGA;QAAa,CAC3B,CAAC;MAAA,CACD,CACF;IAAA,CACA;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_editor","_i18n","_coreData","_data","_icons","_router","_sidebarNavigationScreen","_interopRequireDefault","_categoryItem","_constants","_usePatternCategories","_useTemplatePartAreas","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","jsxs","__experimentalItemGroup","className","children","jsx","default","count","Object","values","map","templateParts","length","reduce","acc","val","icon","getTemplatePartIcon","label","__","id","TEMPLATE_PART_ALL_AREAS_CATEGORY","type","TEMPLATE_PART_POST_TYPE","isActive","entries","area","file","name","PATTERN_TYPES","user","category","SidebarNavigationScreenPatterns","backPath","query","postType","categoryId","PATTERN_DEFAULT_CATEGORY","hasTemplateParts","isLoading","useTemplatePartAreas","hasPatterns","usePatternCategories","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","isRoot","title","description","content","Fragment","__experimentalItem"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartAreas,\n\tpatternCategories,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\tconst [ allPatterns, ...otherPatterns ] = patternCategories;\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t<CategoryItem\n\t\t\t\tkey=\"all\"\n\t\t\t\tcount={ Object.values( templatePartAreas )\n\t\t\t\t\t.map( ( { templateParts } ) => templateParts?.length || 0 )\n\t\t\t\t\t.reduce( ( acc, val ) => acc + val, 0 ) }\n\t\t\t\ticon={ getTemplatePartIcon() } /* no name, so it provides the fallback icon */\n\t\t\t\tlabel={ __( 'All template parts' ) }\n\t\t\t\tid={ TEMPLATE_PART_ALL_AREAS_CATEGORY }\n\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\tisActive={\n\t\t\t\t\tcurrentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY &&\n\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ Object.entries( templatePartAreas ).map(\n\t\t\t\t( [ area, { label, templateParts } ] ) => (\n\t\t\t\t\t<CategoryItem\n\t\t\t\t\t\tkey={ area }\n\t\t\t\t\t\tcount={ templateParts?.length }\n\t\t\t\t\t\ticon={ getTemplatePartIcon( area ) }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tid={ area }\n\t\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\tcurrentCategory === area &&\n\t\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ allPatterns && (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ allPatterns.name }\n\t\t\t\t\tcount={ allPatterns.count }\n\t\t\t\t\tlabel={ allPatterns.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ allPatterns.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ allPatterns.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ otherPatterns.map( ( category ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ category.name }\n\t\t\t\t\tcount={ category.count }\n\t\t\t\t\tlabel={ category.label }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ category.name }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ category.name }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId },\n\t} = useLocation();\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( postType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { templatePartAreas, hasTemplateParts, isLoading } =\n\t\tuseTemplatePartAreas();\n\tconst { patternCategories, hasPatterns } = usePatternCategories();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ ! isBlockBasedTheme }\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartAreas={ templatePartAreas }\n\t\t\t\t\t\t\t\tpatternCategories={ patternCategories }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ postType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAA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AAE,EAAE,gBAAiB,CAAC,EACnC,CAAEoB,SAAS,iBACZ,IAAAjD,WAAA,CAAAW,IAAA,EAAAX,WAAA,CAAA+D,QAAA;QAAAjD,QAAA,GACG,CAAEkC,gBAAgB,IAAI,CAAEG,WAAW,iBACpC,IAAAnD,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA2B,uBAAS;UAACC,SAAS,EAAC,qDAAqD;UAAAC,QAAA,eACzE,IAAAd,WAAA,CAAAe,GAAA,EAAC9B,WAAA,CAAA+E,kBAAI;YAAAlD,QAAA,EAAG,IAAAe,QAAE,EAAE,gBAAiB;UAAC,CAAQ;QAAC,CAC7B,CACX,eACD,IAAA7B,WAAA,CAAAe,GAAA,EAACX,eAAe;UACfC,iBAAiB,EAAGA,iBAAmB;UACvCC,iBAAiB,EAAGA,iBAAmB;UACvCC,eAAe,EAAGA,eAAiB;UACnCC,WAAW,EAAGqC;QAAU,CACxB,CAAC;MAAA,CACD,CACF;IAAA,CACA;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -8,10 +8,14 @@ exports.default = DataviewsTemplatesSidebarContent;
|
|
|
8
8
|
var _coreData = require("@wordpress/core-data");
|
|
9
9
|
var _element = require("@wordpress/element");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
|
-
var
|
|
11
|
+
var _i18n = require("@wordpress/i18n");
|
|
12
|
+
var _router = require("@wordpress/router");
|
|
13
|
+
var _url = require("@wordpress/url");
|
|
14
|
+
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
12
15
|
var _hooks = require("../page-templates/hooks");
|
|
13
16
|
var _icons = require("@wordpress/icons");
|
|
14
17
|
var _constants = require("../../utils/constants");
|
|
18
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
20
|
/**
|
|
17
21
|
* WordPress dependencies
|
|
@@ -21,6 +25,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
25
|
* Internal dependencies
|
|
22
26
|
*/
|
|
23
27
|
|
|
28
|
+
const {
|
|
29
|
+
useLocation
|
|
30
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
24
31
|
const EMPTY_ARRAY = [];
|
|
25
32
|
function TemplateDataviewItem({
|
|
26
33
|
template,
|
|
@@ -30,18 +37,21 @@ function TemplateDataviewItem({
|
|
|
30
37
|
text,
|
|
31
38
|
icon
|
|
32
39
|
} = (0, _hooks.useAddedBy)(template.type, template.id);
|
|
33
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
41
|
+
to: (0, _url.addQueryArgs)('/template', {
|
|
42
|
+
activeView: text
|
|
43
|
+
}),
|
|
36
44
|
icon: icon,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
45
|
+
"aria-current": isActive,
|
|
46
|
+
children: text
|
|
47
|
+
});
|
|
40
48
|
}
|
|
41
|
-
function DataviewsTemplatesSidebarContent({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
function DataviewsTemplatesSidebarContent() {
|
|
50
|
+
const {
|
|
51
|
+
query: {
|
|
52
|
+
activeView = 'all'
|
|
53
|
+
}
|
|
54
|
+
} = useLocation();
|
|
45
55
|
const {
|
|
46
56
|
records
|
|
47
57
|
} = (0, _coreData.useEntityRecords)('postType', _constants.TEMPLATE_POST_TYPE, {
|
|
@@ -59,12 +69,11 @@ function DataviewsTemplatesSidebarContent({
|
|
|
59
69
|
return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : EMPTY_ARRAY;
|
|
60
70
|
}, [records]);
|
|
61
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
62
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
63
|
-
|
|
64
|
-
title: title,
|
|
72
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
73
|
+
to: "/template",
|
|
65
74
|
icon: _icons.layout,
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
"aria-current": activeView === 'all',
|
|
76
|
+
children: (0, _i18n.__)('All templates')
|
|
68
77
|
}), firstItemPerAuthorText.map(template => {
|
|
69
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TemplateDataviewItem, {
|
|
70
79
|
template: template,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_element","_components","
|
|
1
|
+
{"version":3,"names":["_coreData","require","_element","_components","_i18n","_router","_url","_sidebarNavigationItem","_interopRequireDefault","_hooks","_icons","_constants","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","EMPTY_ARRAY","TemplateDataviewItem","template","isActive","text","icon","useAddedBy","type","id","jsx","default","to","addQueryArgs","activeView","children","DataviewsTemplatesSidebarContent","query","records","useEntityRecords","TEMPLATE_POST_TYPE","per_page","firstItemPerAuthorText","useMemo","_ref","firstItemPerAuthor","reduce","acc","author","author_text","Object","values","jsxs","__experimentalItemGroup","layout","__","map"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useAddedBy } from '../page-templates/hooks';\nimport { layout } from '@wordpress/icons';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction TemplateDataviewItem( { template, isActive } ) {\n\tconst { text, icon } = useAddedBy( template.type, template.id );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ addQueryArgs( '/template', { activeView: text } ) }\n\t\t\ticon={ icon }\n\t\t\taria-current={ isActive }\n\t\t>\n\t\t\t{ text }\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function DataviewsTemplatesSidebarContent() {\n\tconst {\n\t\tquery: { activeView = 'all' },\n\t} = useLocation();\n\tconst { records } = useEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\tper_page: -1,\n\t} );\n\tconst firstItemPerAuthorText = useMemo( () => {\n\t\tconst firstItemPerAuthor = records?.reduce( ( acc, template ) => {\n\t\t\tconst author = template.author_text;\n\t\t\tif ( author && ! acc[ author ] ) {\n\t\t\t\tacc[ author ] = template;\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn (\n\t\t\t( firstItemPerAuthor && Object.values( firstItemPerAuthor ) ) ??\n\t\t\tEMPTY_ARRAY\n\t\t);\n\t}, [ records ] );\n\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto=\"/template\"\n\t\t\t\ticon={ layout }\n\t\t\t\taria-current={ activeView === 'all' }\n\t\t\t>\n\t\t\t\t{ __( 'All templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ firstItemPerAuthorText.map( ( template ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<TemplateDataviewItem\n\t\t\t\t\t\tkey={ template.author_text }\n\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\tisActive={ activeView === template.author_text }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GA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,IAAA;IAC7C,MAAMC,kBAAkB,GAAGP,OAAO,EAAEQ,MAAM,CAAE,CAAEC,GAAG,EAAExB,QAAQ,KAAM;MAChE,MAAMyB,MAAM,GAAGzB,QAAQ,CAAC0B,WAAW;MACnC,IAAKD,MAAM,IAAI,CAAED,GAAG,CAAEC,MAAM,CAAE,EAAG;QAChCD,GAAG,CAAEC,MAAM,CAAE,GAAGzB,QAAQ;MACzB;MACA,OAAOwB,GAAG;IACX,CAAC,EAAE,CAAC,CAAE,CAAC;IACP,QAAAH,IAAA,GACGC,kBAAkB,IAAIK,MAAM,CAACC,MAAM,CAAEN,kBAAmB,CAAC,cAAAD,IAAA,cAAAA,IAAA,GAC3DvB,WAAW;EAEb,CAAC,EAAE,CAAEiB,OAAO,CAAG,CAAC;EAEhB,oBACC,IAAArB,WAAA,CAAAmC,IAAA,EAAC7C,WAAA,CAAA8C,uBAAS;IAAAlB,QAAA,gBACT,IAAAlB,WAAA,CAAAa,GAAA,EAACnB,sBAAA,CAAAoB,OAAqB;MACrBC,EAAE,EAAC,WAAW;MACdN,IAAI,EAAG4B,aAAQ;MACf,gBAAepB,UAAU,KAAK,KAAO;MAAAC,QAAA,EAEnC,IAAAoB,QAAE,EAAE,eAAgB;IAAC,CACD,CAAC,EACtBb,sBAAsB,CAACc,GAAG,CAAIjC,QAAQ,IAAM;MAC7C,oBACC,IAAAN,WAAA,CAAAa,GAAA,EAACR,oBAAoB;QAEpBC,QAAQ,EAAGA,QAAU;QACrBC,QAAQ,EAAGU,UAAU,KAAKX,QAAQ,CAAC0B;MAAa,GAF1C1B,QAAQ,CAAC0B,WAGf,CAAC;IAEJ,CAAE,CAAC;EAAA,CACO,CAAC;AAEd","ignoreList":[]}
|
|
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenTemplatesBrowse;
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _router = require("@wordpress/router");
|
|
10
9
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
11
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
12
10
|
var _content = _interopRequireDefault(require("./content"));
|
|
13
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
12
|
/**
|
|
@@ -19,25 +17,14 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
17
|
* Internal dependencies
|
|
20
18
|
*/
|
|
21
19
|
|
|
22
|
-
const {
|
|
23
|
-
useLocation
|
|
24
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
25
20
|
function SidebarNavigationScreenTemplatesBrowse({
|
|
26
21
|
backPath
|
|
27
22
|
}) {
|
|
28
|
-
const {
|
|
29
|
-
params: {
|
|
30
|
-
activeView = 'all'
|
|
31
|
-
}
|
|
32
|
-
} = useLocation();
|
|
33
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
|
|
34
24
|
title: (0, _i18n.__)('Templates'),
|
|
35
25
|
description: (0, _i18n.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.'),
|
|
36
26
|
backPath: backPath,
|
|
37
|
-
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_content.default, {
|
|
38
|
-
activeView: activeView,
|
|
39
|
-
title: (0, _i18n.__)('All templates')
|
|
40
|
-
})
|
|
27
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_content.default, {})
|
|
41
28
|
});
|
|
42
29
|
}
|
|
43
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_sidebarNavigationScreen","_interopRequireDefault","_content","_jsxRuntime","SidebarNavigationScreenTemplatesBrowse","backPath","jsx","default","title","__","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataviewsTemplatesSidebarContent from './content';\n\nexport default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Create new templates, or reset any customizations made to the templates supplied by your theme.'\n\t\t\t) }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ <DataviewsTemplatesSidebarContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAyD,IAAAI,WAAA,GAAAJ,OAAA;AATzD;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASK,sCAAsCA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9E,oBACC,IAAAF,WAAA,CAAAG,GAAA,EAACN,wBAAA,CAAAO,OAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAC3BC,WAAW,EAAG,IAAAD,QAAE,EACf,iGACD,CAAG;IACHJ,QAAQ,EAAGA,QAAU;IACrBM,OAAO,eAAG,IAAAR,WAAA,CAAAG,GAAA,EAACJ,QAAA,CAAAK,OAAgC,IAAE;EAAG,CAChD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.homeRoute = void 0;
|
|
8
8
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
9
|
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -12,14 +12,13 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
name: 'home
|
|
17
|
-
|
|
18
|
-
return params.canvas !== 'edit';
|
|
19
|
-
},
|
|
15
|
+
const homeRoute = exports.homeRoute = {
|
|
16
|
+
name: 'home',
|
|
17
|
+
path: '/',
|
|
20
18
|
areas: {
|
|
21
19
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
|
|
22
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
20
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
21
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {})
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
//# sourceMappingURL=home
|
|
24
|
+
//# sourceMappingURL=home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenMain","_jsxRuntime","homeRoute","exports","name","path","areas","sidebar","jsx","default","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/home.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nexport const homeRoute = {\n\tname: 'home',\n\tpath: '/',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tpreview: <Editor />,\n\t\tmobile: <SidebarNavigationScreenMain />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAJ5E;AACA;AACA;;AAIO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxBE,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,GAAG;EACTC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAN,WAAA,CAAAO,GAAA,EAACR,4BAAA,CAAAS,OAA2B,IAAE,CAAC;IACxCC,OAAO,eAAE,IAAAT,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC;IACnBE,MAAM,eAAE,IAAAV,WAAA,CAAAO,GAAA,EAACR,4BAAA,CAAAS,OAA2B,IAAE;EACvC;AACD,CAAC","ignoreList":[]}
|
|
@@ -8,23 +8,17 @@ var _data = require("@wordpress/data");
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
var _lockUnlock = require("../../lock-unlock");
|
|
10
10
|
var _store = require("../../store");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var _templatesView = require("./templates-view");
|
|
23
|
-
var _pagesView = require("./pages-view");
|
|
24
|
-
var _pagesEdit = require("./pages-edit");
|
|
25
|
-
var _pagesListView = require("./pages-list-view");
|
|
26
|
-
var _pagesListViewQuickEdit = require("./pages-list-view-quick-edit");
|
|
27
|
-
var _pagesViewQuickEdit = require("./pages-view-quick-edit");
|
|
11
|
+
var _home = require("./home");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _navigation = require("./navigation");
|
|
14
|
+
var _navigationItem = require("./navigation-item");
|
|
15
|
+
var _patterns = require("./patterns");
|
|
16
|
+
var _patternItem = require("./pattern-item");
|
|
17
|
+
var _templatePartItem = require("./template-part-item");
|
|
18
|
+
var _templates = require("./templates");
|
|
19
|
+
var _templateItem = require("./template-item");
|
|
20
|
+
var _pages = require("./pages");
|
|
21
|
+
var _pageItem = require("./page-item");
|
|
28
22
|
/**
|
|
29
23
|
* WordPress dependencies
|
|
30
24
|
*/
|
|
@@ -33,7 +27,7 @@ var _pagesViewQuickEdit = require("./pages-view-quick-edit");
|
|
|
33
27
|
* Internal dependencies
|
|
34
28
|
*/
|
|
35
29
|
|
|
36
|
-
const routes = [
|
|
30
|
+
const routes = [_pageItem.pageItemRoute, _pages.pagesRoute, _templateItem.templateItemRoute, _templates.templatesRoute, _templatePartItem.templatePartItemRoute, _patternItem.patternItemRoute, _patterns.patternsRoute, _navigationItem.navigationItemRoute, _navigation.navigationRoute, _styles.stylesRoute, _home.homeRoute];
|
|
37
31
|
function useRegisterSiteEditorRoutes() {
|
|
38
32
|
const registry = (0, _data.useRegistry)();
|
|
39
33
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_lockUnlock","_store","
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_lockUnlock","_store","_home","_styles","_navigation","_navigationItem","_patterns","_patternItem","_templatePartItem","_templates","_templateItem","_pages","_pageItem","routes","pageItemRoute","pagesRoute","templateItemRoute","templatesRoute","templatePartItemRoute","patternItemRoute","patternsRoute","navigationItemRoute","navigationRoute","stylesRoute","homeRoute","useRegisterSiteEditorRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { homeRoute } from './home';\nimport { stylesRoute } from './styles';\nimport { navigationRoute } from './navigation';\nimport { navigationItemRoute } from './navigation-item';\nimport { patternsRoute } from './patterns';\nimport { patternItemRoute } from './pattern-item';\nimport { templatePartItemRoute } from './template-part-item';\nimport { templatesRoute } from './templates';\nimport { templateItemRoute } from './template-item';\nimport { pagesRoute } from './pages';\nimport { pageItemRoute } from './page-item';\n\nconst routes = [\n\tpageItemRoute,\n\tpagesRoute,\n\ttemplateItemRoute,\n\ttemplatesRoute,\n\ttemplatePartItemRoute,\n\tpatternItemRoute,\n\tpatternsRoute,\n\tnavigationItemRoute,\n\tnavigationRoute,\n\tstylesRoute,\n\thomeRoute,\n];\n\nexport function useRegisterSiteEditorRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AArBA;AACA;AACA;;AAIA;AACA;AACA;;AAeA,MAAMe,MAAM,GAAG,CACdC,uBAAa,EACbC,iBAAU,EACVC,+BAAiB,EACjBC,yBAAc,EACdC,uCAAqB,EACrBC,6BAAgB,EAChBC,uBAAa,EACbC,mCAAmB,EACnBC,2BAAe,EACfC,mBAAW,EACXC,eAAS,CACT;AAEM,SAASC,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBpB,MAAM,CAACqB,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.navigationItemRoute = void 0;
|
|
8
|
+
var _router = require("@wordpress/router");
|
|
9
|
+
var _constants = require("../../utils/constants");
|
|
10
|
+
var _editor = _interopRequireDefault(require("../editor"));
|
|
11
|
+
var _sidebarNavigationScreenNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu"));
|
|
12
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
useLocation
|
|
24
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
25
|
+
function MobileNavigationItemView() {
|
|
26
|
+
const {
|
|
27
|
+
query = {}
|
|
28
|
+
} = useLocation();
|
|
29
|
+
const {
|
|
30
|
+
canvas = 'view'
|
|
31
|
+
} = query;
|
|
32
|
+
return canvas === 'edit' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
|
|
33
|
+
backPath: {
|
|
34
|
+
postType: _constants.NAVIGATION_POST_TYPE
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const navigationItemRoute = exports.navigationItemRoute = {
|
|
39
|
+
name: 'navigation-item',
|
|
40
|
+
path: '/wp_navigation/:postId',
|
|
41
|
+
areas: {
|
|
42
|
+
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenu.default, {
|
|
43
|
+
backPath: "/navigation"
|
|
44
|
+
}),
|
|
45
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
46
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(MobileNavigationItemView, {})
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=navigation-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_router","require","_constants","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenu","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","MobileNavigationItemView","query","canvas","jsx","default","backPath","postType","NAVIGATION_POST_TYPE","navigationItemRoute","exports","name","path","areas","sidebar","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction MobileNavigationItemView() {\n\tconst { query = {} } = useLocation();\n\tconst { canvas = 'view' } = query;\n\n\treturn canvas === 'edit' ? (\n\t\t<Editor />\n\t) : (\n\t\t<SidebarNavigationScreenNavigationMenu\n\t\t\tbackPath={ { postType: NAVIGATION_POST_TYPE } }\n\t\t/>\n\t);\n}\n\nexport const navigationItemRoute = {\n\tname: 'navigation-item',\n\tpath: '/wp_navigation/:postId',\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreenNavigationMenu backPath=\"/navigation\" />\n\t\t),\n\t\tpreview: <Editor />,\n\t\tmobile: <MobileNavigationItemView />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,sCAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAX3C;AACA;AACA;;AAGA;AACA;AACA;;AAMA,MAAM;EAAEO;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnD,SAASC,wBAAwBA,CAAA,EAAG;EACnC,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGJ,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEK,MAAM,GAAG;EAAO,CAAC,GAAGD,KAAK;EAEjC,OAAOC,MAAM,KAAK,MAAM,gBACvB,IAAAN,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC,gBAEV,IAAAR,WAAA,CAAAO,GAAA,EAACT,sCAAA,CAAAU,OAAqC;IACrCC,QAAQ,EAAG;MAAEC,QAAQ,EAAEC;IAAqB;EAAG,CAC/C,CACD;AACF;AAEO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE;IACNC,OAAO,eACN,IAAAjB,WAAA,CAAAO,GAAA,EAACT,sCAAA,CAAAU,OAAqC;MAACC,QAAQ,EAAC;IAAa,CAAE,CAC/D;IACDS,OAAO,eAAE,IAAAlB,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC;IACnBW,MAAM,eAAE,IAAAnB,WAAA,CAAAO,GAAA,EAACH,wBAAwB,IAAE;EACpC;AACD,CAAC","ignoreList":[]}
|
|
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.navigationRoute = void 0;
|
|
8
8
|
var _router = require("@wordpress/router");
|
|
9
9
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
10
|
-
var
|
|
10
|
+
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
|
|
11
11
|
var _lockUnlock = require("../../lock-unlock");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
@@ -21,28 +21,26 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
21
|
const {
|
|
22
22
|
useLocation
|
|
23
23
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
24
|
-
function
|
|
24
|
+
function MobileNavigationView() {
|
|
25
25
|
const {
|
|
26
|
-
|
|
26
|
+
query = {}
|
|
27
27
|
} = useLocation();
|
|
28
28
|
const {
|
|
29
29
|
canvas = 'view'
|
|
30
|
-
} =
|
|
31
|
-
return canvas === 'edit' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
32
|
-
|
|
33
|
-
})
|
|
30
|
+
} = query;
|
|
31
|
+
return canvas === 'edit' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
|
|
32
|
+
backPath: "/"
|
|
33
|
+
});
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
name: '
|
|
37
|
-
|
|
38
|
-
return true;
|
|
39
|
-
},
|
|
35
|
+
const navigationRoute = exports.navigationRoute = {
|
|
36
|
+
name: 'navigation',
|
|
37
|
+
path: '/navigation',
|
|
40
38
|
areas: {
|
|
41
|
-
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
42
|
-
|
|
43
|
-
isPostsList: true
|
|
39
|
+
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
|
|
40
|
+
backPath: "/"
|
|
44
41
|
}),
|
|
45
|
-
|
|
42
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
43
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(MobileNavigationView, {})
|
|
46
44
|
}
|
|
47
45
|
};
|
|
48
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_router","require","_editor","_interopRequireDefault","_sidebarNavigationScreenNavigationMenus","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","MobileNavigationView","query","canvas","jsx","default","backPath","navigationRoute","exports","name","path","areas","sidebar","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/navigation.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction MobileNavigationView() {\n\tconst { query = {} } = useLocation();\n\tconst { canvas = 'view' } = query;\n\n\treturn canvas === 'edit' ? (\n\t\t<Editor />\n\t) : (\n\t\t<SidebarNavigationScreenNavigationMenus backPath=\"/\" />\n\t);\n}\n\nexport const navigationRoute = {\n\tname: 'navigation',\n\tpath: '/navigation',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenNavigationMenus backPath=\"/\" />,\n\t\tpreview: <Editor />,\n\t\tmobile: <MobileNavigationView />,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uCAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAV3C;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAM;EAAEM;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnD,SAASC,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGJ,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEK,MAAM,GAAG;EAAO,CAAC,GAAGD,KAAK;EAEjC,OAAOC,MAAM,KAAK,MAAM,gBACvB,IAAAN,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC,gBAEV,IAAAR,WAAA,CAAAO,GAAA,EAACT,uCAAA,CAAAU,OAAsC;IAACC,QAAQ,EAAC;EAAG,CAAE,CACtD;AACF;AAEO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC9BE,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAf,WAAA,CAAAO,GAAA,EAACT,uCAAA,CAAAU,OAAsC;MAACC,QAAQ,EAAC;IAAG,CAAE,CAAC;IAChEO,OAAO,eAAE,IAAAhB,WAAA,CAAAO,GAAA,EAACX,OAAA,CAAAY,OAAM,IAAE,CAAC;IACnBS,MAAM,eAAE,IAAAjB,WAAA,CAAAO,GAAA,EAACH,oBAAoB,IAAE;EAChC;AACD,CAAC","ignoreList":[]}
|