@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.cd6172eb0.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-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-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +31 -13
- 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 -11
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -16
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +8 -17
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +13 -12
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +38 -3
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +25 -39
- 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/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/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/index.js +5 -0
- package/build/components/style-book/index.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-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-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +33 -15
- 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 +6 -11
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -16
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +7 -14
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +13 -12
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +38 -3
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +25 -39
- 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/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/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/index.js +5 -0
- package/build-module/components/style-book/index.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/style-rtl.css +94 -12
- package/build-style/style.css +94 -12
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- 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/style.scss +4 -0
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +36 -6
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +12 -11
- package/src/components/page-patterns/index.js +16 -14
- package/src/components/page-templates/fields.js +4 -15
- package/src/components/page-templates/index.js +18 -13
- package/src/components/post-edit/index.js +36 -2
- package/src/components/post-list/index.js +43 -39
- 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/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/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/index.js +5 -0
- 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/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- 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/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/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
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
5
|
-
import { useLink } from '../routes/link';
|
|
6
|
-
import { TEMPLATE_PART_POST_TYPE, TEMPLATE_PART_ALL_AREAS_CATEGORY, PATTERN_DEFAULT_CATEGORY, PATTERN_TYPES } from '../../utils/constants';
|
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
export default function CategoryItem({
|
|
9
7
|
count,
|
|
@@ -13,20 +11,20 @@ export default function CategoryItem({
|
|
|
13
11
|
label,
|
|
14
12
|
type
|
|
15
13
|
}) {
|
|
16
|
-
const linkInfo = useLink({
|
|
17
|
-
categoryId: id !== TEMPLATE_PART_ALL_AREAS_CATEGORY && id !== PATTERN_DEFAULT_CATEGORY ? id : undefined,
|
|
18
|
-
postType: type === TEMPLATE_PART_POST_TYPE ? TEMPLATE_PART_POST_TYPE : PATTERN_TYPES.user
|
|
19
|
-
});
|
|
20
14
|
if (!count) {
|
|
21
15
|
return;
|
|
22
16
|
}
|
|
17
|
+
const queryArgs = [`postType=${type}`];
|
|
18
|
+
if (id) {
|
|
19
|
+
queryArgs.push(`categoryId=${id}`);
|
|
20
|
+
}
|
|
23
21
|
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
24
|
-
...linkInfo,
|
|
25
22
|
icon: icon,
|
|
26
23
|
suffix: /*#__PURE__*/_jsx("span", {
|
|
27
24
|
children: count
|
|
28
25
|
}),
|
|
29
26
|
"aria-current": isActive ? 'true' : undefined,
|
|
27
|
+
to: `/pattern?${queryArgs.join('&')}`,
|
|
30
28
|
children: label
|
|
31
29
|
});
|
|
32
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SidebarNavigationItem","
|
|
1
|
+
{"version":3,"names":["SidebarNavigationItem","jsx","_jsx","CategoryItem","count","icon","id","isActive","label","type","queryArgs","push","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":"AAAA;AACA;AACA;AACA,OAAOA,qBAAqB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/D,eAAe,SAASC,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,oBACCJ,IAAA,CAACF,qBAAqB;IACrBK,IAAI,EAAGA,IAAM;IACbO,MAAM,eAAGV,IAAA;MAAAW,QAAA,EAAQT;IAAK,CAAQ,CAAG;IACjC,gBAAeG,QAAQ,GAAG,MAAM,GAAGO,SAAW;IAC9CC,EAAE,EAAG,YAAaL,SAAS,CAACM,IAAI,CAAE,GAAI,CAAC,EAAK;IAAAH,QAAA,EAE1CL;EAAK,CACe,CAAC;AAE1B","ignoreList":[]}
|
|
@@ -73,13 +73,12 @@ export default function SidebarNavigationScreenPatterns({
|
|
|
73
73
|
backPath
|
|
74
74
|
}) {
|
|
75
75
|
const {
|
|
76
|
-
|
|
77
|
-
postType,
|
|
76
|
+
query: {
|
|
77
|
+
postType = 'wp_block',
|
|
78
78
|
categoryId
|
|
79
79
|
}
|
|
80
80
|
} = useLocation();
|
|
81
|
-
const
|
|
82
|
-
const currentCategory = categoryId || (currentType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY);
|
|
81
|
+
const currentCategory = categoryId || (postType === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY);
|
|
83
82
|
const {
|
|
84
83
|
templatePartAreas,
|
|
85
84
|
hasTemplateParts,
|
|
@@ -106,7 +105,7 @@ export default function SidebarNavigationScreenPatterns({
|
|
|
106
105
|
templatePartAreas: templatePartAreas,
|
|
107
106
|
patternCategories: patternCategories,
|
|
108
107
|
currentCategory: currentCategory,
|
|
109
|
-
currentType:
|
|
108
|
+
currentType: postType
|
|
110
109
|
})]
|
|
111
110
|
})]
|
|
112
111
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","getTemplatePartIcon","__","store","coreStore","useSelect","file","privateApis","routerPrivateApis","SidebarNavigationScreen","CategoryItem","PATTERN_DEFAULT_CATEGORY","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_ALL_AREAS_CATEGORY","usePatternCategories","useTemplatePartAreas","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useLocation","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","className","children","count","Object","values","map","templateParts","length","reduce","acc","val","icon","label","id","type","isActive","entries","area","name","user","category","SidebarNavigationScreenPatterns","backPath","
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","getTemplatePartIcon","__","store","coreStore","useSelect","file","privateApis","routerPrivateApis","SidebarNavigationScreen","CategoryItem","PATTERN_DEFAULT_CATEGORY","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_ALL_AREAS_CATEGORY","usePatternCategories","useTemplatePartAreas","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useLocation","CategoriesGroup","templatePartAreas","patternCategories","currentCategory","currentType","allPatterns","otherPatterns","className","children","count","Object","values","map","templateParts","length","reduce","acc","val","icon","label","id","type","isActive","entries","area","name","user","category","SidebarNavigationScreenPatterns","backPath","query","postType","categoryId","hasTemplateParts","isLoading","hasPatterns","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","isRoot","title","description","content"],"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\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AA;MAAAU,QAAA,GACG0B,SAAS,IAAIzD,EAAE,CAAE,gBAAiB,CAAC,EACnC,CAAEyD,SAAS,iBACZtC,KAAA,CAAAE,SAAA;QAAAU,QAAA,GACG,CAAEyB,gBAAgB,IAAI,CAAEE,WAAW,iBACpCzC,IAAA,CAACrB,SAAS;UAACkC,SAAS,EAAC,qDAAqD;UAAAC,QAAA,eACzEd,IAAA,CAACnB,IAAI;YAAAiC,QAAA,EAAG/B,EAAE,CAAE,gBAAiB;UAAC,CAAQ;QAAC,CAC7B,CACX,eACDiB,IAAA,CAACM,eAAe;UACfC,iBAAiB,EAAGA,iBAAmB;UACvCC,iBAAiB,EAAGA,iBAAmB;UACvCC,eAAe,EAAGA,eAAiB;UACnCC,WAAW,EAAG2B;QAAU,CACxB,CAAC;MAAA,CACD,CACF;IAAA,CACA;EACF,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -4,15 +4,22 @@
|
|
|
4
4
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
6
|
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Internal dependencies
|
|
10
13
|
*/
|
|
11
|
-
import
|
|
14
|
+
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
12
15
|
import { useAddedBy } from '../page-templates/hooks';
|
|
13
16
|
import { layout } from '@wordpress/icons';
|
|
14
17
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
18
|
+
import { unlock } from '../../lock-unlock';
|
|
15
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
const {
|
|
21
|
+
useLocation
|
|
22
|
+
} = unlock(routerPrivateApis);
|
|
16
23
|
const EMPTY_ARRAY = [];
|
|
17
24
|
function TemplateDataviewItem({
|
|
18
25
|
template,
|
|
@@ -22,18 +29,21 @@ function TemplateDataviewItem({
|
|
|
22
29
|
text,
|
|
23
30
|
icon
|
|
24
31
|
} = useAddedBy(template.type, template.id);
|
|
25
|
-
return /*#__PURE__*/_jsx(
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
33
|
+
to: addQueryArgs('/template', {
|
|
34
|
+
activeView: text
|
|
35
|
+
}),
|
|
28
36
|
icon: icon,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
37
|
+
"aria-current": isActive,
|
|
38
|
+
children: text
|
|
39
|
+
});
|
|
32
40
|
}
|
|
33
|
-
export default function DataviewsTemplatesSidebarContent({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
export default function DataviewsTemplatesSidebarContent() {
|
|
42
|
+
const {
|
|
43
|
+
query: {
|
|
44
|
+
activeView = 'all'
|
|
45
|
+
}
|
|
46
|
+
} = useLocation();
|
|
37
47
|
const {
|
|
38
48
|
records
|
|
39
49
|
} = useEntityRecords('postType', TEMPLATE_POST_TYPE, {
|
|
@@ -51,12 +61,11 @@ export default function DataviewsTemplatesSidebarContent({
|
|
|
51
61
|
return (_ref = firstItemPerAuthor && Object.values(firstItemPerAuthor)) !== null && _ref !== void 0 ? _ref : EMPTY_ARRAY;
|
|
52
62
|
}, [records]);
|
|
53
63
|
return /*#__PURE__*/_jsxs(ItemGroup, {
|
|
54
|
-
children: [/*#__PURE__*/_jsx(
|
|
55
|
-
|
|
56
|
-
title: title,
|
|
64
|
+
children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
65
|
+
to: "/template",
|
|
57
66
|
icon: layout,
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
"aria-current": activeView === 'all',
|
|
68
|
+
children: __('All templates')
|
|
60
69
|
}), firstItemPerAuthorText.map(template => {
|
|
61
70
|
return /*#__PURE__*/_jsx(TemplateDataviewItem, {
|
|
62
71
|
template: template,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEntityRecords","useMemo","__experimentalItemGroup","ItemGroup","
|
|
1
|
+
{"version":3,"names":["useEntityRecords","useMemo","__experimentalItemGroup","ItemGroup","__","privateApis","routerPrivateApis","addQueryArgs","SidebarNavigationItem","useAddedBy","layout","TEMPLATE_POST_TYPE","unlock","jsx","_jsx","jsxs","_jsxs","useLocation","EMPTY_ARRAY","TemplateDataviewItem","template","isActive","text","icon","type","id","to","activeView","children","DataviewsTemplatesSidebarContent","query","records","per_page","firstItemPerAuthorText","_ref","firstItemPerAuthor","reduce","acc","author","author_text","Object","values","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":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D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ACP,QAAAH,IAAA,GACGC,kBAAkB,IAAIK,MAAM,CAACC,MAAM,CAAEN,kBAAmB,CAAC,cAAAD,IAAA,cAAAA,IAAA,GAC3DhB,WAAW;EAEb,CAAC,EAAE,CAAEa,OAAO,CAAG,CAAC;EAEhB,oBACCf,KAAA,CAACb,SAAS;IAAAyB,QAAA,gBACTd,IAAA,CAACN,qBAAqB;MACrBkB,EAAE,EAAC,WAAW;MACdH,IAAI,EAAGb,MAAQ;MACf,gBAAeiB,UAAU,KAAK,KAAO;MAAAC,QAAA,EAEnCxB,EAAE,CAAE,eAAgB;IAAC,CACD,CAAC,EACtB6B,sBAAsB,CAACS,GAAG,CAAItB,QAAQ,IAAM;MAC7C,oBACCN,IAAA,CAACK,oBAAoB;QAEpBC,QAAQ,EAAGA,QAAU;QACrBC,QAAQ,EAAGM,UAAU,KAAKP,QAAQ,CAACmB;MAAa,GAF1CnB,QAAQ,CAACmB,WAGf,CAAC;IAEJ,CAAE,CAAC;EAAA,CACO,CAAC;AAEd","ignoreList":[]}
|
|
@@ -2,34 +2,21 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Internal dependencies
|
|
9
8
|
*/
|
|
10
9
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
11
|
-
import { unlock } from '../../lock-unlock';
|
|
12
10
|
import DataviewsTemplatesSidebarContent from './content';
|
|
13
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const {
|
|
15
|
-
useLocation
|
|
16
|
-
} = unlock(routerPrivateApis);
|
|
17
12
|
export default function SidebarNavigationScreenTemplatesBrowse({
|
|
18
13
|
backPath
|
|
19
14
|
}) {
|
|
20
|
-
const {
|
|
21
|
-
params: {
|
|
22
|
-
activeView = 'all'
|
|
23
|
-
}
|
|
24
|
-
} = useLocation();
|
|
25
15
|
return /*#__PURE__*/_jsx(SidebarNavigationScreen, {
|
|
26
16
|
title: __('Templates'),
|
|
27
17
|
description: __('Create new templates, or reset any customizations made to the templates supplied by your theme.'),
|
|
28
18
|
backPath: backPath,
|
|
29
|
-
content: /*#__PURE__*/_jsx(DataviewsTemplatesSidebarContent, {
|
|
30
|
-
activeView: activeView,
|
|
31
|
-
title: __('All templates')
|
|
32
|
-
})
|
|
19
|
+
content: /*#__PURE__*/_jsx(DataviewsTemplatesSidebarContent, {})
|
|
33
20
|
});
|
|
34
21
|
}
|
|
35
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","
|
|
1
|
+
{"version":3,"names":["__","SidebarNavigationScreen","DataviewsTemplatesSidebarContent","jsx","_jsx","SidebarNavigationScreenTemplatesBrowse","backPath","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,gCAAgC,MAAM,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzD,eAAe,SAASC,sCAAsCA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9E,oBACCF,IAAA,CAACH,uBAAuB;IACvBM,KAAK,EAAGP,EAAE,CAAE,WAAY,CAAG;IAC3BQ,WAAW,EAAGR,EAAE,CACf,iGACD,CAAG;IACHM,QAAQ,EAAGA,QAAU;IACrBG,OAAO,eAAGL,IAAA,CAACF,gCAAgC,IAAE;EAAG,CAChD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const
|
|
8
|
-
name: 'home
|
|
9
|
-
|
|
10
|
-
return params.canvas === 'edit';
|
|
11
|
-
},
|
|
7
|
+
export const homeRoute = {
|
|
8
|
+
name: 'home',
|
|
9
|
+
path: '/',
|
|
12
10
|
areas: {
|
|
13
11
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {}),
|
|
14
12
|
preview: /*#__PURE__*/_jsx(Editor, {}),
|
|
15
|
-
mobile: /*#__PURE__*/_jsx(
|
|
13
|
+
mobile: /*#__PURE__*/_jsx(SidebarNavigationScreenMain, {})
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
|
-
//# sourceMappingURL=home
|
|
16
|
+
//# sourceMappingURL=home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Editor","SidebarNavigationScreenMain","jsx","_jsx","homeRoute","name","path","areas","sidebar","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":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,2BAA2B,MAAM,mCAAmC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,OAAO,MAAMC,SAAS,GAAG;EACxBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,GAAG;EACTC,KAAK,EAAE;IACNC,OAAO,eAAEL,IAAA,CAACF,2BAA2B,IAAE,CAAC;IACxCQ,OAAO,eAAEN,IAAA,CAACH,MAAM,IAAE,CAAC;IACnBU,MAAM,eAAEP,IAAA,CAACF,2BAA2B,IAAE;EACvC;AACD,CAAC","ignoreList":[]}
|
|
@@ -9,24 +9,18 @@ import { useEffect } from '@wordpress/element';
|
|
|
9
9
|
*/
|
|
10
10
|
import { unlock } from '../../lock-unlock';
|
|
11
11
|
import { store as siteEditorStore } from '../../store';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
import { pagesViewRoute } from './pages-view';
|
|
25
|
-
import { pagesEditRoute } from './pages-edit';
|
|
26
|
-
import { pagesListViewRoute } from './pages-list-view';
|
|
27
|
-
import { pagesListViewQuickEditRoute } from './pages-list-view-quick-edit';
|
|
28
|
-
import { pagesViewQuickEditRoute } from './pages-view-quick-edit';
|
|
29
|
-
const routes = [pagesListViewQuickEditRoute, pagesListViewRoute, pagesViewQuickEditRoute, pagesViewRoute, pagesEditRoute, templatesEditRoute, templatesListViewRoute, templatesViewRoute, patternsViewRoute, patternsEditRoute, stylesViewRoute, navigationItemViewRoute, navigationItemEditRoute, navigationViewRoute, navigationEditRoute, homeViewRoute, homeEditRoute];
|
|
12
|
+
import { homeRoute } from './home';
|
|
13
|
+
import { stylesRoute } from './styles';
|
|
14
|
+
import { navigationRoute } from './navigation';
|
|
15
|
+
import { navigationItemRoute } from './navigation-item';
|
|
16
|
+
import { patternsRoute } from './patterns';
|
|
17
|
+
import { patternItemRoute } from './pattern-item';
|
|
18
|
+
import { templatePartItemRoute } from './template-part-item';
|
|
19
|
+
import { templatesRoute } from './templates';
|
|
20
|
+
import { templateItemRoute } from './template-item';
|
|
21
|
+
import { pagesRoute } from './pages';
|
|
22
|
+
import { pageItemRoute } from './page-item';
|
|
23
|
+
const routes = [pageItemRoute, pagesRoute, templateItemRoute, templatesRoute, templatePartItemRoute, patternItemRoute, patternsRoute, navigationItemRoute, navigationRoute, stylesRoute, homeRoute];
|
|
30
24
|
export function useRegisterSiteEditorRoutes() {
|
|
31
25
|
const registry = useRegistry();
|
|
32
26
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRegistry","useDispatch","useEffect","unlock","store","siteEditorStore","
|
|
1
|
+
{"version":3,"names":["useRegistry","useDispatch","useEffect","unlock","store","siteEditorStore","homeRoute","stylesRoute","navigationRoute","navigationItemRoute","patternsRoute","patternItemRoute","templatePartItemRoute","templatesRoute","templateItemRoute","pagesRoute","pageItemRoute","routes","useRegisterSiteEditorRoutes","registry","registerRoute","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":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AAC1D,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,eAAe,QAAQ,aAAa;AACtD,SAASC,SAAS,QAAQ,QAAQ;AAClC,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,eAAe,QAAQ,cAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,aAAa,QAAQ,YAAY;AAC1C,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,aAAa,QAAQ,aAAa;AAE3C,MAAMC,MAAM,GAAG,CACdD,aAAa,EACbD,UAAU,EACVD,iBAAiB,EACjBD,cAAc,EACdD,qBAAqB,EACrBD,gBAAgB,EAChBD,aAAa,EACbD,mBAAmB,EACnBD,eAAe,EACfD,WAAW,EACXD,SAAS,CACT;AAED,OAAO,SAASY,2BAA2BA,CAAA,EAAG;EAC7C,MAAMC,QAAQ,GAAGnB,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEoB;EAAc,CAAC,GAAGjB,MAAM,CAAEF,WAAW,CAAEI,eAAgB,CAAE,CAAC;EAClEH,SAAS,CAAE,MAAM;IAChBiB,QAAQ,CAACE,KAAK,CAAE,MAAM;MACrBJ,MAAM,CAACK,OAAO,CAAEF,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAED,QAAQ,EAAEC,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
10
|
+
import Editor from '../editor';
|
|
11
|
+
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const {
|
|
15
|
+
useLocation
|
|
16
|
+
} = unlock(routerPrivateApis);
|
|
17
|
+
function MobileNavigationItemView() {
|
|
18
|
+
const {
|
|
19
|
+
query = {}
|
|
20
|
+
} = useLocation();
|
|
21
|
+
const {
|
|
22
|
+
canvas = 'view'
|
|
23
|
+
} = query;
|
|
24
|
+
return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
|
|
25
|
+
backPath: {
|
|
26
|
+
postType: NAVIGATION_POST_TYPE
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export const navigationItemRoute = {
|
|
31
|
+
name: 'navigation-item',
|
|
32
|
+
path: '/wp_navigation/:postId',
|
|
33
|
+
areas: {
|
|
34
|
+
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenu, {
|
|
35
|
+
backPath: "/navigation"
|
|
36
|
+
}),
|
|
37
|
+
preview: /*#__PURE__*/_jsx(Editor, {}),
|
|
38
|
+
mobile: /*#__PURE__*/_jsx(MobileNavigationItemView, {})
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=navigation-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["privateApis","routerPrivateApis","NAVIGATION_POST_TYPE","Editor","SidebarNavigationScreenNavigationMenu","unlock","jsx","_jsx","useLocation","MobileNavigationItemView","query","canvas","backPath","postType","navigationItemRoute","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":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,qCAAqC,MAAM,8CAA8C;AAChG,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEJ,iBAAkB,CAAC;AAEnD,SAASQ,wBAAwBA,CAAA,EAAG;EACnC,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGF,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEG,MAAM,GAAG;EAAO,CAAC,GAAGD,KAAK;EAEjC,OAAOC,MAAM,KAAK,MAAM,gBACvBJ,IAAA,CAACJ,MAAM,IAAE,CAAC,gBAEVI,IAAA,CAACH,qCAAqC;IACrCQ,QAAQ,EAAG;MAAEC,QAAQ,EAAEX;IAAqB;EAAG,CAC/C,CACD;AACF;AAEA,OAAO,MAAMY,mBAAmB,GAAG;EAClCC,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE;IACNC,OAAO,eACNX,IAAA,CAACH,qCAAqC;MAACQ,QAAQ,EAAC;IAAa,CAAE,CAC/D;IACDO,OAAO,eAAEZ,IAAA,CAACJ,MAAM,IAAE,CAAC;IACnBiB,MAAM,eAAEb,IAAA,CAACE,wBAAwB,IAAE;EACpC;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import Editor from '../editor';
|
|
10
|
+
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const {
|
|
14
|
+
useLocation
|
|
15
|
+
} = unlock(routerPrivateApis);
|
|
16
|
+
function MobileNavigationView() {
|
|
17
|
+
const {
|
|
18
|
+
query = {}
|
|
19
|
+
} = useLocation();
|
|
20
|
+
const {
|
|
21
|
+
canvas = 'view'
|
|
22
|
+
} = query;
|
|
23
|
+
return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenus, {
|
|
24
|
+
backPath: "/"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export const navigationRoute = {
|
|
28
|
+
name: 'navigation',
|
|
29
|
+
path: '/navigation',
|
|
30
|
+
areas: {
|
|
31
|
+
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenNavigationMenus, {
|
|
32
|
+
backPath: "/"
|
|
33
|
+
}),
|
|
34
|
+
preview: /*#__PURE__*/_jsx(Editor, {}),
|
|
35
|
+
mobile: /*#__PURE__*/_jsx(MobileNavigationView, {})
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["privateApis","routerPrivateApis","Editor","SidebarNavigationScreenNavigationMenus","unlock","jsx","_jsx","useLocation","MobileNavigationView","query","canvas","backPath","navigationRoute","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":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEH,iBAAkB,CAAC;AAEnD,SAASO,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGF,WAAW,CAAC,CAAC;EACpC,MAAM;IAAEG,MAAM,GAAG;EAAO,CAAC,GAAGD,KAAK;EAEjC,OAAOC,MAAM,KAAK,MAAM,gBACvBJ,IAAA,CAACJ,MAAM,IAAE,CAAC,gBAEVI,IAAA,CAACH,sCAAsC;IAACQ,QAAQ,EAAC;EAAG,CAAE,CACtD;AACF;AAEA,OAAO,MAAMC,eAAe,GAAG;EAC9BC,IAAI,EAAE,YAAY;EAClBC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE;IACNC,OAAO,eAAEV,IAAA,CAACH,sCAAsC;MAACQ,QAAQ,EAAC;IAAG,CAAE,CAAC;IAChEM,OAAO,eAAEX,IAAA,CAACJ,MAAM,IAAE,CAAC;IACnBgB,MAAM,eAAEZ,IAAA,CAACE,oBAAoB,IAAE;EAChC;AACD,CAAC","ignoreList":[]}
|
|
@@ -6,30 +6,23 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import Editor from '../editor';
|
|
10
10
|
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
11
11
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
-
import Editor from '../editor';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export const pagesEditRoute = {
|
|
20
|
-
name: 'pages-edit',
|
|
21
|
-
match: params => {
|
|
22
|
-
return params.postType === 'page' && params.canvas === 'edit';
|
|
23
|
-
},
|
|
13
|
+
export const pageItemRoute = {
|
|
14
|
+
name: 'page-item',
|
|
15
|
+
path: '/page/:postId',
|
|
24
16
|
areas: {
|
|
25
17
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreen, {
|
|
26
18
|
title: __('Pages'),
|
|
27
|
-
backPath:
|
|
28
|
-
content: /*#__PURE__*/_jsx(DataViewsSidebarContent, {
|
|
19
|
+
backPath: "/",
|
|
20
|
+
content: /*#__PURE__*/_jsx(DataViewsSidebarContent, {
|
|
21
|
+
postType: "page"
|
|
22
|
+
})
|
|
29
23
|
}),
|
|
30
|
-
content: /*#__PURE__*/_jsx(PageList, {}),
|
|
31
24
|
mobile: /*#__PURE__*/_jsx(Editor, {}),
|
|
32
25
|
preview: /*#__PURE__*/_jsx(Editor, {})
|
|
33
26
|
}
|
|
34
27
|
};
|
|
35
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=page-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","Editor","DataViewsSidebarContent","SidebarNavigationScreen","jsx","_jsx","pageItemRoute","name","path","areas","sidebar","title","backPath","content","postType","mobile","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/page-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\n\nexport const pageItemRoute = {\n\tname: 'page-item',\n\tpath: '/page/:postId',\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tbackPath=\"/\"\n\t\t\t\tcontent={ <DataViewsSidebarContent postType=\"page\" /> }\n\t\t\t/>\n\t\t),\n\t\tmobile: <Editor />,\n\t\tpreview: <Editor />,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,uBAAuB,MAAM,sBAAsB;AAC1D,OAAOC,uBAAuB,MAAM,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnE,OAAO,MAAMC,aAAa,GAAG;EAC5BC,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE;IACNC,OAAO,eACNL,IAAA,CAACF,uBAAuB;MACvBQ,KAAK,EAAGX,EAAE,CAAE,OAAQ,CAAG;MACvBY,QAAQ,EAAC,GAAG;MACZC,OAAO,eAAGR,IAAA,CAACH,uBAAuB;QAACY,QAAQ,EAAC;MAAM,CAAE;IAAG,CACvD,CACD;IACDC,MAAM,eAAEV,IAAA,CAACJ,MAAM,IAAE,CAAC;IAClBe,OAAO,eAAEX,IAAA,CAACJ,MAAM,IAAE;EACnB;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import Editor from '../editor';
|
|
11
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
+
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
13
|
+
import PostList from '../post-list';
|
|
14
|
+
import { unlock } from '../../lock-unlock';
|
|
15
|
+
import { PostEdit } from '../post-edit';
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const {
|
|
18
|
+
useLocation
|
|
19
|
+
} = unlock(routerPrivateApis);
|
|
20
|
+
function MobilePagesView() {
|
|
21
|
+
const {
|
|
22
|
+
query = {}
|
|
23
|
+
} = useLocation();
|
|
24
|
+
const {
|
|
25
|
+
canvas = 'view'
|
|
26
|
+
} = query;
|
|
27
|
+
return canvas === 'edit' ? /*#__PURE__*/_jsx(Editor, {}) : /*#__PURE__*/_jsx(PostList, {
|
|
28
|
+
postType: "page"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export const pagesRoute = {
|
|
32
|
+
name: 'pages',
|
|
33
|
+
path: '/page',
|
|
34
|
+
areas: {
|
|
35
|
+
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreen, {
|
|
36
|
+
title: __('Pages'),
|
|
37
|
+
backPath: "/",
|
|
38
|
+
content: /*#__PURE__*/_jsx(DataViewsSidebarContent, {
|
|
39
|
+
postType: "page"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
content: /*#__PURE__*/_jsx(PostList, {
|
|
43
|
+
postType: "page"
|
|
44
|
+
}),
|
|
45
|
+
preview({
|
|
46
|
+
query
|
|
47
|
+
}) {
|
|
48
|
+
const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true';
|
|
49
|
+
return isListView ? /*#__PURE__*/_jsx(Editor, {}) : undefined;
|
|
50
|
+
},
|
|
51
|
+
mobile: /*#__PURE__*/_jsx(MobilePagesView, {}),
|
|
52
|
+
edit({
|
|
53
|
+
query
|
|
54
|
+
}) {
|
|
55
|
+
var _query$layout;
|
|
56
|
+
const hasQuickEdit = ((_query$layout = query.layout) !== null && _query$layout !== void 0 ? _query$layout : 'list') !== 'list' && !!query.quickEdit;
|
|
57
|
+
return hasQuickEdit ? /*#__PURE__*/_jsx(PostEdit, {
|
|
58
|
+
postType: "page",
|
|
59
|
+
postId: query.postId
|
|
60
|
+
}) : undefined;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
widths: {
|
|
64
|
+
content({
|
|
65
|
+
query
|
|
66
|
+
}) {
|
|
67
|
+
const isListView = (query.layout === 'list' || !query.layout) && query.isCustom !== 'true';
|
|
68
|
+
return isListView ? 380 : undefined;
|
|
69
|
+
},
|
|
70
|
+
edit({
|
|
71
|
+
query
|
|
72
|
+
}) {
|
|
73
|
+
var _query$layout2;
|
|
74
|
+
const hasQuickEdit = ((_query$layout2 = query.layout) !== null && _query$layout2 !== void 0 ? _query$layout2 : 'list') !== 'list' && !!query.quickEdit;
|
|
75
|
+
return hasQuickEdit ? 380 : undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["privateApis","routerPrivateApis","__","Editor","SidebarNavigationScreen","DataViewsSidebarContent","PostList","unlock","PostEdit","jsx","_jsx","useLocation","MobilePagesView","query","canvas","postType","pagesRoute","name","path","areas","sidebar","title","backPath","content","preview","isListView","layout","isCustom","undefined","mobile","edit","_query$layout","hasQuickEdit","quickEdit","postId","widths","_query$layout2"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/pages.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport PostList from '../post-list';\nimport { unlock } from '../../lock-unlock';\nimport { PostEdit } from '../post-edit';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction MobilePagesView() {\n\tconst { query = {} } = useLocation();\n\tconst { canvas = 'view' } = query;\n\n\treturn canvas === 'edit' ? <Editor /> : <PostList postType=\"page\" />;\n}\n\nexport const pagesRoute = {\n\tname: 'pages',\n\tpath: '/page',\n\tareas: {\n\t\tsidebar: (\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tbackPath=\"/\"\n\t\t\t\tcontent={ <DataViewsSidebarContent postType=\"page\" /> }\n\t\t\t/>\n\t\t),\n\t\tcontent: <PostList postType=\"page\" />,\n\t\tpreview( { query } ) {\n\t\t\tconst isListView =\n\t\t\t\t( query.layout === 'list' || ! query.layout ) &&\n\t\t\t\tquery.isCustom !== 'true';\n\t\t\treturn isListView ? <Editor /> : undefined;\n\t\t},\n\t\tmobile: <MobilePagesView />,\n\t\tedit( { query } ) {\n\t\t\tconst hasQuickEdit =\n\t\t\t\t( query.layout ?? 'list' ) !== 'list' && !! query.quickEdit;\n\t\t\treturn hasQuickEdit ? (\n\t\t\t\t<PostEdit postType=\"page\" postId={ query.postId } />\n\t\t\t) : undefined;\n\t\t},\n\t},\n\twidths: {\n\t\tcontent( { query } ) {\n\t\t\tconst isListView =\n\t\t\t\t( query.layout === 'list' || ! query.layout ) &&\n\t\t\t\tquery.isCustom !== 'true';\n\t\t\treturn isListView ? 380 : undefined;\n\t\t},\n\t\tedit( { query } ) {\n\t\t\tconst hasQuickEdit =\n\t\t\t\t( query.layout ?? 'list' ) !== 'list' && !! query.quickEdit;\n\t\t\treturn hasQuickEdit ? 380 : undefined;\n\t\t},\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,uBAAuB,MAAM,sBAAsB;AAC1D,OAAOC,QAAQ,M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