@wordpress/edit-site 7.3.0 → 7.4.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 +25 -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 +3 -3
- 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 +8 -18
- package/build/components/post-list/index.cjs.map +3 -3
- 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 +18 -23
- 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 -2
- package/build/index.cjs.map +3 -3
- 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 +3 -3
- 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 +9 -19
- package/build-module/components/post-list/index.mjs.map +3 -3
- 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 +18 -23
- 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 -2
- package/build-module/index.mjs.map +3 -3
- package/build-style/style-rtl.css +38 -81
- package/build-style/style.css +38 -81
- 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} +5 -2
- 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/post-list/{index.js → index.jsx} +7 -20
- 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} +23 -19
- 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/{index.js → index.jsx} +0 -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/{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
|
@@ -197,6 +197,7 @@ export function usePostTypeArchiveMenuItems() {
|
|
|
197
197
|
|
|
198
198
|
export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
199
199
|
const publicPostTypes = usePublicPostTypes();
|
|
200
|
+
const existingTemplates = useExistingTemplates();
|
|
200
201
|
const defaultTemplateTypes = useDefaultTemplateTypes();
|
|
201
202
|
// We need to keep track of naming conflicts. If a conflict
|
|
202
203
|
// occurs, we need to add slug.
|
|
@@ -236,6 +237,9 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
|
236
237
|
[ publicPostTypes ]
|
|
237
238
|
);
|
|
238
239
|
const postTypesInfo = useEntitiesInfo( 'postType', templatePrefixes );
|
|
240
|
+
const existingTemplateSlugs = ( existingTemplates || [] ).map(
|
|
241
|
+
( { slug } ) => slug
|
|
242
|
+
);
|
|
239
243
|
const menuItems = ( publicPostTypes || [] ).reduce(
|
|
240
244
|
( accumulator, postType ) => {
|
|
241
245
|
const { slug, labels, icon } = postType;
|
|
@@ -246,6 +250,8 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
|
246
250
|
const defaultTemplateType = defaultTemplateTypes?.find(
|
|
247
251
|
( { slug: _slug } ) => _slug === generalTemplateSlug
|
|
248
252
|
);
|
|
253
|
+
const hasGeneralTemplate =
|
|
254
|
+
existingTemplateSlugs?.includes( generalTemplateSlug );
|
|
249
255
|
const _needsUniqueIdentifier = needsUniqueIdentifier( postType );
|
|
250
256
|
let menuItemTitle =
|
|
251
257
|
labels.template_name ||
|
|
@@ -326,12 +332,14 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
|
326
332
|
},
|
|
327
333
|
},
|
|
328
334
|
labels,
|
|
335
|
+
hasGeneralTemplate,
|
|
329
336
|
template,
|
|
330
337
|
} );
|
|
331
338
|
};
|
|
332
339
|
}
|
|
333
|
-
// We don't need to add the menu item if there are no
|
|
334
|
-
|
|
340
|
+
// We don't need to add the menu item if there are no
|
|
341
|
+
// entities and the general template exists.
|
|
342
|
+
if ( ! hasGeneralTemplate || hasEntities ) {
|
|
335
343
|
accumulator.push( menuItem );
|
|
336
344
|
}
|
|
337
345
|
return accumulator;
|
|
@@ -564,11 +572,7 @@ export function useAuthorMenuItem( onClickMenuItem ) {
|
|
|
564
572
|
suggestion.slug
|
|
565
573
|
);
|
|
566
574
|
return {
|
|
567
|
-
title:
|
|
568
|
-
// translators: %s: Name of the author e.g: "Admin".
|
|
569
|
-
__( 'Author: %s' ),
|
|
570
|
-
suggestion.name
|
|
571
|
-
),
|
|
575
|
+
title: templateSlug,
|
|
572
576
|
slug: templateSlug,
|
|
573
577
|
templatePrefix: 'author',
|
|
574
578
|
};
|
|
@@ -590,6 +594,91 @@ export function useAuthorMenuItem( onClickMenuItem ) {
|
|
|
590
594
|
}
|
|
591
595
|
}
|
|
592
596
|
|
|
597
|
+
/**
|
|
598
|
+
* Helper hook that filters all the existing templates by the given
|
|
599
|
+
* object with the entity's slug as key and the template prefix as value.
|
|
600
|
+
*
|
|
601
|
+
* Example:
|
|
602
|
+
* `existingTemplates` is: [ { slug: 'tag-apple' }, { slug: 'page-about' }, { slug: 'tag' } ]
|
|
603
|
+
* `templatePrefixes` is: { post_tag: 'tag' }
|
|
604
|
+
* It will return: { post_tag: ['apple'] }
|
|
605
|
+
*
|
|
606
|
+
* Note: We append the `-` to the given template prefix in this function for our checks.
|
|
607
|
+
*
|
|
608
|
+
* @param {Record<string,string>} templatePrefixes An object with the entity's slug as key and the template prefix as value.
|
|
609
|
+
* @return {Record<string,string[]>} An object with the entity's slug as key and an array with the existing template slugs as value.
|
|
610
|
+
*/
|
|
611
|
+
const useExistingTemplateSlugs = ( templatePrefixes ) => {
|
|
612
|
+
const existingTemplates = useExistingTemplates();
|
|
613
|
+
const existingSlugs = useMemo( () => {
|
|
614
|
+
return Object.entries( templatePrefixes || {} ).reduce(
|
|
615
|
+
( accumulator, [ slug, prefix ] ) => {
|
|
616
|
+
const slugsWithTemplates = ( existingTemplates || [] ).reduce(
|
|
617
|
+
( _accumulator, existingTemplate ) => {
|
|
618
|
+
const _prefix = `${ prefix }-`;
|
|
619
|
+
if ( existingTemplate.slug.startsWith( _prefix ) ) {
|
|
620
|
+
_accumulator.push(
|
|
621
|
+
existingTemplate.slug.substring(
|
|
622
|
+
_prefix.length
|
|
623
|
+
)
|
|
624
|
+
);
|
|
625
|
+
}
|
|
626
|
+
return _accumulator;
|
|
627
|
+
},
|
|
628
|
+
[]
|
|
629
|
+
);
|
|
630
|
+
if ( slugsWithTemplates.length ) {
|
|
631
|
+
accumulator[ slug ] = slugsWithTemplates;
|
|
632
|
+
}
|
|
633
|
+
return accumulator;
|
|
634
|
+
},
|
|
635
|
+
{}
|
|
636
|
+
);
|
|
637
|
+
}, [ templatePrefixes, existingTemplates ] );
|
|
638
|
+
return existingSlugs;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Helper hook that finds the existing records with an associated template,
|
|
643
|
+
* as they need to be excluded from the template suggestions.
|
|
644
|
+
*
|
|
645
|
+
* @param {string} entityName The entity's name.
|
|
646
|
+
* @param {Record<string,string>} templatePrefixes An object with the entity's slug as key and the template prefix as value.
|
|
647
|
+
* @param {Record<string,Object>} additionalQueryParameters An object with the entity's slug as key and additional query parameters as value.
|
|
648
|
+
* @return {Record<string,EntitiesInfo>} An object with the entity's slug as key and the existing records as value.
|
|
649
|
+
*/
|
|
650
|
+
const useTemplatesToExclude = (
|
|
651
|
+
entityName,
|
|
652
|
+
templatePrefixes,
|
|
653
|
+
additionalQueryParameters = {}
|
|
654
|
+
) => {
|
|
655
|
+
const slugsToExcludePerEntity =
|
|
656
|
+
useExistingTemplateSlugs( templatePrefixes );
|
|
657
|
+
const recordsToExcludePerEntity = useSelect(
|
|
658
|
+
( select ) => {
|
|
659
|
+
return Object.entries( slugsToExcludePerEntity || {} ).reduce(
|
|
660
|
+
( accumulator, [ slug, slugsWithTemplates ] ) => {
|
|
661
|
+
const entitiesWithTemplates = select(
|
|
662
|
+
coreStore
|
|
663
|
+
).getEntityRecords( entityName, slug, {
|
|
664
|
+
_fields: 'id',
|
|
665
|
+
context: 'view',
|
|
666
|
+
slug: slugsWithTemplates,
|
|
667
|
+
...additionalQueryParameters[ slug ],
|
|
668
|
+
} );
|
|
669
|
+
if ( entitiesWithTemplates?.length ) {
|
|
670
|
+
accumulator[ slug ] = entitiesWithTemplates;
|
|
671
|
+
}
|
|
672
|
+
return accumulator;
|
|
673
|
+
},
|
|
674
|
+
{}
|
|
675
|
+
);
|
|
676
|
+
},
|
|
677
|
+
[ slugsToExcludePerEntity ]
|
|
678
|
+
);
|
|
679
|
+
return recordsToExcludePerEntity;
|
|
680
|
+
};
|
|
681
|
+
|
|
593
682
|
/**
|
|
594
683
|
* Helper hook that returns information about an entity having
|
|
595
684
|
* records that we can create a specific template for.
|
|
@@ -610,10 +699,19 @@ const useEntitiesInfo = (
|
|
|
610
699
|
templatePrefixes,
|
|
611
700
|
additionalQueryParameters = EMPTY_OBJECT
|
|
612
701
|
) => {
|
|
702
|
+
const recordsToExcludePerEntity = useTemplatesToExclude(
|
|
703
|
+
entityName,
|
|
704
|
+
templatePrefixes,
|
|
705
|
+
additionalQueryParameters
|
|
706
|
+
);
|
|
613
707
|
const entitiesHasRecords = useSelect(
|
|
614
708
|
( select ) => {
|
|
615
709
|
return Object.keys( templatePrefixes || {} ).reduce(
|
|
616
710
|
( accumulator, slug ) => {
|
|
711
|
+
const existingEntitiesIds =
|
|
712
|
+
recordsToExcludePerEntity?.[ slug ]?.map(
|
|
713
|
+
( { id } ) => id
|
|
714
|
+
) || [];
|
|
617
715
|
const records = select( coreStore ).getEntityRecords(
|
|
618
716
|
entityName,
|
|
619
717
|
slug,
|
|
@@ -621,6 +719,7 @@ const useEntitiesInfo = (
|
|
|
621
719
|
per_page: 1,
|
|
622
720
|
_fields: 'id',
|
|
623
721
|
context: 'view',
|
|
722
|
+
exclude: existingEntitiesIds,
|
|
624
723
|
...additionalQueryParameters[ slug ],
|
|
625
724
|
}
|
|
626
725
|
);
|
|
@@ -631,18 +730,28 @@ const useEntitiesInfo = (
|
|
|
631
730
|
{}
|
|
632
731
|
);
|
|
633
732
|
},
|
|
634
|
-
[
|
|
733
|
+
[
|
|
734
|
+
templatePrefixes,
|
|
735
|
+
recordsToExcludePerEntity,
|
|
736
|
+
entityName,
|
|
737
|
+
additionalQueryParameters,
|
|
738
|
+
]
|
|
635
739
|
);
|
|
636
740
|
const entitiesInfo = useMemo( () => {
|
|
637
741
|
return Object.keys( templatePrefixes || {} ).reduce(
|
|
638
742
|
( accumulator, slug ) => {
|
|
743
|
+
const existingEntitiesIds =
|
|
744
|
+
recordsToExcludePerEntity?.[ slug ]?.map(
|
|
745
|
+
( { id } ) => id
|
|
746
|
+
) || [];
|
|
639
747
|
accumulator[ slug ] = {
|
|
640
748
|
hasEntities: entitiesHasRecords[ slug ],
|
|
749
|
+
existingEntitiesIds,
|
|
641
750
|
};
|
|
642
751
|
return accumulator;
|
|
643
752
|
},
|
|
644
753
|
{}
|
|
645
754
|
);
|
|
646
|
-
}, [ templatePrefixes, entitiesHasRecords ] );
|
|
755
|
+
}, [ templatePrefixes, recordsToExcludePerEntity, entitiesHasRecords ] );
|
|
647
756
|
return entitiesInfo;
|
|
648
757
|
};
|
|
@@ -2,73 +2,12 @@ import { __ } from '@wordpress/i18n';
|
|
|
2
2
|
import { pencil, drawerRight } from '@wordpress/icons';
|
|
3
3
|
import { useMemo } from '@wordpress/element';
|
|
4
4
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
7
5
|
import { addQueryArgs } from '@wordpress/url';
|
|
8
6
|
import { PATTERN_TYPES } from '../../utils/constants';
|
|
9
7
|
import { unlock } from '../../lock-unlock';
|
|
10
8
|
|
|
11
9
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
12
10
|
|
|
13
|
-
export const useSetActiveTemplateAction = () => {
|
|
14
|
-
const activeTheme = useSelect( ( select ) =>
|
|
15
|
-
select( coreStore ).getCurrentTheme()
|
|
16
|
-
);
|
|
17
|
-
const { getEntityRecord } = useSelect( coreStore );
|
|
18
|
-
const { editEntityRecord, saveEditedEntityRecord } =
|
|
19
|
-
useDispatch( coreStore );
|
|
20
|
-
return useMemo(
|
|
21
|
-
() => ( {
|
|
22
|
-
id: 'set-active-template',
|
|
23
|
-
label( items ) {
|
|
24
|
-
return items.some( ( item ) => item._isActive )
|
|
25
|
-
? __( 'Deactivate' )
|
|
26
|
-
: __( 'Activate' );
|
|
27
|
-
},
|
|
28
|
-
isPrimary: true,
|
|
29
|
-
icon: pencil,
|
|
30
|
-
isEligible( item ) {
|
|
31
|
-
if ( item.theme !== activeTheme.stylesheet ) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// If it's not a created template but a registered template,
|
|
36
|
-
// only allow activating (so when it's inactive).
|
|
37
|
-
if ( typeof item.id !== 'number' ) {
|
|
38
|
-
return item._isActive === false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return true;
|
|
42
|
-
},
|
|
43
|
-
async callback( items ) {
|
|
44
|
-
const deactivate = items.some( ( item ) => item._isActive );
|
|
45
|
-
// current active templates
|
|
46
|
-
const activeTemplates = {
|
|
47
|
-
...( ( await getEntityRecord( 'root', 'site' )
|
|
48
|
-
.active_templates ) ?? {} ),
|
|
49
|
-
};
|
|
50
|
-
for ( const item of items ) {
|
|
51
|
-
if ( deactivate ) {
|
|
52
|
-
delete activeTemplates[ item.slug ];
|
|
53
|
-
} else {
|
|
54
|
-
activeTemplates[ item.slug ] = item.id;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
await editEntityRecord( 'root', 'site', undefined, {
|
|
58
|
-
active_templates: activeTemplates,
|
|
59
|
-
} );
|
|
60
|
-
await saveEditedEntityRecord( 'root', 'site' );
|
|
61
|
-
},
|
|
62
|
-
} ),
|
|
63
|
-
[
|
|
64
|
-
editEntityRecord,
|
|
65
|
-
saveEditedEntityRecord,
|
|
66
|
-
getEntityRecord,
|
|
67
|
-
activeTheme,
|
|
68
|
-
]
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
11
|
export const useEditPostAction = () => {
|
|
73
12
|
const history = useHistory();
|
|
74
13
|
return useMemo(
|
|
@@ -2,7 +2,6 @@ import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
|
2
2
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
3
3
|
import { store as editorStore } from '@wordpress/editor';
|
|
4
4
|
import { useLayoutEffect } from '@wordpress/element';
|
|
5
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
6
5
|
import { DEFAULT_DEVICE_TYPE } from '../block-editor/viewport';
|
|
7
6
|
|
|
8
7
|
export function useAdaptEditorToCanvas( canvas ) {
|
|
@@ -11,15 +10,11 @@ export function useAdaptEditorToCanvas( canvas ) {
|
|
|
11
10
|
editPost,
|
|
12
11
|
setDeviceType,
|
|
13
12
|
closePublishSidebar,
|
|
14
|
-
setIsListViewOpened,
|
|
15
13
|
setIsInserterOpened,
|
|
16
14
|
} = useDispatch( editorStore );
|
|
17
|
-
const { get: getPreference } = useSelect( preferencesStore );
|
|
18
15
|
const { getCurrentPost } = useSelect( editorStore );
|
|
19
16
|
const registry = useRegistry();
|
|
20
17
|
useLayoutEffect( () => {
|
|
21
|
-
const isMediumOrBigger =
|
|
22
|
-
window.matchMedia( '(min-width: 782px)' ).matches;
|
|
23
18
|
registry.batch( () => {
|
|
24
19
|
clearSelectedBlock();
|
|
25
20
|
if ( getCurrentPost()?.type ) {
|
|
@@ -28,20 +23,6 @@ export function useAdaptEditorToCanvas( canvas ) {
|
|
|
28
23
|
setDeviceType( DEFAULT_DEVICE_TYPE );
|
|
29
24
|
closePublishSidebar();
|
|
30
25
|
setIsInserterOpened( false );
|
|
31
|
-
|
|
32
|
-
// Check if the block list view should be open by default.
|
|
33
|
-
// If `distractionFree` mode is enabled, the block list view should not be open.
|
|
34
|
-
// This behavior is disabled for small viewports.
|
|
35
|
-
if (
|
|
36
|
-
isMediumOrBigger &&
|
|
37
|
-
canvas === 'edit' &&
|
|
38
|
-
getPreference( 'core', 'showListViewByDefault' ) &&
|
|
39
|
-
! getPreference( 'core', 'distractionFree' )
|
|
40
|
-
) {
|
|
41
|
-
setIsListViewOpened( true );
|
|
42
|
-
} else {
|
|
43
|
-
setIsListViewOpened( false );
|
|
44
|
-
}
|
|
45
26
|
} );
|
|
46
27
|
}, [
|
|
47
28
|
canvas,
|
|
@@ -51,8 +32,6 @@ export function useAdaptEditorToCanvas( canvas ) {
|
|
|
51
32
|
setDeviceType,
|
|
52
33
|
closePublishSidebar,
|
|
53
34
|
setIsInserterOpened,
|
|
54
|
-
setIsListViewOpened,
|
|
55
|
-
getPreference,
|
|
56
35
|
getCurrentPost,
|
|
57
36
|
] );
|
|
58
37
|
}
|
|
@@ -41,7 +41,8 @@ const { useLocation } = unlock( routerPrivateApis );
|
|
|
41
41
|
const { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );
|
|
42
42
|
|
|
43
43
|
const ANIMATION_DURATION = 0.3;
|
|
44
|
-
|
|
44
|
+
// Reset to the default background color.
|
|
45
|
+
const CONTENT_COLOR = { background: '#fcfcfc' };
|
|
45
46
|
|
|
46
47
|
function Layout() {
|
|
47
48
|
const { query, name: routeKey, areas, widths } = useLocation();
|
|
@@ -321,7 +322,9 @@ export default function LayoutWithGlobalStylesProvider( props ) {
|
|
|
321
322
|
} }
|
|
322
323
|
>
|
|
323
324
|
<ThemeProvider color={ themeColors }>
|
|
324
|
-
<
|
|
325
|
+
<ErrorBoundary>
|
|
326
|
+
<Layout { ...props } />
|
|
327
|
+
</ErrorBoundary>
|
|
325
328
|
</ThemeProvider>
|
|
326
329
|
</ThemeProvider>
|
|
327
330
|
</Tooltip.Provider>
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import { useDispatch } from '@wordpress/data';
|
|
3
|
-
import {
|
|
3
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
4
4
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
5
|
+
import { unlock } from '../../lock-unlock';
|
|
6
|
+
|
|
7
|
+
const { MoreMenuItem } = unlock( editorPrivateApis );
|
|
5
8
|
|
|
6
9
|
export default function WelcomeGuideMenuItem() {
|
|
7
10
|
const { toggle } = useDispatch( preferencesStore );
|
|
8
11
|
|
|
9
12
|
return (
|
|
10
|
-
<
|
|
13
|
+
<MoreMenuItem
|
|
14
|
+
onClick={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }
|
|
15
|
+
>
|
|
11
16
|
{ __( 'Welcome Guide' ) }
|
|
12
|
-
</
|
|
17
|
+
</MoreMenuItem>
|
|
13
18
|
);
|
|
14
19
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __ } from '@wordpress/i18n';
|
|
2
|
+
import { useMemo } from '@wordpress/element';
|
|
3
|
+
import { parse } from '@wordpress/blocks';
|
|
4
|
+
import { BlockPreview } from '@wordpress/block-editor';
|
|
5
|
+
import {
|
|
6
|
+
EditorProvider,
|
|
7
|
+
privateApis as editorPrivateApis,
|
|
8
|
+
} from '@wordpress/editor';
|
|
9
|
+
import usePatternSettings from '../page-patterns/use-pattern-settings';
|
|
10
|
+
import { unlock } from '../../lock-unlock';
|
|
11
|
+
|
|
12
|
+
const { useStyle } = unlock( editorPrivateApis );
|
|
13
|
+
|
|
14
|
+
function PreviewField( { item } ) {
|
|
15
|
+
const settings = usePatternSettings();
|
|
16
|
+
const backgroundColor = useStyle( 'color.background' ) ?? 'white';
|
|
17
|
+
const blocks = useMemo( () => {
|
|
18
|
+
return parse( item.content.raw );
|
|
19
|
+
}, [ item.content.raw ] );
|
|
20
|
+
|
|
21
|
+
const isEmpty = ! blocks?.length;
|
|
22
|
+
// Wrap everything in a block editor provider to ensure 'styles' that are needed
|
|
23
|
+
// for the previews are synced between the site editor store and the block editor store.
|
|
24
|
+
// Additionally we need to have the `__experimentalBlockPatterns` setting in order to
|
|
25
|
+
// render patterns inside the previews.
|
|
26
|
+
// TODO: Same approach is used in the patterns list and it becomes obvious that some of
|
|
27
|
+
// the block editor settings are needed in context where we don't have the block editor.
|
|
28
|
+
// Explore how we can solve this in a better way.
|
|
29
|
+
return (
|
|
30
|
+
<EditorProvider post={ item } settings={ settings }>
|
|
31
|
+
<div
|
|
32
|
+
className="page-templates-preview-field"
|
|
33
|
+
style={ { backgroundColor } }
|
|
34
|
+
>
|
|
35
|
+
{ isEmpty && __( 'Empty template' ) }
|
|
36
|
+
{ ! isEmpty && (
|
|
37
|
+
<BlockPreview.Async>
|
|
38
|
+
<BlockPreview blocks={ blocks } />
|
|
39
|
+
</BlockPreview.Async>
|
|
40
|
+
) }
|
|
41
|
+
</div>
|
|
42
|
+
</EditorProvider>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const previewField = {
|
|
47
|
+
label: __( 'Preview' ),
|
|
48
|
+
id: 'preview',
|
|
49
|
+
render: PreviewField,
|
|
50
|
+
enableSorting: false,
|
|
51
|
+
};
|
|
@@ -8,7 +8,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
|
8
8
|
import { addQueryArgs } from '@wordpress/url';
|
|
9
9
|
import { useEvent } from '@wordpress/compose';
|
|
10
10
|
import { useView, useViewConfig } from '@wordpress/views';
|
|
11
|
-
import AddNewTemplate from '../add-new-template
|
|
11
|
+
import AddNewTemplate from '../add-new-template';
|
|
12
12
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
14
|
import { useEditPostAction } from '../dataviews-actions';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { useState, useMemo, useCallback, useEffect } from '@wordpress/element';
|
|
8
8
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { DataViews
|
|
10
|
+
import { DataViews } from '@wordpress/dataviews';
|
|
11
11
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
12
12
|
import { useEvent, usePrevious } from '@wordpress/compose';
|
|
13
13
|
import { addQueryArgs } from '@wordpress/url';
|
|
@@ -176,27 +176,14 @@ export default function PostList( { postType } ) {
|
|
|
176
176
|
const { notesCount, isLoading: isLoadingNotesCount } =
|
|
177
177
|
useNotesCount( postIds );
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if ( view?.sort?.field === 'author' ) {
|
|
184
|
-
processedRecords = filterSortAndPaginate(
|
|
185
|
-
records,
|
|
186
|
-
{ sort: { ...view.sort } },
|
|
187
|
-
fields
|
|
188
|
-
).data;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if ( processedRecords ) {
|
|
192
|
-
return processedRecords.map( ( record ) => ( {
|
|
179
|
+
const data = useMemo(
|
|
180
|
+
() =>
|
|
181
|
+
records?.map( ( record ) => ( {
|
|
193
182
|
...record,
|
|
194
183
|
notesCount: notesCount[ record.id ] ?? 0,
|
|
195
|
-
} ) )
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return processedRecords;
|
|
199
|
-
}, [ records, fields, view?.sort, notesCount ] );
|
|
184
|
+
} ) ),
|
|
185
|
+
[ records, notesCount ]
|
|
186
|
+
);
|
|
200
187
|
|
|
201
188
|
const ids = data?.map( ( record ) => getItemId( record ) ) ?? [];
|
|
202
189
|
const prevIds = usePrevious( ids ) ?? [];
|
|
@@ -98,11 +98,13 @@ export default function SidebarGlobalStyles() {
|
|
|
98
98
|
title={ __( 'Styles' ) }
|
|
99
99
|
headingLevel={ 2 }
|
|
100
100
|
>
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
<div className="edit-site-styles__content">
|
|
102
|
+
<GlobalStylesUIWrapper
|
|
103
|
+
path={ section }
|
|
104
|
+
onPathChange={ onChangeSection }
|
|
105
|
+
settings={ settings }
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
106
108
|
</Page>
|
|
107
109
|
);
|
|
108
110
|
}
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.edit-site-styles__content {
|
|
35
|
+
flex-grow: 1;
|
|
36
|
+
min-height: 0;
|
|
37
|
+
background-color: var(--wpds-color-background-surface-neutral-strong);
|
|
38
|
+
}
|
|
39
|
+
|
|
34
40
|
// Show button text labels when preference is enabled.
|
|
35
41
|
.show-icon-labels {
|
|
36
42
|
.edit-site-styles__header-actions {
|
|
@@ -5,6 +5,11 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
5
5
|
import { DataForm } from '@wordpress/dataviews';
|
|
6
6
|
import { MediaEdit } from '@wordpress/fields';
|
|
7
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
|
+
import { useViewConfig } from '@wordpress/views';
|
|
9
|
+
|
|
10
|
+
// The screen only renders a form, so it requests the `form` of the entity
|
|
11
|
+
// view configuration alone.
|
|
12
|
+
const VIEW_CONFIG_FIELDS = [ 'form' ];
|
|
8
13
|
|
|
9
14
|
const fields = [
|
|
10
15
|
{
|
|
@@ -53,14 +58,6 @@ const fields = [
|
|
|
53
58
|
},
|
|
54
59
|
];
|
|
55
60
|
|
|
56
|
-
const form = {
|
|
57
|
-
layout: {
|
|
58
|
-
type: 'regular',
|
|
59
|
-
labelPosition: 'top',
|
|
60
|
-
},
|
|
61
|
-
fields: [ 'title', 'description', 'site_logo', 'site_icon' ],
|
|
62
|
-
};
|
|
63
|
-
|
|
64
61
|
export default function SidebarIdentity() {
|
|
65
62
|
const data = useSelect(
|
|
66
63
|
( select ) =>
|
|
@@ -68,23 +65,30 @@ export default function SidebarIdentity() {
|
|
|
68
65
|
[]
|
|
69
66
|
);
|
|
70
67
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
68
|
+
const { form } = useViewConfig( {
|
|
69
|
+
kind: 'root',
|
|
70
|
+
name: 'site',
|
|
71
|
+
fields: VIEW_CONFIG_FIELDS,
|
|
72
|
+
} );
|
|
71
73
|
|
|
72
74
|
const onChange = ( edits ) => {
|
|
73
75
|
editEntityRecord( 'root', 'site', undefined, edits );
|
|
74
76
|
};
|
|
75
77
|
|
|
78
|
+
if ( ! form ) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
76
82
|
return (
|
|
77
|
-
<Page
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onChange={ onChange }
|
|
87
|
-
/>
|
|
83
|
+
<Page title={ _x( 'Identity', 'site identity' ) } headingLevel={ 2 }>
|
|
84
|
+
<div className="edit-site-sidebar-identity__form">
|
|
85
|
+
<DataForm
|
|
86
|
+
data={ data }
|
|
87
|
+
fields={ fields }
|
|
88
|
+
form={ form }
|
|
89
|
+
onChange={ onChange }
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
88
92
|
</Page>
|
|
89
93
|
);
|
|
90
94
|
}
|
|
@@ -65,13 +65,7 @@ function SidebarNavigationItemContent( {
|
|
|
65
65
|
{ ...props }
|
|
66
66
|
>
|
|
67
67
|
<Stack direction="row" align="center" justify="start" gap="sm">
|
|
68
|
-
{ icon &&
|
|
69
|
-
<Icon
|
|
70
|
-
style={ { fill: 'currentcolor' } }
|
|
71
|
-
icon={ icon }
|
|
72
|
-
size={ 24 }
|
|
73
|
-
/>
|
|
74
|
-
) }
|
|
68
|
+
{ icon && <Icon icon={ icon } size={ 24 } /> }
|
|
75
69
|
<FlexBlock>{ children }</FlexBlock>
|
|
76
70
|
{ withChevron && (
|
|
77
71
|
<Icon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
2
2
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
3
3
|
|
|
4
|
-
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.
|
|
4
|
+
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.
|
|
5
5
|
export default function buildNavigationLabel( title, id, status ) {
|
|
6
6
|
if ( ! title?.rendered ) {
|
|
7
7
|
/* translators: %s: the index of the menu in the list of menus. */
|
|
@@ -15,7 +15,7 @@ import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-m
|
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
16
|
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
17
17
|
|
|
18
|
-
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.
|
|
18
|
+
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.jsx.
|
|
19
19
|
function buildMenuLabel( title, id, status ) {
|
|
20
20
|
if ( ! title ) {
|
|
21
21
|
/* translators: %s: the index of the menu in the list of menus. */
|
|
@@ -14,7 +14,7 @@ import LeafMoreMenu from './leaf-more-menu';
|
|
|
14
14
|
const { PrivateListView } = unlock( blockEditorPrivateApis );
|
|
15
15
|
const { NavigationLinkUI } = unlock( blockLibraryPrivateApis );
|
|
16
16
|
|
|
17
|
-
// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.
|
|
17
|
+
// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.jsx.
|
|
18
18
|
const MAX_PAGE_COUNT = 100;
|
|
19
19
|
const PAGES_QUERY = [
|
|
20
20
|
'postType',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __ } from '@wordpress/i18n';
|
|
2
2
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
3
3
|
import DataviewsTemplatesSidebarContent from './content';
|
|
4
|
-
import DataviewsTemplatesSidebarContentLegacy from './content-legacy';
|
|
5
4
|
|
|
6
5
|
export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
|
|
7
6
|
return (
|
|
@@ -11,13 +10,7 @@ export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
|
|
|
11
10
|
'Manage the templates that define the structure of your pages, or reset any customizations made to those supplied by your theme.'
|
|
12
11
|
) }
|
|
13
12
|
backPath={ backPath }
|
|
14
|
-
content={
|
|
15
|
-
window?.__experimentalTemplateActivate ? (
|
|
16
|
-
<DataviewsTemplatesSidebarContent />
|
|
17
|
-
) : (
|
|
18
|
-
<DataviewsTemplatesSidebarContentLegacy />
|
|
19
|
-
)
|
|
20
|
-
}
|
|
13
|
+
content={ <DataviewsTemplatesSidebarContent /> }
|
|
21
14
|
/>
|
|
22
15
|
);
|
|
23
16
|
}
|