@wordpress/edit-site 7.2.0 → 7.3.2-next.v.202608281122.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 +31 -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 +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +1 -1
- package/build/components/add-new-template/index.cjs +1 -1
- package/build/components/add-new-template/index.cjs.map +1 -1
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +1 -1
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +1 -1
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +1 -1
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +1 -1
- package/build/components/add-new-template-legacy/index.cjs +1 -1
- package/build/components/add-new-template-legacy/index.cjs.map +1 -1
- package/build/components/app/index.cjs +1 -1
- package/build/components/app/index.cjs.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.cjs +4 -20
- package/build/components/block-editor/use-navigate-to-entity-record.cjs.map +2 -2
- package/build/components/block-editor/use-site-editor-settings.cjs +0 -1
- package/build/components/block-editor/use-site-editor-settings.cjs.map +2 -2
- package/build/components/block-editor/viewport.cjs +46 -0
- package/build/components/block-editor/viewport.cjs.map +7 -0
- package/build/components/canvas-loader/index.cjs +1 -1
- package/build/components/canvas-loader/index.cjs.map +1 -1
- package/build/components/editor/index.cjs +9 -8
- package/build/components/editor/index.cjs.map +4 -4
- 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 +2 -13
- package/build/components/editor/use-adapt-editor-to-canvas.cjs.map +3 -3
- package/build/components/layout/index.cjs +12 -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 +3 -4
- package/build/components/more-menu/index.cjs.map +4 -4
- package/build/components/more-menu/welcome-guide-menu-item.cjs +1 -1
- package/build/components/more-menu/welcome-guide-menu-item.cjs.map +1 -1
- 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 +1 -1
- package/build/components/page-templates/fields.cjs.map +1 -1
- package/build/components/page-templates/index-legacy.cjs +1 -1
- package/build/components/page-templates/index-legacy.cjs.map +1 -1
- package/build/components/page-templates/index.cjs +1 -1
- package/build/components/page-templates/index.cjs.map +1 -1
- 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 +1 -1
- package/build/components/sidebar-global-styles/index.cjs.map +1 -1
- package/build/components/sidebar-identity/index.cjs +1 -1
- package/build/components/sidebar-identity/index.cjs.map +1 -1
- package/build/components/sidebar-navigation-item/index.cjs +1 -1
- package/build/components/sidebar-navigation-item/index.cjs.map +1 -1
- 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 +4 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs.map +3 -3
- 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 +2 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs.map +2 -2
- 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 +4 -1
- package/build/components/site-editor-routes/pages.cjs.map +3 -3
- 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 +1 -1
- package/build/components/site-editor-routes/templates.cjs.map +1 -1
- 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 +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +1 -1
- package/build-module/components/add-new-template/index.mjs +1 -1
- package/build-module/components/add-new-template/index.mjs.map +1 -1
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +1 -1
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +1 -1
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +1 -1
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +1 -1
- package/build-module/components/add-new-template-legacy/index.mjs +1 -1
- package/build-module/components/add-new-template-legacy/index.mjs.map +1 -1
- package/build-module/components/app/index.mjs +1 -1
- package/build-module/components/app/index.mjs.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.mjs +5 -21
- package/build-module/components/block-editor/use-navigate-to-entity-record.mjs.map +2 -2
- package/build-module/components/block-editor/use-site-editor-settings.mjs +0 -1
- package/build-module/components/block-editor/use-site-editor-settings.mjs.map +2 -2
- package/build-module/components/block-editor/viewport.mjs +19 -0
- package/build-module/components/block-editor/viewport.mjs.map +7 -0
- 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/editor/index.mjs +9 -9
- package/build-module/components/editor/index.mjs.map +3 -3
- 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 +1 -12
- package/build-module/components/editor/use-adapt-editor-to-canvas.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +12 -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 +2 -3
- package/build-module/components/more-menu/index.mjs.map +3 -3
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs +1 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs.map +1 -1
- 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 +1 -1
- package/build-module/components/page-templates/fields.mjs.map +1 -1
- package/build-module/components/page-templates/index-legacy.mjs +1 -1
- package/build-module/components/page-templates/index-legacy.mjs.map +1 -1
- package/build-module/components/page-templates/index.mjs +1 -1
- package/build-module/components/page-templates/index.mjs.map +1 -1
- 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 +1 -1
- package/build-module/components/sidebar-global-styles/index.mjs.map +1 -1
- package/build-module/components/sidebar-identity/index.mjs +1 -1
- package/build-module/components/sidebar-identity/index.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-item/index.mjs.map +1 -1
- 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 +4 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs.map +3 -3
- 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 +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs.map +2 -2
- 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 +4 -1
- package/build-module/components/site-editor-routes/pages.mjs.map +3 -3
- 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 +1 -1
- package/build-module/components/site-editor-routes/templates.mjs.map +1 -1
- 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 +130 -85
- package/build-style/style.css +130 -85
- package/package.json +39 -52
- package/src/components/block-editor/use-navigate-to-entity-record.js +11 -32
- package/src/components/block-editor/use-site-editor-settings.js +0 -1
- package/src/components/block-editor/viewport.js +34 -0
- package/src/components/editor/{index.js → index.jsx} +13 -8
- package/src/components/editor/use-adapt-editor-to-canvas.js +1 -22
- package/src/components/layout/{index.js → index.jsx} +10 -2
- package/src/components/more-menu/{index.js → index.jsx} +2 -2
- 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} +7 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/{navigation-menu-content.js → navigation-menu-content.jsx} +1 -1
- package/src/components/sidebar-navigation-screen-patterns/{index.js → index.jsx} +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/{index.js → index.jsx} +1 -1
- package/src/components/site-editor-routes/{pages.js → pages.jsx} +3 -0
- package/src/style.scss +7 -3
- package/build/components/block-editor/use-viewport-sync.cjs +0 -55
- package/build/components/block-editor/use-viewport-sync.cjs.map +0 -7
- package/build/components/more-menu/site-export.cjs +0 -93
- package/build/components/more-menu/site-export.cjs.map +0 -7
- package/build-module/components/block-editor/use-viewport-sync.mjs +0 -29
- package/build-module/components/block-editor/use-viewport-sync.mjs.map +0 -7
- package/build-module/components/more-menu/site-export.mjs +0 -62
- package/build-module/components/more-menu/site-export.mjs.map +0 -7
- package/src/components/block-editor/use-viewport-sync.js +0 -44
- package/src/components/more-menu/site-export.js +0 -71
- /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/{add-custom-generic-template-modal-content.js → add-custom-generic-template-modal-content.jsx} +0 -0
- /package/src/components/add-new-template/{add-custom-template-modal-content.js → add-custom-template-modal-content.jsx} +0 -0
- /package/src/components/add-new-template/{index.js → index.jsx} +0 -0
- /package/src/components/add-new-template-legacy/{add-custom-generic-template-modal-content.js → add-custom-generic-template-modal-content.jsx} +0 -0
- /package/src/components/add-new-template-legacy/{add-custom-template-modal-content.js → add-custom-template-modal-content.jsx} +0 -0
- /package/src/components/add-new-template-legacy/{index.js → 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/{site-preview.js → site-preview.jsx} +0 -0
- /package/src/components/media/{index.js → index.jsx} +0 -0
- /package/src/components/more-menu/{welcome-guide-menu-item.js → welcome-guide-menu-item.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/page-templates/{fields.js → fields.jsx} +0 -0
- /package/src/components/page-templates/{index-legacy.js → index-legacy.jsx} +0 -0
- /package/src/components/page-templates/{index.js → index.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-global-styles/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-identity/{index.js → index.jsx} +0 -0
- /package/src/components/sidebar-navigation-item/{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-templates-browse/{content-legacy.js → content-legacy.jsx} +0 -0
- /package/src/components/sidebar-navigation-screen-templates-browse/{content.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/{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-editor-routes/{templates.js → templates.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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const DEFAULT_DEVICE_TYPE = 'Desktop';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Lowercase in the URL, PascalCase in the editor store. Duplicated in
|
|
5
|
+
* packages/boot/src/components/canvas/viewport.ts, in the editor's
|
|
6
|
+
* preview-dropdown choices, and in the block editor's block-visibility
|
|
7
|
+
* constants. Update all four when adding a viewport type.
|
|
8
|
+
*/
|
|
9
|
+
const VALID_VIEWPORTS = [ 'desktop', 'tablet', 'mobile' ];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Whether a viewport is one an entity can be asked to be edited at.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} [viewport] Viewport, as written in the URL.
|
|
15
|
+
* @return {boolean} Whether the editor has a width for it.
|
|
16
|
+
*/
|
|
17
|
+
export function isValidViewport( viewport ) {
|
|
18
|
+
return !! viewport && VALID_VIEWPORTS.includes( viewport.toLowerCase() );
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The device type a `viewport` query param names.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} [viewport] Viewport, as written in the URL.
|
|
25
|
+
* @return {string} Device type, Desktop for a viewport the editor has no width for.
|
|
26
|
+
*/
|
|
27
|
+
export function getDeviceType( viewport ) {
|
|
28
|
+
if ( ! isValidViewport( viewport ) ) {
|
|
29
|
+
return DEFAULT_DEVICE_TYPE;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const value = viewport.toLowerCase();
|
|
33
|
+
return value.charAt( 0 ).toUpperCase() + value.slice( 1 );
|
|
34
|
+
}
|
|
@@ -2,13 +2,11 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
2
2
|
import { Button } from '@wordpress/components';
|
|
3
3
|
import { useInstanceId } from '@wordpress/compose';
|
|
4
4
|
import {
|
|
5
|
-
EditorKeyboardShortcutsRegister,
|
|
6
5
|
privateApis as editorPrivateApis,
|
|
7
6
|
store as editorStore,
|
|
8
7
|
} from '@wordpress/editor';
|
|
9
8
|
import { __, isRTL, sprintf } from '@wordpress/i18n';
|
|
10
9
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
11
|
-
import { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';
|
|
12
10
|
import { useCallback } from '@wordpress/element';
|
|
13
11
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
12
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
@@ -16,6 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
16
14
|
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
17
15
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
18
16
|
import { addQueryArgs } from '@wordpress/url';
|
|
17
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
19
18
|
import WelcomeGuide from '../welcome-guide';
|
|
20
19
|
import CanvasLoader from '../canvas-loader';
|
|
21
20
|
import { unlock } from '../../lock-unlock';
|
|
@@ -26,7 +25,7 @@ import SaveButton from '../save-button';
|
|
|
26
25
|
import SavePanel from '../save-panel';
|
|
27
26
|
import SiteEditorMoreMenu from '../more-menu';
|
|
28
27
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
29
|
-
import {
|
|
28
|
+
import { getDeviceType } from '../block-editor/viewport';
|
|
30
29
|
import useEditorTitle from './use-editor-title';
|
|
31
30
|
import useRevisionsURLSync from './use-revisions-url-sync';
|
|
32
31
|
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
@@ -39,7 +38,6 @@ import SitePreview from './site-preview';
|
|
|
39
38
|
|
|
40
39
|
const { Editor, BackButton } = unlock( editorPrivateApis );
|
|
41
40
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
42
|
-
const { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );
|
|
43
41
|
|
|
44
42
|
function getListPathForPostType( postType ) {
|
|
45
43
|
switch ( postType ) {
|
|
@@ -90,6 +88,11 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
90
88
|
( select ) => select( coreDataStore ).getCurrentTheme()?.is_block_theme,
|
|
91
89
|
[]
|
|
92
90
|
);
|
|
91
|
+
const showIconLabels = useSelect(
|
|
92
|
+
( select ) =>
|
|
93
|
+
select( preferencesStore ).get( 'core', 'showIconLabels' ),
|
|
94
|
+
[]
|
|
95
|
+
);
|
|
93
96
|
const postWithTemplate = !! context?.postId;
|
|
94
97
|
const editorPostType = postWithTemplate ? context.postType : postType;
|
|
95
98
|
const editorPostId = postWithTemplate ? context.postId : postId;
|
|
@@ -167,8 +170,6 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
167
170
|
<SitePreview />
|
|
168
171
|
) : (
|
|
169
172
|
<>
|
|
170
|
-
<EditorKeyboardShortcutsRegister />
|
|
171
|
-
{ isEditMode && <BlockKeyboardShortcuts /> }
|
|
172
173
|
{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }
|
|
173
174
|
{ isEditMode && isReady && (
|
|
174
175
|
<WelcomeGuide
|
|
@@ -188,13 +189,17 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
188
189
|
customSavePanel={ _isPreviewingTheme && <SavePanel /> }
|
|
189
190
|
iframeProps={ iframeProps }
|
|
190
191
|
onActionPerformed={ onActionPerformed }
|
|
192
|
+
initialViewport={
|
|
193
|
+
isEditMode
|
|
194
|
+
? getDeviceType( location.query.viewport )
|
|
195
|
+
: undefined
|
|
196
|
+
}
|
|
191
197
|
extraSidebarPanels={
|
|
192
198
|
! postWithTemplate && (
|
|
193
199
|
<PluginTemplateSettingPanel.Slot />
|
|
194
200
|
)
|
|
195
201
|
}
|
|
196
202
|
>
|
|
197
|
-
{ isEditMode && <ViewportSync /> }
|
|
198
203
|
{ isEditMode && (
|
|
199
204
|
<BackButton>
|
|
200
205
|
{ ( { length } ) =>
|
|
@@ -202,7 +207,7 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
202
207
|
<Button
|
|
203
208
|
size="compact"
|
|
204
209
|
label={ __( 'Open Navigation' ) }
|
|
205
|
-
showTooltip
|
|
210
|
+
showTooltip={ ! showIconLabels }
|
|
206
211
|
tooltipPosition="middle right"
|
|
207
212
|
onClick={ () => {
|
|
208
213
|
resetZoomLevel();
|
|
@@ -2,8 +2,7 @@ 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 {
|
|
6
|
-
import { DEFAULT_DEVICE_TYPE } from '../block-editor/use-viewport-sync';
|
|
5
|
+
import { DEFAULT_DEVICE_TYPE } from '../block-editor/viewport';
|
|
7
6
|
|
|
8
7
|
export function useAdaptEditorToCanvas( canvas ) {
|
|
9
8
|
const { clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
@@ -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
|
}
|
|
@@ -313,8 +313,16 @@ export default function LayoutWithGlobalStylesProvider( props ) {
|
|
|
313
313
|
<Tooltip.Provider>
|
|
314
314
|
{ /** This needs to be within the SlotFillProvider */ }
|
|
315
315
|
<PluginArea onError={ onPluginAreaError } />
|
|
316
|
-
<ThemeProvider
|
|
317
|
-
|
|
316
|
+
<ThemeProvider
|
|
317
|
+
isRoot
|
|
318
|
+
color={ {
|
|
319
|
+
primary: themeColors.primary,
|
|
320
|
+
...CONTENT_COLOR,
|
|
321
|
+
} }
|
|
322
|
+
>
|
|
323
|
+
<ThemeProvider color={ themeColors }>
|
|
324
|
+
<Layout { ...props } />
|
|
325
|
+
</ThemeProvider>
|
|
318
326
|
</ThemeProvider>
|
|
319
327
|
</Tooltip.Provider>
|
|
320
328
|
</SlotFillProvider>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
2
|
-
import SiteExport from './site-export';
|
|
3
2
|
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
4
3
|
import { unlock } from '../../lock-unlock';
|
|
5
4
|
|
|
6
|
-
const { ToolsMoreMenuGroup, PreferencesModal } =
|
|
5
|
+
const { ToolsMoreMenuGroup, PreferencesModal, SiteExport } =
|
|
6
|
+
unlock( editorPrivateApis );
|
|
7
7
|
|
|
8
8
|
export default function MoreMenu() {
|
|
9
9
|
return (
|
|
@@ -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. */
|
|
@@ -135,7 +135,12 @@ export function SidebarNavigationScreenWrapper( {
|
|
|
135
135
|
<SidebarNavigationScreen
|
|
136
136
|
title={ title || __( 'Navigation' ) }
|
|
137
137
|
actions={ actions }
|
|
138
|
-
description={
|
|
138
|
+
description={
|
|
139
|
+
description ||
|
|
140
|
+
__(
|
|
141
|
+
'Manage the menus that help visitors find their way around your site.'
|
|
142
|
+
)
|
|
143
|
+
}
|
|
139
144
|
backPath={ backPath }
|
|
140
145
|
content={ children }
|
|
141
146
|
/>
|
|
@@ -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',
|
|
@@ -121,7 +121,7 @@ export default function SidebarNavigationScreenPatterns( { backPath } ) {
|
|
|
121
121
|
<SidebarNavigationScreen
|
|
122
122
|
title={ __( 'Patterns' ) }
|
|
123
123
|
description={ __(
|
|
124
|
-
'Manage what patterns are available when editing
|
|
124
|
+
'Manage what patterns are available when editing your site.'
|
|
125
125
|
) }
|
|
126
126
|
isRoot={ ! backPath }
|
|
127
127
|
backPath={ backPath }
|
|
@@ -8,7 +8,7 @@ export default function SidebarNavigationScreenTemplatesBrowse( { backPath } ) {
|
|
|
8
8
|
<SidebarNavigationScreen
|
|
9
9
|
title={ __( 'Templates' ) }
|
|
10
10
|
description={ __(
|
|
11
|
-
'
|
|
11
|
+
'Manage the templates that define the structure of your pages, or reset any customizations made to those supplied by your theme.'
|
|
12
12
|
) }
|
|
13
13
|
backPath={ backPath }
|
|
14
14
|
content={
|
|
@@ -41,6 +41,9 @@ export const pagesRoute = {
|
|
|
41
41
|
return siteData.currentTheme.is_block_theme ? (
|
|
42
42
|
<SidebarNavigationScreen
|
|
43
43
|
title={ __( 'Pages' ) }
|
|
44
|
+
description={ __(
|
|
45
|
+
'Manage or edit the pages that make up your site, and their appearance.'
|
|
46
|
+
) }
|
|
44
47
|
backPath="/"
|
|
45
48
|
content={ <DataViewsSidebarContent postType="page" /> }
|
|
46
49
|
/>
|
package/src/style.scss
CHANGED
|
@@ -56,12 +56,16 @@ body.js.site-editor-php {
|
|
|
56
56
|
background: var(--wpds-color-background-surface-neutral-weak);
|
|
57
57
|
|
|
58
58
|
@include break-medium {
|
|
59
|
+
// Relayed through a custom property to keep `body` the subject of its
|
|
60
|
+
// own `:has()`. With `body:has(…) #wpadminbar`, every DOM change in the
|
|
61
|
+
// editor recalculates the whole document.
|
|
59
62
|
&:has(.editor-editor-interface.is-distraction-free) {
|
|
60
63
|
--wp-admin--admin-bar--height: 0px;
|
|
64
|
+
--wp-editor-admin-bar-display: none;
|
|
65
|
+
}
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
67
|
+
#wpadminbar {
|
|
68
|
+
display: var(--wp-editor-admin-bar-display, block);
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/edit-site/src/components/block-editor/use-viewport-sync.js
|
|
21
|
-
var use_viewport_sync_exports = {};
|
|
22
|
-
__export(use_viewport_sync_exports, {
|
|
23
|
-
DEFAULT_DEVICE_TYPE: () => DEFAULT_DEVICE_TYPE,
|
|
24
|
-
ViewportSync: () => ViewportSync,
|
|
25
|
-
default: () => useViewportSync
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(use_viewport_sync_exports);
|
|
28
|
-
var import_element = require("@wordpress/element");
|
|
29
|
-
var import_data = require("@wordpress/data");
|
|
30
|
-
var import_router = require("@wordpress/router");
|
|
31
|
-
var import_editor = require("@wordpress/editor");
|
|
32
|
-
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
33
|
-
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
34
|
-
var DEFAULT_DEVICE_TYPE = "Desktop";
|
|
35
|
-
var VALID_DEVICE_TYPES = ["desktop", "tablet", "mobile"];
|
|
36
|
-
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
37
|
-
function useViewportSync() {
|
|
38
|
-
const { query } = useLocation();
|
|
39
|
-
const { setDeviceType } = (0, import_data.useDispatch)(import_editor.store);
|
|
40
|
-
(0, import_element.useEffect)(() => {
|
|
41
|
-
const viewport = query?.viewport?.toLowerCase();
|
|
42
|
-
const isValid = VALID_DEVICE_TYPES.includes(viewport);
|
|
43
|
-
setDeviceType(isValid ? capitalize(viewport) : DEFAULT_DEVICE_TYPE);
|
|
44
|
-
}, [query?.viewport, setDeviceType]);
|
|
45
|
-
}
|
|
46
|
-
function ViewportSync() {
|
|
47
|
-
useViewportSync();
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
-
0 && (module.exports = {
|
|
52
|
-
DEFAULT_DEVICE_TYPE,
|
|
53
|
-
ViewportSync
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=use-viewport-sync.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/block-editor/use-viewport-sync.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as editorStore } from '@wordpress/editor';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const DEFAULT_DEVICE_TYPE = 'Desktop';\n\n// Lowercase values for URL params. Duplicated from block-editor block-visibility constants\n// and editor preview-dropdown choices. See those files when adding new viewport types.\nconst VALID_DEVICE_TYPES = [ 'desktop', 'tablet', 'mobile' ];\n\n// URL viewport params are lowercase; the editor store uses PascalCase.\nconst capitalize = ( str ) => str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\n/**\n * Syncs the editor's device type with the `viewport` URL query param.\n *\n * Intentionally responds to ongoing URL changes (not just initial load) so that\n * viewport is restored correctly when navigating back (e.g. from overlay template\n * part editor to the previous entity).\n */\nexport default function useViewportSync() {\n\tconst { query } = useLocation();\n\tconst { setDeviceType } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tconst viewport = query?.viewport?.toLowerCase();\n\t\tconst isValid = VALID_DEVICE_TYPES.includes( viewport );\n\n\t\tsetDeviceType( isValid ? capitalize( viewport ) : DEFAULT_DEVICE_TYPE );\n\t}, [ query?.viewport, setDeviceType ] );\n}\n\n/**\n * Component wrapper that runs the viewport sync hook.\n * Renders nothing; used to run the hook inside the Editor tree (inside EditorProvider).\n */\nexport function ViewportSync() {\n\tuseViewportSync();\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,kBAA4B;AAC5B,oBAAiD;AACjD,oBAAqC;AACrC,yBAAuB;AAEvB,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAE3C,IAAM,sBAAsB;AAInC,IAAM,qBAAqB,CAAE,WAAW,UAAU,QAAS;AAG3D,IAAM,aAAa,CAAE,QAAS,IAAI,OAAQ,CAAE,EAAE,YAAY,IAAI,IAAI,MAAO,CAAE;AAS5D,SAAR,kBAAmC;AACzC,QAAM,EAAE,MAAM,IAAI,YAAY;AAC9B,QAAM,EAAE,cAAc,QAAI,yBAAa,cAAAC,KAAY;AAEnD,gCAAW,MAAM;AAChB,UAAM,WAAW,OAAO,UAAU,YAAY;AAC9C,UAAM,UAAU,mBAAmB,SAAU,QAAS;AAEtD,kBAAe,UAAU,WAAY,QAAS,IAAI,mBAAoB;AAAA,EACvE,GAAG,CAAE,OAAO,UAAU,aAAc,CAAE;AACvC;AAMO,SAAS,eAAe;AAC9B,kBAAgB;AAChB,SAAO;AACR;",
|
|
6
|
-
"names": ["routerPrivateApis", "editorStore"]
|
|
7
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/edit-site/src/components/more-menu/site-export.js
|
|
31
|
-
var site_export_exports = {};
|
|
32
|
-
__export(site_export_exports, {
|
|
33
|
-
default: () => SiteExport
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(site_export_exports);
|
|
36
|
-
var import_i18n = require("@wordpress/i18n");
|
|
37
|
-
var import_components = require("@wordpress/components");
|
|
38
|
-
var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
|
|
39
|
-
var import_icons = require("@wordpress/icons");
|
|
40
|
-
var import_data = require("@wordpress/data");
|
|
41
|
-
var import_blob = require("@wordpress/blob");
|
|
42
|
-
var import_core_data = require("@wordpress/core-data");
|
|
43
|
-
var import_notices = require("@wordpress/notices");
|
|
44
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
-
function SiteExport() {
|
|
46
|
-
const canExport = (0, import_data.useSelect)((select) => {
|
|
47
|
-
const targetHints = select(import_core_data.store).getCurrentTheme()?._links?.["wp:export-theme"]?.[0]?.targetHints ?? {};
|
|
48
|
-
return !!targetHints.allow?.includes("GET");
|
|
49
|
-
}, []);
|
|
50
|
-
const { createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
51
|
-
if (!canExport) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
async function handleExport() {
|
|
55
|
-
try {
|
|
56
|
-
const response = await (0, import_api_fetch.default)({
|
|
57
|
-
path: "/wp-block-editor/v1/export",
|
|
58
|
-
parse: false,
|
|
59
|
-
headers: {
|
|
60
|
-
Accept: "application/zip"
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const blob = await response.blob();
|
|
64
|
-
const contentDisposition = response.headers.get(
|
|
65
|
-
"content-disposition"
|
|
66
|
-
);
|
|
67
|
-
const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/);
|
|
68
|
-
const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : "edit-site-export";
|
|
69
|
-
(0, import_blob.downloadBlob)(fileName + ".zip", blob, "application/zip");
|
|
70
|
-
} catch (errorResponse) {
|
|
71
|
-
let error = {};
|
|
72
|
-
try {
|
|
73
|
-
error = await errorResponse.json();
|
|
74
|
-
} catch {
|
|
75
|
-
}
|
|
76
|
-
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n.__)("An error occurred while creating the site export.");
|
|
77
|
-
createErrorNotice(errorMessage, { type: "snackbar" });
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
-
import_components.MenuItem,
|
|
82
|
-
{
|
|
83
|
-
role: "menuitem",
|
|
84
|
-
icon: import_icons.download,
|
|
85
|
-
onClick: handleExport,
|
|
86
|
-
info: (0, import_i18n.__)(
|
|
87
|
-
"Download your theme with updated templates and styles."
|
|
88
|
-
),
|
|
89
|
-
children: (0, import_i18n._x)("Export", "site exporter menu item")
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=site-export.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/more-menu/site-export.js"],
|
|
4
|
-
"sourcesContent": ["import { __, _x } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\nimport { download } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { downloadBlob } from '@wordpress/blob';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function SiteExport() {\n\tconst canExport = useSelect( ( select ) => {\n\t\tconst targetHints =\n\t\t\tselect( coreStore ).getCurrentTheme()?._links?.[\n\t\t\t\t'wp:export-theme'\n\t\t\t]?.[ 0 ]?.targetHints ?? {};\n\n\t\treturn !! targetHints.allow?.includes( 'GET' );\n\t}, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tif ( ! canExport ) {\n\t\treturn null;\n\t}\n\n\tasync function handleExport() {\n\t\ttry {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tpath: '/wp-block-editor/v1/export',\n\t\t\t\tparse: false,\n\t\t\t\theaders: {\n\t\t\t\t\tAccept: 'application/zip',\n\t\t\t\t},\n\t\t\t} );\n\t\t\tconst blob = await response.blob();\n\t\t\tconst contentDisposition = response.headers.get(\n\t\t\t\t'content-disposition'\n\t\t\t);\n\t\t\tconst contentDispositionMatches =\n\t\t\t\tcontentDisposition.match( /=(.+)\\.zip/ );\n\t\t\tconst fileName = contentDispositionMatches[ 1 ]\n\t\t\t\t? contentDispositionMatches[ 1 ]\n\t\t\t\t: 'edit-site-export';\n\n\t\t\tdownloadBlob( fileName + '.zip', blob, 'application/zip' );\n\t\t} catch ( errorResponse ) {\n\t\t\tlet error = {};\n\t\t\ttry {\n\t\t\t\terror = await errorResponse.json();\n\t\t\t} catch {}\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the site export.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\trole=\"menuitem\"\n\t\t\ticon={ download }\n\t\t\tonClick={ handleExport }\n\t\t\tinfo={ __(\n\t\t\t\t'Download your theme with updated templates and styles.'\n\t\t\t) }\n\t\t>\n\t\t\t{ _x( 'Export', 'site exporter menu item' ) }\n\t\t</MenuItem>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AACvB,wBAAyB;AACzB,uBAAqB;AACrB,mBAAyB;AACzB,kBAAuC;AACvC,kBAA6B;AAC7B,uBAAmC;AACnC,qBAAsC;AAoDpC;AAlDa,SAAR,aAA8B;AACpC,QAAM,gBAAY,uBAAW,CAAE,WAAY;AAC1C,UAAM,cACL,OAAQ,iBAAAA,KAAU,EAAE,gBAAgB,GAAG,SACtC,iBACD,IAAK,CAAE,GAAG,eAAe,CAAC;AAE3B,WAAO,CAAC,CAAE,YAAY,OAAO,SAAU,KAAM;AAAA,EAC9C,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,kBAAkB,QAAI,yBAAa,eAAAC,KAAa;AAExD,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,iBAAe,eAAe;AAC7B,QAAI;AACH,YAAM,WAAW,UAAM,iBAAAC,SAAU;AAAA,QAChC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,SAAS;AAAA,UACR,QAAQ;AAAA,QACT;AAAA,MACD,CAAE;AACF,YAAM,OAAO,MAAM,SAAS,KAAK;AACjC,YAAM,qBAAqB,SAAS,QAAQ;AAAA,QAC3C;AAAA,MACD;AACA,YAAM,4BACL,mBAAmB,MAAO,YAAa;AACxC,YAAM,WAAW,0BAA2B,CAAE,IAC3C,0BAA2B,CAAE,IAC7B;AAEH,oCAAc,WAAW,QAAQ,MAAM,iBAAkB;AAAA,IAC1D,SAAU,eAAgB;AACzB,UAAI,QAAQ,CAAC;AACb,UAAI;AACH,gBAAQ,MAAM,cAAc,KAAK;AAAA,MAClC,QAAQ;AAAA,MAAC;AACT,YAAM,eACL,MAAM,WAAW,MAAM,SAAS,kBAC7B,MAAM,cACN,gBAAI,mDAAoD;AAE5D,wBAAmB,cAAc,EAAE,MAAM,WAAW,CAAE;AAAA,IACvD;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,MAAO;AAAA,MACP,SAAU;AAAA,MACV,UAAO;AAAA,QACN;AAAA,MACD;AAAA,MAEE,8BAAI,UAAU,yBAA0B;AAAA;AAAA,EAC3C;AAEF;",
|
|
6
|
-
"names": ["coreStore", "noticesStore", "apiFetch"]
|
|
7
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// packages/edit-site/src/components/block-editor/use-viewport-sync.js
|
|
2
|
-
import { useEffect } from "@wordpress/element";
|
|
3
|
-
import { useDispatch } from "@wordpress/data";
|
|
4
|
-
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
5
|
-
import { store as editorStore } from "@wordpress/editor";
|
|
6
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
7
|
-
var { useLocation } = unlock(routerPrivateApis);
|
|
8
|
-
var DEFAULT_DEVICE_TYPE = "Desktop";
|
|
9
|
-
var VALID_DEVICE_TYPES = ["desktop", "tablet", "mobile"];
|
|
10
|
-
var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
11
|
-
function useViewportSync() {
|
|
12
|
-
const { query } = useLocation();
|
|
13
|
-
const { setDeviceType } = useDispatch(editorStore);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const viewport = query?.viewport?.toLowerCase();
|
|
16
|
-
const isValid = VALID_DEVICE_TYPES.includes(viewport);
|
|
17
|
-
setDeviceType(isValid ? capitalize(viewport) : DEFAULT_DEVICE_TYPE);
|
|
18
|
-
}, [query?.viewport, setDeviceType]);
|
|
19
|
-
}
|
|
20
|
-
function ViewportSync() {
|
|
21
|
-
useViewportSync();
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
DEFAULT_DEVICE_TYPE,
|
|
26
|
-
ViewportSync,
|
|
27
|
-
useViewportSync as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=use-viewport-sync.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/block-editor/use-viewport-sync.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as editorStore } from '@wordpress/editor';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport const DEFAULT_DEVICE_TYPE = 'Desktop';\n\n// Lowercase values for URL params. Duplicated from block-editor block-visibility constants\n// and editor preview-dropdown choices. See those files when adding new viewport types.\nconst VALID_DEVICE_TYPES = [ 'desktop', 'tablet', 'mobile' ];\n\n// URL viewport params are lowercase; the editor store uses PascalCase.\nconst capitalize = ( str ) => str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\n/**\n * Syncs the editor's device type with the `viewport` URL query param.\n *\n * Intentionally responds to ongoing URL changes (not just initial load) so that\n * viewport is restored correctly when navigating back (e.g. from overlay template\n * part editor to the previous entity).\n */\nexport default function useViewportSync() {\n\tconst { query } = useLocation();\n\tconst { setDeviceType } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tconst viewport = query?.viewport?.toLowerCase();\n\t\tconst isValid = VALID_DEVICE_TYPES.includes( viewport );\n\n\t\tsetDeviceType( isValid ? capitalize( viewport ) : DEFAULT_DEVICE_TYPE );\n\t}, [ query?.viewport, setDeviceType ] );\n}\n\n/**\n * Component wrapper that runs the viewport sync hook.\n * Renders nothing; used to run the hook inside the Editor tree (inside EditorProvider).\n */\nexport function ViewportSync() {\n\tuseViewportSync();\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,eAAe,yBAAyB;AACjD,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AAEvB,IAAM,EAAE,YAAY,IAAI,OAAQ,iBAAkB;AAE3C,IAAM,sBAAsB;AAInC,IAAM,qBAAqB,CAAE,WAAW,UAAU,QAAS;AAG3D,IAAM,aAAa,CAAE,QAAS,IAAI,OAAQ,CAAE,EAAE,YAAY,IAAI,IAAI,MAAO,CAAE;AAS5D,SAAR,kBAAmC;AACzC,QAAM,EAAE,MAAM,IAAI,YAAY;AAC9B,QAAM,EAAE,cAAc,IAAI,YAAa,WAAY;AAEnD,YAAW,MAAM;AAChB,UAAM,WAAW,OAAO,UAAU,YAAY;AAC9C,UAAM,UAAU,mBAAmB,SAAU,QAAS;AAEtD,kBAAe,UAAU,WAAY,QAAS,IAAI,mBAAoB;AAAA,EACvE,GAAG,CAAE,OAAO,UAAU,aAAc,CAAE;AACvC;AAMO,SAAS,eAAe;AAC9B,kBAAgB;AAChB,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// packages/edit-site/src/components/more-menu/site-export.js
|
|
2
|
-
import { __, _x } from "@wordpress/i18n";
|
|
3
|
-
import { MenuItem } from "@wordpress/components";
|
|
4
|
-
import apiFetch from "@wordpress/api-fetch";
|
|
5
|
-
import { download } from "@wordpress/icons";
|
|
6
|
-
import { useDispatch, useSelect } from "@wordpress/data";
|
|
7
|
-
import { downloadBlob } from "@wordpress/blob";
|
|
8
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
9
|
-
import { store as noticesStore } from "@wordpress/notices";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
function SiteExport() {
|
|
12
|
-
const canExport = useSelect((select) => {
|
|
13
|
-
const targetHints = select(coreStore).getCurrentTheme()?._links?.["wp:export-theme"]?.[0]?.targetHints ?? {};
|
|
14
|
-
return !!targetHints.allow?.includes("GET");
|
|
15
|
-
}, []);
|
|
16
|
-
const { createErrorNotice } = useDispatch(noticesStore);
|
|
17
|
-
if (!canExport) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
async function handleExport() {
|
|
21
|
-
try {
|
|
22
|
-
const response = await apiFetch({
|
|
23
|
-
path: "/wp-block-editor/v1/export",
|
|
24
|
-
parse: false,
|
|
25
|
-
headers: {
|
|
26
|
-
Accept: "application/zip"
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const blob = await response.blob();
|
|
30
|
-
const contentDisposition = response.headers.get(
|
|
31
|
-
"content-disposition"
|
|
32
|
-
);
|
|
33
|
-
const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/);
|
|
34
|
-
const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : "edit-site-export";
|
|
35
|
-
downloadBlob(fileName + ".zip", blob, "application/zip");
|
|
36
|
-
} catch (errorResponse) {
|
|
37
|
-
let error = {};
|
|
38
|
-
try {
|
|
39
|
-
error = await errorResponse.json();
|
|
40
|
-
} catch {
|
|
41
|
-
}
|
|
42
|
-
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : __("An error occurred while creating the site export.");
|
|
43
|
-
createErrorNotice(errorMessage, { type: "snackbar" });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
-
MenuItem,
|
|
48
|
-
{
|
|
49
|
-
role: "menuitem",
|
|
50
|
-
icon: download,
|
|
51
|
-
onClick: handleExport,
|
|
52
|
-
info: __(
|
|
53
|
-
"Download your theme with updated templates and styles."
|
|
54
|
-
),
|
|
55
|
-
children: _x("Export", "site exporter menu item")
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
export {
|
|
60
|
-
SiteExport as default
|
|
61
|
-
};
|
|
62
|
-
//# sourceMappingURL=site-export.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/more-menu/site-export.js"],
|
|
4
|
-
"sourcesContent": ["import { __, _x } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\nimport { download } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { downloadBlob } from '@wordpress/blob';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function SiteExport() {\n\tconst canExport = useSelect( ( select ) => {\n\t\tconst targetHints =\n\t\t\tselect( coreStore ).getCurrentTheme()?._links?.[\n\t\t\t\t'wp:export-theme'\n\t\t\t]?.[ 0 ]?.targetHints ?? {};\n\n\t\treturn !! targetHints.allow?.includes( 'GET' );\n\t}, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tif ( ! canExport ) {\n\t\treturn null;\n\t}\n\n\tasync function handleExport() {\n\t\ttry {\n\t\t\tconst response = await apiFetch( {\n\t\t\t\tpath: '/wp-block-editor/v1/export',\n\t\t\t\tparse: false,\n\t\t\t\theaders: {\n\t\t\t\t\tAccept: 'application/zip',\n\t\t\t\t},\n\t\t\t} );\n\t\t\tconst blob = await response.blob();\n\t\t\tconst contentDisposition = response.headers.get(\n\t\t\t\t'content-disposition'\n\t\t\t);\n\t\t\tconst contentDispositionMatches =\n\t\t\t\tcontentDisposition.match( /=(.+)\\.zip/ );\n\t\t\tconst fileName = contentDispositionMatches[ 1 ]\n\t\t\t\t? contentDispositionMatches[ 1 ]\n\t\t\t\t: 'edit-site-export';\n\n\t\t\tdownloadBlob( fileName + '.zip', blob, 'application/zip' );\n\t\t} catch ( errorResponse ) {\n\t\t\tlet error = {};\n\t\t\ttry {\n\t\t\t\terror = await errorResponse.json();\n\t\t\t} catch {}\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the site export.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\trole=\"menuitem\"\n\t\t\ticon={ download }\n\t\t\tonClick={ handleExport }\n\t\t\tinfo={ __(\n\t\t\t\t'Download your theme with updated templates and styles.'\n\t\t\t) }\n\t\t>\n\t\t\t{ _x( 'Export', 'site exporter menu item' ) }\n\t\t</MenuItem>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,IAAI,UAAU;AACvB,SAAS,gBAAgB;AACzB,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,SAAS,aAAa,iBAAiB;AACvC,SAAS,oBAAoB;AAC7B,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,oBAAoB;AAoDpC;AAlDa,SAAR,aAA8B;AACpC,QAAM,YAAY,UAAW,CAAE,WAAY;AAC1C,UAAM,cACL,OAAQ,SAAU,EAAE,gBAAgB,GAAG,SACtC,iBACD,IAAK,CAAE,GAAG,eAAe,CAAC;AAE3B,WAAO,CAAC,CAAE,YAAY,OAAO,SAAU,KAAM;AAAA,EAC9C,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,kBAAkB,IAAI,YAAa,YAAa;AAExD,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,iBAAe,eAAe;AAC7B,QAAI;AACH,YAAM,WAAW,MAAM,SAAU;AAAA,QAChC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,SAAS;AAAA,UACR,QAAQ;AAAA,QACT;AAAA,MACD,CAAE;AACF,YAAM,OAAO,MAAM,SAAS,KAAK;AACjC,YAAM,qBAAqB,SAAS,QAAQ;AAAA,QAC3C;AAAA,MACD;AACA,YAAM,4BACL,mBAAmB,MAAO,YAAa;AACxC,YAAM,WAAW,0BAA2B,CAAE,IAC3C,0BAA2B,CAAE,IAC7B;AAEH,mBAAc,WAAW,QAAQ,MAAM,iBAAkB;AAAA,IAC1D,SAAU,eAAgB;AACzB,UAAI,QAAQ,CAAC;AACb,UAAI;AACH,gBAAQ,MAAM,cAAc,KAAK;AAAA,MAClC,QAAQ;AAAA,MAAC;AACT,YAAM,eACL,MAAM,WAAW,MAAM,SAAS,kBAC7B,MAAM,UACN,GAAI,mDAAoD;AAE5D,wBAAmB,cAAc,EAAE,MAAM,WAAW,CAAE;AAAA,IACvD;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,MAAO;AAAA,MACP,SAAU;AAAA,MACV,MAAO;AAAA,QACN;AAAA,MACD;AAAA,MAEE,aAAI,UAAU,yBAA0B;AAAA;AAAA,EAC3C;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect } from '@wordpress/element';
|
|
2
|
-
import { useDispatch } from '@wordpress/data';
|
|
3
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
4
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
5
|
-
import { unlock } from '../../lock-unlock';
|
|
6
|
-
|
|
7
|
-
const { useLocation } = unlock( routerPrivateApis );
|
|
8
|
-
|
|
9
|
-
export const DEFAULT_DEVICE_TYPE = 'Desktop';
|
|
10
|
-
|
|
11
|
-
// Lowercase values for URL params. Duplicated from block-editor block-visibility constants
|
|
12
|
-
// and editor preview-dropdown choices. See those files when adding new viewport types.
|
|
13
|
-
const VALID_DEVICE_TYPES = [ 'desktop', 'tablet', 'mobile' ];
|
|
14
|
-
|
|
15
|
-
// URL viewport params are lowercase; the editor store uses PascalCase.
|
|
16
|
-
const capitalize = ( str ) => str.charAt( 0 ).toUpperCase() + str.slice( 1 );
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Syncs the editor's device type with the `viewport` URL query param.
|
|
20
|
-
*
|
|
21
|
-
* Intentionally responds to ongoing URL changes (not just initial load) so that
|
|
22
|
-
* viewport is restored correctly when navigating back (e.g. from overlay template
|
|
23
|
-
* part editor to the previous entity).
|
|
24
|
-
*/
|
|
25
|
-
export default function useViewportSync() {
|
|
26
|
-
const { query } = useLocation();
|
|
27
|
-
const { setDeviceType } = useDispatch( editorStore );
|
|
28
|
-
|
|
29
|
-
useEffect( () => {
|
|
30
|
-
const viewport = query?.viewport?.toLowerCase();
|
|
31
|
-
const isValid = VALID_DEVICE_TYPES.includes( viewport );
|
|
32
|
-
|
|
33
|
-
setDeviceType( isValid ? capitalize( viewport ) : DEFAULT_DEVICE_TYPE );
|
|
34
|
-
}, [ query?.viewport, setDeviceType ] );
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Component wrapper that runs the viewport sync hook.
|
|
39
|
-
* Renders nothing; used to run the hook inside the Editor tree (inside EditorProvider).
|
|
40
|
-
*/
|
|
41
|
-
export function ViewportSync() {
|
|
42
|
-
useViewportSync();
|
|
43
|
-
return null;
|
|
44
|
-
}
|