@wordpress/edit-site 6.34.0 → 6.34.1-next.2f1c7c01b.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/build/components/add-new-pattern/index.js +6 -4
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +3 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +4 -2
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +7 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +14 -12
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +4 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +3 -1
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +3 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +3 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js +5 -3
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/dataviews-actions/index.js +5 -3
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +8 -6
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/site-preview.js +3 -1
- package/build/components/editor/site-preview.js.map +1 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +2 -0
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -1
- package/build/components/editor/use-editor-title.js +3 -1
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +5 -3
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build/components/layout/animation.js +3 -1
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/hooks.js +3 -1
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +6 -4
- package/build/components/layout/index.js.map +1 -1
- package/build/components/media/index.js +3 -1
- package/build/components/media/index.js.map +1 -1
- package/build/components/more-menu/index.js +4 -2
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/site-export.js +3 -1
- package/build/components/more-menu/site-export.js.map +1 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +3 -1
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/page-patterns/actions.js +3 -1
- package/build/components/page-patterns/actions.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +4 -2
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +8 -6
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +9 -7
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js +4 -2
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +10 -8
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +2 -0
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +8 -6
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js +3 -1
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-templates/fields.js +14 -12
- package/build/components/page-templates/fields.js.map +2 -2
- package/build/components/page-templates/hooks.js +2 -0
- package/build/components/page-templates/hooks.js.map +1 -1
- package/build/components/page-templates/index.js +16 -11
- package/build/components/page-templates/index.js.map +2 -2
- package/build/components/page-templates/view-utils.js +8 -2
- package/build/components/page-templates/view-utils.js.map +2 -2
- package/build/components/pagination/index.js +3 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +5 -3
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/post-edit/index.js +5 -3
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +8 -6
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/post-list/view-utils.js +5 -3
- package/build/components/post-list/view-utils.js.map +1 -1
- package/build/components/posts-app/index.js +4 -2
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +3 -1
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/posts-app-routes/post-item.js +4 -2
- package/build/components/posts-app-routes/post-item.js.map +1 -1
- package/build/components/posts-app-routes/posts.js +5 -3
- package/build/components/posts-app-routes/posts.js.map +1 -1
- package/build/components/resizable-frame/index.js +10 -8
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/routes/use-title.js +3 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +4 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +3 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +3 -1
- package/build/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build/components/save-panel/index.js +7 -5
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +4 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +3 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +4 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -2
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles/index.js +7 -5
- package/build/components/sidebar-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +4 -2
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +4 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +3 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +4 -2
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +3 -1
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +5 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +5 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +4 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +4 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +2 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +4 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -2
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +2 -0
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +2 -0
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +3 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -0
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +5 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.js +3 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.js.map +1 -1
- package/build/components/site-editor-routes/home.js +4 -2
- package/build/components/site-editor-routes/home.js.map +1 -1
- package/build/components/site-editor-routes/index.js +3 -1
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +5 -3
- package/build/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build/components/site-editor-routes/navigation.js +5 -3
- package/build/components/site-editor-routes/navigation.js.map +1 -1
- package/build/components/site-editor-routes/notfound.js +4 -2
- package/build/components/site-editor-routes/notfound.js.map +1 -1
- package/build/components/site-editor-routes/page-item.js +4 -2
- package/build/components/site-editor-routes/page-item.js.map +1 -1
- package/build/components/site-editor-routes/pages.js +5 -3
- package/build/components/site-editor-routes/pages.js.map +1 -1
- package/build/components/site-editor-routes/pattern-item.js +4 -2
- package/build/components/site-editor-routes/pattern-item.js.map +1 -1
- package/build/components/site-editor-routes/patterns.js +4 -2
- package/build/components/site-editor-routes/patterns.js.map +1 -1
- package/build/components/site-editor-routes/stylebook.js +5 -3
- package/build/components/site-editor-routes/stylebook.js.map +1 -1
- package/build/components/site-editor-routes/styles.js +6 -4
- package/build/components/site-editor-routes/styles.js.map +1 -1
- package/build/components/site-editor-routes/template-item.js +5 -3
- package/build/components/site-editor-routes/template-item.js.map +1 -1
- package/build/components/site-editor-routes/template-part-item.js +4 -2
- package/build/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build/components/site-editor-routes/templates.js +4 -2
- package/build/components/site-editor-routes/templates.js.map +1 -1
- package/build/components/site-editor-routes/utils.js +2 -0
- package/build/components/site-editor-routes/utils.js.map +1 -1
- package/build/components/site-hub/index.js +6 -4
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +3 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +3 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +2 -0
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +3 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +3 -1
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +3 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +5 -3
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +7 -5
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +4 -2
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +3 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/posts.js +3 -1
- package/build/posts.js.map +1 -1
- package/build/store/actions.js +14 -12
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +3 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +2 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +2 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +2 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +11 -9
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +18 -16
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js +3 -1
- package/build/utils/get-filtered-template-parts.js.map +1 -1
- package/build/utils/is-previewing-theme.js +2 -0
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-removable.js +2 -0
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js +2 -0
- package/build/utils/is-template-revertable.js.map +2 -2
- package/build/utils/use-activate-theme.js +3 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-actual-current-theme.js +3 -1
- package/build/utils/use-actual-current-theme.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +5 -4
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +2 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +2 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -2
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +6 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +13 -12
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +3 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +2 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +2 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +2 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js +4 -3
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +4 -3
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +7 -6
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/site-preview.js +2 -1
- package/build-module/components/editor/site-preview.js.map +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +1 -0
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +2 -1
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +4 -3
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build-module/components/layout/animation.js +2 -1
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/hooks.js +2 -1
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +5 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/media/index.js +2 -1
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +3 -2
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/site-export.js +2 -1
- package/build-module/components/more-menu/site-export.js.map +1 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +2 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/actions.js +2 -1
- package/build-module/components/page-patterns/actions.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +3 -2
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +7 -6
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +8 -7
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +3 -2
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +11 -10
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +7 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js +2 -1
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-templates/fields.js +13 -12
- package/build-module/components/page-templates/fields.js.map +2 -2
- package/build-module/components/page-templates/hooks.js +1 -0
- package/build-module/components/page-templates/hooks.js.map +1 -1
- package/build-module/components/page-templates/index.js +15 -11
- package/build-module/components/page-templates/index.js.map +2 -2
- package/build-module/components/page-templates/view-utils.js +7 -2
- package/build-module/components/page-templates/view-utils.js.map +2 -2
- package/build-module/components/pagination/index.js +2 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +4 -3
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +4 -3
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +7 -6
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/post-list/view-utils.js +4 -3
- package/build-module/components/post-list/view-utils.js.map +1 -1
- package/build-module/components/posts-app/index.js +3 -2
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +2 -1
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/posts-app-routes/post-item.js +3 -2
- package/build-module/components/posts-app-routes/post-item.js.map +1 -1
- package/build-module/components/posts-app-routes/posts.js +4 -3
- package/build-module/components/posts-app-routes/posts.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +9 -8
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/routes/use-title.js +2 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +2 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +2 -1
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +6 -5
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +3 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +3 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles/index.js +6 -5
- package/build-module/components/sidebar-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +3 -2
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +3 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +4 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +4 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +5 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +2 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +4 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +1 -1
- package/build-module/components/site-editor-routes/home.js +3 -2
- package/build-module/components/site-editor-routes/home.js.map +1 -1
- package/build-module/components/site-editor-routes/index.js +2 -1
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +4 -3
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation.js +4 -3
- package/build-module/components/site-editor-routes/navigation.js.map +1 -1
- package/build-module/components/site-editor-routes/notfound.js +3 -2
- package/build-module/components/site-editor-routes/notfound.js.map +1 -1
- package/build-module/components/site-editor-routes/page-item.js +3 -2
- package/build-module/components/site-editor-routes/page-item.js.map +1 -1
- package/build-module/components/site-editor-routes/pages.js +4 -3
- package/build-module/components/site-editor-routes/pages.js.map +1 -1
- package/build-module/components/site-editor-routes/pattern-item.js +3 -2
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -1
- package/build-module/components/site-editor-routes/patterns.js +3 -2
- package/build-module/components/site-editor-routes/patterns.js.map +1 -1
- package/build-module/components/site-editor-routes/stylebook.js +4 -3
- package/build-module/components/site-editor-routes/stylebook.js.map +1 -1
- package/build-module/components/site-editor-routes/styles.js +5 -4
- package/build-module/components/site-editor-routes/styles.js.map +1 -1
- package/build-module/components/site-editor-routes/template-item.js +4 -3
- package/build-module/components/site-editor-routes/template-item.js.map +1 -1
- package/build-module/components/site-editor-routes/template-part-item.js +3 -2
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
- package/build-module/components/site-editor-routes/templates.js +3 -2
- package/build-module/components/site-editor-routes/templates.js.map +1 -1
- package/build-module/components/site-editor-routes/utils.js +1 -0
- package/build-module/components/site-editor-routes/utils.js.map +1 -1
- package/build-module/components/site-hub/index.js +5 -4
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +2 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +2 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +1 -0
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +2 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +2 -1
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +2 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +4 -3
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +6 -5
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +3 -2
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/index.js +7 -6
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js +2 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/posts.js +2 -1
- package/build-module/posts.js.map +1 -1
- package/build-module/store/actions.js +13 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +2 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +3 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +1 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +17 -16
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js +2 -1
- package/build-module/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-removable.js +1 -0
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +1 -0
- package/build-module/utils/is-template-revertable.js.map +2 -2
- package/build-module/utils/use-activate-theme.js +2 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-actual-current-theme.js +2 -1
- package/build-module/utils/use-actual-current-theme.js.map +1 -1
- package/package.json +46 -46
- package/src/components/page-templates/fields.js +3 -3
- package/src/components/page-templates/index.js +11 -7
- package/src/components/page-templates/view-utils.js +7 -0
- package/src/utils/is-template-revertable.js +1 -2
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/block-editor/use-editor-iframe-props.js
|
|
29
31
|
var use_editor_iframe_props_exports = {};
|
|
30
32
|
__export(use_editor_iframe_props_exports, {
|
|
31
33
|
default: () => useEditorIframeProps
|
|
@@ -40,7 +42,7 @@ var import_editor = require("@wordpress/editor");
|
|
|
40
42
|
var import_router = require("@wordpress/router");
|
|
41
43
|
var import_url = require("@wordpress/url");
|
|
42
44
|
var import_lock_unlock = require("../../lock-unlock");
|
|
43
|
-
|
|
45
|
+
var { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
44
46
|
function useEditorIframeProps() {
|
|
45
47
|
const { query, path } = useLocation();
|
|
46
48
|
const history = useHistory();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-editor/use-editor-iframe-props.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function useEditorIframeProps() {\n\tconst { query, path } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = query;\n\tconst currentPostIsTrashed = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPostAttribute( 'status' ) ===\n\t\t\t'trash'\n\t\t);\n\t}, [] );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( canvas === 'edit' ) {\n\t\t\tsetIsFocused( false );\n\t\t}\n\t}, [ canvas ] );\n\n\t// In view mode, make the canvas iframe be perceived and behave as a button\n\t// to switch to edit mode, with a meaningful label and no title attribute.\n\tconst viewModeIframeProps = {\n\t\t'aria-label': __( 'Edit' ),\n\t\t'aria-disabled': currentPostIsTrashed,\n\t\ttitle: null,\n\t\trole: 'button',\n\t\ttabIndex: 0,\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tconst { keyCode } = event;\n\t\t\tif (\n\t\t\t\t( keyCode === ENTER || keyCode === SPACE ) &&\n\t\t\t\t! currentPostIsTrashed\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\thistory.navigate( addQueryArgs( path, { canvas: 'edit' } ), {\n\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\tonClick: () =>\n\t\t\thistory.navigate( addQueryArgs( path, { canvas: 'edit' } ), {\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t} ),\n\t\tonClickCapture: ( event ) => {\n\t\t\tif ( currentPostIsTrashed ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\treturn {\n\t\tclassName: clsx( 'edit-site-visual-editor__editor-canvas', {\n\t\t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AAA,MACH;AAAA,IACD;AAAA,IACA,SAAS,MACR,QAAQ,aAAU,yBAAc,MAAM,EAAE,QAAQ,OAAO,CAAE,GAAG;AAAA,MAC3D,YAAY;AAAA,IACb,CAAE;AAAA,IACH,gBAAgB,CAAE,UAAW;AAC5B,UAAK,sBAAuB;AAC3B,cAAM,eAAe;AACrB,cAAM,gBAAgB;AAAA,MACvB;AAAA,IACD;AAAA,IACA,UAAU;AAAA,EACX;AAEA,SAAO;AAAA,IACN,eAAW,YAAAC,SAAM,0CAA0C;AAAA,MAC1D,cAAc,aAAa,WAAW;AAAA,IACvC,CAAE;AAAA,IACF,GAAK,WAAW,SAAS,sBAAsB,CAAC;AAAA,EACjD;AACD;",
|
|
6
6
|
"names": ["routerPrivateApis", "editorStore", "clsx"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/block-editor/use-navigate-to-entity-record.js
|
|
19
21
|
var use_navigate_to_entity_record_exports = {};
|
|
20
22
|
__export(use_navigate_to_entity_record_exports, {
|
|
21
23
|
default: () => useNavigateToEntityRecord
|
|
@@ -24,7 +26,7 @@ module.exports = __toCommonJS(use_navigate_to_entity_record_exports);
|
|
|
24
26
|
var import_router = require("@wordpress/router");
|
|
25
27
|
var import_element = require("@wordpress/element");
|
|
26
28
|
var import_lock_unlock = require("../../lock-unlock");
|
|
27
|
-
|
|
29
|
+
var { useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
28
30
|
function useNavigateToEntityRecord() {
|
|
29
31
|
const history = useHistory();
|
|
30
32
|
const onNavigateToEntityRecord = (0, import_element.useCallback)(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-editor/use-navigate-to-entity-record.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function useNavigateToEntityRecord() {\n\tconst history = useHistory();\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\thistory.navigate(\n\t\t\t\t`/${ params.postType }/${ params.postId }?canvas=edit&focusMode=true`\n\t\t\t);\n\t\t},\n\t\t[ history ]\n\t);\n\n\treturn onNavigateToEntityRecord;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,qBAA4B;AAK5B,yBAAuB;AAEvB,IAAM,EAAE,WAAW,QAAI,2BAAQ,cAAAA,WAAkB;AAElC,SAAR,4BAA6C;AACnD,QAAM,UAAU,WAAW;AAE3B,QAAM,+BAA2B;AAAA,IAChC,CAAE,WAAY;AACb,cAAQ;AAAA,QACP,IAAK,OAAO,QAAS,IAAK,OAAO,MAAO;AAAA,MACzC;AAAA,IACD;AAAA,IACA,CAAE,OAAQ;AAAA,EACX;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": ["routerPrivateApis"]
|
|
7
7
|
}
|
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/block-editor/use-site-editor-settings.js
|
|
29
31
|
var use_site_editor_settings_exports = {};
|
|
30
32
|
__export(use_site_editor_settings_exports, {
|
|
31
33
|
useSpecificEditorSettings: () => useSpecificEditorSettings
|
|
@@ -40,7 +42,7 @@ var import_store = require("../../store");
|
|
|
40
42
|
var import_lock_unlock = require("../../lock-unlock");
|
|
41
43
|
var import_use_navigate_to_entity_record = __toESM(require("./use-navigate-to-entity-record"));
|
|
42
44
|
var import_constants = require("../../utils/constants");
|
|
43
|
-
|
|
45
|
+
var { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
44
46
|
function useNavigateToPreviousEntityRecord() {
|
|
45
47
|
const location = useLocation();
|
|
46
48
|
const previousLocation = (0, import_compose.usePrevious)(location);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-editor/use-site-editor-settings.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { usePrevious } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useNavigateToEntityRecord from './use-navigate-to-entity-record';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction useNavigateToPreviousEntityRecord() {\n\tconst location = useLocation();\n\tconst previousLocation = usePrevious( location );\n\tconst history = useHistory();\n\tconst goBack = useMemo( () => {\n\t\tconst isFocusMode =\n\t\t\tlocation.query.focusMode ||\n\t\t\t( location?.params?.postId &&\n\t\t\t\tFOCUSABLE_ENTITIES.includes( location?.params?.postType ) );\n\t\tconst didComeFromEditorCanvas =\n\t\t\tpreviousLocation?.query.canvas === 'edit';\n\t\tconst showBackButton = isFocusMode && didComeFromEditorCanvas;\n\t\treturn showBackButton ? () => history.back() : undefined;\n\t\t// `previousLocation` changes when the component updates for any reason, not\n\t\t// just when location changes. Until this is fixed we can't add it to deps. See\n\t\t// https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.\n\t}, [ location, history ] );\n\treturn goBack;\n}\n\nexport function useSpecificEditorSettings() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst onNavigateToEntityRecord = useNavigateToEntityRecord();\n\tconst { settings, currentPostIsTrashed } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( editSiteStore );\n\t\tconst { getCurrentPostAttribute } = select( editorStore );\n\t\treturn {\n\t\t\tsettings: getSettings(),\n\t\t\tcurrentPostIsTrashed:\n\t\t\t\tgetCurrentPostAttribute( 'status' ) === 'trash',\n\t\t};\n\t}, [] );\n\n\tconst onNavigateToPreviousEntityRecord =\n\t\tuseNavigateToPreviousEntityRecord();\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\t\t\tstyles: [\n\t\t\t\t...settings.styles,\n\t\t\t\t{\n\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\tcss:\n\t\t\t\t\t\tcanvas === 'view'\n\t\t\t\t\t\t\t? `body{min-height: 100vh; ${\n\t\t\t\t\t\t\t\t\tcurrentPostIsTrashed\n\t\t\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t\t\t: 'cursor: pointer;'\n\t\t\t\t\t\t\t }}`\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t],\n\t\t\trichEditingEnabled: true,\n\t\t\tsupportsTemplateMode: true,\n\t\t\tfocusMode: canvas !== 'view',\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tisPreviewMode: canvas === 'view',\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tcanvas,\n\t\tcurrentPostIsTrashed,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t] );\n\n\treturn defaultEditorSettings;\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A,QACP,GAAG,SAAS;AAAA,QACZ;AAAA;AAAA;AAAA,UAGC,KACC,WAAW,SACR,2BACA,uBACG,KACA,kBACH,MACA;AAAA,QACL;AAAA,MACD;AAAA,MACA,oBAAoB;AAAA,MACpB,sBAAsB;AAAA,MACtB,WAAW,WAAW;AAAA,MACtB;AAAA,MACA;AAAA,MACA,eAAe,WAAW;AAAA,IAC3B;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO;AACR;",
|
|
6
6
|
"names": ["routerPrivateApis", "useNavigateToEntityRecord", "editSiteStore", "editorStore"]
|
|
7
7
|
}
|
|
@@ -16,19 +16,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/canvas-loader/index.js
|
|
19
21
|
var canvas_loader_exports = {};
|
|
20
22
|
__export(canvas_loader_exports, {
|
|
21
23
|
default: () => CanvasLoader
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(canvas_loader_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_components = require("@wordpress/components");
|
|
26
27
|
var import_core_data = require("@wordpress/core-data");
|
|
27
28
|
var import_data = require("@wordpress/data");
|
|
28
29
|
var import_editor = require("@wordpress/editor");
|
|
29
30
|
var import_lock_unlock = require("../../lock-unlock");
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var { Theme } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
33
|
+
var { useStyle } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
32
34
|
function CanvasLoader({ id }) {
|
|
33
35
|
const textColor = useStyle("color.text");
|
|
34
36
|
const backgroundColor = useStyle("color.background");
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/canvas-loader/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as componentsPrivateApis,\n\tProgressBar,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { Theme } = unlock( componentsPrivateApis );\nconst { useStyle } = unlock( editorPrivateApis );\n\nexport default function CanvasLoader( { id } ) {\n\tconst textColor = useStyle( 'color.text' );\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst { elapsed, total } = useSelect( ( select ) => {\n\t\tconst selectorsByStatus = select( coreStore ).countSelectorsByStatus();\n\t\tconst resolving = selectorsByStatus.resolving ?? 0;\n\t\tconst finished = selectorsByStatus.finished ?? 0;\n\t\treturn {\n\t\t\telapsed: finished,\n\t\t\ttotal: finished + resolving,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<div className=\"edit-site-canvas-loader\">\n\t\t\t<Theme accent={ textColor } background={ backgroundColor }>\n\t\t\t\t<ProgressBar id={ id } max={ total } value={ elapsed } />\n\t\t\t</Theme>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,uBAAmC;AACnC,kBAA0B;AAC1B,oBAAiD;AAKjD,yBAAuB;AAqBnB;AAnBJ,IAAM,EAAE,MAAM,QAAI,2BAAQ,kBAAAA,WAAsB;AAChD,IAAM,EAAE,SAAS,QAAI,2BAAQ,cAAAC,WAAkB;AAEhC,SAAR,aAA+B,EAAE,GAAG,GAAI;AAC9C,QAAM,YAAY,SAAU,YAAa;AACzC,QAAM,kBAAkB,SAAU,kBAAmB;AACrD,QAAM,EAAE,SAAS,MAAM,QAAI,uBAAW,CAAE,WAAY;AACnD,UAAM,oBAAoB,OAAQ,iBAAAC,KAAU,EAAE,uBAAuB;AACrE,UAAM,YAAY,kBAAkB,aAAa;AACjD,UAAM,WAAW,kBAAkB,YAAY;AAC/C,WAAO;AAAA,MACN,SAAS;AAAA,MACT,OAAO,WAAW;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SACC,4CAAC,SAAI,WAAU,2BACd,sDAAC,SAAM,QAAS,WAAY,YAAa,iBACxC,sDAAC,iCAAY,IAAU,KAAM,OAAQ,OAAQ,SAAU,GACxD,GACD;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "editorPrivateApis", "coreStore"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/dataviews-actions/index.js
|
|
19
21
|
var dataviews_actions_exports = {};
|
|
20
22
|
__export(dataviews_actions_exports, {
|
|
21
23
|
useEditPostAction: () => useEditPostAction,
|
|
@@ -30,8 +32,8 @@ var import_data = require("@wordpress/data");
|
|
|
30
32
|
var import_core_data = require("@wordpress/core-data");
|
|
31
33
|
var import_constants = require("../../utils/constants");
|
|
32
34
|
var import_lock_unlock = require("../../lock-unlock");
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
var { useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
36
|
+
var useSetActiveTemplateAction = () => {
|
|
35
37
|
const activeTheme = (0, import_data.useSelect)(
|
|
36
38
|
(select) => select(import_core_data.store).getCurrentTheme()
|
|
37
39
|
);
|
|
@@ -80,7 +82,7 @@ const useSetActiveTemplateAction = () => {
|
|
|
80
82
|
]
|
|
81
83
|
);
|
|
82
84
|
};
|
|
83
|
-
|
|
85
|
+
var useEditPostAction = () => {
|
|
84
86
|
const history = useHistory();
|
|
85
87
|
return (0, import_element.useMemo)(
|
|
86
88
|
() => ({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataviews-actions/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { PATTERN_TYPES } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport const useSetActiveTemplateAction = () => {\n\tconst activeTheme = useSelect( ( select ) =>\n\t\tselect( coreStore ).getCurrentTheme()\n\t);\n\tconst { getEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( coreStore );\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'set-active-template',\n\t\t\tlabel( items ) {\n\t\t\t\treturn items.some( ( item ) => item._isActive )\n\t\t\t\t\t? __( 'Deactivate' )\n\t\t\t\t\t: __( 'Activate' );\n\t\t\t},\n\t\t\tisPrimary: true,\n\t\t\ticon: pencil,\n\t\t\tisEligible( item ) {\n\t\t\t\tif ( item.theme !== activeTheme.stylesheet ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// If it's not a created template but a registered template,\n\t\t\t\t// only allow activating (so when it's inactive).\n\t\t\t\tif ( typeof item.id !== 'number' ) {\n\t\t\t\t\treturn item._isActive === false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tasync callback( items ) {\n\t\t\t\tconst deactivate = items.some( ( item ) => item._isActive );\n\t\t\t\t// current active templates\n\t\t\t\tconst activeTemplates = {\n\t\t\t\t\t...( ( await getEntityRecord( 'root', 'site' )\n\t\t\t\t\t\t.active_templates ) ?? {} ),\n\t\t\t\t};\n\t\t\t\tfor ( const item of items ) {\n\t\t\t\t\tif ( deactivate ) {\n\t\t\t\t\t\tdelete activeTemplates[ item.slug ];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tactiveTemplates[ item.slug ] = item.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait editEntityRecord( 'root', 'site', undefined, {\n\t\t\t\t\tactive_templates: activeTemplates,\n\t\t\t\t} );\n\t\t\t\tawait saveEditedEntityRecord( 'root', 'site' );\n\t\t\t},\n\t\t} ),\n\t\t[\n\t\t\teditEntityRecord,\n\t\t\tsaveEditedEntityRecord,\n\t\t\tgetEntityRecord,\n\t\t\tactiveTheme,\n\t\t]\n\t);\n};\n\nexport const useEditPostAction = () => {\n\tconst history = useHistory();\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'edit-post',\n\t\t\tlabel: __( 'Edit' ),\n\t\t\tisPrimary: true,\n\t\t\ticon: pencil,\n\t\t\tisEligible( post ) {\n\t\t\t\tif ( post.status === 'trash' ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// It's eligible for all post types except theme patterns.\n\t\t\t\treturn post.type !== PATTERN_TYPES.theme;\n\t\t\t},\n\t\t\tcallback( items ) {\n\t\t\t\tconst post = items[ 0 ];\n\t\t\t\thistory.navigate( `/${ post.type }/${ post.id }?canvas=edit` );\n\t\t\t},\n\t\t} ),\n\t\t[ history ]\n\t);\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAAuB;AACvB,qBAAwB;AACxB,oBAAiD;AACjD,kBAAuC;AACvC,uBAAmC;AAKnC,uBAA8B;AAC9B,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A,EACD;AACD;AAEO,IAAM,oBAAoB,MAAM;AACtC,QAAM,UAAU,WAAW;AAC3B,aAAO;AAAA,IACN,OAAQ;AAAA,MACP,IAAI;AAAA,MACJ,WAAO,gBAAI,MAAO;AAAA,MAClB,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAY,MAAO;AAClB,YAAK,KAAK,WAAW,SAAU;AAC9B,iBAAO;AAAA,QACR;AAEA,eAAO,KAAK,SAAS,+BAAc;AAAA,MACpC;AAAA,MACA,SAAU,OAAQ;AACjB,cAAM,OAAO,MAAO,CAAE;AACtB,gBAAQ,SAAU,IAAK,KAAK,IAAK,IAAK,KAAK,EAAG,cAAe;AAAA,MAC9D;AAAA,IACD;AAAA,IACA,CAAE,OAAQ;AAAA,EACX;AACD;",
|
|
6
6
|
"names": ["routerPrivateApis", "coreStore"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/editor/index.js
|
|
29
31
|
var editor_exports = {};
|
|
30
32
|
__export(editor_exports, {
|
|
31
33
|
default: () => EditSiteEditor
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(editor_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_clsx = __toESM(require("clsx"));
|
|
36
37
|
var import_data = require("@wordpress/data");
|
|
37
38
|
var import_components = require("@wordpress/components");
|
|
@@ -63,10 +64,11 @@ var import_hooks = require("../layout/hooks");
|
|
|
63
64
|
var import_use_adapt_editor_to_canvas = require("./use-adapt-editor-to-canvas");
|
|
64
65
|
var import_use_resolve_edited_entity = require("./use-resolve-edited-entity");
|
|
65
66
|
var import_site_preview = __toESM(require("./site-preview"));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
68
|
+
var { Editor, BackButton } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
69
|
+
var { useHistory, useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
70
|
+
var { BlockKeyboardShortcuts } = (0, import_lock_unlock.unlock)(import_block_library.privateApis);
|
|
71
|
+
var toggleHomeIconVariants = {
|
|
70
72
|
edit: {
|
|
71
73
|
opacity: 0,
|
|
72
74
|
scale: 0.2
|
|
@@ -77,7 +79,7 @@ const toggleHomeIconVariants = {
|
|
|
77
79
|
clipPath: "inset( 22% round 2px )"
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
|
-
|
|
82
|
+
var siteIconVariants = {
|
|
81
83
|
edit: {
|
|
82
84
|
clipPath: "inset(0% round 0px)"
|
|
83
85
|
},
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/index.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { Icon, arrowUpLeft } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport SaveButton from '../save-button';\nimport SavePanel from '../save-panel';\nimport SiteEditorMoreMenu from '../more-menu';\nimport SiteIcon from '../site-icon';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport useEditorTitle from './use-editor-title';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\nimport { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';\nimport {\n\tuseResolveEditedEntity,\n\tuseSyncDeprecatedEntityIntoState,\n} from './use-resolve-edited-entity';\nimport SitePreview from './site-preview';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nfunction getListPathForPostType( postType ) {\n\tswitch ( postType ) {\n\t\tcase 'navigation':\n\t\t\treturn '/navigation';\n\t\tcase 'wp_block':\n\t\t\treturn '/pattern?postType=wp_block';\n\t\tcase 'wp_template_part':\n\t\t\treturn '/pattern?postType=wp_template_part';\n\t\tcase 'wp_template':\n\t\t\treturn '/template';\n\t\tcase 'page':\n\t\t\treturn '/page';\n\t\tcase 'post':\n\t\t\treturn '/';\n\t}\n\tthrow 'Unknown post type';\n}\n\nfunction getNavigationPath( location, postType ) {\n\tconst { path, name } = location;\n\tif (\n\t\t[\n\t\t\t'pattern-item',\n\t\t\t'template-part-item',\n\t\t\t'page-item',\n\t\t\t'template-item',\n\t\t\t'static-template-item',\n\t\t\t'post-item',\n\t\t].includes( name )\n\t) {\n\t\treturn getListPathForPostType( postType );\n\t}\n\treturn addQueryArgs( path, { canvas: undefined } );\n}\n\nexport default function EditSiteEditor( {\n\tisHomeRoute = false,\n\tisPostsList = false,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst location = useLocation();\n\tconst { canvas = 'view' } = location.query;\n\tconst isLoading = useIsSiteEditorLoading();\n\tuseAdaptEditorToCanvas( canvas );\n\tconst entity = useResolveEditedEntity();\n\t// deprecated sync state with url\n\tuseSyncDeprecatedEntityIntoState( entity );\n\tconst { postType, postId, context } = entity;\n\tconst { isBlockBasedTheme, hasSiteIcon } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\treturn {\n\t\t\tisBlockBasedTheme: getCurrentTheme()?.is_block_theme,\n\t\t\thasSiteIcon: !! siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\tconst postWithTemplate = !! context?.postId;\n\tuseEditorTitle(\n\t\tpostWithTemplate ? context.postType : postType,\n\t\tpostWithTemplate ? context.postId : postId\n\t);\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvas === 'edit';\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\tgetListPathForPostType(\n\t\t\t\t\t\t\t\tpostWithTemplate ? context.postType : postType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t`/${ newItem.type }/${ newItem.id }?canvas=edit`\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tpostType,\n\t\t\tcontext?.postType,\n\t\t\tpostWithTemplate,\n\t\t\thistory,\n\t\t\tcreateSuccessNotice,\n\t\t]\n\t);\n\n\tconst isReady = ! isLoading;\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\treturn ! isBlockBasedTheme && isHomeRoute ? (\n\t\t<SitePreview />\n\t) : (\n\t\t<>\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && (\n\t\t\t\t<WelcomeGuide\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t\tpostId={ postWithTemplate ? context.postId : postId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? postId : undefined }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tclassName=\"edit-site-editor__editor-interface\"\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tcustomSavePanel={ _isPreviewingTheme && <SavePanel /> }\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! postWithTemplate && (\n\t\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__view-mode-toggle\"\n\t\t\t\t\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\t\t\t\t\tanimate=\"edit\"\n\t\t\t\t\t\t\t\t\t\tinitial=\"edit\"\n\t\t\t\t\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\t\t\t\t\twhileTap=\"tap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tresetZoomLevel();\n\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO: this is a temporary solution to navigate to the posts list if we are\n\t\t\t\t\t\t\t\t\t\t\t\t// come here through `posts list` and are in focus mode editing a template, template part etc..\n\t\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPostsList &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocation.query?.focusMode\n\t\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thistory.navigate( '/', {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'canvas-mode-view-transition',\n\t\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetNavigationPath(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostWithTemplate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? context.postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'canvas-mode-view-transition',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\tvariants={ siteIconVariants }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-editor__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-editor__back-icon',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'has-site-icon':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thasSiteIcon,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tvariants={ toggleHomeIconVariants }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ arrowUpLeft } />\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t</Editor>\n\t\t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A,sBACD;AAAA,oBACD;AAAA,oBAEA;AAAA,sBAAC,kBAAAA,iBAAO;AAAA,sBAAP;AAAA,wBACA,UAAW;AAAA,wBAEX,sDAAC,iBAAAC,SAAA,EAAS,WAAU,2CAA0C;AAAA;AAAA,oBAC/D;AAAA;AAAA,gBACD;AAAA,gBACA;AAAA,kBAAC,kBAAAD,iBAAO;AAAA,kBAAP;AAAA,oBACA,eAAY,YAAAE;AAAA,sBACX;AAAA,sBACA;AAAA,wBACC,iBACC;AAAA,sBACF;AAAA,oBACD;AAAA,oBACA,UAAW;AAAA,oBAEX,sDAAC,qBAAK,MAAO,0BAAc;AAAA;AAAA,gBAC5B;AAAA;AAAA;AAAA,UACD,GAGH;AAAA,UAED,4CAAC,iBAAAC,SAAA,EAAmB;AAAA;AAAA;AAAA,IACrB;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": ["editorPrivateApis", "routerPrivateApis", "blockLibraryPrivateApis", "coreDataStore", "useEditorTitle", "useEditorIframeProps", "CanvasLoader", "blockEditorStore", "noticesStore", "SitePreview", "WelcomeGuide", "SaveButton", "SavePanel", "PluginTemplateSettingPanel", "motion", "SiteIcon", "clsx", "SiteEditorMoreMenu"]
|
|
7
7
|
}
|
|
@@ -16,17 +16,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/editor/site-preview.js
|
|
19
21
|
var site_preview_exports = {};
|
|
20
22
|
__export(site_preview_exports, {
|
|
21
23
|
default: () => SitePreview
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(site_preview_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_i18n = require("@wordpress/i18n");
|
|
26
27
|
var import_data = require("@wordpress/data");
|
|
27
28
|
var import_core_data = require("@wordpress/core-data");
|
|
28
29
|
var import_dom = require("@wordpress/dom");
|
|
29
30
|
var import_url = require("@wordpress/url");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
32
|
function SitePreview() {
|
|
31
33
|
const siteUrl = (0, import_data.useSelect)((select) => {
|
|
32
34
|
const { getEntityRecord } = select(import_core_data.store);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/site-preview.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { focus } from '@wordpress/dom';\nimport { addQueryArgs } from '@wordpress/url';\n\nexport default function SitePreview() {\n\tconst siteUrl = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\t\treturn siteData?.home;\n\t}, [] );\n\n\treturn (\n\t\t<iframe\n\t\t\tsrc={ addQueryArgs( siteUrl, {\n\t\t\t\t// Parameter for hiding the admin bar.\n\t\t\t\twp_site_preview: 1,\n\t\t\t} ) }\n\t\t\ttitle={ __( 'Site Preview' ) }\n\t\t\tstyle={ {\n\t\t\t\tdisplay: 'block',\n\t\t\t\twidth: '100%',\n\t\t\t\theight: '100%',\n\t\t\t\tbackgroundColor: '#fff',\n\t\t\t} }\n\t\t\tonLoad={ ( event ) => {\n\t\t\t\t// Make interactive elements unclickable.\n\t\t\t\tconst document = event.target.contentDocument;\n\t\t\t\tconst focusableElements = focus.focusable.find( document );\n\t\t\t\tfocusableElements.forEach( ( element ) => {\n\t\t\t\t\telement.style.pointerEvents = 'none';\n\t\t\t\t\telement.tabIndex = -1;\n\t\t\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\t\t\t\t} );\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAA0B;AAC1B,uBAAmC;AACnC,iBAAsB;AACtB,iBAA6B;AAU3B;AARa,SAAR,cAA+B;AACrC,QAAM,cAAU,uBAAW,CAAE,WAAY;AACxC,UAAM,EAAE,gBAAgB,IAAI,OAAQ,iBAAAA,KAAU;AAC9C,UAAM,WAAW,gBAAiB,QAAQ,gBAAiB;AAC3D,WAAO,UAAU;AAAA,EAClB,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAM,yBAAc,SAAS;AAAA;AAAA,QAE5B,iBAAiB;AAAA,MAClB,CAAE;AAAA,MACF,WAAQ,gBAAI,cAAe;AAAA,MAC3B,OAAQ;AAAA,QACP,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,iBAAiB;AAAA,MAClB;AAAA,MACA,QAAS,CAAE,UAAW;AAErB,cAAM,WAAW,MAAM,OAAO;AAC9B,cAAM,oBAAoB,iBAAM,UAAU,KAAM,QAAS;AACzD,0BAAkB,QAAS,CAAE,YAAa;AACzC,kBAAQ,MAAM,gBAAgB;AAC9B,kBAAQ,WAAW;AACnB,kBAAQ,aAAc,eAAe,MAAO;AAAA,QAC7C,CAAE;AAAA,MACH;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["coreStore"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/editor/use-adapt-editor-to-canvas.js
|
|
19
21
|
var use_adapt_editor_to_canvas_exports = {};
|
|
20
22
|
__export(use_adapt_editor_to_canvas_exports, {
|
|
21
23
|
useAdaptEditorToCanvas: () => useAdaptEditorToCanvas
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-adapt-editor-to-canvas.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useLayoutEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport function useAdaptEditorToCanvas( canvas ) {\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst {\n\t\tsetDeviceType,\n\t\tclosePublishSidebar,\n\t\tsetIsListViewOpened,\n\t\tsetIsInserterOpened,\n\t} = useDispatch( editorStore );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst registry = useRegistry();\n\tuseLayoutEffect( () => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\n\t\tregistry.batch( () => {\n\t\t\tclearSelectedBlock();\n\t\t\tsetDeviceType( 'Desktop' );\n\t\t\tclosePublishSidebar();\n\t\t\tsetIsInserterOpened( false );\n\n\t\t\t// Check if the block list view should be open by default.\n\t\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\t\t// This behavior is disabled for small viewports.\n\t\t\tif (\n\t\t\t\tisMediumOrBigger &&\n\t\t\t\tcanvas === 'edit' &&\n\t\t\t\tgetPreference( 'core', 'showListViewByDefault' ) &&\n\t\t\t\t! getPreference( 'core', 'distractionFree' )\n\t\t\t) {\n\t\t\t\tsetIsListViewOpened( true );\n\t\t\t} else {\n\t\t\t\tsetIsListViewOpened( false );\n\t\t\t}\n\t\t} );\n\t}, [\n\t\tcanvas,\n\t\tregistry,\n\t\tclearSelectedBlock,\n\t\tsetDeviceType,\n\t\tclosePublishSidebar,\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t\tgetPreference,\n\t] );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAoD;AACpD,0BAA0C;AAC1C,oBAAqC;AACrC,qBAAgC;AAChC,yBAA0C;AAEnC,SAAS,uBAAwB,QAAS;AAChD,QAAM,EAAE,mBAAmB,QAAI,yBAAa,oBAAAA,KAAiB;AAC7D,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,yBAAa,cAAAC,KAAY;AAC7B,QAAM,EAAE,KAAK,cAAc,QAAI,uBAAW,mBAAAC,KAAiB;AAC3D,QAAM,eAAW,yBAAY;AAC7B,sCAAiB,MAAM;AACtB,UAAM,mBACL,OAAO,WAAY,oBAAqB,EAAE;AAC3C,aAAS,MAAO,MAAM;AACrB,yBAAmB;AACnB,oBAAe,SAAU;AACzB,0BAAoB;AACpB,0BAAqB,KAAM;AAK3B,UACC,oBACA,WAAW,UACX,cAAe,QAAQ,uBAAwB,KAC/C,CAAE,cAAe,QAAQ,iBAAkB,GAC1C;AACD,4BAAqB,IAAK;AAAA,MAC3B,OAAO;AACN,4BAAqB,KAAM;AAAA,MAC5B;AAAA,IACD,CAAE;AAAA,EACH,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
|
|
6
6
|
"names": ["blockEditorStore", "editorStore", "preferencesStore"]
|
|
7
7
|
}
|
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/editor/use-editor-title.js
|
|
29
31
|
var use_editor_title_exports = {};
|
|
30
32
|
__export(use_editor_title_exports, {
|
|
31
33
|
default: () => use_editor_title_default
|
|
@@ -39,7 +41,7 @@ var import_editor = require("@wordpress/editor");
|
|
|
39
41
|
var import_use_title = __toESM(require("../routes/use-title"));
|
|
40
42
|
var import_constants = require("../../utils/constants");
|
|
41
43
|
var import_lock_unlock = require("../../lock-unlock");
|
|
42
|
-
|
|
44
|
+
var { getTemplateInfo } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
43
45
|
function useEditorTitle(postType, postId) {
|
|
44
46
|
const { title, isLoaded } = (0, import_data.useSelect)(
|
|
45
47
|
(select) => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-editor-title.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { getTemplateInfo } = unlock( editorPrivateApis );\n\nfunction useEditorTitle( postType, postId ) {\n\tconst { title, isLoaded } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetCurrentTheme,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn { isLoaded: false };\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\tconst templateInfo = getTemplateInfo( {\n\t\t\t\ttemplate: _record,\n\t\t\t\ttemplateTypes,\n\t\t\t} );\n\n\t\t\tconst _isLoaded = hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t] );\n\n\t\t\treturn {\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tlet editorTitle;\n\tif ( isLoaded ) {\n\t\teditorTitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).\n\t\t\t_x( '%1$s \u2039 %2$s', 'breadcrumb trail' ),\n\t\t\tdecodeEntities( title ),\n\t\t\tPOST_TYPE_LABELS[ postType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( isLoaded && editorTitle );\n}\n\nexport default useEditorTitle;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,kBAA0B;AAC1B,uBAAmC;AACnC,2BAA+B;AAC/B,oBAAiD;AAKjD,uBAAqB;AACrB,uBAAqD;AACrD,yBAAuB;AAEvB,IAAM,EAAE,gBAAgB,QAAI,2BAAQ,cAAAA,WAAkB;AAEtD,SAAS,eAAgB,UAAU,QAAS;AAC3C,QAAM,EAAE,OAAO,SAAS,QAAI;AAAA,IAC3B,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,iBAAAC,KAAU;AAEtB,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,UAAU,MAAM;AAAA,MAC1B;AAEA,YAAM,UAAU;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,YAAM,EAAE,wBAAwB,gBAAgB,CAAC,EAAE,IAClD,gBAAgB,KAAK,CAAC;AAEvB,YAAM,eAAe,gBAAiB;AAAA,QACrC,UAAU;AAAA,QACV;AAAA,MACD,CAAE;AAEF,YAAM,YAAY,sBAAuB,yBAAyB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,aAAO;AAAA,QACN,OAAO,aAAa;AAAA,QACpB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,UAAW;AACf,sBAAc;AAAA;AAAA,UAEb,gBAAI,oBAAe,kBAAmB;AAAA,UACtC,qCAAgB,KAAM;AAAA,MACtB,kCAAkB,QAAS,KAC1B,kCAAkB,mCAAmB;AAAA,IACvC;AAAA,EACD;AAIA,uBAAAC,SAAU,YAAY,WAAY;AACnC;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": ["editorPrivateApis", "coreStore", "useTitle"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/editor/use-resolve-edited-entity.js
|
|
19
21
|
var use_resolve_edited_entity_exports = {};
|
|
20
22
|
__export(use_resolve_edited_entity_exports, {
|
|
21
23
|
useResolveEditedEntity: () => useResolveEditedEntity,
|
|
@@ -29,14 +31,14 @@ var import_router = require("@wordpress/router");
|
|
|
29
31
|
var import_store = require("../../store");
|
|
30
32
|
var import_lock_unlock = require("../../lock-unlock");
|
|
31
33
|
var import_constants = require("../../utils/constants");
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
35
|
+
var postTypesWithoutParentTemplate = [
|
|
34
36
|
import_constants.TEMPLATE_POST_TYPE,
|
|
35
37
|
import_constants.TEMPLATE_PART_POST_TYPE,
|
|
36
38
|
import_constants.NAVIGATION_POST_TYPE,
|
|
37
39
|
import_constants.PATTERN_TYPES.user
|
|
38
40
|
];
|
|
39
|
-
|
|
41
|
+
var authorizedPostTypes = ["page", "post"];
|
|
40
42
|
function getPostType(name) {
|
|
41
43
|
let postType;
|
|
42
44
|
if (name === "navigation-item") {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-resolve-edited-entity.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction getPostType( name ) {\n\tlet postType;\n\tif ( name === 'navigation-item' ) {\n\t\tpostType = NAVIGATION_POST_TYPE;\n\t} else if ( name === 'pattern-item' ) {\n\t\tpostType = PATTERN_TYPES.user;\n\t} else if ( name === 'template-part-item' ) {\n\t\tpostType = TEMPLATE_PART_POST_TYPE;\n\t} else if ( name === 'templates' ) {\n\t\tpostType = TEMPLATE_POST_TYPE;\n\t} else if ( name === 'template-item' ) {\n\t\tpostType = TEMPLATE_POST_TYPE;\n\t} else if ( name === 'page-item' || name === 'pages' ) {\n\t\tpostType = 'page';\n\t} else if ( name === 'post-item' || name === 'posts' ) {\n\t\tpostType = 'post';\n\t}\n\n\treturn postType;\n}\n\nexport function useResolveEditedEntity() {\n\tconst { name, params = {}, query } = useLocation();\n\tconst { postId = query?.postId } = params; // Fallback to query param for postId for list view routes.\n\tconst postType = getPostType( name, postId ) ?? query?.postType;\n\n\tconst homePage = useSelect( ( select ) => {\n\t\tconst { getHomePage } = unlock( select( coreDataStore ) );\n\t\treturn getHomePage();\n\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getTemplateId } = unlock( select( coreDataStore ) );\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn getTemplateId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homePage?.postType === 'page' ) {\n\t\t\t\treturn getTemplateId( 'page', homePage?.postId );\n\t\t\t}\n\n\t\t\tif ( homePage?.postType === 'wp_template' ) {\n\t\t\t\treturn homePage?.postId;\n\t\t\t}\n\t\t},\n\t\t[ homePage, postId, postType ]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homePage?.postType === 'page' ) {\n\t\t\treturn { postType: 'page', postId: homePage?.postId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homePage, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( !! homePage ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport function useSyncDeprecatedEntityIntoState( {\n\tpostType,\n\tpostId,\n\tcontext,\n\tisReady,\n} ) {\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\t// setEditedEntity expects a string (because the postId used to be\n\t\t\t// the template slug, even for edited templates). Now the postId can\n\t\t\t// be a number (either because it's an auto-draft or edited\n\t\t\t// template). Passing a number could break plugins doing things like\n\t\t\t// `id.includes`. It would be way more complex to keep passing the\n\t\t\t// template slug, while also being incorrect, so the easiest\n\t\t\t// solution is to cast the postId to a string.\n\t\t\tsetEditedEntity( postType, String( postId ), context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAm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coreDataStore", "editSiteStore"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/layout/animation.js
|
|
19
21
|
var animation_exports = {};
|
|
20
22
|
__export(animation_exports, {
|
|
21
23
|
default: () => animation_default
|
|
@@ -29,7 +31,7 @@ function getAbsolutePosition(element) {
|
|
|
29
31
|
left: element.offsetLeft
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
|
-
|
|
34
|
+
var ANIMATION_DURATION = 400;
|
|
33
35
|
function useMovingAnimation({ triggerAnimationOnChange }) {
|
|
34
36
|
const ref = (0, import_element.useRef)();
|
|
35
37
|
const { previous, prevRect } = (0, import_element.useMemo)(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/animation.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * External dependencies\n */\nimport { Controller, easings } from '@react-spring/web';\n\n/**\n * WordPress dependencies\n */\nimport { useLayoutEffect, useMemo, useRef } from '@wordpress/element';\n\nfunction getAbsolutePosition( element ) {\n\treturn {\n\t\ttop: element.offsetTop,\n\t\tleft: element.offsetLeft,\n\t};\n}\n\nconst ANIMATION_DURATION = 400;\n\n/**\n * Hook used to compute the styles required to move a div into a new position.\n *\n * The way this animation works is the following:\n * - It first renders the element as if there was no animation.\n * - It takes a snapshot of the position of the block to use it\n * as a destination point for the animation.\n * - It restores the element to the previous position using a CSS transform\n * - It uses the \"resetAnimation\" flag to reset the animation\n * from the beginning in order to animate to the new destination point.\n *\n * @param {Object} $1 Options\n * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.\n */\nfunction useMovingAnimation( { triggerAnimationOnChange } ) {\n\tconst ref = useRef();\n\n\t// Whenever the trigger changes, we need to take a snapshot of the current\n\t// position of the block to use it as a destination point for the animation.\n\tconst { previous, prevRect } = useMemo(\n\t\t() => ( {\n\t\t\tprevious: ref.current && getAbsolutePosition( ref.current ),\n\t\t\tprevRect: ref.current && ref.current.getBoundingClientRect(),\n\t\t} ),\n\t\t[ triggerAnimationOnChange ]\n\t);\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previous || ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We disable the animation if the user has a preference for reduced\n\t\t// motion.\n\t\tconst disableAnimation = window.matchMedia(\n\t\t\t'(prefers-reduced-motion: reduce)'\n\t\t).matches;\n\n\t\tif ( disableAnimation ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst controller = new Controller( {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth: prevRect.width,\n\t\t\theight: prevRect.height,\n\t\t\tconfig: {\n\t\t\t\tduration: ANIMATION_DURATION,\n\t\t\t\teasing: easings.easeInOutQuint,\n\t\t\t},\n\t\t\tonChange( { value } ) {\n\t\t\t\tif ( ! ref.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet { x, y, width, height } = value;\n\t\t\t\tx = Math.round( x );\n\t\t\t\ty = Math.round( y );\n\t\t\t\twidth = Math.round( width );\n\t\t\t\theight = Math.round( height );\n\t\t\t\tconst finishedMoving = x === 0 && y === 0;\n\t\t\t\tref.current.style.transformOrigin = 'center center';\n\t\t\t\tref.current.style.transform = finishedMoving\n\t\t\t\t\t? null // Set to `null` to explicitly remove the transform.\n\t\t\t\t\t: `translate3d(${ x }px,${ y }px,0)`;\n\t\t\t\tref.current.style.width = finishedMoving\n\t\t\t\t\t? null\n\t\t\t\t\t: `${ width }px`;\n\t\t\t\tref.current.style.height = finishedMoving\n\t\t\t\t\t? null\n\t\t\t\t\t: `${ height }px`;\n\t\t\t},\n\t\t} );\n\n\t\tref.current.style.transform = undefined;\n\t\tconst destination = ref.current.getBoundingClientRect();\n\n\t\tconst x = Math.round( prevRect.left - destination.left );\n\t\tconst y = Math.round( prevRect.top - destination.top );\n\t\tconst width = destination.width;\n\t\tconst height = destination.height;\n\n\t\tcontroller.start( {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tfrom: { x, y, width: prevRect.width, height: prevRect.height },\n\t\t} );\n\n\t\treturn () => {\n\t\t\tcontroller.stop();\n\t\t\tcontroller.set( {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0,\n\t\t\t\twidth: prevRect.width,\n\t\t\t\theight: prevRect.height,\n\t\t\t} );\n\t\t};\n\t}, [ previous, prevRect ] );\n\n\treturn ref;\n}\n\nexport default useMovingAnimation;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAoC;AAKpC,qBAAiD;AAEjD,SAAS,oBAAqB,SAAU;AACvC,SAAO;AAAA,IACN,KAAK,QAAQ;AAAA,IACb,MAAM,QAAQ;AAAA,EACf;AACD;AAEA,IAAM,qBAAqB;AAgB3B,SAAS,mBAAoB,EAAE,yBAAyB,GAAI;AAC3D,QAAM,UAAM,uBAAO;AAInB,QAAM,EAAE,UAAU,SAAS,QAAI;AAAA,IAC9B,OAAQ;AAAA,MACP,UAAU,IAAI,WAAW,oBAAqB,IAAI,OAAQ;AAAA,MAC1D,UAAU,IAAI,WAAW,IAAI,QAAQ,sBAAsB;AAAA,IAC5D;AAAA,IACA,CAAE,wBAAyB;AAAA,EAC5B;AAEA,sCAAiB,MAAM;AACtB,QAAK,CAAE,YAAY,CAAE,IAAI,SAAU;AAClC;AAAA,IACD;AAIA,UAAM,mBAAmB,OAAO;AAAA,MAC/B;AAAA,IACD,EAAE;AAEF,QAAK,kBAAmB;AACvB;AAAA,IACD;AAEA,UAAM,aAAa,IAAI,sBAAY;AAAA,MAClC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,OAAO,SAAS;AAA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,SAAS;AAAA,MAClB,CAAE;AAAA,IACH;AAAA,EACD,GAAG,CAAE,UAAU,QAAS,CAAE;AAE1B,SAAO;AACR;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": ["x", "y", "width", "height"]
|
|
7
7
|
}
|
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// packages/edit-site/src/components/layout/hooks.js
|
|
19
21
|
var hooks_exports = {};
|
|
20
22
|
__export(hooks_exports, {
|
|
21
23
|
useIsSiteEditorLoading: () => useIsSiteEditorLoading
|
|
@@ -24,7 +26,7 @@ module.exports = __toCommonJS(hooks_exports);
|
|
|
24
26
|
var import_element = require("@wordpress/element");
|
|
25
27
|
var import_data = require("@wordpress/data");
|
|
26
28
|
var import_core_data = require("@wordpress/core-data");
|
|
27
|
-
|
|
29
|
+
var MAX_LOADING_TIME = 1e4;
|
|
28
30
|
function useIsSiteEditorLoading() {
|
|
29
31
|
const [loaded, setLoaded] = (0, import_element.useState)(false);
|
|
30
32
|
const inLoadingPause = (0, import_data.useSelect)(
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/hooks.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst MAX_LOADING_TIME = 10000; // 10 seconds\n\nexport function useIsSiteEditorLoading() {\n\tconst [ loaded, setLoaded ] = useState( false );\n\tconst inLoadingPause = useSelect(\n\t\t( select ) => {\n\t\t\tconst hasResolvingSelectors =\n\t\t\t\tselect( coreStore ).hasResolvingSelectors();\n\t\t\treturn ! loaded && ! hasResolvingSelectors;\n\t\t},\n\t\t[ loaded ]\n\t);\n\n\t/*\n\t * If the maximum expected loading time has passed, we're marking the\n\t * editor as loaded, in order to prevent any failed requests from blocking\n\t * the editor canvas from appearing.\n\t */\n\tuseEffect( () => {\n\t\tlet timeout;\n\n\t\tif ( ! loaded ) {\n\t\t\ttimeout = setTimeout( () => {\n\t\t\t\tsetLoaded( true );\n\t\t\t}, MAX_LOADING_TIME );\n\t\t}\n\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t};\n\t}, [ loaded ] );\n\n\tuseEffect( () => {\n\t\tif ( inLoadingPause ) {\n\t\t\t/*\n\t\t\t * We're using an arbitrary 100ms timeout here to catch brief\n\t\t\t * moments without any resolving selectors that would result in\n\t\t\t * displaying brief flickers of loading state and loaded state.\n\t\t\t *\n\t\t\t * It's worth experimenting with different values, since this also\n\t\t\t * adds 100ms of artificial delay after loading has finished.\n\t\t\t */\n\t\t\tconst ARTIFICIAL_DELAY = 100;\n\t\t\tconst timeout = setTimeout( () => {\n\t\t\t\tsetLoaded( true );\n\t\t\t}, ARTIFICIAL_DELAY );\n\n\t\t\treturn () => {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t};\n\t\t}\n\t}, [ inLoadingPause ] );\n\n\treturn ! loaded;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAoC;AACpC,kBAA0B;AAC1B,uBAAmC;AAEnC,IAAM,mBAAmB;AAElB,SAAS,yBAAyB;AACxC,QAAM,CAAE,QAAQ,SAAU,QAAI,yBAAU,KAAM;AAC9C,QAAM,qBAAiB;AAAA,IACtB,CAAE,WAAY;AACb,YAAM,wBACL,OAAQ,iBAAAA,KAAU,EAAE,sBAAsB;AAC3C,aAAO,CAAE,UAAU,CAAE;AAAA,IACtB;AAAA,IACA,CAAE,MAAO;AAAA,EACV;AAOA,gCAAW,MAAM;AAChB,QAAI;AAEJ,QAAK,CAAE,QAAS;AACf,gBAAU,WAAY,MAAM;AAC3B,kBAAW,IAAK;AAAA,MACjB,GAAG,gBAAiB;AAAA,IACrB;AAEA,WAAO,MAAM;AACZ,mBAAc,OAAQ;AAAA,IACvB;AAAA,EACD,GAAG,CAAE,MAAO,CAAE;AAEd,gCAAW,MAAM;AAChB,QAAK,gBAAiB;AASrB,YAAM,mBAAmB;AACzB,YAAM,UAAU,WAAY,MAAM;AACjC,kBAAW,IAAK;AAAA,MACjB,GAAG,gBAAiB;AAEpB,aAAO,MAAM;AACZ,qBAAc,OAAQ;AAAA,MACvB;AAAA,IACD;AAAA,EACD,GAAG,CAAE,cAAe,CAAE;AAEtB,SAAO,CAAE;AACV;",
|
|
6
6
|
"names": ["coreStore"]
|
|
7
7
|
}
|
|
@@ -26,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// packages/edit-site/src/components/layout/index.js
|
|
29
31
|
var layout_exports = {};
|
|
30
32
|
__export(layout_exports, {
|
|
31
33
|
default: () => LayoutWithGlobalStylesProvider
|
|
32
34
|
});
|
|
33
35
|
module.exports = __toCommonJS(layout_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_clsx = __toESM(require("clsx"));
|
|
36
37
|
var import_admin_ui = require("@wordpress/admin-ui");
|
|
37
38
|
var import_components = require("@wordpress/components");
|
|
@@ -53,9 +54,10 @@ var import_animation = __toESM(require("./animation"));
|
|
|
53
54
|
var import_sidebar = require("../sidebar");
|
|
54
55
|
var import_save_hub = __toESM(require("../save-hub"));
|
|
55
56
|
var import_save_panel = __toESM(require("../save-panel"));
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
+
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
59
|
+
var { useStyle } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
60
|
+
var ANIMATION_DURATION = 0.3;
|
|
59
61
|
function Layout() {
|
|
60
62
|
const { query, name: routeKey, areas, widths } = useLocation();
|
|
61
63
|
const { canvas = "view" } = query;
|