@wordpress/edit-site 7.0.0 → 7.2.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 +8 -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.map +2 -2
- package/build/components/block-editor/use-site-editor-settings.cjs.map +2 -2
- package/build/components/block-editor/use-viewport-sync.cjs.map +2 -2
- package/build/components/canvas-loader/index.cjs +8 -3
- package/build/components/canvas-loader/index.cjs.map +3 -3
- package/build/components/dataviews-actions/index.cjs.map +2 -2
- package/build/components/editor/index.cjs +6 -5
- 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.map +2 -2
- package/build/components/editor/use-editor-title.cjs +1 -2
- package/build/components/editor/use-editor-title.cjs.map +3 -3
- 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 +0 -1
- 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.map +2 -2
- package/build/components/more-menu/site-export.cjs.map +2 -2
- 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 +3 -3
- package/build/components/save-button/index.cjs.map +3 -3
- 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 +7 -4
- package/build/components/save-panel/index.cjs.map +3 -3
- 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.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 +3 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +3 -3
- 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.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.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 +17 -12
- 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.map +2 -2
- package/build-module/components/block-editor/use-site-editor-settings.mjs.map +2 -2
- package/build-module/components/block-editor/use-viewport-sync.mjs.map +2 -2
- package/build-module/components/canvas-loader/index.mjs +9 -7
- 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 +6 -5
- 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.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +5 -3
- 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 +0 -1
- 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.map +2 -2
- package/build-module/components/more-menu/site-export.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 +6 -6
- 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 +9 -7
- 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.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 +2 -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.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.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 +17 -12
- 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 +79 -22
- package/build-style/style.css +79 -22
- package/package.json +48 -49
- 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 +0 -7
- package/src/components/block-editor/use-site-editor-settings.js +0 -7
- package/src/components/block-editor/use-viewport-sync.js +0 -7
- package/src/components/canvas-loader/index.js +6 -17
- package/src/components/canvas-loader/style.scss +3 -4
- package/src/components/dataviews-actions/index.js +0 -7
- package/src/components/editor/index.js +6 -12
- package/src/components/editor/site-preview.js +0 -3
- package/src/components/editor/use-adapt-editor-to-canvas.js +0 -7
- package/src/components/editor/use-editor-title.js +5 -10
- 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 +0 -12
- package/src/components/media/index.js +0 -3
- package/src/components/more-menu/index.js +0 -7
- package/src/components/more-menu/site-export.js +0 -3
- 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 +6 -13
- 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 +9 -18
- 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 +0 -8
- 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 +2 -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 +0 -7
- 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 +0 -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 +19 -18
- 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/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
|
@@ -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,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useSelect, 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
8
|
import { DEFAULT_DEVICE_TYPE } from './use-viewport-sync';
|
|
16
9
|
|
|
@@ -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';
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useEffect } from '@wordpress/element';
|
|
5
2
|
import { useDispatch } from '@wordpress/data';
|
|
6
3
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
7
4
|
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
5
|
import { unlock } from '../../lock-unlock';
|
|
13
6
|
|
|
14
7
|
const { useLocation } = unlock( routerPrivateApis );
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
privateApis as componentsPrivateApis,
|
|
6
|
-
ProgressBar,
|
|
7
|
-
} from '@wordpress/components';
|
|
1
|
+
import { ProgressBar } from '@wordpress/components';
|
|
8
2
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
3
|
import { useSelect } from '@wordpress/data';
|
|
10
4
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
5
|
import { unlock } from '../../lock-unlock';
|
|
16
6
|
|
|
17
|
-
const { Theme } = unlock( componentsPrivateApis );
|
|
18
7
|
const { useStyle } = unlock( editorPrivateApis );
|
|
19
8
|
|
|
20
9
|
export default function CanvasLoader( { id } ) {
|
|
21
10
|
const textColor = useStyle( 'color.text' );
|
|
22
|
-
const backgroundColor = useStyle( 'color.background' );
|
|
23
11
|
const { elapsed, total } = useSelect( ( select ) => {
|
|
24
12
|
const selectorsByStatus = select( coreStore ).countSelectorsByStatus();
|
|
25
13
|
const resolving = selectorsByStatus.resolving ?? 0;
|
|
@@ -31,10 +19,11 @@ export default function CanvasLoader( { id } ) {
|
|
|
31
19
|
}, [] );
|
|
32
20
|
|
|
33
21
|
return (
|
|
34
|
-
<div
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
<div
|
|
23
|
+
className="edit-site-canvas-loader"
|
|
24
|
+
style={ textColor ? { '--color': textColor } : undefined }
|
|
25
|
+
>
|
|
26
|
+
<ProgressBar id={ id } max={ total } value={ elapsed } />
|
|
38
27
|
</div>
|
|
39
28
|
);
|
|
40
29
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.edit-site-canvas-loader {
|
|
2
|
+
// TODO: Use design tokens with ThemeProvider.
|
|
3
|
+
--wp-components-color-foreground: var(--color);
|
|
4
|
+
|
|
2
5
|
width: 100%;
|
|
3
6
|
height: 100%;
|
|
4
7
|
display: flex;
|
|
@@ -13,10 +16,6 @@
|
|
|
13
16
|
animation: 0.5s ease 0.2s edit-site-canvas-loader__fade-in-animation;
|
|
14
17
|
animation-fill-mode: forwards;
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
& > div {
|
|
18
|
-
width: 160px;
|
|
19
|
-
}
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
@keyframes edit-site-canvas-loader__fade-in-animation {
|
|
@@ -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,6 +1,3 @@
|
|
|
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';
|
|
@@ -19,10 +16,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
19
16
|
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
20
17
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
21
18
|
import { addQueryArgs } from '@wordpress/url';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
19
|
import WelcomeGuide from '../welcome-guide';
|
|
27
20
|
import CanvasLoader from '../canvas-loader';
|
|
28
21
|
import { unlock } from '../../lock-unlock';
|
|
@@ -35,6 +28,7 @@ import SiteEditorMoreMenu from '../more-menu';
|
|
|
35
28
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
36
29
|
import { ViewportSync } from '../block-editor/use-viewport-sync';
|
|
37
30
|
import useEditorTitle from './use-editor-title';
|
|
31
|
+
import useRevisionsURLSync from './use-revisions-url-sync';
|
|
38
32
|
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
39
33
|
import { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';
|
|
40
34
|
import {
|
|
@@ -79,7 +73,7 @@ function getNavigationPath( location, postType ) {
|
|
|
79
73
|
) {
|
|
80
74
|
return getListPathForPostType( postType );
|
|
81
75
|
}
|
|
82
|
-
return addQueryArgs( path, { canvas: undefined } );
|
|
76
|
+
return addQueryArgs( path, { canvas: undefined, revision: undefined } );
|
|
83
77
|
}
|
|
84
78
|
|
|
85
79
|
export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
@@ -97,13 +91,13 @@ export default function EditSiteEditor( { isHomeRoute = false } ) {
|
|
|
97
91
|
[]
|
|
98
92
|
);
|
|
99
93
|
const postWithTemplate = !! context?.postId;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
);
|
|
94
|
+
const editorPostType = postWithTemplate ? context.postType : postType;
|
|
95
|
+
const editorPostId = postWithTemplate ? context.postId : postId;
|
|
96
|
+
useEditorTitle( editorPostType, editorPostId );
|
|
104
97
|
const _isPreviewingTheme = isPreviewingTheme();
|
|
105
98
|
const iframeProps = useEditorIframeProps();
|
|
106
99
|
const isEditMode = canvas === 'edit';
|
|
100
|
+
useRevisionsURLSync( isEditMode, editorPostType, editorPostId );
|
|
107
101
|
const loadingProgressId = useInstanceId(
|
|
108
102
|
CanvasLoader,
|
|
109
103
|
'edit-site-editor__loading-progress'
|
|
@@ -1,15 +1,8 @@
|
|
|
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
6
|
import { DEFAULT_DEVICE_TYPE } from '../block-editor/use-viewport-sync';
|
|
14
7
|
|
|
15
8
|
export function useAdaptEditorToCanvas( canvas ) {
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { _x, sprintf } from '@wordpress/i18n';
|
|
5
2
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
store as coreStore,
|
|
5
|
+
privateApis as coreDataPrivateApis,
|
|
6
|
+
} from '@wordpress/core-data';
|
|
7
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
8
|
import useTitle from '../routes/use-title';
|
|
14
9
|
import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
15
10
|
import { unlock } from '../../lock-unlock';
|
|
16
11
|
|
|
17
|
-
const { getTemplateInfo } = unlock(
|
|
12
|
+
const { getTemplateInfo } = unlock( coreDataPrivateApis );
|
|
18
13
|
|
|
19
14
|
function useEditorTitle( postType, postId ) {
|
|
20
15
|
const { title, isLoaded } = useSelect(
|
|
@@ -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
|
+
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';
|
|
10
3
|
import {
|
|
11
4
|
__unstableMotion as motion,
|
|
@@ -34,10 +27,6 @@ import { SnackbarNotices, store as noticesStore } from '@wordpress/notices';
|
|
|
34
27
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
35
28
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
36
29
|
import { Tooltip } from '@wordpress/ui';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Internal dependencies
|
|
40
|
-
*/
|
|
41
30
|
import { SiteHubMobile } from '../site-hub';
|
|
42
31
|
import ResizableFrame from '../resizable-frame';
|
|
43
32
|
import { unlock } from '../../lock-unlock';
|
|
@@ -104,7 +93,6 @@ function Layout() {
|
|
|
104
93
|
{ canvas === 'view' && <SaveKeyboardShortcut /> }
|
|
105
94
|
<div
|
|
106
95
|
{ ...navigateRegionsProps }
|
|
107
|
-
ref={ navigateRegionsProps.ref }
|
|
108
96
|
className={ clsx(
|
|
109
97
|
'edit-site-layout',
|
|
110
98
|
navigateRegionsProps.className,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import SiteExport from './site-export';
|
|
10
3
|
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
11
4
|
import { unlock } from '../../lock-unlock';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { DropdownMenu, MenuGroup } from '@wordpress/components';
|
|
5
2
|
import { __ } from '@wordpress/i18n';
|
|
6
3
|
import { moreVertical } from '@wordpress/icons';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import AddNewPattern from '../add-new-pattern';
|
|
12
5
|
import RenameCategoryMenuItem from './rename-category-menu-item';
|
|
13
6
|
import DeleteCategoryMenuItem from './delete-category-menu-item';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import {
|
|
5
2
|
MenuItem,
|
|
6
3
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
@@ -12,10 +9,6 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
9
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
13
10
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
12
|
import { unlock } from '../../lock-unlock';
|
|
20
13
|
import { PATTERN_TYPES, PATTERN_DEFAULT_CATEGORY } from '../../utils/constants';
|
|
21
14
|
|