@wordpress/edit-site 7.3.0 → 7.4.1-next.v.202609031004.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 +22 -0
- package/build/components/add-new-pattern/index.cjs +1 -1
- package/build/components/add-new-pattern/index.cjs.map +1 -1
- package/build/components/add-new-post/index.cjs +1 -1
- package/build/components/add-new-post/index.cjs.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.cjs +4 -2
- package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +3 -3
- package/build/components/add-new-template/index.cjs +7 -5
- package/build/components/add-new-template/index.cjs.map +3 -3
- package/build/components/add-new-template/utils.cjs +84 -9
- package/build/components/add-new-template/utils.cjs.map +2 -2
- package/build/components/app/index.cjs +1 -1
- package/build/components/app/index.cjs.map +1 -1
- package/build/components/canvas-loader/index.cjs +1 -1
- package/build/components/canvas-loader/index.cjs.map +1 -1
- package/build/components/dataviews-actions/index.cjs +2 -55
- package/build/components/dataviews-actions/index.cjs.map +3 -3
- package/build/components/editor/index.cjs +1 -1
- package/build/components/editor/index.cjs.map +1 -1
- package/build/components/editor/site-preview.cjs +1 -1
- package/build/components/editor/site-preview.cjs.map +1 -1
- package/build/components/editor/use-adapt-editor-to-canvas.cjs +0 -11
- package/build/components/editor/use-adapt-editor-to-canvas.cjs.map +3 -3
- package/build/components/layout/index.cjs +2 -2
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/media/index.cjs +1 -1
- package/build/components/media/index.cjs.map +1 -1
- package/build/components/more-menu/index.cjs +1 -1
- package/build/components/more-menu/index.cjs.map +1 -1
- package/build/components/more-menu/welcome-guide-menu-item.cjs +11 -3
- package/build/components/more-menu/welcome-guide-menu-item.cjs.map +4 -4
- package/build/components/page-patterns/actions.cjs +1 -1
- package/build/components/page-patterns/actions.cjs.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.cjs +1 -1
- package/build/components/page-patterns/delete-category-menu-item.cjs.map +1 -1
- package/build/components/page-patterns/fields.cjs +1 -1
- package/build/components/page-patterns/fields.cjs.map +1 -1
- package/build/components/page-patterns/index.cjs +1 -1
- package/build/components/page-patterns/index.cjs.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.cjs +1 -1
- package/build/components/page-patterns/rename-category-menu-item.cjs.map +1 -1
- package/build/components/page-templates/fields.cjs +3 -127
- package/build/components/page-templates/fields.cjs.map +4 -4
- package/build/components/page-templates/index.cjs +47 -231
- package/build/components/page-templates/index.cjs.map +4 -4
- package/build/components/pagination/index.cjs +1 -1
- package/build/components/pagination/index.cjs.map +1 -1
- package/build/components/plugin-template-setting-panel/index.cjs +1 -1
- package/build/components/plugin-template-setting-panel/index.cjs.map +1 -1
- package/build/components/post-list/index.cjs +1 -1
- package/build/components/post-list/index.cjs.map +1 -1
- package/build/components/post-list/quick-edit-modal.cjs +1 -1
- package/build/components/post-list/quick-edit-modal.cjs.map +1 -1
- package/build/components/resizable-frame/index.cjs +1 -1
- package/build/components/resizable-frame/index.cjs.map +1 -1
- package/build/components/save-button/index.cjs +1 -1
- package/build/components/save-button/index.cjs.map +1 -1
- package/build/components/save-hub/index.cjs +1 -1
- package/build/components/save-hub/index.cjs.map +1 -1
- package/build/components/save-panel/index.cjs +1 -1
- package/build/components/save-panel/index.cjs.map +1 -1
- package/build/components/sidebar/index.cjs +1 -1
- package/build/components/sidebar/index.cjs.map +1 -1
- package/build/components/sidebar-button/index.cjs +1 -1
- package/build/components/sidebar-button/index.cjs.map +1 -1
- package/build/components/sidebar-dataviews/index.cjs +1 -1
- package/build/components/sidebar-dataviews/index.cjs.map +1 -1
- package/build/components/sidebar-global-styles/index.cjs +3 -3
- package/build/components/sidebar-global-styles/index.cjs.map +3 -3
- package/build/components/sidebar-identity/index.cjs +8 -16
- package/build/components/sidebar-identity/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-item/index.cjs +2 -9
- package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.cjs +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-identity/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-identity/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-main/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.cjs +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/category-item.cjs +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs +35 -73
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs.map +4 -4
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs +2 -3
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs.map +4 -4
- package/build/components/sidebar-navigation-screen-unsupported/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.cjs.map +1 -1
- package/build/components/site-editor-routes/home.cjs +1 -1
- package/build/components/site-editor-routes/home.cjs.map +1 -1
- package/build/components/site-editor-routes/identity.cjs +1 -1
- package/build/components/site-editor-routes/identity.cjs.map +1 -1
- package/build/components/site-editor-routes/navigation-item.cjs +1 -1
- package/build/components/site-editor-routes/navigation-item.cjs.map +1 -1
- package/build/components/site-editor-routes/navigation.cjs +1 -1
- package/build/components/site-editor-routes/navigation.cjs.map +1 -1
- package/build/components/site-editor-routes/notfound.cjs +1 -1
- package/build/components/site-editor-routes/notfound.cjs.map +1 -1
- package/build/components/site-editor-routes/page-item.cjs +1 -1
- package/build/components/site-editor-routes/page-item.cjs.map +1 -1
- package/build/components/site-editor-routes/pages.cjs +1 -1
- package/build/components/site-editor-routes/pages.cjs.map +1 -1
- package/build/components/site-editor-routes/pattern-item.cjs +1 -1
- package/build/components/site-editor-routes/pattern-item.cjs.map +1 -1
- package/build/components/site-editor-routes/patterns.cjs +1 -1
- package/build/components/site-editor-routes/patterns.cjs.map +1 -1
- package/build/components/site-editor-routes/stylebook.cjs +1 -1
- package/build/components/site-editor-routes/stylebook.cjs.map +1 -1
- package/build/components/site-editor-routes/styles.cjs +1 -1
- package/build/components/site-editor-routes/styles.cjs.map +1 -1
- package/build/components/site-editor-routes/template-item.cjs +1 -1
- package/build/components/site-editor-routes/template-item.cjs.map +1 -1
- package/build/components/site-editor-routes/template-part-item.cjs +1 -1
- package/build/components/site-editor-routes/template-part-item.cjs.map +1 -1
- package/build/components/site-editor-routes/templates.cjs +3 -5
- package/build/components/site-editor-routes/templates.cjs.map +4 -4
- package/build/components/site-hub/index.cjs +1 -1
- package/build/components/site-hub/index.cjs.map +1 -1
- package/build/components/welcome-guide/editor.cjs +1 -1
- package/build/components/welcome-guide/editor.cjs.map +1 -1
- package/build/components/welcome-guide/image.cjs +1 -1
- package/build/components/welcome-guide/image.cjs.map +1 -1
- package/build/components/welcome-guide/index.cjs +1 -1
- package/build/components/welcome-guide/index.cjs.map +1 -1
- package/build/components/welcome-guide/page.cjs +1 -1
- package/build/components/welcome-guide/page.cjs.map +1 -1
- package/build/components/welcome-guide/template.cjs +1 -1
- package/build/components/welcome-guide/template.cjs.map +1 -1
- package/build/deprecated.cjs +1 -1
- package/build/deprecated.cjs.map +1 -1
- package/build/index.cjs +1 -1
- package/build/index.cjs.map +1 -1
- package/build-module/components/add-new-pattern/index.mjs +1 -1
- package/build-module/components/add-new-pattern/index.mjs.map +1 -1
- package/build-module/components/add-new-post/index.mjs +1 -1
- package/build-module/components/add-new-post/index.mjs.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs +4 -2
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +3 -3
- package/build-module/components/add-new-template/index.mjs +8 -5
- package/build-module/components/add-new-template/index.mjs.map +3 -3
- package/build-module/components/add-new-template/utils.mjs +84 -9
- package/build-module/components/add-new-template/utils.mjs.map +2 -2
- package/build-module/components/app/index.mjs +1 -1
- package/build-module/components/app/index.mjs.map +1 -1
- package/build-module/components/canvas-loader/index.mjs +1 -1
- package/build-module/components/canvas-loader/index.mjs.map +1 -1
- package/build-module/components/dataviews-actions/index.mjs +1 -53
- package/build-module/components/dataviews-actions/index.mjs.map +2 -2
- package/build-module/components/editor/index.mjs +1 -1
- package/build-module/components/editor/index.mjs.map +1 -1
- package/build-module/components/editor/site-preview.mjs +1 -1
- package/build-module/components/editor/site-preview.mjs.map +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.mjs +0 -11
- package/build-module/components/editor/use-adapt-editor-to-canvas.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +2 -2
- package/build-module/components/layout/index.mjs.map +3 -3
- package/build-module/components/media/index.mjs +1 -1
- package/build-module/components/media/index.mjs.map +1 -1
- package/build-module/components/more-menu/index.mjs +1 -1
- package/build-module/components/more-menu/index.mjs.map +1 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs +11 -3
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs.map +3 -3
- package/build-module/components/page-patterns/actions.mjs +1 -1
- package/build-module/components/page-patterns/actions.mjs.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.mjs +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.mjs.map +1 -1
- package/build-module/components/page-patterns/fields.mjs +1 -1
- package/build-module/components/page-patterns/fields.mjs.map +1 -1
- package/build-module/components/page-patterns/index.mjs +1 -1
- package/build-module/components/page-patterns/index.mjs.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.mjs +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.mjs.map +1 -1
- package/build-module/components/page-templates/fields.mjs +4 -130
- package/build-module/components/page-templates/fields.mjs.map +4 -4
- package/build-module/components/page-templates/index.mjs +53 -254
- package/build-module/components/page-templates/index.mjs.map +3 -3
- package/build-module/components/pagination/index.mjs +1 -1
- package/build-module/components/pagination/index.mjs.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.mjs +1 -1
- package/build-module/components/plugin-template-setting-panel/index.mjs.map +1 -1
- package/build-module/components/post-list/index.mjs +1 -1
- package/build-module/components/post-list/index.mjs.map +1 -1
- package/build-module/components/post-list/quick-edit-modal.mjs +1 -1
- package/build-module/components/post-list/quick-edit-modal.mjs.map +1 -1
- package/build-module/components/resizable-frame/index.mjs +1 -1
- package/build-module/components/resizable-frame/index.mjs.map +1 -1
- package/build-module/components/save-button/index.mjs +1 -1
- package/build-module/components/save-button/index.mjs.map +1 -1
- package/build-module/components/save-hub/index.mjs +1 -1
- package/build-module/components/save-hub/index.mjs.map +1 -1
- package/build-module/components/save-panel/index.mjs +1 -1
- package/build-module/components/save-panel/index.mjs.map +1 -1
- package/build-module/components/sidebar/index.mjs +1 -1
- package/build-module/components/sidebar/index.mjs.map +1 -1
- package/build-module/components/sidebar-button/index.mjs +1 -1
- package/build-module/components/sidebar-button/index.mjs.map +1 -1
- package/build-module/components/sidebar-dataviews/index.mjs +1 -1
- package/build-module/components/sidebar-dataviews/index.mjs.map +1 -1
- package/build-module/components/sidebar-global-styles/index.mjs +3 -3
- package/build-module/components/sidebar-global-styles/index.mjs.map +3 -3
- package/build-module/components/sidebar-identity/index.mjs +8 -16
- package/build-module/components/sidebar-identity/index.mjs.map +3 -3
- package/build-module/components/sidebar-navigation-item/index.mjs +2 -9
- package/build-module/components/sidebar-navigation-item/index.mjs.map +3 -3
- package/build-module/components/sidebar-navigation-screen/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs +43 -76
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs.map +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs +2 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs.map +3 -3
- package/build-module/components/sidebar-navigation-screen-unsupported/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.mjs.map +1 -1
- package/build-module/components/site-editor-routes/home.mjs +1 -1
- package/build-module/components/site-editor-routes/home.mjs.map +1 -1
- package/build-module/components/site-editor-routes/identity.mjs +1 -1
- package/build-module/components/site-editor-routes/identity.mjs.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.mjs +1 -1
- package/build-module/components/site-editor-routes/navigation-item.mjs.map +1 -1
- package/build-module/components/site-editor-routes/navigation.mjs +1 -1
- package/build-module/components/site-editor-routes/navigation.mjs.map +1 -1
- package/build-module/components/site-editor-routes/notfound.mjs +1 -1
- package/build-module/components/site-editor-routes/notfound.mjs.map +1 -1
- package/build-module/components/site-editor-routes/page-item.mjs +1 -1
- package/build-module/components/site-editor-routes/page-item.mjs.map +1 -1
- package/build-module/components/site-editor-routes/pages.mjs +1 -1
- package/build-module/components/site-editor-routes/pages.mjs.map +1 -1
- package/build-module/components/site-editor-routes/pattern-item.mjs +1 -1
- package/build-module/components/site-editor-routes/pattern-item.mjs.map +1 -1
- package/build-module/components/site-editor-routes/patterns.mjs +1 -1
- package/build-module/components/site-editor-routes/patterns.mjs.map +1 -1
- package/build-module/components/site-editor-routes/stylebook.mjs +1 -1
- package/build-module/components/site-editor-routes/stylebook.mjs.map +1 -1
- package/build-module/components/site-editor-routes/styles.mjs +1 -1
- package/build-module/components/site-editor-routes/styles.mjs.map +1 -1
- package/build-module/components/site-editor-routes/template-item.mjs +1 -1
- package/build-module/components/site-editor-routes/template-item.mjs.map +1 -1
- package/build-module/components/site-editor-routes/template-part-item.mjs +1 -1
- package/build-module/components/site-editor-routes/template-part-item.mjs.map +1 -1
- package/build-module/components/site-editor-routes/templates.mjs +3 -5
- package/build-module/components/site-editor-routes/templates.mjs.map +3 -3
- package/build-module/components/site-hub/index.mjs +1 -1
- package/build-module/components/site-hub/index.mjs.map +1 -1
- package/build-module/components/welcome-guide/editor.mjs +1 -1
- package/build-module/components/welcome-guide/editor.mjs.map +1 -1
- package/build-module/components/welcome-guide/image.mjs +1 -1
- package/build-module/components/welcome-guide/image.mjs.map +1 -1
- package/build-module/components/welcome-guide/index.mjs +1 -1
- package/build-module/components/welcome-guide/index.mjs.map +1 -1
- package/build-module/components/welcome-guide/page.mjs +1 -1
- package/build-module/components/welcome-guide/page.mjs.map +1 -1
- package/build-module/components/welcome-guide/template.mjs +1 -1
- package/build-module/components/welcome-guide/template.mjs.map +1 -1
- package/build-module/deprecated.mjs +1 -1
- package/build-module/deprecated.mjs.map +1 -1
- package/build-module/index.mjs +1 -1
- package/build-module/index.mjs.map +1 -1
- package/build-style/style-rtl.css +31 -64
- package/build-style/style.css +31 -64
- package/package.json +42 -52
- package/src/components/add-new-template/style.scss +8 -21
- package/src/components/add-new-template/utils.js +118 -9
- package/src/components/dataviews-actions/index.js +0 -61
- package/src/components/editor/use-adapt-editor-to-canvas.js +0 -21
- package/src/components/layout/{index.js → index.jsx} +2 -1
- package/src/components/more-menu/{welcome-guide-menu-item.js → welcome-guide-menu-item.jsx} +8 -3
- package/src/components/page-templates/fields.jsx +51 -0
- package/src/components/page-templates/{index-legacy.js → index.jsx} +1 -1
- package/src/components/sidebar-global-styles/{index.js → index.jsx} +7 -5
- package/src/components/sidebar-global-styles/style.scss +6 -0
- package/src/components/sidebar-identity/{index.js → index.jsx} +9 -11
- package/src/components/sidebar-identity/style.scss +7 -0
- package/src/components/sidebar-navigation-item/{index.js → index.jsx} +1 -7
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/{index.js → index.jsx} +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/{navigation-menu-content.js → navigation-menu-content.jsx} +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/{index.js → index.jsx} +1 -8
- package/src/components/site-editor-routes/{templates.js → templates.jsx} +2 -19
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/style.scss +1 -1
- package/src/utils/test/get-filtered-template-parts.js +1 -0
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -107
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +0 -7
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +0 -327
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +0 -7
- package/build/components/add-new-template-legacy/index.cjs +0 -390
- package/build/components/add-new-template-legacy/index.cjs.map +0 -7
- package/build/components/add-new-template-legacy/utils.cjs +0 -623
- package/build/components/add-new-template-legacy/utils.cjs.map +0 -7
- package/build/components/page-templates/hooks.cjs +0 -94
- package/build/components/page-templates/hooks.cjs.map +0 -7
- package/build/components/page-templates/index-legacy.cjs +0 -167
- package/build/components/page-templates/index-legacy.cjs.map +0 -7
- package/build/components/page-templates/view-utils.cjs +0 -79
- package/build/components/page-templates/view-utils.cjs.map +0 -7
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs +0 -78
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +0 -7
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -91
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +0 -315
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/index.mjs +0 -391
- package/build-module/components/add-new-template-legacy/index.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/utils.mjs +0 -592
- package/build-module/components/add-new-template-legacy/utils.mjs.map +0 -7
- package/build-module/components/page-templates/hooks.mjs +0 -74
- package/build-module/components/page-templates/hooks.mjs.map +0 -7
- package/build-module/components/page-templates/index-legacy.mjs +0 -136
- package/build-module/components/page-templates/index-legacy.mjs.map +0 -7
- package/build-module/components/page-templates/view-utils.mjs +0 -52
- package/build-module/components/page-templates/view-utils.mjs.map +0 -7
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs +0 -52
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +0 -7
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -85
- package/src/components/add-new-template/add-custom-template-modal-content.js +0 -304
- package/src/components/add-new-template/index.js +0 -435
- package/src/components/add-new-template-legacy/utils.js +0 -757
- package/src/components/page-templates/fields.js +0 -195
- package/src/components/page-templates/hooks.js +0 -93
- package/src/components/page-templates/index.js +0 -369
- package/src/components/page-templates/view-utils.js +0 -50
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +0 -87
- package/src/components/sidebar-navigation-screen-templates-browse/style.scss +0 -6
- /package/src/components/add-new-pattern/{index.js → index.jsx} +0 -0
- /package/src/components/add-new-post/{index.js → index.jsx} +0 -0
- /package/src/components/{add-new-template-legacy/add-custom-generic-template-modal-content.js → add-new-template/add-custom-generic-template-modal-content.jsx} +0 -0
- /package/src/components/{add-new-template-legacy/add-custom-template-modal-content.js → add-new-template/add-custom-template-modal-content.jsx} +0 -0
- /package/src/components/{add-new-template-legacy/index.js → add-new-template/index.jsx} +0 -0
- /package/src/components/app/{index.js → index.jsx} +0 -0
- /package/src/components/canvas-loader/{index.js → index.jsx} +0 -0
- /package/src/components/editor/{index.js → index.jsx} +0 -0
- /package/src/components/editor/{site-preview.js → site-preview.jsx} +0 -0
- /package/src/components/media/{index.js → index.jsx} +0 -0
- /package/src/components/more-menu/{index.js → index.jsx} +0 -0
- /package/src/components/page-patterns/{actions.js → actions.jsx} +0 -0
- /package/src/components/page-patterns/{delete-category-menu-item.js → delete-category-menu-item.jsx} +0 -0
- /package/src/components/page-patterns/{fields.js → fields.jsx} +0 -0
- /package/src/components/page-patterns/{index.js → index.jsx} +0 -0
- /package/src/components/page-patterns/{rename-category-menu-item.js → rename-category-menu-item.jsx} +0 -0
- /package/src/components/pagination/{index.js → index.jsx} +0 -0
- /package/src/components/plugin-template-setting-panel/{index.js → index.jsx} +0 -0
- /package/src/components/post-list/{index.js → index.jsx} +0 -0
- /package/src/components/post-list/{quick-edit-modal.js → quick-edit-modal.jsx} +0 -0
- /package/src/components/resizable-frame/{index.js → index.jsx} +0 -0
- /package/src/components/save-button/{index.js → index.jsx} +0 -0
- /package/src/components/save-hub/{index.js → index.jsx} +0 -0
- /package/src/components/save-panel/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-button/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-dataviews/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-details-footer/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-global-styles/{content.js → content.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-global-styles/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-identity/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-main/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{delete-confirm-dialog.js → delete-confirm-dialog.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{more-menu.js → more-menu.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{navigation-menu-editor.js → navigation-menu-editor.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{rename-modal.js → rename-modal.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menu/{single-navigation-menu.js → single-navigation-menu.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-navigation-menus/{leaf-more-menu.js → leaf-more-menu.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-patterns/{category-item.js → category-item.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-patterns/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-templates-browse/{content-legacy.js → content.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-unsupported/{index.js → index.jsx} +0 -0
- /package/src/components/site-editor-routes/{home.js → home.jsx} +0 -0
- /package/src/components/site-editor-routes/{identity.js → identity.jsx} +0 -0
- /package/src/components/site-editor-routes/{navigation-item.js → navigation-item.jsx} +0 -0
- /package/src/components/site-editor-routes/{navigation.js → navigation.jsx} +0 -0
- /package/src/components/site-editor-routes/{notfound.js → notfound.jsx} +0 -0
- /package/src/components/site-editor-routes/{page-item.js → page-item.jsx} +0 -0
- /package/src/components/site-editor-routes/{pages.js → pages.jsx} +0 -0
- /package/src/components/site-editor-routes/{pattern-item.js → pattern-item.jsx} +0 -0
- /package/src/components/site-editor-routes/{patterns.js → patterns.jsx} +0 -0
- /package/src/components/site-editor-routes/{stylebook.js → stylebook.jsx} +0 -0
- /package/src/components/site-editor-routes/{styles.js → styles.jsx} +0 -0
- /package/src/components/site-editor-routes/{template-item.js → template-item.jsx} +0 -0
- /package/src/components/site-editor-routes/{template-part-item.js → template-part-item.jsx} +0 -0
- /package/src/components/site-hub/{index.js → index.jsx} +0 -0
- /package/src/components/welcome-guide/{editor.js → editor.jsx} +0 -0
- /package/src/components/welcome-guide/{image.js → image.jsx} +0 -0
- /package/src/components/welcome-guide/{index.js → index.jsx} +0 -0
- /package/src/components/welcome-guide/{page.js → page.jsx} +0 -0
- /package/src/components/welcome-guide/{template.js → template.jsx} +0 -0
- /package/src/{deprecated.js → deprecated.jsx} +0 -0
- /package/src/{index.js → index.jsx} +0 -0
package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menu/rename-modal.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menu/rename-modal.jsx"],
|
|
4
4
|
"sourcesContent": ["import {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\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{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA;AAAA,EACC,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAqBpB,cAMA,YANA;AAnBL,IAAM,iBAAiB,CAAE,eAAgB,YAAY,KAAK,GAAG,SAAS;AAEvD,SAAR,YAA8B,EAAE,WAAW,SAAS,OAAO,GAAI;AACrE,QAAM,CAAE,iBAAiB,kBAAmB,IAAI,SAAU,SAAU;AAEpE,QAAM,kBAAkB,oBAAoB;AAE5C,QAAM,yBACL,mBAAmB,eAAgB,eAAgB;AAEpD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,QAAS;AAAA,MACrB,gBAAiB;AAAA,MACjB,cAAa;AAAA,MACb,MAAK;AAAA,MAEL,8BAAC,UAAK,WAAU,yCACf,+BAAC,UAAO,SAAQ,KACf;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR,aAAc,GAAI,kBAAmB;AAAA,YACrC,UAAW;AAAA,YACX,OAAQ,GAAI,MAAO;AAAA;AAAA,QACpB;AAAA,QACA,qBAAC,UAAO,SAAQ,SACf;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,aAAI,QAAS;AAAA;AAAA,UAChB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,wBAAsB;AAAA,cACtB,UAAW,CAAE;AAAA,cACb,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAU,CAAE,MAAO;AAClB,kBAAE,eAAe;AAEjB,oBAAK,CAAE,wBAAyB;AAC/B;AAAA,gBACD;AACA,uBAAQ,EAAE,OAAO,gBAAgB,CAAE;AAGnC,wBAAQ;AAAA,cACT;AAAA,cAEE,aAAI,MAAO;AAAA;AAAA,UACd;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { decodeEntities } from "@wordpress/html-entities";
|
|
4
4
|
import { SidebarNavigationScreenWrapper } from "../sidebar-navigation-screen-navigation-menus/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.jsx"],
|
|
4
4
|
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport NavigationMenuEditor from './navigation-menu-editor';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport default function SingleNavigationMenu( {\n\tnavigationMenu,\n\tbackPath,\n\thandleDelete,\n\thandleDuplicate,\n\thandleSave,\n} ) {\n\tconst menuTitle = navigationMenu?.title?.rendered;\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuId={ navigationMenu?.id }\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ handleDelete }\n\t\t\t\t\t\tonSave={ handleSave }\n\t\t\t\t\t\tonDuplicate={ handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\tnavigationMenu?.title,\n\t\t\t\tnavigationMenu?.id,\n\t\t\t\tnavigationMenu?.status\n\t\t\t) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenuId={ navigationMenu?.id } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,sCAAsC;AAC/C,OAAO,8BAA8B;AACrC,OAAO,0BAA0B;AACjC,OAAO,0BAA0B;AAc7B,mBACC,WADD;AAZW,SAAR,qBAAuC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,YAAY,gBAAgB,OAAO;AAEzC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SACC,gCACC;AAAA,QAAC;AAAA;AAAA,UACA,QAAS,gBAAgB;AAAA,UACzB,WAAY,eAAgB,SAAU;AAAA,UACtC,UAAW;AAAA,UACX,QAAS;AAAA,UACT,aAAc;AAAA;AAAA,MACf,GACD;AAAA,MAED;AAAA,MACA,OAAQ;AAAA,QACP,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,MACjB;AAAA,MACA,aAAc;AAAA,QACb;AAAA,MACD;AAAA,MAEA,8BAAC,wBAAqB,kBAAmB,gBAAgB,IAAK;AAAA;AAAA,EAC/D;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],
|
|
4
|
-
"sourcesContent": ["import { __, _x, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.
|
|
4
|
+
"sourcesContent": ["import { __, _x, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,sBAAsB;AAGhB,SAAR,qBAAuC,OAAO,IAAI,QAAS;AACjE,MAAK,CAAE,OAAO,UAAW;AAExB,WAAO,QAAS,GAAI,eAAgB,GAAG,EAAG;AAAA,EAC3C;AAEA,MAAK,WAAW,WAAY;AAC3B,WAAO,eAAgB,OAAO,QAAS;AAAA,EACxC;AAEA,SAAO;AAAA;AAAA,IAEN,GAAI,eAAe,YAAa;AAAA,IAChC,eAAgB,OAAO,QAAS;AAAA,IAChC;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.jsx
|
|
2
2
|
import { __, _x, sprintf } from "@wordpress/i18n";
|
|
3
3
|
import { useEntityRecords, store as coreStore } from "@wordpress/core-data";
|
|
4
4
|
import { useSelect } from "@wordpress/data";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/index.
|
|
4
|
-
"sourcesContent": ["import { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/index.jsx"],
|
|
4
|
+
"sourcesContent": ["import { __, _x, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s: the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).\n\t\t_x( '%1$s (%2$s)', 'menu label' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\nexport default function SidebarNavigationScreenNavigationMenus( { backPath } ) {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\tconst isCreatingNavigationFallback = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).isResolving( 'getNavigationFallbackId' ),\n\t\t[]\n\t);\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t// Ensure a fallback navigation is created only once\n\t\t! isCreatingNavigationFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper backPath={ backPath }>\n\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-navigation-menus\">\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n\tbackPath,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={\n\t\t\t\tdescription ||\n\t\t\t\t__(\n\t\t\t\t\t'Manage the menus that help visitors find their way around your site.'\n\t\t\t\t)\n\t\t\t}\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ `/wp_navigation/${ postId }` }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,kBAAkB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1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.jsx
|
|
2
2
|
import { chevronUp, chevronDown, moreVertical } from "@wordpress/icons";
|
|
3
3
|
import { DropdownMenu, MenuItem, MenuGroup } from "@wordpress/components";
|
|
4
4
|
import { useDispatch, useSelect } from "@wordpress/data";
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.jsx"],
|
|
4
4
|
"sourcesContent": ["import { 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';\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\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 { clientId } = props;\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, blockName, attributes } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\trootClientId: getBlockRootClientId( clientId ),\n\t\t\t\tblockName: getBlockName( clientId ),\n\t\t\t\tattributes: getBlockAttributes( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst onGoToPage = useCallback( () => {\n\t\tif (\n\t\t\tattributes.kind === 'post-type' &&\n\t\t\tattributes.id &&\n\t\t\tattributes.type &&\n\t\t\thistory\n\t\t) {\n\t\t\thistory.navigate(\n\t\t\t\t`/${ attributes.type }/${ attributes.id }?canvas=edit`,\n\t\t\t\t{\n\t\t\t\t\tstate: { backPath: path },\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\tif ( blockName === 'core/page-list-item' && attributes.id && history ) {\n\t\t\thistory.navigate( `/page/${ attributes.id }?canvas=edit`, {\n\t\t\t\tstate: { backPath: path },\n\t\t\t} );\n\t\t}\n\t}, [ path, history, attributes, blockName ] );\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{ attributes?.type === 'page' && attributes?.id && (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonGoToPage();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ goToLabel }\n\t\t\t\t\t\t\t</MenuItem>\n\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"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,WAAW,aAAa,oBAAoB;AACrD,SAAS,cAAc,UAAU,iBAAiB;AAClD,SAAS,aAAa,iBAAiB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,IAAI,eAAe;AAC5B,SAAS,YAAY,SAAS,wBAAwB;AACtD,SAAS,eAAe,yBAAyB;AAKjD,SAAS,cAAc;AAoEnB,mBAEE,KADD,YADD;AAxEJ,IAAM,gBAAgB;AAAA,EACrB,WAAW;AAAA,EACX,WAAW;AACZ;AAGA,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P,OAAQ,GAAI,SAAU;AAAA,MACtB,WAAU;AAAA,MACV,cAAe;AAAA,MACf,SAAO;AAAA,MACL,GAAG;AAAA,MAEH,WAAE,EAAE,QAAQ,MACb,iCACC;AAAA,6BAAC,aACA;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,MAAO;AAAA,cACP,SAAU,MAAM;AACf,6BAAc,CAAE,QAAS,GAAG,YAAa;AACzC,wBAAQ;AAAA,cACT;AAAA,cAEE,aAAI,SAAU;AAAA;AAAA,UACjB;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,MAAO;AAAA,cACP,SAAU,MAAM;AACf,+BAAgB,CAAE,QAAS,GAAG,YAAa;AAC3C,wBAAQ;AAAA,cACT;AAAA,cAEE,aAAI,WAAY;AAAA;AAAA,UACnB;AAAA,UACE,YAAY,SAAS,UAAU,YAAY,MAC5C;AAAA,YAAC;AAAA;AAAA,cACA,SAAU,MAAM;AACf,2BAAW;AACX,wBAAQ;AAAA,cACT;AAAA,cAEE;AAAA;AAAA,UACH;AAAA,WAEF;AAAA,QACA,oBAAC,aACA;AAAA,UAAC;AAAA;AAAA,YACA,SAAU,MAAM;AACf,2BAAc,CAAE,QAAS,GAAG,KAAM;AAClC,sBAAQ;AAAA,YACT;AAAA,YAEE;AAAA;AAAA,QACH,GACD;AAAA,SACD;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.jsx
|
|
2
2
|
import {
|
|
3
3
|
privateApis as blockEditorPrivateApis,
|
|
4
4
|
store as blockEditorStore,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.
|
|
4
|
-
"sourcesContent": ["import {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { unlock } from '../../lock-unlock';\nimport LeafMoreMenu from './leaf-more-menu';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\nconst { NavigationLinkUI } = unlock( blockLibraryPrivateApis );\n\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.jsx"],
|
|
4
|
+
"sourcesContent": ["import {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { unlock } from '../../lock-unlock';\nimport LeafMoreMenu from './leaf-more-menu';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\nconst { NavigationLinkUI } = unlock( blockLibraryPrivateApis );\n\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.jsx.\nconst MAX_PAGE_COUNT = 100;\nconst PAGES_QUERY = [\n\t'postType',\n\t'page',\n\t{\n\t\tper_page: MAX_PAGE_COUNT,\n\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t// sort.\n\t\torderby: 'menu_order',\n\t\torder: 'asc',\n\t},\n];\n\nexport default function NavigationMenuContent( { rootClientId } ) {\n\tconst { listViewRootClientId, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tareInnerBlocksControlled,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { isResolving } = select( coreStore );\n\n\t\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\n\t\t\tconst hasOnlyPageListBlock =\n\t\t\t\tblockClientIds.length === 1 &&\n\t\t\t\tgetBlockName( blockClientIds[ 0 ] ) === 'core/page-list';\n\t\t\tconst pageListHasBlocks =\n\t\t\t\thasOnlyPageListBlock &&\n\t\t\t\tgetBlockCount( blockClientIds[ 0 ] ) > 0;\n\n\t\t\tconst isLoadingPages = isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tPAGES_QUERY\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tlistViewRootClientId: pageListHasBlocks\n\t\t\t\t\t? blockClientIds[ 0 ]\n\t\t\t\t\t: rootClientId,\n\t\t\t\t// This is a small hack to wait for the navigation block\n\t\t\t\t// to actually load its inner blocks.\n\t\t\t\tisLoading:\n\t\t\t\t\t! areInnerBlocksControlled( rootClientId ) ||\n\t\t\t\t\tisLoadingPages,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst offCanvasOnselect = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\t! block.attributes.url\n\t\t\t) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlock(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\tcreateBlock( 'core/navigation-link', block.attributes )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ __unstableMarkNextChangeAsNotPersistent, replaceBlock ]\n\t);\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t{ ! isLoading && (\n\t\t\t\t<PrivateListView\n\t\t\t\t\trootClientId={ listViewRootClientId }\n\t\t\t\t\tonSelect={ offCanvasOnselect }\n\t\t\t\t\tblockSettingsMenu={ LeafMoreMenu }\n\t\t\t\t\tshowAppender\n\t\t\t\t\tadditionalBlockContent={ NavigationLinkUI }\n\t\t\t\t\tisExpanded\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor\">\n\t\t\t\t<BlockList />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA;AAAA,EACC,eAAe;AAAA,EACf,SAAS;AAAA,EACT;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe,+BAA+B;AACvD,SAAS,cAAc;AACvB,OAAO,kBAAkB;AAiFvB,mBAEE,KAFF;AA/EF,IAAM,EAAE,gBAAgB,IAAI,OAAQ,sBAAuB;AAC3D,IAAM,EAAE,iBAAiB,IAAI,OAAQ,uBAAwB;AAG7D,IAAM,iBAAiB;AACvB,IAAM,cAAc;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,IACC,UAAU;AAAA,IACV,SAAS,CAAE,MAAM,QAAQ,cAAc,UAAU,SAAS,MAAO;AAAA;AAAA;AAAA;AAAA,IAIjE,SAAS;AAAA,IACT,OAAO;AAAA,EACR;AACD;AAEe,SAAR,sBAAwC,EAAE,aAAa,GAAI;AACjE,QAAM,EAAE,sBAAsB,UAAU,IAAI;AAAA,IAC3C,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,gBAAiB;AAC7B,YAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAE1C,YAAM,iBAAiB,cAAe,YAAa;AAEnD,YAAM,uBACL,eAAe,WAAW,KAC1B,aAAc,eAAgB,CAAE,CAAE,MAAM;AACzC,YAAM,oBACL,wBACA,cAAe,eAAgB,CAAE,CAAE,IAAI;AAExC,YAAM,iBAAiB;AAAA,QACtB;AAAA,QACA;AAAA,MACD;AAEA,aAAO;AAAA,QACN,sBAAsB,oBACnB,eAAgB,CAAE,IAClB;AAAA;AAAA;AAAA,QAGH,WACC,CAAE,yBAA0B,YAAa,KACzC;AAAA,MACF;AAAA,IACD;AAAA,IACA,CAAE,YAAa;AAAA,EAChB;AACA,QAAM,EAAE,cAAc,wCAAwC,IAC7D,YAAa,gBAAiB;AAE/B,QAAM,oBAAoB;AAAA,IACzB,CAAE,UAAW;AACZ,UACC,MAAM,SAAS,0BACf,CAAE,MAAM,WAAW,KAClB;AACD,gDAAwC;AACxC;AAAA,UACC,MAAM;AAAA,UACN,YAAa,wBAAwB,MAAM,UAAW;AAAA,QACvD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,yCAAyC,YAAa;AAAA,EACzD;AAIA,SACC,iCACG;AAAA,KAAE,aACH;AAAA,MAAC;AAAA;AAAA,QACA,cAAe;AAAA,QACf,UAAW;AAAA,QACX,mBAAoB;AAAA,QACpB,cAAY;AAAA,QACZ,wBAAyB;AAAA,QACzB,YAAU;AAAA;AAAA,IACX;AAAA,IAED,oBAAC,SAAI,WAAU,6EACd,8BAAC,aAAU,GACZ;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-patterns/category-item.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-patterns/category-item.jsx
|
|
2
2
|
import SidebarNavigationItem from "../sidebar-navigation-item/index.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function CategoryItem({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/category-item.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/category-item.jsx"],
|
|
4
4
|
"sourcesContent": ["import 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"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,2BAA2B;AAqBtB;AAnBG,SAAR,aAA+B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AACA,QAAM,YAAY,CAAE,YAAa,IAAK,EAAG;AACzC,MAAK,IAAK;AACT,cAAU,KAAM,cAAe,EAAG,EAAG;AAAA,EACtC;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,QAAS,oBAAC,UAAO,iBAAO;AAAA,MACxB,gBAAe,WAAW,SAAS;AAAA,MACnC,IAAK,YAAa,UAAU,KAAM,GAAI,CAAE;AAAA,MAEtC;AAAA;AAAA,EACH;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/index.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreDataPrivateApis } from '@wordpress/core-data';\nimport { useViewConfig } from '@wordpress/views';\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 VIEW_CONFIG_FIELDS = [ 'view_list' ];\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { getTemplatePartIcon } = unlock( coreDataPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartViews,\n\tpatternViews,\n\ttemplatePartCounts,\n\tpatternCounts,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t{ templatePartViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ templatePartCounts[ view.slug ] }\n\t\t\t\t\ticon={ getTemplatePartIcon(\n\t\t\t\t\t\tview.slug === TEMPLATE_PART_ALL_AREAS_CATEGORY\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: view.slug\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === view.slug &&\n\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\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{ patternViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ patternCounts[ view.slug ] }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ view.slug }` &&\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 { view_list: templatePartViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: TEMPLATE_PART_POST_TYPE,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\tconst { view_list: patternViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: PATTERN_TYPES.user,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\n\tconst { templatePartAreas, isLoading, hasTemplateParts } =\n\t\tuseTemplatePartAreas();\n\tconst templatePartCounts = useMemo( () => {\n\t\tconst counts = { [ TEMPLATE_PART_ALL_AREAS_CATEGORY ]: 0 };\n\t\tObject.entries( templatePartAreas ).forEach(\n\t\t\t( [ area, { templateParts } ] ) => {\n\t\t\t\tconst count = templateParts?.length || 0;\n\t\t\t\tcounts[ area ] = count;\n\t\t\t\tcounts[ TEMPLATE_PART_ALL_AREAS_CATEGORY ] += count;\n\t\t\t}\n\t\t);\n\t\treturn counts;\n\t}, [ templatePartAreas ] );\n\tconst { patternCategories } = usePatternCategories();\n\tconst patternCounts = useMemo( () => {\n\t\tconst counts = {};\n\t\tpatternCategories.forEach( ( cat ) => {\n\t\t\tcounts[ cat.name ] = cat.count;\n\t\t} );\n\t\treturn counts;\n\t}, [ patternCategories ] );\n\n\tconst hasPatterns = patternCounts[ PATTERN_DEFAULT_CATEGORY ] > 0;\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing your site.'\n\t\t\t) }\n\t\t\tisRoot={ ! backPath }\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\ttemplatePartViews={ templatePartViews }\n\t\t\t\t\t\t\t\tpatternViews={ patternViews }\n\t\t\t\t\t\t\t\ttemplatePartCounts={ templatePartCounts }\n\t\t\t\t\t\t\t\tpatternCounts={ patternCounts }\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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AC;AAAA;AAAA,MACA,OAAQ,GAAI,UAAW;AAAA,MACvB,aAAc;AAAA,QACb;AAAA,MACD;AAAA,MACA,QAAS,CAAE;AAAA,MACX;AAAA,MACA,SACC,iCACG;AAAA,qBAAa,GAAI,gBAAiB;AAAA,QAClC,CAAE,aACH,iCACG;AAAA,WAAE,oBAAoB,CAAE,eACzB,oBAAC,aAAU,WAAU,uDACpB,8BAAC,QAAO,aAAI,gBAAiB,GAAG,GACjC;AAAA,UAED;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,aAAc;AAAA;AAAA,UACf;AAAA,WACD;AAAA,SAEF;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,84 +1,51 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-templates-browse/content.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { jsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-templates-browse/content.jsx
|
|
2
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
3
|
+
import { useSelect } from "@wordpress/data";
|
|
4
|
+
import {
|
|
5
|
+
commentAuthorAvatar,
|
|
6
|
+
layout,
|
|
7
|
+
plugins as pluginIcon,
|
|
8
|
+
globe
|
|
9
|
+
} from "@wordpress/icons";
|
|
10
|
+
import { TEMPLATE_POST_TYPE } from "../../utils/constants.mjs";
|
|
11
|
+
import DataViewsSidebarContent from "../sidebar-dataviews/index.mjs";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var SOURCE_TO_ICON = {
|
|
14
|
+
user: commentAuthorAvatar,
|
|
15
|
+
theme: layout,
|
|
16
|
+
plugin: pluginIcon,
|
|
17
|
+
site: globe
|
|
18
|
+
};
|
|
19
|
+
function DataviewsTemplatesSidebarContent() {
|
|
20
|
+
const authorSourceMap = useSelect((select) => {
|
|
21
|
+
const templates = select(coreStore).getEntityRecords(
|
|
22
|
+
"postType",
|
|
23
|
+
TEMPLATE_POST_TYPE,
|
|
24
|
+
{ per_page: -1 }
|
|
25
|
+
);
|
|
26
|
+
if (!templates) {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
const map = {};
|
|
30
|
+
for (const template of templates) {
|
|
31
|
+
if (template.author_text && template.original_source && !map[template.author_text]) {
|
|
32
|
+
map[template.author_text] = template.original_source;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return map;
|
|
36
|
+
}, []);
|
|
37
|
+
const resolveIcon = (view) => {
|
|
38
|
+
const source = authorSourceMap[view.slug];
|
|
39
|
+
return SOURCE_TO_ICON[source] ?? layout;
|
|
40
|
+
};
|
|
17
41
|
return /* @__PURE__ */ jsx(
|
|
18
|
-
|
|
42
|
+
DataViewsSidebarContent,
|
|
19
43
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"aria-current": isActive,
|
|
23
|
-
children: text
|
|
44
|
+
postType: TEMPLATE_POST_TYPE,
|
|
45
|
+
resolveIcon
|
|
24
46
|
}
|
|
25
47
|
);
|
|
26
48
|
}
|
|
27
|
-
function DataviewsTemplatesSidebarContent() {
|
|
28
|
-
const {
|
|
29
|
-
query: { activeView = "active" }
|
|
30
|
-
} = useLocation();
|
|
31
|
-
const { records } = useEntityRecords("root", "registeredTemplate", {
|
|
32
|
-
// This should not be needed, the endpoint returns all registered
|
|
33
|
-
// templates, but it's not possible right now to turn off pagination for
|
|
34
|
-
// entity configs.
|
|
35
|
-
per_page: -1
|
|
36
|
-
});
|
|
37
|
-
const firstItemPerAuthorText = useMemo(() => {
|
|
38
|
-
const firstItemPerAuthor = records?.reduce((acc, template) => {
|
|
39
|
-
const author = template.author_text;
|
|
40
|
-
if (author && !acc[author]) {
|
|
41
|
-
acc[author] = template;
|
|
42
|
-
}
|
|
43
|
-
return acc;
|
|
44
|
-
}, {});
|
|
45
|
-
return (firstItemPerAuthor && Object.values(firstItemPerAuthor)) ?? EMPTY_ARRAY;
|
|
46
|
-
}, [records]);
|
|
47
|
-
return /* @__PURE__ */ jsxs(ItemGroup, { className: "edit-site-sidebar-navigation-screen-templates-browse", children: [
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
SidebarNavigationItem,
|
|
50
|
-
{
|
|
51
|
-
to: "/template",
|
|
52
|
-
icon: published,
|
|
53
|
-
"aria-current": activeView === "active",
|
|
54
|
-
children: __("Active templates")
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
/* @__PURE__ */ jsx(
|
|
58
|
-
SidebarNavigationItem,
|
|
59
|
-
{
|
|
60
|
-
to: addQueryArgs("/template", { activeView: "user" }),
|
|
61
|
-
icon: commentAuthorAvatar,
|
|
62
|
-
"aria-current": activeView === "user",
|
|
63
|
-
// Let's avoid calling them "custom templates" to avoid
|
|
64
|
-
// confusion. "Created" is closest to meaning database
|
|
65
|
-
// templates, created by users.
|
|
66
|
-
// https://developer.wordpress.org/themes/classic-themes/templates/page-template-files/#creating-custom-page-templates-for-global-use
|
|
67
|
-
children: __("Created templates")
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
firstItemPerAuthorText.map((template) => {
|
|
71
|
-
return /* @__PURE__ */ jsx(
|
|
72
|
-
TemplateDataviewItem,
|
|
73
|
-
{
|
|
74
|
-
template,
|
|
75
|
-
isActive: activeView === template.author_text
|
|
76
|
-
},
|
|
77
|
-
template.author_text
|
|
78
|
-
);
|
|
79
|
-
})
|
|
80
|
-
] });
|
|
81
|
-
}
|
|
82
49
|
export {
|
|
83
50
|
DataviewsTemplatesSidebarContent as default
|
|
84
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-templates-browse/content.
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";AAAA,SAAS,
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-templates-browse/content.jsx"],
|
|
4
|
+
"sourcesContent": ["import { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tcommentAuthorAvatar,\n\tlayout,\n\tplugins as pluginIcon,\n\tglobe,\n} from '@wordpress/icons';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\n\nconst SOURCE_TO_ICON = {\n\tuser: commentAuthorAvatar,\n\ttheme: layout,\n\tplugin: pluginIcon,\n\tsite: globe,\n};\nexport default function DataviewsTemplatesSidebarContent() {\n\tconst authorSourceMap = useSelect( ( select ) => {\n\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\t\tif ( ! templates ) {\n\t\t\treturn {};\n\t\t}\n\t\tconst map = {};\n\t\tfor ( const template of templates ) {\n\t\t\tif (\n\t\t\t\ttemplate.author_text &&\n\t\t\t\ttemplate.original_source &&\n\t\t\t\t! map[ template.author_text ]\n\t\t\t) {\n\t\t\t\tmap[ template.author_text ] = template.original_source;\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}, [] );\n\n\tconst resolveIcon = ( view ) => {\n\t\tconst source = authorSourceMap[ view.slug ];\n\t\treturn SOURCE_TO_ICON[ source ] ?? layout;\n\t};\n\n\treturn (\n\t\t<DataViewsSidebarContent\n\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\tresolveIcon={ resolveIcon }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,OAAO,6BAA6B;AAqClC;AAnCF,IAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACP;AACe,SAAR,mCAAoD;AAC1D,QAAM,kBAAkB,UAAW,CAAE,WAAY;AAChD,UAAM,YAAY,OAAQ,SAAU,EAAE;AAAA,MACrC;AAAA,MACA;AAAA,MACA,EAAE,UAAU,GAAG;AAAA,IAChB;AACA,QAAK,CAAE,WAAY;AAClB,aAAO,CAAC;AAAA,IACT;AACA,UAAM,MAAM,CAAC;AACb,eAAY,YAAY,WAAY;AACnC,UACC,SAAS,eACT,SAAS,mBACT,CAAE,IAAK,SAAS,WAAY,GAC3B;AACD,YAAK,SAAS,WAAY,IAAI,SAAS;AAAA,MACxC;AAAA,IACD;AACA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AAEN,QAAM,cAAc,CAAE,SAAU;AAC/B,UAAM,SAAS,gBAAiB,KAAK,IAAK;AAC1C,WAAO,eAAgB,MAAO,KAAK;AAAA,EACpC;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,UAAW;AAAA,MACX;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import SidebarNavigationScreen from "../sidebar-navigation-screen/index.mjs";
|
|
4
4
|
import DataviewsTemplatesSidebarContent from "./content.mjs";
|
|
5
|
-
import DataviewsTemplatesSidebarContentLegacy from "./content-legacy.mjs";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
function SidebarNavigationScreenTemplatesBrowse({ backPath }) {
|
|
8
7
|
return /* @__PURE__ */ jsx(
|
|
@@ -13,7 +12,7 @@ function SidebarNavigationScreenTemplatesBrowse({ backPath }) {
|
|
|
13
12
|
"Manage the templates that define the structure of your pages, or reset any customizations made to those supplied by your theme."
|
|
14
13
|
),
|
|
15
14
|
backPath,
|
|
16
|
-
content:
|
|
15
|
+
content: /* @__PURE__ */ jsx(DataviewsTemplatesSidebarContent, {})
|
|
17
16
|
}
|
|
18
17
|
);
|
|
19
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-templates-browse/index.
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataviewsTemplatesSidebarContent from './content';\
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU;AACnB,OAAO,6BAA6B;AACpC,OAAO,sCAAsC;
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-templates-browse/index.jsx"],
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\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'Manage the templates that define the structure of your pages, or reset any customizations made to those 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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU;AACnB,OAAO,6BAA6B;AACpC,OAAO,sCAAsC;AAUhC;AARE,SAAR,uCAAyD,EAAE,SAAS,GAAI;AAC9E,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,WAAY;AAAA,MACxB,aAAc;AAAA,QACb;AAAA,MACD;AAAA,MACA;AAAA,MACA,SAAU,oBAAC,oCAAiC;AAAA;AAAA,EAC7C;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/sidebar-navigation-screen-unsupported/index.
|
|
1
|
+
// packages/edit-site/src/components/sidebar-navigation-screen-unsupported/index.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { Notice, __experimentalSpacer as Spacer } from "@wordpress/components";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar-navigation-screen-unsupported/index.
|
|
3
|
+
"sources": ["../../../src/components/sidebar-navigation-screen-unsupported/index.jsx"],
|
|
4
4
|
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenUnsupported() {\n\treturn (\n\t\t<Spacer padding={ 3 }>\n\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t{ __(\n\t\t\t\t\t'The theme you are currently using does not support this screen.'\n\t\t\t\t) }\n\t\t\t</Notice>\n\t\t</Spacer>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,QAAQ,wBAAwB,cAAc;AAKpD;AAHY,SAAR,qCAAsD;AAC5D,SACC,oBAAC,UAAO,SAAU,GACjB,8BAAC,UAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,IACD;AAAA,EACD,GACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/home.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/home.jsx
|
|
2
2
|
import SidebarNavigationScreenMain from "../sidebar-navigation-screen-main/index.mjs";
|
|
3
3
|
import SidebarNavigationScreenUnsupported from "../sidebar-navigation-screen-unsupported/index.mjs";
|
|
4
4
|
import Editor from "../editor/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/home.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/home.jsx"],
|
|
4
4
|
"sourcesContent": ["import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport Editor from '../editor';\nimport { isClassicThemeWithStyleBookSupport, isThemeDataLoaded } from './utils';\n\nexport const homeRoute = {\n\tname: 'home',\n\tpath: '/',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ||\n\t\t\t\tisClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tpreview( { siteData } ) {\n\t\t\tconst isBlockTheme = siteData.currentTheme?.is_block_theme;\n\t\t\treturn isBlockTheme ||\n\t\t\t\tisClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<Editor isHomeRoute />\n\t\t\t) : undefined;\n\t\t},\n\t\tmobileSidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn <></>;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ||\n\t\t\t\tisClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,iCAAiC;AACxC,OAAO,wCAAwC;AAC/C,OAAO,YAAY;AACnB,SAAS,oCAAoC,yBAAyB;AAYlE,SAcO,UAdP;AAVG,IAAM,YAAY;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,kBAC5B,mCAAoC,QAAS,IAC7C,oBAAC,+BAA4B,IAE7B,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,IACA,QAAS,EAAE,SAAS,GAAI;AACvB,YAAM,eAAe,SAAS,cAAc;AAC5C,aAAO,gBACN,mCAAoC,QAAS,IAC7C,oBAAC,UAAO,aAAW,MAAC,IACjB;AAAA,IACL;AAAA,IACA,cAAe,EAAE,SAAS,GAAI;AAC7B,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO,gCAAE;AAAA,MACV;AACA,aAAO,SAAS,aAAa,kBAC5B,mCAAoC,QAAS,IAC7C,oBAAC,+BAA4B,IAE7B,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/identity.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/identity.jsx
|
|
2
2
|
import Editor from "../editor/index.mjs";
|
|
3
3
|
import SidebarNavigationScreenIdentity from "../sidebar-navigation-screen-identity/index.mjs";
|
|
4
4
|
import SidebarIdentity from "../sidebar-identity/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/identity.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/identity.jsx"],
|
|
4
4
|
"sourcesContent": ["import Editor from '../editor';\nimport SidebarNavigationScreenIdentity from '../sidebar-navigation-screen-identity';\nimport SidebarIdentity from '../sidebar-identity';\n\nexport const identityRoute = {\n\tname: 'identity',\n\tpath: '/identity',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenIdentity />,\n\t\tcontent: <SidebarIdentity />,\n\t\tpreview: <Editor />,\n\t\tmobileContent: <SidebarIdentity />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,YAAY;AACnB,OAAO,qCAAqC;AAC5C,OAAO,qBAAqB;AAMjB;AAJJ,IAAM,gBAAgB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,SAAS,oBAAC,mCAAgC;AAAA,IAC1C,SAAS,oBAAC,mBAAgB;AAAA,IAC1B,SAAS,oBAAC,UAAO;AAAA,IACjB,eAAe,oBAAC,mBAAgB;AAAA,EACjC;AAAA,EACA,QAAQ;AAAA,IACP,SAAS;AAAA,EACV;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/navigation-item.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/navigation-item.jsx
|
|
2
2
|
import Editor from "../editor/index.mjs";
|
|
3
3
|
import SidebarNavigationScreenNavigationMenu from "../sidebar-navigation-screen-navigation-menu/index.mjs";
|
|
4
4
|
import SidebarNavigationScreenUnsupported from "../sidebar-navigation-screen-unsupported/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/navigation-item.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/navigation-item.jsx"],
|
|
4
4
|
"sourcesContent": ["import Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport { isThemeDataLoaded } from './utils';\n\nexport const navigationItemRoute = {\n\tname: 'navigation-item',\n\tpath: '/wp_navigation/:postId',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreenNavigationMenu backPath=\"/navigation\" />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tpreview( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<Editor />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tmobileSidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn <></>;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreenNavigationMenu backPath=\"/navigation\" />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,YAAY;AACnB,OAAO,2CAA2C;AAClD,OAAO,wCAAwC;AAC/C,SAAS,yBAAyB;AAW9B,SAiBO,UAjBP;AATG,IAAM,sBAAsB;AAAA,EAClC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,yCAAsC,UAAS,eAAc,IAE9D,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,IACA,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,UAAO,IAER,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,IACA,cAAe,EAAE,SAAS,GAAI;AAC7B,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO,gCAAE;AAAA,MACV;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,yCAAsC,UAAS,eAAc,IAE9D,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/navigation.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/navigation.jsx
|
|
2
2
|
import Editor from "../editor/index.mjs";
|
|
3
3
|
import SidebarNavigationScreenNavigationMenus from "../sidebar-navigation-screen-navigation-menus/index.mjs";
|
|
4
4
|
import SidebarNavigationScreenUnsupported from "../sidebar-navigation-screen-unsupported/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/navigation.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/navigation.jsx"],
|
|
4
4
|
"sourcesContent": ["import Editor from '../editor';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport { isThemeDataLoaded } from './utils';\n\nexport const navigationRoute = {\n\tname: 'navigation',\n\tpath: '/navigation',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreenNavigationMenus backPath=\"/\" />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tpreview( { siteData } ) {\n\t\t\tconst isBlockTheme = siteData.currentTheme?.is_block_theme;\n\t\t\treturn isBlockTheme ? <Editor /> : undefined;\n\t\t},\n\t\tmobileSidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn <></>;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreenNavigationMenus backPath=\"/\" />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,OAAO,YAAY;AACnB,OAAO,4CAA4C;AACnD,OAAO,wCAAwC;AAC/C,SAAS,yBAAyB;AAW9B,SAWO,UAXP;AATG,IAAM,kBAAkB;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,0CAAuC,UAAS,KAAI,IAErD,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,IACA,QAAS,EAAE,SAAS,GAAI;AACvB,YAAM,eAAe,SAAS,cAAc;AAC5C,aAAO,eAAe,oBAAC,UAAO,IAAK;AAAA,IACpC;AAAA,IACA,cAAe,EAAE,SAAS,GAAI;AAC7B,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO,gCAAE;AAAA,MACV;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,0CAAuC,UAAS,KAAI,IAErD,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/notfound.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/notfound.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { Notice, __experimentalSpacer as Spacer } from "@wordpress/components";
|
|
4
4
|
import SidebarNavigationScreenMain from "../sidebar-navigation-screen-main/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/notfound.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/notfound.jsx"],
|
|
4
4
|
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\n\nfunction NotFoundError() {\n\treturn (\n\t\t<Notice status=\"error\" isDismissible={ false }>\n\t\t\t{ __(\n\t\t\t\t'The requested page could not be found. Please check the URL.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport const notFoundRoute = {\n\tname: 'notfound',\n\tpath: '*',\n\tareas: {\n\t\tsidebar: <SidebarNavigationScreenMain />,\n\t\tmobileSidebar: (\n\t\t\t<SidebarNavigationScreenMain\n\t\t\t\tcustomDescription={ <NotFoundError /> }\n\t\t\t/>\n\t\t),\n\t\tcontent: (\n\t\t\t<Spacer padding={ 2 }>\n\t\t\t\t<NotFoundError />\n\t\t\t</Spacer>\n\t\t),\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,QAAQ,wBAAwB,cAAc;AACvD,OAAO,iCAAiC;AAItC;AAFF,SAAS,gBAAgB;AACxB,SACC,oBAAC,UAAO,QAAO,SAAQ,eAAgB,OACpC;AAAA,IACD;AAAA,EACD,GACD;AAEF;AAEO,IAAM,gBAAgB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,SAAS,oBAAC,+BAA4B;AAAA,IACtC,eACC;AAAA,MAAC;AAAA;AAAA,QACA,mBAAoB,oBAAC,iBAAc;AAAA;AAAA,IACpC;AAAA,IAED,SACC,oBAAC,UAAO,SAAU,GACjB,8BAAC,iBAAc,GAChB;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/page-item.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/page-item.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import Editor from "../editor/index.mjs";
|
|
4
4
|
import DataViewsSidebarContent from "../sidebar-dataviews/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/page-item.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/page-item.jsx"],
|
|
4
4
|
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport Editor from '../editor';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport { isThemeDataLoaded } from './utils';\n\nexport const pageItemRoute = {\n\tname: 'page-item',\n\tpath: '/page/:postId',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\t\tbackPath=\"/\"\n\t\t\t\t\tcontent={ <DataViewsSidebarContent postType=\"page\" /> }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\t// Also rendered on mobile, where this route is only reached at canvas=edit.\n\t\tpreview( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<Editor />\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,UAAU;AACnB,OAAO,YAAY;AACnB,OAAO,6BAA6B;AACpC,OAAO,6BAA6B;AACpC,OAAO,wCAAwC;AAC/C,SAAS,yBAAyB;AAcnB;AAZR,IAAM,gBAAgB;AAAA,EAC5B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,iBAC5B;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,GAAI,OAAQ;AAAA,UACpB,UAAS;AAAA,UACT,SAAU,oBAAC,2BAAwB,UAAS,QAAO;AAAA;AAAA,MACpD,IAEA,oBAAC,sCAAmC;AAAA,IAEtC;AAAA;AAAA,IAEA,QAAS,EAAE,SAAS,GAAI;AACvB,UAAK,CAAE,kBAAmB,QAAS,GAAI;AACtC,eAAO;AAAA,MACR;AACA,aAAO,SAAS,aAAa,iBAC5B,oBAAC,UAAO,IAER,oBAAC,sCAAmC;AAAA,IAEtC;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/pages.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/pages.jsx
|
|
2
2
|
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { resolveSelect } from "@wordpress/data";
|
|
4
4
|
import { store as coreStore } from "@wordpress/core-data";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-editor-routes/pages.
|
|
3
|
+
"sources": ["../../../src/components/site-editor-routes/pages.jsx"],
|
|
4
4
|
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { loadView } from '@wordpress/views';\nimport Editor from '../editor';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport PostList from '../post-list';\nimport { unlock } from '../../lock-unlock';\nimport { isThemeDataLoaded } from './utils';\n\nasync function isListView( query ) {\n\tconst { activeView = 'all' } = query;\n\tconst config = await unlock( resolveSelect( coreStore ) ).getViewConfig(\n\t\t'postType',\n\t\t'page'\n\t);\n\tconst defaultView = config?.default_view;\n\tconst defaultLayouts = config?.default_layouts;\n\tconst viewEntry = config?.view_list?.find( ( v ) => v.slug === activeView );\n\tconst view = await loadView( {\n\t\tkind: 'postType',\n\t\tname: 'page',\n\t\tslug: 'default',\n\t\tdefaultView,\n\t\tdefaultLayouts,\n\t\tactiveViewOverrides: viewEntry?.view ?? {},\n\t} );\n\treturn view.type === 'list';\n}\n\nexport const pagesRoute = {\n\tname: 'pages',\n\tpath: '/page',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? (\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t'Manage or edit the pages that make up your site, and their appearance.'\n\t\t\t\t\t) }\n\t\t\t\t\tbackPath=\"/\"\n\t\t\t\t\tcontent={ <DataViewsSidebarContent postType=\"page\" /> }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tcontent( { siteData } ) {\n\t\t\tconst isBlockTheme = siteData.currentTheme?.is_block_theme;\n\t\t\treturn isBlockTheme ? <PostList postType=\"page\" /> : undefined;\n\t\t},\n\t\tasync preview( { query, siteData } ) {\n\t\t\tconst isBlockTheme = siteData.currentTheme?.is_block_theme;\n\t\t\tif ( ! isBlockTheme ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst isList = await isListView( query );\n\t\t\treturn isList ? <Editor /> : undefined;\n\t\t},\n\t\tmobileSidebar( { siteData } ) {\n\t\t\tif ( ! isThemeDataLoaded( siteData ) ) {\n\t\t\t\treturn <></>;\n\t\t\t}\n\t\t\treturn siteData.currentTheme.is_block_theme ? undefined : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tmobileContent( { siteData } ) {\n\t\t\tconst isBlockTheme = siteData.currentTheme?.is_block_theme;\n\t\t\treturn isBlockTheme ? <PostList postType=\"page\" /> : undefined;\n\t\t},\n\t},\n\twidths: {\n\t\tasync content( { query } ) {\n\t\t\tconst isList = await isListView( query );\n\t\t\treturn isList ? 380 : undefined;\n\t\t},\n\t},\n};\n"],
|
|
5
5
|
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,qBAAqB;AAC9B,SAAS,SAAS,iBAAiB;AACnC,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,OAAO,6BAA6B;AACpC,OAAO,wCAAwC;AAC/C,OAAO,6BAA6B;AACpC,OAAO,cAAc;AACrB,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAqCnB,SAoBJ,UApBI;AAnCf,eAAe,WAAY,OAAQ;AAClC,QAAM,EAAE,aAAa,MAAM,IAAI;AAC/B,QAAM,SAAS,MAAM,OAAQ,cAAe,SAAU,CAAE,EAAE;AAAA,IACzD;AAAA,IACA;AAAA,EACD;AACA,QAAM,cAAc,QAAQ;AAC5B,QAAM,iBAAiB,QAAQ;AAC/B,QAAM,YAAY,QAAQ,WAAW,KAAM,CAAE,MAAO,EAAE,SAAS,UAA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D;AAAA,EACD;AAAA,EACA,QAAQ;AAAA,IACP,MAAM,QAAS,EAAE,MAAM,GAAI;AAC1B,YAAM,SAAS,MAAM,WAAY,KAAM;AACvC,aAAO,SAAS,MAAM;AAAA,IACvB;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/edit-site/src/components/site-editor-routes/pattern-item.
|
|
1
|
+
// packages/edit-site/src/components/site-editor-routes/pattern-item.jsx
|
|
2
2
|
import Editor from "../editor/index.mjs";
|
|
3
3
|
import SidebarNavigationScreenPatterns from "../sidebar-navigation-screen-patterns/index.mjs";
|
|
4
4
|
import { isClassicThemeWithStyleBookSupport } from "./utils.mjs";
|