@wordpress/edit-site 7.1.0 → 7.3.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 +28 -0
- package/README.md +0 -7
- package/build/components/add-new-pattern/index.cjs.map +2 -2
- package/build/components/add-new-post/index.cjs.map +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template/index.cjs.map +2 -2
- package/build/components/add-new-template/utils.cjs.map +2 -2
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template-legacy/index.cjs.map +2 -2
- package/build/components/add-new-template-legacy/utils.cjs.map +2 -2
- package/build/components/app/index.cjs.map +2 -2
- package/build/components/block-editor/use-editor-iframe-props.cjs.map +2 -2
- 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.map +2 -2
- package/build/components/dataviews-actions/index.cjs.map +2 -2
- package/build/components/editor/index.cjs +14 -12
- package/build/components/editor/index.cjs.map +3 -3
- package/build/components/editor/site-preview.cjs.map +2 -2
- package/build/components/editor/use-adapt-editor-to-canvas.cjs +2 -2
- package/build/components/editor/use-adapt-editor-to-canvas.cjs.map +2 -2
- package/build/components/editor/use-editor-title.cjs.map +2 -2
- package/build/components/editor/use-resolve-edited-entity.cjs.map +2 -2
- package/build/components/editor/use-revisions-url-sync.cjs +122 -0
- package/build/components/editor/use-revisions-url-sync.cjs.map +7 -0
- package/build/components/layout/animation.cjs.map +2 -2
- package/build/components/layout/hooks.cjs.map +2 -2
- package/build/components/layout/index.cjs +11 -2
- package/build/components/layout/index.cjs.map +2 -2
- package/build/components/media/index.cjs.map +2 -2
- package/build/components/more-menu/index.cjs +2 -3
- package/build/components/more-menu/index.cjs.map +3 -3
- package/build/components/more-menu/welcome-guide-menu-item.cjs.map +2 -2
- package/build/components/page-patterns/actions.cjs.map +2 -2
- package/build/components/page-patterns/delete-category-menu-item.cjs.map +2 -2
- package/build/components/page-patterns/fields.cjs.map +2 -2
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/page-patterns/rename-category-menu-item.cjs.map +2 -2
- package/build/components/page-patterns/search-items.cjs.map +2 -2
- package/build/components/page-patterns/use-pattern-settings.cjs.map +2 -2
- package/build/components/page-patterns/use-patterns.cjs.map +2 -2
- package/build/components/page-templates/fields.cjs.map +2 -2
- package/build/components/page-templates/hooks.cjs.map +2 -2
- package/build/components/page-templates/index-legacy.cjs.map +2 -2
- package/build/components/page-templates/index.cjs.map +2 -2
- package/build/components/pagination/index.cjs.map +2 -2
- package/build/components/plugin-template-setting-panel/index.cjs.map +2 -2
- package/build/components/post-list/index.cjs.map +2 -2
- package/build/components/post-list/quick-edit-modal.cjs.map +2 -2
- package/build/components/post-list/use-notes-count.cjs.map +2 -2
- package/build/components/resizable-frame/index.cjs.map +2 -2
- package/build/components/routes/use-title.cjs.map +2 -2
- package/build/components/save-button/index.cjs.map +2 -2
- package/build/components/save-hub/index.cjs.map +2 -2
- package/build/components/save-keyboard-shortcut/index.cjs.map +2 -2
- package/build/components/save-panel/index.cjs.map +2 -2
- package/build/components/sidebar/index.cjs.map +2 -2
- package/build/components/sidebar-button/index.cjs.map +2 -2
- package/build/components/sidebar-dataviews/index.cjs.map +2 -2
- package/build/components/sidebar-global-styles/index.cjs.map +2 -2
- package/build/components/sidebar-identity/index.cjs +5 -2
- package/build/components/sidebar-identity/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-item/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-details-footer/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-global-styles/content.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-identity/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.cjs +3 -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 +24 -25
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.cjs.map +2 -2
- 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.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-unsupported/index.cjs.map +2 -2
- package/build/components/site-editor-routes/home.cjs.map +2 -2
- package/build/components/site-editor-routes/identity.cjs.map +2 -2
- package/build/components/site-editor-routes/index.cjs.map +2 -2
- package/build/components/site-editor-routes/navigation-item.cjs.map +2 -2
- package/build/components/site-editor-routes/navigation.cjs.map +2 -2
- package/build/components/site-editor-routes/notfound.cjs.map +2 -2
- package/build/components/site-editor-routes/page-item.cjs.map +2 -2
- package/build/components/site-editor-routes/pages.cjs +3 -0
- package/build/components/site-editor-routes/pages.cjs.map +2 -2
- package/build/components/site-editor-routes/pattern-item.cjs.map +2 -2
- package/build/components/site-editor-routes/patterns.cjs.map +2 -2
- package/build/components/site-editor-routes/stylebook.cjs.map +2 -2
- package/build/components/site-editor-routes/styles.cjs.map +2 -2
- package/build/components/site-editor-routes/template-item.cjs.map +2 -2
- package/build/components/site-editor-routes/template-part-item.cjs.map +2 -2
- package/build/components/site-editor-routes/templates.cjs.map +2 -2
- package/build/components/site-hub/index.cjs.map +2 -2
- package/build/components/welcome-guide/editor.cjs.map +2 -2
- package/build/components/welcome-guide/index.cjs.map +2 -2
- package/build/components/welcome-guide/page.cjs.map +2 -2
- package/build/components/welcome-guide/template.cjs.map +2 -2
- package/build/deprecated.cjs.map +2 -2
- package/build/hooks/commands/use-common-commands.cjs.map +2 -2
- package/build/hooks/commands/use-set-command-context.cjs.map +2 -2
- package/build/index.cjs.map +2 -2
- package/build/lock-unlock.cjs.map +2 -2
- package/build/store/actions.cjs.map +2 -2
- package/build/store/index.cjs.map +2 -2
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/constants.cjs.map +2 -2
- package/build/utils/get-filtered-template-parts.cjs.map +2 -2
- package/build/utils/is-previewing-theme.cjs.map +2 -2
- package/build/utils/is-template-removable.cjs.map +2 -2
- package/build/utils/is-template-revertable.cjs.map +2 -2
- package/build/utils/use-activate-theme.cjs.map +2 -2
- package/build/utils/use-actual-current-theme.cjs.map +2 -2
- package/build-module/components/add-new-pattern/index.mjs.map +2 -2
- package/build-module/components/add-new-post/index.mjs.map +2 -2
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template/index.mjs.map +2 -2
- package/build-module/components/add-new-template/utils.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/index.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/utils.mjs.map +2 -2
- package/build-module/components/app/index.mjs.map +2 -2
- package/build-module/components/block-editor/use-editor-iframe-props.mjs.map +2 -2
- 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.map +2 -2
- package/build-module/components/dataviews-actions/index.mjs.map +2 -2
- package/build-module/components/editor/index.mjs +14 -13
- package/build-module/components/editor/index.mjs.map +2 -2
- package/build-module/components/editor/site-preview.mjs.map +2 -2
- package/build-module/components/editor/use-adapt-editor-to-canvas.mjs +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.mjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/editor/use-resolve-edited-entity.mjs.map +2 -2
- package/build-module/components/editor/use-revisions-url-sync.mjs +101 -0
- package/build-module/components/editor/use-revisions-url-sync.mjs.map +7 -0
- package/build-module/components/layout/animation.mjs.map +2 -2
- package/build-module/components/layout/hooks.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +11 -2
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/media/index.mjs.map +2 -2
- package/build-module/components/more-menu/index.mjs +1 -2
- package/build-module/components/more-menu/index.mjs.map +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs.map +2 -2
- package/build-module/components/page-patterns/actions.mjs.map +2 -2
- package/build-module/components/page-patterns/delete-category-menu-item.mjs.map +2 -2
- package/build-module/components/page-patterns/fields.mjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/page-patterns/rename-category-menu-item.mjs.map +2 -2
- package/build-module/components/page-patterns/search-items.mjs.map +2 -2
- package/build-module/components/page-patterns/use-pattern-settings.mjs.map +2 -2
- package/build-module/components/page-patterns/use-patterns.mjs.map +2 -2
- package/build-module/components/page-templates/fields.mjs.map +2 -2
- package/build-module/components/page-templates/hooks.mjs.map +2 -2
- package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
- package/build-module/components/page-templates/index.mjs.map +2 -2
- package/build-module/components/pagination/index.mjs.map +2 -2
- package/build-module/components/plugin-template-setting-panel/index.mjs.map +2 -2
- package/build-module/components/post-list/index.mjs.map +2 -2
- package/build-module/components/post-list/quick-edit-modal.mjs.map +2 -2
- package/build-module/components/post-list/use-notes-count.mjs.map +2 -2
- package/build-module/components/resizable-frame/index.mjs.map +2 -2
- package/build-module/components/routes/use-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs.map +2 -2
- package/build-module/components/save-hub/index.mjs.map +2 -2
- package/build-module/components/save-keyboard-shortcut/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar-button/index.mjs.map +2 -2
- package/build-module/components/sidebar-dataviews/index.mjs.map +2 -2
- package/build-module/components/sidebar-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-identity/index.mjs +5 -2
- package/build-module/components/sidebar-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-details-footer/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/content.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs +3 -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 +24 -25
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs.map +2 -2
- 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.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +2 -2
- 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 +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-unsupported/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/home.mjs.map +2 -2
- package/build-module/components/site-editor-routes/identity.mjs.map +2 -2
- package/build-module/components/site-editor-routes/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/navigation.mjs.map +2 -2
- package/build-module/components/site-editor-routes/notfound.mjs.map +2 -2
- package/build-module/components/site-editor-routes/page-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/pages.mjs +3 -0
- package/build-module/components/site-editor-routes/pages.mjs.map +2 -2
- package/build-module/components/site-editor-routes/pattern-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/patterns.mjs.map +2 -2
- package/build-module/components/site-editor-routes/stylebook.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
- package/build-module/components/site-editor-routes/template-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/template-part-item.mjs.map +2 -2
- package/build-module/components/site-editor-routes/templates.mjs.map +2 -2
- package/build-module/components/site-hub/index.mjs.map +2 -2
- package/build-module/components/welcome-guide/editor.mjs.map +2 -2
- package/build-module/components/welcome-guide/index.mjs.map +2 -2
- package/build-module/components/welcome-guide/page.mjs.map +2 -2
- package/build-module/components/welcome-guide/template.mjs.map +2 -2
- package/build-module/deprecated.mjs.map +2 -2
- package/build-module/hooks/commands/use-common-commands.mjs.map +2 -2
- package/build-module/hooks/commands/use-set-command-context.mjs.map +2 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/lock-unlock.mjs.map +2 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/index.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/constants.mjs.map +2 -2
- package/build-module/utils/get-filtered-template-parts.mjs.map +2 -2
- package/build-module/utils/is-previewing-theme.mjs.map +2 -2
- package/build-module/utils/is-template-removable.mjs.map +2 -2
- package/build-module/utils/is-template-revertable.mjs.map +2 -2
- package/build-module/utils/use-activate-theme.mjs.map +2 -2
- package/build-module/utils/use-actual-current-theme.mjs.map +2 -2
- package/build-style/style-rtl.css +157 -66
- package/build-style/style.css +157 -66
- package/package.json +48 -48
- package/src/components/add-new-pattern/index.js +0 -7
- package/src/components/add-new-post/index.js +0 -3
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -7
- package/src/components/add-new-template/add-custom-template-modal-content.js +0 -7
- package/src/components/add-new-template/index.js +0 -15
- package/src/components/add-new-template/utils.js +0 -7
- package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +0 -7
- package/src/components/add-new-template-legacy/add-custom-template-modal-content.js +0 -7
- package/src/components/add-new-template-legacy/index.js +0 -15
- package/src/components/add-new-template-legacy/utils.js +0 -7
- package/src/components/app/index.js +0 -7
- package/src/components/block-editor/use-editor-iframe-props.js +0 -11
- package/src/components/block-editor/use-navigate-to-entity-record.js +11 -39
- package/src/components/block-editor/use-site-editor-settings.js +0 -8
- package/src/components/block-editor/viewport.js +34 -0
- package/src/components/canvas-loader/index.js +0 -7
- package/src/components/dataviews-actions/index.js +0 -7
- package/src/components/editor/index.js +19 -20
- package/src/components/editor/site-preview.js +0 -3
- package/src/components/editor/use-adapt-editor-to-canvas.js +1 -8
- package/src/components/editor/use-editor-title.js +0 -7
- package/src/components/editor/use-resolve-edited-entity.js +0 -7
- package/src/components/editor/use-revisions-url-sync.js +132 -0
- package/src/components/layout/animation.js +0 -7
- package/src/components/layout/hooks.js +0 -3
- package/src/components/layout/index.js +10 -14
- package/src/components/media/index.js +0 -3
- package/src/components/more-menu/index.js +2 -9
- package/src/components/more-menu/welcome-guide-menu-item.js +0 -3
- package/src/components/page-patterns/actions.js +0 -7
- package/src/components/page-patterns/delete-category-menu-item.js +0 -7
- package/src/components/page-patterns/fields.js +0 -7
- package/src/components/page-patterns/index.js +0 -7
- package/src/components/page-patterns/rename-category-menu-item.js +0 -10
- package/src/components/page-patterns/search-items.js +0 -12
- package/src/components/page-patterns/style.scss +3 -0
- package/src/components/page-patterns/use-pattern-settings.js +0 -7
- package/src/components/page-patterns/use-patterns.js +0 -7
- package/src/components/page-templates/fields.js +0 -11
- package/src/components/page-templates/hooks.js +0 -7
- package/src/components/page-templates/index-legacy.js +0 -7
- package/src/components/page-templates/index.js +0 -7
- package/src/components/pagination/index.js +0 -7
- package/src/components/plugin-template-setting-panel/index.js +0 -4
- package/src/components/post-list/index.js +0 -9
- package/src/components/post-list/quick-edit-modal.js +0 -7
- package/src/components/post-list/use-notes-count.js +0 -3
- package/src/components/resizable-frame/index.js +0 -11
- package/src/components/routes/use-title.js +0 -7
- package/src/components/save-button/index.js +0 -7
- package/src/components/save-hub/index.js +0 -7
- package/src/components/save-keyboard-shortcut/index.js +0 -7
- package/src/components/save-panel/index.js +0 -11
- package/src/components/sidebar/index.js +0 -7
- package/src/components/sidebar-button/index.js +0 -7
- package/src/components/sidebar-dataviews/index.js +0 -7
- package/src/components/sidebar-global-styles/index.js +0 -7
- package/src/components/sidebar-identity/index.js +3 -3
- package/src/components/sidebar-navigation-item/index.js +0 -11
- package/src/components/sidebar-navigation-item/style.scss +3 -10
- package/src/components/sidebar-navigation-screen/index.js +0 -11
- package/src/components/sidebar-navigation-screen-details-footer/index.js +0 -7
- package/src/components/sidebar-navigation-screen-global-styles/content.js +0 -7
- package/src/components/sidebar-navigation-screen-global-styles/index.js +0 -7
- package/src/components/sidebar-navigation-screen-identity/index.js +0 -7
- package/src/components/sidebar-navigation-screen-main/index.js +0 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +0 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +0 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +0 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +0 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +0 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +0 -7
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +0 -3
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -9
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +38 -48
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +0 -7
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +0 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +1 -8
- package/src/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +0 -7
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +0 -7
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +0 -7
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +0 -7
- package/src/components/sidebar-navigation-screen-templates-browse/content-legacy.js +0 -7
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -8
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -8
- package/src/components/sidebar-navigation-screen-unsupported/index.js +0 -3
- package/src/components/site-editor-routes/home.js +0 -3
- package/src/components/site-editor-routes/identity.js +0 -3
- package/src/components/site-editor-routes/index.js +0 -7
- package/src/components/site-editor-routes/navigation-item.js +0 -3
- package/src/components/site-editor-routes/navigation.js +0 -3
- package/src/components/site-editor-routes/notfound.js +0 -7
- package/src/components/site-editor-routes/page-item.js +0 -7
- package/src/components/site-editor-routes/pages.js +3 -7
- package/src/components/site-editor-routes/pattern-item.js +0 -3
- package/src/components/site-editor-routes/patterns.js +0 -3
- package/src/components/site-editor-routes/stylebook.js +0 -7
- package/src/components/site-editor-routes/styles.js +0 -7
- package/src/components/site-editor-routes/template-item.js +0 -3
- package/src/components/site-editor-routes/template-part-item.js +0 -3
- package/src/components/site-editor-routes/templates.js +0 -7
- package/src/components/site-hub/index.js +0 -7
- package/src/components/welcome-guide/editor.js +0 -7
- package/src/components/welcome-guide/index.js +0 -3
- package/src/components/welcome-guide/page.js +0 -3
- package/src/components/welcome-guide/template.js +0 -3
- package/src/deprecated.js +0 -3
- package/src/hooks/commands/use-common-commands.js +0 -7
- package/src/hooks/commands/use-set-command-context.js +0 -7
- package/src/index.js +0 -7
- package/src/lock-unlock.js +0 -3
- package/src/store/actions.js +0 -7
- package/src/store/index.js +0 -7
- package/src/store/reducer.js +0 -3
- package/src/store/selectors.js +0 -7
- package/src/style.scss +7 -3
- package/src/utils/constants.js +0 -7
- package/src/utils/get-filtered-template-parts.js +0 -3
- package/src/utils/is-previewing-theme.js +0 -3
- package/src/utils/is-template-removable.js +0 -3
- package/src/utils/is-template-revertable.js +0 -3
- package/src/utils/test/get-filtered-template-parts.js +0 -3
- package/src/utils/use-activate-theme.js +0 -7
- package/src/utils/use-actual-current-theme.js +0 -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 -51
- package/src/components/more-menu/site-export.js +0 -74
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import {
|
|
10
3
|
Button,
|
|
11
4
|
Modal,
|
|
@@ -42,15 +35,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
42
35
|
import { store as noticesStore } from '@wordpress/notices';
|
|
43
36
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
44
37
|
import { focus } from '@wordpress/dom';
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Internal dependencies
|
|
48
|
-
*/
|
|
49
38
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Internal dependencies
|
|
53
|
-
*/
|
|
54
39
|
import AddCustomTemplateModalContent from './add-custom-template-modal-content';
|
|
55
40
|
import {
|
|
56
41
|
useDefaultTemplateTypes,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useSelect } from '@wordpress/data';
|
|
5
2
|
import { store as coreStore } from '@wordpress/core-data';
|
|
6
3
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -8,10 +5,6 @@ import { useMemo, useCallback } from '@wordpress/element';
|
|
|
8
5
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
9
6
|
import { blockMeta, post, archive } from '@wordpress/icons';
|
|
10
7
|
import { safeDecodeURI } from '@wordpress/url';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
8
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
16
9
|
|
|
17
10
|
const EMPTY_OBJECT = {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useState, useMemo, useEffect } from '@wordpress/element';
|
|
5
2
|
import { __ } from '@wordpress/i18n';
|
|
6
3
|
import {
|
|
@@ -18,10 +15,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
18
15
|
import { useDebouncedInput } from '@wordpress/compose';
|
|
19
16
|
import { focus } from '@wordpress/dom';
|
|
20
17
|
import { safeDecodeURI } from '@wordpress/url';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
18
|
import { mapToIHasNameAndId } from './utils';
|
|
26
19
|
|
|
27
20
|
const EMPTY_ARRAY = [];
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import {
|
|
10
3
|
Button,
|
|
11
4
|
Modal,
|
|
@@ -42,15 +35,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
42
35
|
import { store as noticesStore } from '@wordpress/notices';
|
|
43
36
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
44
37
|
import { focus } from '@wordpress/dom';
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Internal dependencies
|
|
48
|
-
*/
|
|
49
38
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Internal dependencies
|
|
53
|
-
*/
|
|
54
39
|
import AddCustomTemplateModalContent from './add-custom-template-modal-content';
|
|
55
40
|
import {
|
|
56
41
|
useExistingTemplates,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useSelect } from '@wordpress/data';
|
|
5
2
|
import { store as coreStore } from '@wordpress/core-data';
|
|
6
3
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -8,10 +5,6 @@ import { useMemo, useCallback } from '@wordpress/element';
|
|
|
8
5
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
9
6
|
import { blockMeta, post, archive } from '@wordpress/icons';
|
|
10
7
|
import { safeDecodeURI } from '@wordpress/url';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
8
|
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
16
9
|
|
|
17
10
|
const EMPTY_OBJECT = {};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useSelect } from '@wordpress/data';
|
|
5
2
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
3
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
7
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import Layout from '../layout';
|
|
13
6
|
import { unlock } from '../../lock-unlock';
|
|
14
7
|
import { store as editSiteStore } from '../../store';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useSelect } from '@wordpress/data';
|
|
10
3
|
import { ENTER, SPACE } from '@wordpress/keycodes';
|
|
11
4
|
import { useState, useEffect } from '@wordpress/element';
|
|
@@ -13,10 +6,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
6
|
import { store as editorStore } from '@wordpress/editor';
|
|
14
7
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
8
|
import { addQueryArgs } from '@wordpress/url';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
9
|
import { unlock } from '../../lock-unlock';
|
|
21
10
|
|
|
22
11
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect, useRegistry } from '@wordpress/data';
|
|
1
|
+
import { useRegistry } from '@wordpress/data';
|
|
5
2
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
3
|
import { useCallback } from '@wordpress/element';
|
|
7
4
|
import { addQueryArgs } from '@wordpress/url';
|
|
8
5
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
6
|
import { store as editorStore } from '@wordpress/editor';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
7
|
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import {
|
|
8
|
+
import { isValidViewport } from './viewport';
|
|
16
9
|
|
|
17
10
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
18
11
|
|
|
19
|
-
const VALID_VIEWPORTS = [ 'desktop', 'tablet', 'mobile' ];
|
|
20
12
|
/**
|
|
21
13
|
* Hook to handle navigation to entity records.
|
|
22
14
|
*
|
|
@@ -27,10 +19,6 @@ export default function useNavigateToEntityRecord() {
|
|
|
27
19
|
const location = useLocation();
|
|
28
20
|
const { query, path } = location;
|
|
29
21
|
const registry = useRegistry();
|
|
30
|
-
const currentDeviceType = useSelect(
|
|
31
|
-
( select ) => select( editorStore ).getDeviceType(),
|
|
32
|
-
[]
|
|
33
|
-
);
|
|
34
22
|
|
|
35
23
|
const onNavigateToEntityRecord = useCallback(
|
|
36
24
|
( params ) => {
|
|
@@ -56,37 +44,21 @@ export default function useNavigateToEntityRecord() {
|
|
|
56
44
|
// Store the selected block in the URL for restoration when navigating back.
|
|
57
45
|
if ( externalClientId ) {
|
|
58
46
|
urlUpdates.selectedBlock = externalClientId;
|
|
47
|
+
history.navigate( addQueryArgs( path, urlUpdates ), {
|
|
48
|
+
replace: true,
|
|
49
|
+
} );
|
|
59
50
|
}
|
|
60
51
|
|
|
61
|
-
//
|
|
62
|
-
//
|
|
52
|
+
// The width an entity is asked to be edited at is where it opens,
|
|
53
|
+
// not something the entity being left carries away: a width set from
|
|
54
|
+
// the device preview is view state, and an entity that asks for none
|
|
55
|
+
// opens at the default.
|
|
63
56
|
const requestedViewport =
|
|
64
57
|
typeof params.viewport === 'string'
|
|
65
58
|
? params.viewport.toLowerCase()
|
|
66
59
|
: undefined;
|
|
67
60
|
const isValidRequestedViewport =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if ( isValidRequestedViewport ) {
|
|
71
|
-
const currentViewportLower = (
|
|
72
|
-
currentDeviceType || DEFAULT_DEVICE_TYPE
|
|
73
|
-
).toLowerCase();
|
|
74
|
-
if (
|
|
75
|
-
currentViewportLower === DEFAULT_DEVICE_TYPE.toLowerCase()
|
|
76
|
-
) {
|
|
77
|
-
delete urlUpdates.viewport;
|
|
78
|
-
} else {
|
|
79
|
-
urlUpdates.viewport = currentViewportLower;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const hasUpdatesToSave =
|
|
84
|
-
externalClientId || isValidRequestedViewport;
|
|
85
|
-
if ( hasUpdatesToSave ) {
|
|
86
|
-
history.navigate( addQueryArgs( path, urlUpdates ), {
|
|
87
|
-
replace: true,
|
|
88
|
-
} );
|
|
89
|
-
}
|
|
61
|
+
isValidViewport( requestedViewport );
|
|
90
62
|
|
|
91
63
|
// Navigate to the new entity record
|
|
92
64
|
const queryArgs = {
|
|
@@ -103,7 +75,7 @@ export default function useNavigateToEntityRecord() {
|
|
|
103
75
|
|
|
104
76
|
history.navigate( url );
|
|
105
77
|
},
|
|
106
|
-
[ history, path, query, registry
|
|
78
|
+
[ history, path, query, registry ]
|
|
107
79
|
);
|
|
108
80
|
|
|
109
81
|
return onNavigateToEntityRecord;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useSelect } from '@wordpress/data';
|
|
5
2
|
import { useMemo } from '@wordpress/element';
|
|
6
3
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
@@ -10,10 +7,6 @@ import {
|
|
|
10
7
|
privateApis as editorPrivateApis,
|
|
11
8
|
} from '@wordpress/editor';
|
|
12
9
|
import { generateGlobalStyles } from '@wordpress/global-styles-engine';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
10
|
import { store as editSiteStore } from '../../store';
|
|
18
11
|
import { unlock } from '../../lock-unlock';
|
|
19
12
|
import useNavigateToEntityRecord from './use-navigate-to-entity-record';
|
|
@@ -98,7 +91,6 @@ export function useSpecificEditorSettings() {
|
|
|
98
91
|
__experimentalFeatures: globalSettings,
|
|
99
92
|
richEditingEnabled: true,
|
|
100
93
|
supportsTemplateMode: true,
|
|
101
|
-
focusMode: canvas !== 'view',
|
|
102
94
|
onNavigateToEntityRecord,
|
|
103
95
|
onNavigateToPreviousEntityRecord,
|
|
104
96
|
isPreviewMode: canvas === 'view',
|
|
@@ -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
|
+
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { ProgressBar } from '@wordpress/components';
|
|
5
2
|
import { store as coreStore } from '@wordpress/core-data';
|
|
6
3
|
import { useSelect } from '@wordpress/data';
|
|
7
4
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { unlock } from '../../lock-unlock';
|
|
13
6
|
|
|
14
7
|
const { useStyle } = unlock( editorPrivateApis );
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
2
|
import { pencil, drawerRight } from '@wordpress/icons';
|
|
6
3
|
import { useMemo } from '@wordpress/element';
|
|
@@ -8,10 +5,6 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
8
5
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
9
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
7
|
import { addQueryArgs } from '@wordpress/url';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
8
|
import { PATTERN_TYPES } from '../../utils/constants';
|
|
16
9
|
import { unlock } from '../../lock-unlock';
|
|
17
10
|
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
2
|
import { Button } from '@wordpress/components';
|
|
6
3
|
import { useInstanceId } from '@wordpress/compose';
|
|
7
4
|
import {
|
|
8
|
-
EditorKeyboardShortcutsRegister,
|
|
9
5
|
privateApis as editorPrivateApis,
|
|
10
6
|
store as editorStore,
|
|
11
7
|
} from '@wordpress/editor';
|
|
12
8
|
import { __, isRTL, sprintf } from '@wordpress/i18n';
|
|
13
9
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
14
|
-
import { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';
|
|
15
10
|
import { useCallback } from '@wordpress/element';
|
|
16
11
|
import { store as noticesStore } from '@wordpress/notices';
|
|
17
12
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
@@ -19,10 +14,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
19
14
|
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
20
15
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
21
16
|
import { addQueryArgs } from '@wordpress/url';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
17
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
26
18
|
import WelcomeGuide from '../welcome-guide';
|
|
27
19
|
import CanvasLoader from '../canvas-loader';
|
|
28
20
|
import { unlock } from '../../lock-unlock';
|
|
@@ -33,8 +25,9 @@ import SaveButton from '../save-button';
|
|
|
33
25
|
import SavePanel from '../save-panel';
|
|
34
26
|
import SiteEditorMoreMenu from '../more-menu';
|
|
35
27
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
36
|
-
import {
|
|
28
|
+
import { getDeviceType } from '../block-editor/viewport';
|
|
37
29
|
import useEditorTitle from './use-editor-title';
|
|
30
|
+
import useRevisionsURLSync from './use-revisions-url-sync';
|
|
38
31
|
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
39
32
|
import { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';
|
|
40
33
|
import {
|
|
@@ -45,7 +38,6 @@ import SitePreview from './site-preview';
|
|
|
45
38
|
|
|
46
39
|
const { Editor, BackButton } = unlock( editorPrivateApis );
|
|
47
40
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
48
|
-
const { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );
|
|
49
41
|
|
|
50
42
|
function getListPathForPostType( postType ) {
|
|
51
43
|
switch ( postType ) {
|
|
@@ -79,7 +71,7 @@ function getNavigationPath( location, postType ) {
|
|
|
79
71
|
) {
|
|
80
72
|
return getListPathForPostType( postType );
|
|
81
73
|
}
|
|
82
|
-
return addQueryArgs( path, { canvas: undefined } );
|
|
74
|
+
return addQueryArgs( path, { canvas: undefined, revision: undefined } );
|
|
83
75
|
}
|
|
84
76
|
|
|
85
77
|
export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
@@ -96,14 +88,19 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
96
88
|
( select ) => select( coreDataStore ).getCurrentTheme()?.is_block_theme,
|
|
97
89
|
[]
|
|
98
90
|
);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
const showIconLabels = useSelect(
|
|
92
|
+
( select ) =>
|
|
93
|
+
select( preferencesStore ).get( 'core', 'showIconLabels' ),
|
|
94
|
+
[]
|
|
103
95
|
);
|
|
96
|
+
const postWithTemplate = !! context?.postId;
|
|
97
|
+
const editorPostType = postWithTemplate ? context.postType : postType;
|
|
98
|
+
const editorPostId = postWithTemplate ? context.postId : postId;
|
|
99
|
+
useEditorTitle( editorPostType, editorPostId );
|
|
104
100
|
const _isPreviewingTheme = isPreviewingTheme();
|
|
105
101
|
const iframeProps = useEditorIframeProps();
|
|
106
102
|
const isEditMode = canvas === 'edit';
|
|
103
|
+
useRevisionsURLSync( isEditMode, editorPostType, editorPostId );
|
|
107
104
|
const loadingProgressId = useInstanceId(
|
|
108
105
|
CanvasLoader,
|
|
109
106
|
'edit-site-editor__loading-progress'
|
|
@@ -173,8 +170,6 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
173
170
|
<SitePreview />
|
|
174
171
|
) : (
|
|
175
172
|
<>
|
|
176
|
-
<EditorKeyboardShortcutsRegister />
|
|
177
|
-
{ isEditMode && <BlockKeyboardShortcuts /> }
|
|
178
173
|
{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }
|
|
179
174
|
{ isEditMode && isReady && (
|
|
180
175
|
<WelcomeGuide
|
|
@@ -194,13 +189,17 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
194
189
|
customSavePanel={ _isPreviewingTheme && <SavePanel /> }
|
|
195
190
|
iframeProps={ iframeProps }
|
|
196
191
|
onActionPerformed={ onActionPerformed }
|
|
192
|
+
initialViewport={
|
|
193
|
+
isEditMode
|
|
194
|
+
? getDeviceType( location.query.viewport )
|
|
195
|
+
: undefined
|
|
196
|
+
}
|
|
197
197
|
extraSidebarPanels={
|
|
198
198
|
! postWithTemplate && (
|
|
199
199
|
<PluginTemplateSettingPanel.Slot />
|
|
200
200
|
)
|
|
201
201
|
}
|
|
202
202
|
>
|
|
203
|
-
{ isEditMode && <ViewportSync /> }
|
|
204
203
|
{ isEditMode && (
|
|
205
204
|
<BackButton>
|
|
206
205
|
{ ( { length } ) =>
|
|
@@ -208,7 +207,7 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
208
207
|
<Button
|
|
209
208
|
size="compact"
|
|
210
209
|
label={ __( 'Open Navigation' ) }
|
|
211
|
-
showTooltip
|
|
210
|
+
showTooltip={ ! showIconLabels }
|
|
212
211
|
tooltipPosition="middle right"
|
|
213
212
|
onClick={ () => {
|
|
214
213
|
resetZoomLevel();
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
5
2
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
3
|
import { store as editorStore } from '@wordpress/editor';
|
|
7
4
|
import { useLayoutEffect } from '@wordpress/element';
|
|
8
5
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { DEFAULT_DEVICE_TYPE } from '../block-editor/use-viewport-sync';
|
|
6
|
+
import { DEFAULT_DEVICE_TYPE } from '../block-editor/viewport';
|
|
14
7
|
|
|
15
8
|
export function useAdaptEditorToCanvas( canvas ) {
|
|
16
9
|
const { clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { _x, sprintf } from '@wordpress/i18n';
|
|
5
2
|
import { useSelect } from '@wordpress/data';
|
|
6
3
|
import {
|
|
@@ -8,10 +5,6 @@ import {
|
|
|
8
5
|
privateApis as coreDataPrivateApis,
|
|
9
6
|
} from '@wordpress/core-data';
|
|
10
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
8
|
import useTitle from '../routes/use-title';
|
|
16
9
|
import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
17
10
|
import { unlock } from '../../lock-unlock';
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useEffect, useMemo, useRef } from '@wordpress/element';
|
|
5
2
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
3
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
7
4
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { store as editSiteStore } from '../../store';
|
|
13
6
|
import { unlock } from '../../lock-unlock';
|
|
14
7
|
import {
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
2
|
+
import { useEffect, useRef } from '@wordpress/element';
|
|
3
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
6
|
+
import { unlock } from '../../lock-unlock';
|
|
7
|
+
|
|
8
|
+
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Safari throws after more than 100 History API calls in 30 seconds.
|
|
12
|
+
*/
|
|
13
|
+
const URL_WRITE_DEBOUNCE_MS = 300;
|
|
14
|
+
|
|
15
|
+
export default function useRevisionsURLSync( enabled, postType, postId ) {
|
|
16
|
+
const location = useLocation();
|
|
17
|
+
const history = useHistory();
|
|
18
|
+
const { currentPostType, currentPostId, currentRevisionId } = useSelect(
|
|
19
|
+
( select ) => {
|
|
20
|
+
const editor = select( editorStore );
|
|
21
|
+
return {
|
|
22
|
+
currentPostType: editor.getCurrentPostType(),
|
|
23
|
+
currentPostId: editor.getCurrentPostId(),
|
|
24
|
+
currentRevisionId: unlock( editor ).getCurrentRevisionId(),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[]
|
|
28
|
+
);
|
|
29
|
+
const { openRevision, setCurrentRevisionId } = unlock(
|
|
30
|
+
useDispatch( editorStore )
|
|
31
|
+
);
|
|
32
|
+
const entityKey = postType && postId ? `${ postType }:${ postId }` : null;
|
|
33
|
+
const isCurrentEntity =
|
|
34
|
+
!! entityKey &&
|
|
35
|
+
currentPostType === postType &&
|
|
36
|
+
String( currentPostId ) === String( postId );
|
|
37
|
+
|
|
38
|
+
// The route can change before the editor store. Wait until both point to the
|
|
39
|
+
// same entity so a revision from the previous entity is not copied into the
|
|
40
|
+
// new URL.
|
|
41
|
+
const handledEntityKeyRef = useRef( null );
|
|
42
|
+
const lastURLWriteTimeRef = useRef( null );
|
|
43
|
+
useEffect( () => {
|
|
44
|
+
if ( ! enabled ) {
|
|
45
|
+
handledEntityKeyRef.current = null;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (
|
|
49
|
+
! isCurrentEntity ||
|
|
50
|
+
! entityKey ||
|
|
51
|
+
handledEntityKeyRef.current === entityKey
|
|
52
|
+
) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
lastURLWriteTimeRef.current = null;
|
|
57
|
+
handledEntityKeyRef.current = entityKey;
|
|
58
|
+
const revision = Number( location.query.revision );
|
|
59
|
+
if ( Number.isInteger( revision ) && revision > 0 ) {
|
|
60
|
+
openRevision( revision );
|
|
61
|
+
} else if ( currentRevisionId ) {
|
|
62
|
+
setCurrentRevisionId( null );
|
|
63
|
+
}
|
|
64
|
+
}, [
|
|
65
|
+
enabled,
|
|
66
|
+
isCurrentEntity,
|
|
67
|
+
entityKey,
|
|
68
|
+
location.query.revision,
|
|
69
|
+
currentRevisionId,
|
|
70
|
+
openRevision,
|
|
71
|
+
setCurrentRevisionId,
|
|
72
|
+
] );
|
|
73
|
+
|
|
74
|
+
useEffect( () => {
|
|
75
|
+
if (
|
|
76
|
+
! enabled ||
|
|
77
|
+
! isCurrentEntity ||
|
|
78
|
+
! entityKey ||
|
|
79
|
+
handledEntityKeyRef.current !== entityKey
|
|
80
|
+
) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if ( lastURLWriteTimeRef.current === null ) {
|
|
84
|
+
lastURLWriteTimeRef.current = Date.now();
|
|
85
|
+
}
|
|
86
|
+
const revisionArg = currentRevisionId
|
|
87
|
+
? String( currentRevisionId )
|
|
88
|
+
: undefined;
|
|
89
|
+
if ( location.query.revision === revisionArg ) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const write = async () => {
|
|
93
|
+
// Route matching can lag behind the address bar. Writing the stale
|
|
94
|
+
// match back would undo the navigation.
|
|
95
|
+
const addressBarArg =
|
|
96
|
+
new URLSearchParams( window.location.search ).get(
|
|
97
|
+
'revision'
|
|
98
|
+
) ?? undefined;
|
|
99
|
+
if ( addressBarArg !== location.query.revision ) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
lastURLWriteTimeRef.current = Date.now();
|
|
103
|
+
// Passing `undefined` removes `revision` without dropping the other
|
|
104
|
+
// query args.
|
|
105
|
+
try {
|
|
106
|
+
await history.navigate(
|
|
107
|
+
addQueryArgs( location.path, { revision: revisionArg } ),
|
|
108
|
+
{ replace: true }
|
|
109
|
+
);
|
|
110
|
+
} catch {
|
|
111
|
+
// Leave the URL unchanged. The effect can try again on the next
|
|
112
|
+
// state change.
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (
|
|
116
|
+
Date.now() - lastURLWriteTimeRef.current >=
|
|
117
|
+
URL_WRITE_DEBOUNCE_MS
|
|
118
|
+
) {
|
|
119
|
+
write();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const timeoutId = setTimeout( write, URL_WRITE_DEBOUNCE_MS );
|
|
123
|
+
return () => clearTimeout( timeoutId );
|
|
124
|
+
}, [
|
|
125
|
+
enabled,
|
|
126
|
+
isCurrentEntity,
|
|
127
|
+
entityKey,
|
|
128
|
+
currentRevisionId,
|
|
129
|
+
location,
|
|
130
|
+
history,
|
|
131
|
+
] );
|
|
132
|
+
}
|