@wordpress/edit-site 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-page/index.js +105 -0
- package/build/components/add-new-page/index.js.map +1 -0
- package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +9 -25
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +28 -41
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/index.js +4 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +9 -12
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +106 -80
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +71 -120
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/back-button.js +1 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +3 -4
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +6 -7
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +14 -13
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +25 -42
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +6 -7
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +5 -7
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +5 -6
- package/build/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +30 -35
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +37 -53
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +15 -9
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +8 -10
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +7 -10
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +3 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +1 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +8 -10
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +3 -4
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -5
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +4 -5
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +5 -6
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +10 -14
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +41 -51
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -7
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +88 -12
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +3 -4
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +10 -17
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -33
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -35
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +5 -5
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +3 -4
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +11 -16
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +4 -5
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +4 -5
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +5 -6
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +49 -30
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +5 -6
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +99 -95
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -7
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +49 -53
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +41 -51
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +33 -94
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +13 -23
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +4 -7
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +2 -4
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +35 -40
- package/build/components/list/table.js.map +1 -1
- package/build/components/page-actions/delete-page-menu-item.js +70 -0
- package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build/components/page-actions/index.js +43 -0
- package/build/components/page-actions/index.js.map +1 -0
- package/build/components/page-content-lock/constants.js +9 -0
- package/build/components/page-content-lock/constants.js.map +1 -0
- package/build/components/page-content-lock/index.js +29 -0
- package/build/components/page-content-lock/index.js.map +1 -0
- package/build/components/page-content-lock/use-disable-non-content-blocks.js +49 -0
- package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
- package/build/components/page-content-lock/use-page-content-lock-notifications.js +112 -0
- package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
- package/build/components/preferences-modal/index.js +4 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +250 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +13 -15
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +8 -12
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +1 -5
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +13 -7
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +97 -5
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +63 -17
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +12 -6
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +11 -9
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +13 -10
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +79 -0
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +86 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +39 -21
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -18
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +7 -8
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +21 -14
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +166 -12
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -33
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +159 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +51 -107
- 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 +84 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +16 -74
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +52 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/index.js +81 -10
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +148 -0
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js +110 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +128 -17
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +22 -16
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template-part/index.js +105 -0
- package/build/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +44 -24
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +3 -4
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -1
- package/build/components/site-hub/index.js +20 -15
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +4 -5
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +15 -21
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +107 -37
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/{list/actions → template-actions}/index.js +39 -33
- package/build/components/template-actions/index.js.map +1 -0
- package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build/components/template-actions/rename-menu-item.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +4 -5
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +8 -10
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +12 -18
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -5
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +103 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +11 -8
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +5 -6
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +3 -6
- package/build/index.js.map +1 -1
- package/build/store/actions.js +131 -125
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +7 -10
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +32 -33
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +35 -11
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +1 -3
- package/build/store/utils.js.map +1 -1
- package/build/utils/get-is-list-page.js +3 -4
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -3
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-revertable.js +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build-module/components/add-new-page/index.js +93 -0
- package/build-module/components/add-new-page/index.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +10 -23
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +30 -42
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/index.js +4 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +9 -12
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +105 -82
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +71 -120
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +1 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +3 -4
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +6 -7
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +13 -13
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +25 -42
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +6 -7
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +5 -7
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +5 -6
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +31 -36
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -56
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +12 -9
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +8 -10
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +7 -10
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +3 -4
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +8 -10
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -4
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +4 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +4 -5
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +5 -6
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +10 -14
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +41 -51
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +4 -7
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +90 -13
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +3 -4
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +10 -17
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +26 -34
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -34
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +5 -5
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +3 -4
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +12 -17
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +4 -5
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +4 -5
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +5 -6
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +50 -31
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +5 -6
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +99 -97
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -8
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -49
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +34 -97
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +13 -23
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/header.js +4 -7
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +2 -4
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +34 -39
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
- package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build-module/components/page-actions/index.js +30 -0
- package/build-module/components/page-actions/index.js.map +1 -0
- package/build-module/components/page-content-lock/constants.js +2 -0
- package/build-module/components/page-content-lock/constants.js.map +1 -0
- package/build-module/components/page-content-lock/index.js +14 -0
- package/build-module/components/page-content-lock/index.js.map +1 -0
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js +36 -0
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +98 -0
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +4 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +236 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +13 -14
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +8 -12
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -5
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +13 -7
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +95 -8
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +62 -19
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +12 -6
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +9 -8
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +14 -11
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +67 -0
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +67 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +36 -22
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/index.js +20 -19
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +7 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +22 -15
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +161 -15
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +21 -32
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +138 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +49 -106
- 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 +68 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -74
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +39 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js +79 -14
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +97 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +125 -19
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +22 -17
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template-part/index.js +86 -0
- package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +43 -24
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +3 -4
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +21 -16
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +4 -5
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +15 -21
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +107 -38
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +92 -0
- package/build-module/components/template-actions/index.js.map +1 -0
- package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +8 -10
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +12 -18
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +4 -5
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +84 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +11 -8
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -6
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +3 -6
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +127 -126
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +7 -10
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +30 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +31 -11
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +1 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +3 -4
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -3
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +477 -232
- package/build-style/style.css +478 -232
- package/package.json +40 -37
- package/src/components/add-new-page/index.js +105 -0
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -26
- package/src/components/add-new-template/new-template.js +141 -154
- package/src/components/add-new-template/style.scss +79 -66
- package/src/components/block-editor/index.js +27 -17
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +30 -53
- package/src/components/editor/style.scss +11 -1
- package/src/components/editor-canvas-container/index.js +28 -19
- package/src/components/global-styles/screen-block.js +74 -3
- package/src/components/global-styles/screen-revisions/index.js +3 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +33 -25
- package/src/components/global-styles/screen-revisions/style.scss +3 -2
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +16 -3
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +22 -24
- package/src/components/global-styles/screen-root.js +5 -3
- package/src/components/global-styles/style-variations-container.js +13 -18
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/global-styles/ui.js +39 -9
- package/src/components/header-edit-mode/document-actions/index.js +112 -121
- package/src/components/header-edit-mode/document-actions/style.scss +78 -54
- package/src/components/header-edit-mode/index.js +18 -0
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +47 -122
- package/src/components/layout/style.scss +8 -2
- package/src/components/list/style.scss +1 -0
- package/src/components/list/table.js +6 -2
- package/src/components/page-actions/delete-page-menu-item.js +71 -0
- package/src/components/page-actions/index.js +36 -0
- package/src/components/page-content-lock/constants.js +5 -0
- package/src/components/page-content-lock/index.js +14 -0
- package/src/components/page-content-lock/use-disable-non-content-blocks.js +44 -0
- package/src/components/page-content-lock/use-page-content-lock-notifications.js +128 -0
- package/src/components/resizable-frame/index.js +263 -0
- package/src/components/resizable-frame/style.scss +71 -0
- package/src/components/revisions/index.js +7 -7
- package/src/components/save-button/index.js +6 -0
- package/src/components/save-hub/index.js +143 -38
- package/src/components/save-hub/style.scss +6 -0
- package/src/components/save-panel/index.js +62 -15
- package/src/components/secondary-sidebar/list-view-sidebar.js +10 -2
- package/src/components/sidebar/index.js +10 -8
- package/src/components/sidebar/style.scss +3 -4
- package/src/components/sidebar-edit-mode/index.js +16 -14
- package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +77 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +10 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +51 -28
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
- package/src/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -19
- package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +1 -2
- package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
- package/src/components/sidebar-navigation-item/style.scss +9 -0
- package/src/components/sidebar-navigation-screen/index.js +74 -50
- package/src/components/sidebar-navigation-screen/style.scss +46 -6
- package/src/components/sidebar-navigation-screen-global-styles/index.js +212 -21
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-main/index.js +35 -52
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -117
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -72
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +7 -21
- package/src/components/sidebar-navigation-screen-page/index.js +137 -24
- package/src/components/sidebar-navigation-screen-page/page-details.js +163 -0
- package/src/components/sidebar-navigation-screen-page/status-label.js +101 -0
- package/src/components/sidebar-navigation-screen-page/style.scss +80 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +180 -44
- package/src/components/sidebar-navigation-screen-template/index.js +25 -22
- package/src/components/sidebar-navigation-screen-template-part/index.js +103 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +52 -13
- package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
- package/src/components/site-hub/index.js +29 -15
- package/src/components/site-hub/style.scss +26 -0
- package/src/components/start-template-options/style.scss +20 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/{list/actions → template-actions}/index.js +31 -11
- package/src/components/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/hooks/push-changes-to-global-styles/index.js +13 -7
- package/src/store/actions.js +24 -6
- package/src/store/reducer.js +20 -0
- package/src/store/selectors.js +24 -0
- package/src/store/test/actions.js +31 -0
- package/src/store/test/reducer.js +44 -0
- package/src/store/test/selectors.js +57 -0
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +6 -3
- package/src/utils/is-previewing-theme.js +1 -4
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -135
- package/build/components/global-styles/border-panel.js.map +0 -1
- package/build/components/list/actions/index.js.map +0 -1
- package/build/components/list/actions/rename-menu-item.js.map +0 -1
- package/build/components/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -166
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -125
- package/build-module/components/global-styles/border-panel.js.map +0 -1
- package/build-module/components/list/actions/index.js +0 -86
- package/build-module/components/list/actions/index.js.map +0 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
- package/build-module/components/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -145
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -114
- package/src/components/navigate-to-link/index.js +0 -46
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -167
- package/src/components/template-details/template-part-area-selector.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
- /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useIsSiteEditorLoading = useIsSiteEditorLoading;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _coreData = require("@wordpress/core-data");
|
|
15
|
+
|
|
16
|
+
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
function useIsSiteEditorLoading() {
|
|
26
|
+
const {
|
|
27
|
+
isLoaded: hasLoadedPost
|
|
28
|
+
} = (0, _useEditedEntityRecord.default)();
|
|
29
|
+
const [loaded, setLoaded] = (0, _element.useState)(false);
|
|
30
|
+
const inLoadingPause = (0, _data.useSelect)(select => {
|
|
31
|
+
const hasResolvingSelectors = select(_coreData.store).hasResolvingSelectors();
|
|
32
|
+
return !loaded && !hasResolvingSelectors;
|
|
33
|
+
}, [loaded]);
|
|
34
|
+
(0, _element.useEffect)(() => {
|
|
35
|
+
if (inLoadingPause) {
|
|
36
|
+
/*
|
|
37
|
+
* We're using an arbitrary 1s timeout here to catch brief moments
|
|
38
|
+
* without any resolving selectors that would result in displaying
|
|
39
|
+
* brief flickers of loading state and loaded state.
|
|
40
|
+
*
|
|
41
|
+
* It's worth experimenting with different values, since this also
|
|
42
|
+
* adds 1s of artificial delay after loading has finished.
|
|
43
|
+
*/
|
|
44
|
+
const timeout = setTimeout(() => {
|
|
45
|
+
setLoaded(true);
|
|
46
|
+
}, 1000);
|
|
47
|
+
return () => {
|
|
48
|
+
clearTimeout(timeout);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}, [inLoadingPause]);
|
|
52
|
+
return !loaded || !hasLoadedPost;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/hooks.js"],"names":["useIsSiteEditorLoading","isLoaded","hasLoadedPost","loaded","setLoaded","inLoadingPause","select","hasResolvingSelectors","coreStore","timeout","setTimeout","clearTimeout"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGO,SAASA,sBAAT,GAAkC;AACxC,QAAM;AAAEC,IAAAA,QAAQ,EAAEC;AAAZ,MAA8B,qCAApC;AACA,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,KAAV,CAA9B;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAc;AACb,UAAMC,qBAAqB,GAC1BD,MAAM,CAAEE,eAAF,CAAN,CAAoBD,qBAApB,EADD;AAEA,WAAO,CAAEJ,MAAF,IAAY,CAAEI,qBAArB;AACA,GALqB,EAMtB,CAAEJ,MAAF,CANsB,CAAvB;AASA,0BAAW,MAAM;AAChB,QAAKE,cAAL,EAAsB;AACrB;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACG,YAAMI,OAAO,GAAGC,UAAU,CAAE,MAAM;AACjCN,QAAAA,SAAS,CAAE,IAAF,CAAT;AACA,OAFyB,EAEvB,IAFuB,CAA1B;AAIA,aAAO,MAAM;AACZO,QAAAA,YAAY,CAAEF,OAAF,CAAZ;AACA,OAFD;AAGA;AACD,GAlBD,EAkBG,CAAEJ,cAAF,CAlBH;AAoBA,SAAO,CAAEF,MAAF,IAAY,CAAED,aAArB;AACA","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\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\nexport function useIsSiteEditorLoading() {\n\tconst { isLoaded: hasLoadedPost } = useEditedEntityRecord();\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\tuseEffect( () => {\n\t\tif ( inLoadingPause ) {\n\t\t\t/*\n\t\t\t * We're using an arbitrary 1s timeout here to catch brief moments\n\t\t\t * without any resolving selectors that would result in displaying\n\t\t\t * 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 1s of artificial delay after loading has finished.\n\t\t\t */\n\t\t\tconst timeout = setTimeout( () => {\n\t\t\t\tsetLoaded( true );\n\t\t\t}, 1000 );\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 || ! hasLoadedPost;\n}\n"]}
|
|
@@ -51,7 +51,7 @@ var _useInitEditedEntityFromUrl = _interopRequireDefault(require("../sync-state-
|
|
|
51
51
|
|
|
52
52
|
var _siteHub = _interopRequireDefault(require("../site-hub"));
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _resizableFrame = _interopRequireDefault(require("../resizable-frame"));
|
|
55
55
|
|
|
56
56
|
var _useSyncCanvasModeWithUrl = _interopRequireDefault(require("../sync-state-with-url/use-sync-canvas-mode-with-url"));
|
|
57
57
|
|
|
@@ -63,6 +63,10 @@ var _register = _interopRequireDefault(require("../keyboard-shortcuts/register")
|
|
|
63
63
|
|
|
64
64
|
var _global = _interopRequireDefault(require("../keyboard-shortcuts/global"));
|
|
65
65
|
|
|
66
|
+
var _useEditModeCommands = require("../../hooks/commands/use-edit-mode-commands");
|
|
67
|
+
|
|
68
|
+
var _hooks = require("./hooks");
|
|
69
|
+
|
|
66
70
|
/**
|
|
67
71
|
* External dependencies
|
|
68
72
|
*/
|
|
@@ -77,29 +81,20 @@ var _global = _interopRequireDefault(require("../keyboard-shortcuts/global"));
|
|
|
77
81
|
const {
|
|
78
82
|
useCommands
|
|
79
83
|
} = (0, _privateApis.unlock)(_coreCommands.privateApis);
|
|
84
|
+
const {
|
|
85
|
+
useCommandContext
|
|
86
|
+
} = (0, _privateApis.unlock)(_commands.privateApis);
|
|
80
87
|
const {
|
|
81
88
|
useLocation
|
|
82
89
|
} = (0, _privateApis.unlock)(_router.privateApis);
|
|
83
90
|
const ANIMATION_DURATION = 0.5;
|
|
84
|
-
const emptyResizeHandleStyles = {
|
|
85
|
-
position: undefined,
|
|
86
|
-
userSelect: undefined,
|
|
87
|
-
cursor: undefined,
|
|
88
|
-
width: undefined,
|
|
89
|
-
height: undefined,
|
|
90
|
-
top: undefined,
|
|
91
|
-
right: undefined,
|
|
92
|
-
bottom: undefined,
|
|
93
|
-
left: undefined
|
|
94
|
-
};
|
|
95
91
|
|
|
96
92
|
function Layout() {
|
|
97
|
-
var _window;
|
|
98
|
-
|
|
99
93
|
// This ensures the edited entity id and type are initialized properly.
|
|
100
94
|
(0, _useInitEditedEntityFromUrl.default)();
|
|
101
95
|
(0, _useSyncCanvasModeWithUrl.default)();
|
|
102
96
|
useCommands();
|
|
97
|
+
(0, _useEditModeCommands.useEditModeCommands)();
|
|
103
98
|
const hubRef = (0, _element.useRef)();
|
|
104
99
|
const {
|
|
105
100
|
params
|
|
@@ -125,41 +120,35 @@ function Layout() {
|
|
|
125
120
|
hasFixedToolbar: select(_preferences.store).get('fixedToolbar')
|
|
126
121
|
};
|
|
127
122
|
}, []);
|
|
123
|
+
const isEditing = canvasMode === 'edit';
|
|
128
124
|
const navigateRegionsProps = (0, _components.__unstableUseNavigateRegions)({
|
|
129
125
|
previous: previousShortcut,
|
|
130
126
|
next: nextShortcut
|
|
131
127
|
});
|
|
132
128
|
const disableMotion = (0, _compose.useReducedMotion)();
|
|
133
129
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
134
|
-
const canvasPadding = isMobileViewport ? 0 : 24;
|
|
135
130
|
const showSidebar = isMobileViewport && !isListPage || !isMobileViewport && (canvasMode === 'view' || !isEditorPage);
|
|
136
|
-
const showCanvas = isMobileViewport && isEditorPage &&
|
|
137
|
-
const
|
|
138
|
-
const isFullCanvas = isMobileViewport && isListPage || isEditorPage && canvasMode === 'edit';
|
|
131
|
+
const showCanvas = isMobileViewport && isEditorPage && isEditing || !isMobileViewport || !isEditorPage;
|
|
132
|
+
const isFullCanvas = isMobileViewport && isListPage || isEditorPage && isEditing;
|
|
139
133
|
const [canvasResizer, canvasSize] = (0, _compose.useResizeObserver)();
|
|
140
|
-
const [fullResizer
|
|
141
|
-
const [
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (showFrame && !isResizing) {
|
|
148
|
-
canvasWidth = canvasSize.width - canvasPadding;
|
|
149
|
-
} // Synchronizing the URL with the store value of canvasMode happens in an effect
|
|
134
|
+
const [fullResizer] = (0, _compose.useResizeObserver)();
|
|
135
|
+
const [isResizing] = (0, _element.useState)(false);
|
|
136
|
+
const isEditorLoading = (0, _hooks.useIsSiteEditorLoading)(); // Sets the right context for the command center
|
|
137
|
+
|
|
138
|
+
const commandContext = canvasMode === 'edit' && isEditorPage ? 'site-editor-edit' : 'site-editor';
|
|
139
|
+
useCommandContext(commandContext); // Synchronizing the URL with the store value of canvasMode happens in an effect
|
|
150
140
|
// This condition ensures the component is only rendered after the synchronization happens
|
|
151
141
|
// which prevents any animations due to potential canvasMode value change.
|
|
152
142
|
|
|
153
|
-
|
|
154
143
|
if (canvasMode === 'init') {
|
|
155
144
|
return null;
|
|
156
145
|
}
|
|
157
146
|
|
|
158
|
-
return (0, _element.createElement)(_element.Fragment, null, (
|
|
147
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_commands.CommandMenu, null), (0, _element.createElement)(_register.default, null), (0, _element.createElement)(_global.default, null), fullResizer, (0, _element.createElement)("div", (0, _extends2.default)({}, navigateRegionsProps, {
|
|
159
148
|
ref: navigateRegionsProps.ref,
|
|
160
149
|
className: (0, _classnames.default)('edit-site-layout', navigateRegionsProps.className, {
|
|
161
150
|
'is-full-canvas': isFullCanvas,
|
|
162
|
-
'is-edit-mode':
|
|
151
|
+
'is-edit-mode': isEditing,
|
|
163
152
|
'has-fixed-toolbar': hasFixedToolbar
|
|
164
153
|
})
|
|
165
154
|
}), (0, _element.createElement)(_siteHub.default, {
|
|
@@ -167,7 +156,7 @@ function Layout() {
|
|
|
167
156
|
className: "edit-site-layout__hub"
|
|
168
157
|
}), (0, _element.createElement)(_components.__unstableAnimatePresence, {
|
|
169
158
|
initial: false
|
|
170
|
-
}, isEditorPage &&
|
|
159
|
+
}, isEditorPage && isEditing && (0, _element.createElement)(_interface.NavigableRegion, {
|
|
171
160
|
className: "edit-site-layout__header",
|
|
172
161
|
ariaLabel: (0, _i18n.__)('Editor top bar'),
|
|
173
162
|
as: _components.__unstableMotion.div,
|
|
@@ -185,12 +174,11 @@ function Layout() {
|
|
|
185
174
|
duration: disableMotion ? 0 : ANIMATION_DURATION,
|
|
186
175
|
ease: 'easeOut'
|
|
187
176
|
}
|
|
188
|
-
}, (0, _element.createElement)(_headerEditMode.default, null))), (0, _element.createElement)("div", {
|
|
177
|
+
}, isEditing && (0, _element.createElement)(_headerEditMode.default, null))), (0, _element.createElement)("div", {
|
|
189
178
|
className: "edit-site-layout__content"
|
|
190
179
|
}, (0, _element.createElement)(_components.__unstableAnimatePresence, {
|
|
191
180
|
initial: false
|
|
192
|
-
}, showSidebar && (0, _element.createElement)(_components.
|
|
193
|
-
as: _components.__unstableMotion.div,
|
|
181
|
+
}, showSidebar && (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
194
182
|
initial: {
|
|
195
183
|
opacity: 0
|
|
196
184
|
},
|
|
@@ -202,55 +190,16 @@ function Layout() {
|
|
|
202
190
|
},
|
|
203
191
|
transition: {
|
|
204
192
|
type: 'tween',
|
|
205
|
-
duration:
|
|
193
|
+
duration: ANIMATION_DURATION,
|
|
206
194
|
ease: 'easeOut'
|
|
207
195
|
},
|
|
208
|
-
|
|
209
|
-
height: '100%',
|
|
210
|
-
width: isResizingEnabled && forcedWidth ? forcedWidth : defaultSidebarWidth
|
|
211
|
-
},
|
|
212
|
-
className: "edit-site-layout__sidebar",
|
|
213
|
-
enable: {
|
|
214
|
-
right: isResizingEnabled
|
|
215
|
-
},
|
|
216
|
-
onResizeStop: (event, direction, elt) => {
|
|
217
|
-
setForcedWidth(elt.clientWidth);
|
|
218
|
-
setIsResizing(false);
|
|
219
|
-
},
|
|
220
|
-
onResizeStart: () => {
|
|
221
|
-
setIsResizing(true);
|
|
222
|
-
},
|
|
223
|
-
onResize: (event, direction, elt) => {
|
|
224
|
-
// This is a performance optimization
|
|
225
|
-
// We set the width imperatively to avoid re-rendering
|
|
226
|
-
// the whole component while resizing.
|
|
227
|
-
hubRef.current.style.width = elt.clientWidth - 48 + 'px';
|
|
228
|
-
},
|
|
229
|
-
handleComponent: {
|
|
230
|
-
right: (0, _element.createElement)(_resizeHandle.default, {
|
|
231
|
-
direction: "right",
|
|
232
|
-
variation: "separator",
|
|
233
|
-
resizeWidthBy: delta => {
|
|
234
|
-
setForcedWidth((forcedWidth !== null && forcedWidth !== void 0 ? forcedWidth : defaultSidebarWidth) + delta);
|
|
235
|
-
}
|
|
236
|
-
})
|
|
237
|
-
},
|
|
238
|
-
handleClasses: undefined,
|
|
239
|
-
handleStyles: {
|
|
240
|
-
right: emptyResizeHandleStyles
|
|
241
|
-
},
|
|
242
|
-
minWidth: isResizingEnabled ? 320 : undefined,
|
|
243
|
-
maxWidth: isResizingEnabled && fullSize ? fullSize.width - 360 : undefined
|
|
196
|
+
className: "edit-site-layout__sidebar"
|
|
244
197
|
}, (0, _element.createElement)(_interface.NavigableRegion, {
|
|
245
198
|
ariaLabel: (0, _i18n.__)('Navigation')
|
|
246
199
|
}, (0, _element.createElement)(_sidebar.default, null)))), (0, _element.createElement)(_savePanel.default, null), showCanvas && (0, _element.createElement)("div", {
|
|
247
200
|
className: (0, _classnames.default)('edit-site-layout__canvas-container', {
|
|
248
201
|
'is-resizing': isResizing
|
|
249
|
-
})
|
|
250
|
-
style: {
|
|
251
|
-
paddingTop: showFrame ? canvasPadding : 0,
|
|
252
|
-
paddingBottom: showFrame ? canvasPadding : 0
|
|
253
|
-
}
|
|
202
|
+
})
|
|
254
203
|
}, canvasResizer, !!canvasSize.width && (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
255
204
|
whileHover: isEditorPage && canvasMode === 'view' ? {
|
|
256
205
|
scale: 1.005,
|
|
@@ -267,22 +216,12 @@ function Layout() {
|
|
|
267
216
|
duration: disableMotion || isResizing ? 0 : ANIMATION_DURATION,
|
|
268
217
|
ease: 'easeOut'
|
|
269
218
|
}
|
|
270
|
-
}, (0, _element.createElement)(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
initial: false,
|
|
278
|
-
animate: {
|
|
279
|
-
width: canvasWidth
|
|
280
|
-
},
|
|
281
|
-
transition: {
|
|
282
|
-
type: 'tween',
|
|
283
|
-
duration: disableMotion || isResizing ? 0 : ANIMATION_DURATION,
|
|
284
|
-
ease: 'easeOut'
|
|
285
|
-
}
|
|
286
|
-
}, (0, _element.createElement)(_errorBoundary.default, null, isEditorPage && (0, _element.createElement)(_editor.default, null), isListPage && (0, _element.createElement)(_list.default, null))))))));
|
|
219
|
+
}, (0, _element.createElement)(_errorBoundary.default, null, isEditorPage && (0, _element.createElement)(_resizableFrame.default, {
|
|
220
|
+
isReady: !isEditorLoading,
|
|
221
|
+
isFullWidth: isEditing,
|
|
222
|
+
oversizedClassName: "edit-site-layout__resizable-frame-oversized"
|
|
223
|
+
}, (0, _element.createElement)(_editor.default, {
|
|
224
|
+
isLoading: isEditorLoading
|
|
225
|
+
})), isListPage && (0, _element.createElement)(_list.default, null)))))));
|
|
287
226
|
}
|
|
288
227
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["useCommands","coreCmmandsPrivateApis","useLocation","routerPrivateApis","ANIMATION_DURATION","emptyResizeHandleStyles","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","Layout","hubRef","params","isListPage","isEditorPage","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","preferencesStore","get","navigateRegionsProps","previous","next","disableMotion","isMobileViewport","canvasPadding","showSidebar","showCanvas","showFrame","isFullCanvas","canvasResizer","canvasSize","fullResizer","fullSize","forcedWidth","setForcedWidth","isResizing","setIsResizing","isResizingEnabled","defaultSidebarWidth","canvasWidth","window","__experimentalEnableCommandCenter","ref","className","motion","div","y","type","duration","ease","opacity","event","direction","elt","clientWidth","current","style","delta","paddingTop","paddingBottom","scale","transition"],"mappings":";;;;;;;;;AAqBA;;;;AAlBA;;AAKA;;AACA;;AAMA;;AAKA;;AAEA;;AACA;;AACA;;AACA;;AACA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4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,UAAU,EACTU,YAAY,IAAIE,UAAU,KAAK,MAA/B,GACG;AACAmD,MAAAA,KAAK,EAAE,KADP;AAEAC,MAAAA,UAAU,EAAE;AACXb,QAAAA,QAAQ,EACP1B,aAAa,IACba,UADA,GAEG,CAFH,GAGG,GALO;AAMXc,QAAAA,IAAI,EAAE;AANK;AAFZ,KADH,GAYG,EAdL;AAgBC,IAAA,OAAO,EAAG,KAhBX;AAiBC,IAAA,MAAM,EAAC,UAjBR;AAkBC,IAAA,SAAS,EAAC,0BAlBX;AAmBC,IAAA,UAAU,EAAG;AACZF,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACP1B,aAAa,IAAIa,UAAjB,GACG,CADH,GAEG5C,kBALQ;AAMZ0D,MAAAA,IAAI,EAAE;AANM;AAnBd,KA4BC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,KAAK,EAAG;AACPxD,MAAAA,QAAQ,EAAE,UADH;AAEPM,MAAAA,GAAG,EAAE,CAFE;AAGPG,MAAAA,IAAI,EAAE,CAHC;AAIPD,MAAAA,MAAM,EAAE;AAJD,KADT;AAOC,IAAA,OAAO,EAAG,KAPX;AAQC,IAAA,OAAO,EAAG;AACTJ,MAAAA,KAAK,EAAE0C;AADE,KARX;AAWC,IAAA,UAAU,EAAG;AACZQ,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACP1B,aAAa,IAAIa,UAAjB,GACG,CADH,GAEG5C,kBALQ;AAMZ0D,MAAAA,IAAI,EAAE;AANM;AAXd,KAoBC,4BAAC,sBAAD,QACG1C,YAAY,IAAI,4BAAC,eAAD,OADnB,EAEGD,UAAU,IAAI,4BAAC,aAAD,OAFjB,CApBD,CA5BD,CAdF,CArFF,CA3CD,CALD,CADD;AAiNA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tResizableBox,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { CommandMenu } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCmmandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ListPage from '../list';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizeHandle from '../block-editor/resize-handle';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../private-apis';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\n\nconst { useCommands } = unlock( coreCmmandsPrivateApis );\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\nconst emptyResizeHandleStyles = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isListPage = getIsListPage( params );\n\tconst isEditorPage = ! isListPage;\n\tconst { hasFixedToolbar, canvasMode, previousShortcut, nextShortcut } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/next-region'\n\t\t\t\t),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tselect( preferencesStore ).get( 'fixedToolbar' ),\n\t\t\t};\n\t\t}, [] );\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst canvasPadding = isMobileViewport ? 0 : 24;\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && canvasMode === 'edit' ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst showFrame =\n\t\t( ! isEditorPage && ! isMobileViewport ) ||\n\t\t( ! isMobileViewport && isEditorPage && canvasMode === 'view' );\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) ||\n\t\t( isEditorPage && canvasMode === 'edit' );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer, fullSize ] = useResizeObserver();\n\tconst [ forcedWidth, setForcedWidth ] = useState( null );\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst isResizingEnabled = ! isMobileViewport && canvasMode === 'view';\n\tconst defaultSidebarWidth = isMobileViewport ? '100vw' : 360;\n\tlet canvasWidth = isResizing ? '100%' : fullSize.width;\n\tif ( showFrame && ! isResizing ) {\n\t\tcanvasWidth = canvasSize.width - canvasPadding;\n\t}\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ window?.__experimentalEnableCommandCenter && <CommandMenu /> }\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': canvasMode === 'edit',\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<SiteHub ref={ hubRef } className=\"edit-site-layout__hub\" />\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage && canvasMode === 'edit' && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ showSidebar && (\n\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\tisResizingEnabled && forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t? forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t: defaultSidebarWidth,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\tright: isResizingEnabled,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\tsetForcedWidth( elt.clientWidth );\n\t\t\t\t\t\t\t\t\tsetIsResizing( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\tsetIsResizing( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResize={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\t// This is a performance optimization\n\t\t\t\t\t\t\t\t\t// We set the width imperatively to avoid re-rendering\n\t\t\t\t\t\t\t\t\t// the whole component while resizing.\n\t\t\t\t\t\t\t\t\thubRef.current.style.width =\n\t\t\t\t\t\t\t\t\t\telt.clientWidth - 48 + 'px';\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleComponent={ {\n\t\t\t\t\t\t\t\t\tright: (\n\t\t\t\t\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\t\t\t\t\t\tvariation=\"separator\"\n\t\t\t\t\t\t\t\t\t\t\tresizeWidthBy={ ( delta ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetForcedWidth(\n\t\t\t\t\t\t\t\t\t\t\t\t\t( forcedWidth ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultSidebarWidth ) +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelta\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),\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleClasses={ undefined }\n\t\t\t\t\t\t\t\thandleStyles={ {\n\t\t\t\t\t\t\t\t\tright: emptyResizeHandleStyles,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tminWidth={ isResizingEnabled ? 320 : undefined }\n\t\t\t\t\t\t\t\tmaxWidth={\n\t\t\t\t\t\t\t\t\tisResizingEnabled && fullSize\n\t\t\t\t\t\t\t\t\t\t? fullSize.width - 360\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tpaddingTop: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t\tpaddingBottom: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\tisEditorPage && canvasMode === 'view'\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\tscale: 1.005,\n\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\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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 }\n\t\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\tinitial={ false }\n\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\twidth: canvasWidth,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ isEditorPage && <Editor /> }\n\t\t\t\t\t\t\t\t\t\t\t{ isListPage && <ListPage /> }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","useLocation","routerPrivateApis","ANIMATION_DURATION","Layout","hubRef","params","isListPage","isEditorPage","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","preferencesStore","get","isEditing","navigateRegionsProps","previous","next","disableMotion","isMobileViewport","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isResizing","isEditorLoading","commandContext","ref","className","motion","div","y","type","duration","ease","opacity","width","scale","transition"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAKA;;AACA;;AAKA;;AAKA;;AAEA;;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BC,4BAAC,0BAAD;AACC,IAAA,SAAS,EAAG,cAAI,YAAJ;AADb,KAGC,4BAAC,gBAAD,OAHD,CAjBD,CAFF,CADD,EA6BC,4BAAC,kBAAD,OA7BD,EA+BGf,UAAU,IACX;AACC,IAAA,SAAS,EAAG,yBACX,oCADW,EAEX;AACC,qBAAeK;AADhB,KAFW;AADb,KAQGH,aARH,EASG,CAAC,CAAEC,UAAU,CAACc,KAAd,IACD,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,UAAU,EACTpC,YAAY,IAAIE,UAAU,KAAK,MAA/B,GACG;AACAmC,MAAAA,KAAK,EAAE,KADP;AAEAC,MAAAA,UAAU,EAAE;AACXL,QAAAA,QAAQ,EACPjB,aAAa,IACbQ,UADA,GAEG,CAFH,GAGG,GALO;AAMXU,QAAAA,IAAI,EAAE;AANK;AAFZ,KADH,GAYG,EAdL;AAgBC,IAAA,OAAO,EAAG,KAhBX;AAiBC,IAAA,MAAM,EAAC,UAjBR;AAkBC,IAAA,SAAS,EAAC,0BAlBX;AAmBC,IAAA,UAAU,EAAG;AACZF,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACPjB,aAAa,IAAIQ,UAAjB,GACG,CADH,GAEG7B,kBALQ;AAMZuC,MAAAA,IAAI,EAAE;AANM;AAnBd,KA4BC,4BAAC,sBAAD,QACGlC,YAAY,IACb,4BAAC,uBAAD;AACC,IAAA,OAAO,EAAG,CAAEyB,eADb;AAEC,IAAA,WAAW,EAAGb,SAFf;AAGC,IAAA,kBAAkB,EAAC;AAHpB,KAKC,4BAAC,eAAD;AACC,IAAA,SAAS,EACRa;AAFF,IALD,CAFF,EAcG1B,UAAU,IAAI,4BAAC,aAAD,OAdjB,CA5BD,CAVF,CAhCF,CA3CD,CALD,CADD;AA+IA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ListPage from '../list';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../private-apis';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isListPage = getIsListPage( params );\n\tconst isEditorPage = ! isListPage;\n\tconst { hasFixedToolbar, canvasMode, previousShortcut, nextShortcut } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/next-region'\n\t\t\t\t),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tselect( preferencesStore ).get( 'fixedToolbar' ),\n\t\t\t};\n\t\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst [ isResizing ] = useState( false );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\n\t// Sets the right context for the command center\n\tconst commandContext =\n\t\tcanvasMode === 'edit' && isEditorPage\n\t\t\t? 'site-editor-edit'\n\t\t\t: 'site-editor';\n\tuseCommandContext( commandContext );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<SiteHub ref={ hubRef } className=\"edit-site-layout__hub\" />\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isEditing && <Header /> }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ showSidebar && (\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\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\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\tisEditorPage && canvasMode === 'view'\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\tscale: 1.005,\n\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\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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 }\n\t\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\tinitial={ false }\n\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\toversizedClassName=\"edit-site-layout__resizable-frame-oversized\"\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<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\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</ResizableFrame>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ isListPage && <ListPage /> }\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -54,8 +54,6 @@ const TEMPLATE_POST_TYPE_NAMES = ['wp_template', 'wp_template_part'];
|
|
|
54
54
|
|
|
55
55
|
function useAddedBy(postType, postId) {
|
|
56
56
|
return (0, _data.useSelect)(select => {
|
|
57
|
-
var _user$avatar_urls;
|
|
58
|
-
|
|
59
57
|
const {
|
|
60
58
|
getTheme,
|
|
61
59
|
getPlugin,
|
|
@@ -73,24 +71,20 @@ function useAddedBy(postType, postId) {
|
|
|
73
71
|
// older customized templates by checking for no origin and a 'theme'
|
|
74
72
|
// or 'custom' source.
|
|
75
73
|
if (template.has_theme_file && (template.origin === 'theme' || !template.origin && ['theme', 'custom'].includes(template.source))) {
|
|
76
|
-
var _getTheme, _getTheme$name;
|
|
77
|
-
|
|
78
74
|
return {
|
|
79
75
|
type: 'theme',
|
|
80
76
|
icon: _icons.layout,
|
|
81
|
-
text:
|
|
77
|
+
text: getTheme(template.theme)?.name?.rendered || template.theme,
|
|
82
78
|
isCustomized: template.source === 'custom'
|
|
83
79
|
};
|
|
84
80
|
} // Added by plugin.
|
|
85
81
|
|
|
86
82
|
|
|
87
83
|
if (template.has_theme_file && template.origin === 'plugin') {
|
|
88
|
-
var _getPlugin;
|
|
89
|
-
|
|
90
84
|
return {
|
|
91
85
|
type: 'plugin',
|
|
92
86
|
icon: _icons.plugins,
|
|
93
|
-
text:
|
|
87
|
+
text: getPlugin(template.theme)?.name || template.theme,
|
|
94
88
|
isCustomized: template.source === 'custom'
|
|
95
89
|
};
|
|
96
90
|
} // Added by site.
|
|
@@ -100,14 +94,12 @@ function useAddedBy(postType, postId) {
|
|
|
100
94
|
|
|
101
95
|
|
|
102
96
|
if (!template.has_theme_file && template.source === 'custom' && !template.author) {
|
|
103
|
-
var _getMedia;
|
|
104
|
-
|
|
105
97
|
const siteData = getEntityRecord('root', '__unstableBase');
|
|
106
98
|
return {
|
|
107
99
|
type: 'site',
|
|
108
100
|
icon: _icons.globe,
|
|
109
|
-
imageUrl: siteData
|
|
110
|
-
text: siteData
|
|
101
|
+
imageUrl: siteData?.site_logo ? getMedia(siteData.site_logo)?.source_url : undefined,
|
|
102
|
+
text: siteData?.name,
|
|
111
103
|
isCustomized: false
|
|
112
104
|
};
|
|
113
105
|
}
|
|
@@ -118,8 +110,8 @@ function useAddedBy(postType, postId) {
|
|
|
118
110
|
return {
|
|
119
111
|
type: 'user',
|
|
120
112
|
icon: _icons.commentAuthorAvatar,
|
|
121
|
-
imageUrl: user
|
|
122
|
-
text: user
|
|
113
|
+
imageUrl: user?.avatar_urls?.[48],
|
|
114
|
+
text: user?.nickname,
|
|
123
115
|
isCustomized: false
|
|
124
116
|
};
|
|
125
117
|
}, [postType, postId]);
|
|
@@ -130,10 +122,9 @@ function useAddedBy(postType, postId) {
|
|
|
130
122
|
*/
|
|
131
123
|
|
|
132
124
|
|
|
133
|
-
function AvatarImage(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} = _ref;
|
|
125
|
+
function AvatarImage({
|
|
126
|
+
imageUrl
|
|
127
|
+
}) {
|
|
137
128
|
const [isImageLoaded, setIsImageLoaded] = (0, _element.useState)(false);
|
|
138
129
|
return (0, _element.createElement)("div", {
|
|
139
130
|
className: (0, _classnames.default)('edit-site-list-added-by__avatar', {
|
|
@@ -152,11 +143,10 @@ function AvatarImage(_ref) {
|
|
|
152
143
|
*/
|
|
153
144
|
|
|
154
145
|
|
|
155
|
-
function AddedBy(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} = _ref2;
|
|
146
|
+
function AddedBy({
|
|
147
|
+
postType,
|
|
148
|
+
postId
|
|
149
|
+
}) {
|
|
160
150
|
const {
|
|
161
151
|
text,
|
|
162
152
|
icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/added-by.js"],"names":["TEMPLATE_POST_TYPE_NAMES","useAddedBy","postType","postId","select","getTheme","getPlugin","getEntityRecord","getMedia","getUser","getEditedEntityRecord","coreStore","template","includes","type","has_theme_file","origin","source","icon","themeIcon","text","theme","name","rendered","isCustomized","pluginIcon","author","siteData","globeIcon","imageUrl","site_logo","source_url","undefined","user","authorIcon","avatar_urls","nickname","AvatarImage","isImageLoaded","setIsImageLoaded","AddedBy"],"mappings":";;;;;;;;;;AAYA;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AAMA;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;;AAEA;AACA,MAAMA,wBAAwB,GAAG,CAAE,aAAF,EAAiB,kBAAjB,CAAjC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,UAAT,CAAqBC,QAArB,EAA+BC,MAA/B,EAAwC;AAC9C,SAAO,qBACJC,MAAF,IAAc;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/added-by.js"],"names":["TEMPLATE_POST_TYPE_NAMES","useAddedBy","postType","postId","select","getTheme","getPlugin","getEntityRecord","getMedia","getUser","getEditedEntityRecord","coreStore","template","includes","type","has_theme_file","origin","source","icon","themeIcon","text","theme","name","rendered","isCustomized","pluginIcon","author","siteData","globeIcon","imageUrl","site_logo","source_url","undefined","user","authorIcon","avatar_urls","nickname","AvatarImage","isImageLoaded","setIsImageLoaded","AddedBy"],"mappings":";;;;;;;;;;AAYA;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AAMA;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;;AAEA;AACA,MAAMA,wBAAwB,GAAG,CAAE,aAAF,EAAiB,kBAAjB,CAAjC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,UAAT,CAAqBC,QAArB,EAA+BC,MAA/B,EAAwC;AAC9C,SAAO,qBACJC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,QADK;AAELC,MAAAA,SAFK;AAGLC,MAAAA,eAHK;AAILC,MAAAA,QAJK;AAKLC,MAAAA,OALK;AAMLC,MAAAA;AANK,QAOFN,MAAM,CAAEO,eAAF,CAPV;AAQA,UAAMC,QAAQ,GAAGF,qBAAqB,CACrC,UADqC,EAErCR,QAFqC,EAGrCC,MAHqC,CAAtC;;AAMA,QAAKH,wBAAwB,CAACa,QAAzB,CAAmCD,QAAQ,CAACE,IAA5C,CAAL,EAA0D;AACzD;AACA;AACA;AACA;AACA;AACA,UACCF,QAAQ,CAACG,cAAT,KACEH,QAAQ,CAACI,MAAT,KAAoB,OAApB,IACC,CAAEJ,QAAQ,CAACI,MAAX,IACD,CAAE,OAAF,EAAW,QAAX,EAAsBH,QAAtB,CACCD,QAAQ,CAACK,MADV,CAHF,CADD,EAOE;AACD,eAAO;AACNH,UAAAA,IAAI,EAAE,OADA;AAENI,UAAAA,IAAI,EAAEC,aAFA;AAGNC,UAAAA,IAAI,EACHf,QAAQ,CAAEO,Q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","sourcesContent":["// @ts-check\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport {\n\tcommentAuthorAvatar as authorIcon,\n\tlayout as themeIcon,\n\tplugins as pluginIcon,\n\tglobe as globeIcon,\n} from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\n/** @typedef {'wp_template'|'wp_template_part'} TemplateType */\n\n/** @type {TemplateType} */\nconst TEMPLATE_POST_TYPE_NAMES = [ 'wp_template', 'wp_template_part' ];\n\n/**\n * @typedef {'theme'|'plugin'|'site'|'user'} AddedByType\n *\n * @typedef AddedByData\n * @type {Object}\n * @property {AddedByType} type The type of the data.\n * @property {JSX.Element} icon The icon to display.\n * @property {string} [imageUrl] The optional image URL to display.\n * @property {string} [text] The text to display.\n * @property {boolean} isCustomized Whether the template has been customized.\n *\n * @param {TemplateType} postType The template post type.\n * @param {number} postId The template post id.\n * @return {AddedByData} The added by object or null.\n */\nexport function useAddedBy( postType, postId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTheme,\n\t\t\t\tgetPlugin,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetMedia,\n\t\t\t\tgetUser,\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t} = select( coreStore );\n\t\t\tconst template = 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\tif ( TEMPLATE_POST_TYPE_NAMES.includes( template.type ) ) {\n\t\t\t\t// Added by theme.\n\t\t\t\t// Template originally provided by a theme, but customized by a user.\n\t\t\t\t// Templates originally didn't have the 'origin' field so identify\n\t\t\t\t// older customized templates by checking for no origin and a 'theme'\n\t\t\t\t// or 'custom' source.\n\t\t\t\tif (\n\t\t\t\t\ttemplate.has_theme_file &&\n\t\t\t\t\t( template.origin === 'theme' ||\n\t\t\t\t\t\t( ! template.origin &&\n\t\t\t\t\t\t\t[ 'theme', 'custom' ].includes(\n\t\t\t\t\t\t\t\ttemplate.source\n\t\t\t\t\t\t\t) ) )\n\t\t\t\t) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'theme',\n\t\t\t\t\t\ticon: themeIcon,\n\t\t\t\t\t\ttext:\n\t\t\t\t\t\t\tgetTheme( template.theme )?.name?.rendered ||\n\t\t\t\t\t\t\ttemplate.theme,\n\t\t\t\t\t\tisCustomized: template.source === 'custom',\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Added by plugin.\n\t\t\t\tif ( template.has_theme_file && template.origin === 'plugin' ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'plugin',\n\t\t\t\t\t\ticon: pluginIcon,\n\t\t\t\t\t\ttext:\n\t\t\t\t\t\t\tgetPlugin( template.theme )?.name || template.theme,\n\t\t\t\t\t\tisCustomized: template.source === 'custom',\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Added by site.\n\t\t\t\t// Template was created from scratch, but has no author. Author support\n\t\t\t\t// was only added to templates in WordPress 5.9. Fallback to showing the\n\t\t\t\t// site logo and title.\n\t\t\t\tif (\n\t\t\t\t\t! template.has_theme_file &&\n\t\t\t\t\ttemplate.source === 'custom' &&\n\t\t\t\t\t! template.author\n\t\t\t\t) {\n\t\t\t\t\tconst siteData = getEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'__unstableBase'\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'site',\n\t\t\t\t\t\ticon: globeIcon,\n\t\t\t\t\t\timageUrl: siteData?.site_logo\n\t\t\t\t\t\t\t? getMedia( siteData.site_logo )?.source_url\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\ttext: siteData?.name,\n\t\t\t\t\t\tisCustomized: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Added by user.\n\t\t\tconst user = getUser( template.author );\n\t\t\treturn {\n\t\t\t\ttype: 'user',\n\t\t\t\ticon: authorIcon,\n\t\t\t\timageUrl: user?.avatar_urls?.[ 48 ],\n\t\t\t\ttext: user?.nickname,\n\t\t\t\tisCustomized: false,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n}\n\n/**\n * @param {Object} props\n * @param {string} props.imageUrl\n */\nfunction AvatarImage( { imageUrl } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-list-added-by__avatar', {\n\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t} ) }\n\t\t>\n\t\t\t<img\n\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ imageUrl }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * @param {Object} props\n * @param {TemplateType} props.postType The template post type.\n * @param {number} props.postId The template post id.\n */\nexport default function AddedBy( { postType, postId } ) {\n\tconst { text, icon, imageUrl, isCustomized } = useAddedBy(\n\t\tpostType,\n\t\tpostId\n\t);\n\n\treturn (\n\t\t<HStack alignment=\"left\">\n\t\t\t{ imageUrl ? (\n\t\t\t\t<AvatarImage imageUrl={ imageUrl } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-list-added-by__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span>\n\t\t\t\t{ text }\n\t\t\t\t{ isCustomized && (\n\t\t\t\t\t<span className=\"edit-site-list-added-by__customized-info\">\n\t\t\t\t\t\t{ postType === 'wp_template'\n\t\t\t\t\t\t\t? _x( 'Customized', 'template' )\n\t\t\t\t\t\t\t: _x( 'Customized', 'template part' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -26,12 +26,9 @@ var _store = require("../../store");
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
function Header(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let {
|
|
33
|
-
templateType
|
|
34
|
-
} = _ref;
|
|
29
|
+
function Header({
|
|
30
|
+
templateType
|
|
31
|
+
}) {
|
|
35
32
|
const {
|
|
36
33
|
canCreate,
|
|
37
34
|
postType
|
|
@@ -54,7 +51,7 @@ function Header(_ref) {
|
|
|
54
51
|
}, (0, _element.createElement)(_components.__experimentalHeading, {
|
|
55
52
|
level: 1,
|
|
56
53
|
className: "edit-site-list-header__title"
|
|
57
|
-
},
|
|
54
|
+
}, postType.labels?.name), canCreate && (0, _element.createElement)("div", {
|
|
58
55
|
className: "edit-site-list-header__right"
|
|
59
56
|
}, (0, _element.createElement)(_addNewTemplate.default, {
|
|
60
57
|
templateType: templateType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/header.js"],"names":["Header","templateType","canCreate","postType","select","supportsTemplatePartsMode","editSiteStore","getSettings","coreStore","getPostType","labels","name","variant"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIe,SAASA,MAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/header.js"],"names":["Header","templateType","canCreate","postType","select","supportsTemplatePartsMode","editSiteStore","getSettings","coreStore","getPostType","labels","name","variant"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIe,SAASA,MAAT,CAAiB;AAAEC,EAAAA;AAAF,CAAjB,EAAoC;AAClD,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0B,qBAC7BC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QACLD,MAAM,CAAEE,YAAF,CAAN,CAAwBC,WAAxB,EADD;AAEA,WAAO;AACNJ,MAAAA,QAAQ,EAAEC,MAAM,CAAEI,eAAF,CAAN,CAAoBC,WAApB,CAAiCR,YAAjC,CADJ;AAENC,MAAAA,SAAS,EAAE,CAAEG;AAFP,KAAP;AAIA,GAR8B,EAS/B,CAAEJ,YAAF,CAT+B,CAAhC;;AAYA,MAAK,CAAEE,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACC,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG,CAAjB;AAAqB,IAAA,SAAS,EAAC;AAA/B,KACGA,QAAQ,CAACO,MAAT,EAAiBC,IADpB,CADD,EAKGT,SAAS,IACV;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,uBAAD;AACC,IAAA,YAAY,EAAGD,YADhB;AAEC,IAAA,QAAQ,EAAG,KAFZ;AAGC,IAAA,WAAW,EAAG;AAAEW,MAAAA,OAAO,EAAE;AAAX;AAHf,IADD,CANF,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport AddNewTemplate from '../add-new-template';\nimport { store as editSiteStore } from '../../store';\n\nexport default function Header( { templateType } ) {\n\tconst { canCreate, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { supportsTemplatePartsMode } =\n\t\t\t\tselect( editSiteStore ).getSettings();\n\t\t\treturn {\n\t\t\t\tpostType: select( coreStore ).getPostType( templateType ),\n\t\t\t\tcanCreate: ! supportsTemplatePartsMode,\n\t\t\t};\n\t\t},\n\t\t[ templateType ]\n\t);\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<header className=\"edit-site-list-header\">\n\t\t\t<Heading level={ 1 } className=\"edit-site-list-header__title\">\n\t\t\t\t{ postType.labels?.name }\n\t\t\t</Heading>\n\n\t\t\t{ canCreate && (\n\t\t\t\t<div className=\"edit-site-list-header__right\">\n\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\ttemplateType={ templateType }\n\t\t\t\t\t\tshowIcon={ false }\n\t\t\t\t\t\ttoggleProps={ { variant: 'primary' } }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</header>\n\t);\n}\n"]}
|
|
@@ -45,8 +45,6 @@ const {
|
|
|
45
45
|
} = (0, _privateApis.unlock)(_router.privateApis);
|
|
46
46
|
|
|
47
47
|
function List() {
|
|
48
|
-
var _postType$labels, _postType$labels2;
|
|
49
|
-
|
|
50
48
|
const {
|
|
51
49
|
params: {
|
|
52
50
|
path
|
|
@@ -64,10 +62,10 @@ function List() {
|
|
|
64
62
|
};
|
|
65
63
|
}, []);
|
|
66
64
|
const postType = (0, _data.useSelect)(select => select(_coreData.store).getPostType(templateType), [templateType]);
|
|
67
|
-
(0, _useTitle.default)(postType
|
|
65
|
+
(0, _useTitle.default)(postType?.labels?.name); // `postType` could load in asynchronously. Only provide the detailed region labels if
|
|
68
66
|
// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.
|
|
69
67
|
|
|
70
|
-
const itemsListLabel = postType
|
|
68
|
+
const itemsListLabel = postType?.labels?.items_list;
|
|
71
69
|
const detailedRegionLabels = postType ? {
|
|
72
70
|
header: (0, _i18n.sprintf)( // translators: %s - the name of the page, 'Header' as in the header area of that page.
|
|
73
71
|
(0, _i18n.__)('%s - Header'), itemsListLabel),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["useLocation","routerPrivateApis","List","params","path","templateType","previousShortcut","nextShortcut","select","keyboardShortcutsStore","getAllShortcutKeyCombinations","postType","coreStore","getPostType","labels","name","itemsListLabel","items_list","detailedRegionLabels","header","body","undefined","previous","next"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AASA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,yBAAQC,mBAAR,CAAxB;;AAEe,SAASC,IAAT,GAAgB;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["useLocation","routerPrivateApis","List","params","path","templateType","previousShortcut","nextShortcut","select","keyboardShortcutsStore","getAllShortcutKeyCombinations","postType","coreStore","getPostType","labels","name","itemsListLabel","items_list","detailedRegionLabels","header","body","undefined","previous","next"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AASA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,yBAAQC,mBAAR,CAAxB;;AAEe,SAASC,IAAT,GAAgB;AAC9B,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEFJ,WAAW,EAFf;AAGA,QAAMK,YAAY,GACjBD,IAAI,KAAK,kBAAT,GAA8B,aAA9B,GAA8C,kBAD/C;AAGA;AAEA,QAAM;AAAEE,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAAqC,qBAAaC,MAAF,IAAc;AACnE,WAAO;AACNF,MAAAA,gBAAgB,EAAEE,MAAM,CACvBC,wBADuB,CAAN,CAEhBC,6BAFgB,CAEe,gCAFf,CADZ;AAINH,MAAAA,YAAY,EAAEC,MAAM,CACnBC,wBADmB,CAAN,CAEZC,6BAFY,CAEmB,4BAFnB;AAJR,KAAP;AAQA,GAT0C,EASxC,EATwC,CAA3C;AAWA,QAAMC,QAAQ,GAAG,qBACdH,MAAF,IAAcA,MAAM,CAAEI,eAAF,CAAN,CAAoBC,WAApB,CAAiCR,YAAjC,CADE,EAEhB,CAAEA,YAAF,CAFgB,CAAjB;AAKA,yBAAUM,QAAQ,EAAEG,MAAV,EAAkBC,IAA5B,EAzB8B,CA2B9B;AACA;;AACA,QAAMC,cAAc,GAAGL,QAAQ,EAAEG,MAAV,EAAkBG,UAAzC;AACA,QAAMC,oBAAoB,GAAGP,QAAQ,GAClC;AACAQ,IAAAA,MAAM,EAAE,oBACP;AACA,kBAAI,aAAJ,CAFO,EAGPH,cAHO,CADR;AAMAI,IAAAA,IAAI,EAAE,oBACL;AACA,kBAAI,cAAJ,CAFK,EAGLJ,cAHK;AANN,GADkC,GAalCK,SAbH;AAeA,SACC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAC,gBADX;AAEC,IAAA,MAAM,EAAGH,oBAFV;AAGC,IAAA,MAAM,EAAG,4BAAC,eAAD;AAAQ,MAAA,YAAY,EAAGb;AAAvB,MAHV;AAIC,IAAA,OAAO,EAAG,4BAAC,uBAAD,OAJX;AAKC,IAAA,OAAO,EAAG,4BAAC,cAAD;AAAO,MAAA,YAAY,EAAGA;AAAtB,MALX;AAMC,IAAA,SAAS,EAAG;AACXiB,MAAAA,QAAQ,EAAEhB,gBADC;AAEXiB,MAAAA,IAAI,EAAEhB;AAFK;AANb,IADD;AAaA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { InterfaceSkeleton } from '@wordpress/interface';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { EditorSnackbars } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport useRegisterShortcuts from './use-register-shortcuts';\nimport Header from './header';\nimport Table from './table';\nimport useTitle from '../routes/use-title';\nimport { unlock } from '../../private-apis';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function List() {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst templateType =\n\t\tpath === '/wp_template/all' ? 'wp_template' : 'wp_template_part';\n\n\tuseRegisterShortcuts();\n\n\tconst { previousShortcut, nextShortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t};\n\t}, [] );\n\n\tconst postType = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( templateType ),\n\t\t[ templateType ]\n\t);\n\n\tuseTitle( postType?.labels?.name );\n\n\t// `postType` could load in asynchronously. Only provide the detailed region labels if\n\t// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.\n\tconst itemsListLabel = postType?.labels?.items_list;\n\tconst detailedRegionLabels = postType\n\t\t? {\n\t\t\t\theader: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Header' as in the header area of that page.\n\t\t\t\t\t__( '%s - Header' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t\t\tbody: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Content' as in the content area of that page.\n\t\t\t\t\t__( '%s - Content' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t }\n\t\t: undefined;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tclassName=\"edit-site-list\"\n\t\t\tlabels={ detailedRegionLabels }\n\t\t\theader={ <Header templateType={ templateType } /> }\n\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\tcontent={ <Table templateType={ templateType } /> }\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
|