@wordpress/edit-site 5.11.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 +2 -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-content.js +4 -5
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +19 -22
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- 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 +19 -26
- 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 +13 -10
- 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 +25 -29
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +26 -17
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +7 -8
- 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 +9 -10
- 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 +8 -8
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
- 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 +5 -11
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +3 -3
- 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 +5 -6
- 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 +40 -21
- 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 +102 -23
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +2 -6
- 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/index.js +4 -12
- 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 +20 -12
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +11 -14
- 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 +8 -3
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +7 -5
- 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-module/components/sidebar-edit-mode/template-revisions/index.js.map → build/components/sidebar-edit-mode/template-panel/last-revision.js.map} +1 -1
- 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 +103 -13
- package/build/components/sidebar-navigation-screen-global-styles/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 +7 -10
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
- 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 +20 -23
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
- 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 +8 -9
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
- 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 +13 -18
- 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 -13
- 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 +35 -39
- 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 +34 -31
- 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/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 +6 -8
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- 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 +129 -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-content.js +4 -5
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +19 -22
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +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 +18 -26
- 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 +12 -10
- 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 +25 -29
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +26 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +7 -8
- 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 +9 -10
- 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 +8 -8
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
- 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 +5 -10
- 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 +3 -3
- 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 +5 -6
- 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 +40 -21
- 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 +102 -24
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +2 -6
- 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/index.js +4 -12
- 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 +20 -12
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +11 -13
- 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 +9 -3
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +6 -5
- 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 +104 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/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 +7 -10
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +17 -23
- 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 +20 -23
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +4 -5
- 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 +8 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -1
- 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 +13 -18
- 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 -14
- 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 +35 -39
- 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/{list/actions → template-actions}/index.js +34 -31
- 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/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 +6 -8
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- 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 +125 -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 +281 -59
- package/build-style/style.css +281 -59
- package/package.json +39 -36
- package/src/components/add-new-page/index.js +105 -0
- package/src/components/add-new-template/new-template.js +2 -1
- package/src/components/block-editor/index.js +25 -14
- package/src/components/editor/index.js +14 -8
- package/src/components/editor/style.scss +6 -11
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -5
- package/src/components/global-styles/ui.js +28 -0
- package/src/components/header-edit-mode/document-actions/index.js +126 -32
- package/src/components/header-edit-mode/document-actions/style.scss +64 -9
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
- package/src/components/layout/index.js +3 -9
- 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 +15 -5
- package/src/components/resizable-frame/style.scss +20 -18
- package/src/components/revisions/index.js +6 -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 +8 -1
- package/src/components/sidebar/index.js +6 -4
- 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-card → template-panel}/style.scss +2 -32
- package/src/components/sidebar-navigation-screen/index.js +74 -50
- package/src/components/sidebar-navigation-screen/style.scss +45 -4
- package/src/components/sidebar-navigation-screen-global-styles/index.js +118 -12
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
- 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 +1 -1
- package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
- package/src/components/site-hub/index.js +21 -6
- package/src/components/site-hub/style.scss +26 -0
- package/src/components/{list/actions → template-actions}/index.js +19 -6
- package/src/hooks/push-changes-to-global-styles/index.js +13 -7
- package/src/store/actions.js +20 -1
- 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/style.scss +5 -2
- package/src/utils/is-previewing-theme.js +1 -4
- 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/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-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/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/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
- /package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
- /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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -9,10 +10,11 @@ import classnames from 'classnames';
|
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import { Button, Modal } from '@wordpress/components';
|
|
12
|
-
import { EntitiesSavedStates } from '@wordpress/editor';
|
|
13
|
+
import { EntitiesSavedStates, useEntitiesSavedStatesIsDirty, privateApis } from '@wordpress/editor';
|
|
13
14
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
14
|
-
import { __ } from '@wordpress/i18n';
|
|
15
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
15
16
|
import { NavigableRegion } from '@wordpress/interface';
|
|
17
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
16
18
|
/**
|
|
17
19
|
* Internal dependencies
|
|
18
20
|
*/
|
|
@@ -20,9 +22,59 @@ import { NavigableRegion } from '@wordpress/interface';
|
|
|
20
22
|
import { store as editSiteStore } from '../../store';
|
|
21
23
|
import { unlock } from '../../private-apis';
|
|
22
24
|
import { useActivateTheme } from '../../utils/use-activate-theme';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
import { currentlyPreviewingTheme, isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
26
|
+
const {
|
|
27
|
+
EntitiesSavedStatesExtensible
|
|
28
|
+
} = unlock(privateApis);
|
|
29
|
+
|
|
30
|
+
const EntitiesSavedStatesForPreview = ({
|
|
31
|
+
onClose
|
|
32
|
+
}) => {
|
|
33
|
+
const isDirtyProps = useEntitiesSavedStatesIsDirty();
|
|
34
|
+
let activateSaveLabel;
|
|
35
|
+
|
|
36
|
+
if (isDirtyProps.isDirty) {
|
|
37
|
+
activateSaveLabel = __('Activate & Save');
|
|
38
|
+
} else {
|
|
39
|
+
activateSaveLabel = __('Activate');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const {
|
|
43
|
+
getTheme
|
|
44
|
+
} = useSelect(coreStore);
|
|
45
|
+
const theme = getTheme(currentlyPreviewingTheme());
|
|
46
|
+
const additionalPrompt = createElement("p", null, sprintf('Saving your changes will change your active theme to %1$s.', theme?.name?.rendered));
|
|
47
|
+
const activateTheme = useActivateTheme();
|
|
48
|
+
|
|
49
|
+
const onSave = async values => {
|
|
50
|
+
await activateTheme();
|
|
51
|
+
return values;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return createElement(EntitiesSavedStatesExtensible, _extends({}, isDirtyProps, {
|
|
55
|
+
additionalPrompt,
|
|
56
|
+
close: onClose,
|
|
57
|
+
onSave,
|
|
58
|
+
saveEnabled: true,
|
|
59
|
+
saveLabel: activateSaveLabel
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const _EntitiesSavedStates = ({
|
|
64
|
+
onClose
|
|
65
|
+
}) => {
|
|
66
|
+
if (isPreviewingTheme()) {
|
|
67
|
+
return createElement(EntitiesSavedStatesForPreview, {
|
|
68
|
+
onClose: onClose
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return createElement(EntitiesSavedStates, {
|
|
73
|
+
close: onClose
|
|
74
|
+
});
|
|
75
|
+
};
|
|
25
76
|
|
|
77
|
+
export default function SavePanel() {
|
|
26
78
|
const {
|
|
27
79
|
isSaveViewOpen,
|
|
28
80
|
canvasMode
|
|
@@ -41,29 +93,18 @@ export default function SavePanel() {
|
|
|
41
93
|
const {
|
|
42
94
|
setIsSaveViewOpened
|
|
43
95
|
} = useDispatch(editSiteStore);
|
|
44
|
-
const activateTheme = useActivateTheme();
|
|
45
96
|
|
|
46
97
|
const onClose = () => setIsSaveViewOpened(false);
|
|
47
98
|
|
|
48
|
-
const onSave = async values => {
|
|
49
|
-
await activateTheme();
|
|
50
|
-
return values;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const entitySavedStates = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableThemePreviews ? createElement(EntitiesSavedStates, {
|
|
54
|
-
close: onClose,
|
|
55
|
-
onSave: onSave
|
|
56
|
-
}) : createElement(EntitiesSavedStates, {
|
|
57
|
-
close: onClose
|
|
58
|
-
});
|
|
59
|
-
|
|
60
99
|
if (canvasMode === 'view') {
|
|
61
100
|
return isSaveViewOpen ? createElement(Modal, {
|
|
62
101
|
className: "edit-site-save-panel__modal",
|
|
63
102
|
onRequestClose: onClose,
|
|
64
103
|
__experimentalHideHeader: true,
|
|
65
104
|
contentLabel: __('Save site, content, and template changes')
|
|
66
|
-
},
|
|
105
|
+
}, createElement(_EntitiesSavedStates, {
|
|
106
|
+
onClose: onClose
|
|
107
|
+
})) : null;
|
|
67
108
|
}
|
|
68
109
|
|
|
69
110
|
return createElement(NavigableRegion, {
|
|
@@ -71,7 +112,9 @@ export default function SavePanel() {
|
|
|
71
112
|
'is-entity-save-view-open': isSaveViewOpen
|
|
72
113
|
}),
|
|
73
114
|
ariaLabel: __('Save panel')
|
|
74
|
-
}, isSaveViewOpen ?
|
|
115
|
+
}, isSaveViewOpen ? createElement(_EntitiesSavedStates, {
|
|
116
|
+
onClose: onClose
|
|
117
|
+
}) : createElement("div", {
|
|
75
118
|
className: "edit-site-editor__toggle-save-panel"
|
|
76
119
|
}, createElement(Button, {
|
|
77
120
|
variant: "secondary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useDispatch","useSelect","__","NavigableRegion","store","editSiteStore","unlock","useActivateTheme","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","currentlyPreviewingTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","isDirtyProps","activateSaveLabel","isDirty","getTheme","theme","additionalPrompt","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst { getTheme } = useSelect( coreStore );\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t'Saving your changes will change your active theme to %1$s.',\n\t\t\t\ttheme?.name?.rendered\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -7,6 +7,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
7
7
|
import { Button } from '@wordpress/components';
|
|
8
8
|
import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
|
|
9
9
|
import { useDispatch } from '@wordpress/data';
|
|
10
|
+
import { useState } from '@wordpress/element';
|
|
10
11
|
import { __ } from '@wordpress/i18n';
|
|
11
12
|
import { closeSmall } from '@wordpress/icons';
|
|
12
13
|
import { ESCAPE } from '@wordpress/keycodes';
|
|
@@ -22,7 +23,10 @@ const {
|
|
|
22
23
|
export default function ListViewSidebar() {
|
|
23
24
|
const {
|
|
24
25
|
setIsListViewOpened
|
|
25
|
-
} = useDispatch(editSiteStore);
|
|
26
|
+
} = useDispatch(editSiteStore); // Use internal state instead of a ref to make sure that the component
|
|
27
|
+
// re-renders when the dropZoneElement updates.
|
|
28
|
+
|
|
29
|
+
const [dropZoneElement, setDropZoneElement] = useState(null);
|
|
26
30
|
const focusOnMountRef = useFocusOnMount('firstElement');
|
|
27
31
|
const headerFocusReturnRef = useFocusReturn();
|
|
28
32
|
const contentFocusReturnRef = useFocusReturn();
|
|
@@ -46,8 +50,10 @@ export default function ListViewSidebar() {
|
|
|
46
50
|
onClick: () => setIsListViewOpened(false)
|
|
47
51
|
})), createElement("div", {
|
|
48
52
|
className: "edit-site-editor__list-view-panel-content",
|
|
49
|
-
ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef])
|
|
50
|
-
}, createElement(PrivateListView,
|
|
53
|
+
ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef, setDropZoneElement])
|
|
54
|
+
}, createElement(PrivateListView, {
|
|
55
|
+
dropZoneElement: dropZoneElement
|
|
56
|
+
})))
|
|
51
57
|
);
|
|
52
58
|
}
|
|
53
59
|
//# sourceMappingURL=list-view-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","__","closeSmall","ESCAPE","store","editSiteStore","unlock","PrivateListView","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsBD,MAAM,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["privateApis","blockEditorPrivateApis","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","useState","__","closeSmall","ESCAPE","store","editSiteStore","unlock","PrivateListView","ListViewSidebar","setIsListViewOpened","dropZoneElement","setDropZoneElement","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAsBD,MAAM,CAAEZ,sBAAF,CAAlC;AAEA,eAAe,SAASc,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BV,WAAW,CAAEM,aAAF,CAA3C,CADyC,CAGzC;AACA;;AACA,QAAM,CAAEK,eAAF,EAAmBC,kBAAnB,IAA0CX,QAAQ,CAAE,IAAF,CAAxD;AAEA,QAAMY,eAAe,GAAGhB,eAAe,CAAE,cAAF,CAAvC;AACA,QAAMiB,oBAAoB,GAAGhB,cAAc,EAA3C;AACA,QAAMiB,qBAAqB,GAAGjB,cAAc,EAA5C;;AAEA,WAASkB,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBd,MAAlB,IAA4B,CAAEa,KAAK,CAACE,gBAAzC,EAA4D;AAC3DT,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD;;AAED,SACC;AACA;AACC,MAAA,SAAS,EAAC,mCADX;AAEC,MAAA,SAAS,EAAGM;AAFb,OAIC;AACC,MAAA,SAAS,EAAC,0CADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIC,8BAAUZ,EAAE,CAAE,WAAF,CAAZ,CAJD,EAKC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGC,UADR;AAEC,MAAA,KAAK,EAAGD,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,OAAO,EAAG,MAAMQ,mBAAmB,CAAE,KAAF;AAHpC,MALD,CAJD,EAeC;AACC,MAAA,SAAS,EAAC,2CADX;AAEC,MAAA,GAAG,EAAGX,YAAY,CAAE,CACnBgB,qBADmB,EAEnBF,eAFmB,EAGnBD,kBAHmB,CAAF;AAFnB,OAQC,cAAC,eAAD;AAAiB,MAAA,eAAe,EAAGD;AAAnC,MARD,CAfD;AAFD;AA6BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-site-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-header\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tsetDropZoneElement,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t<PrivateListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -13,6 +13,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
13
13
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
14
14
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
15
15
|
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
16
|
+
import SidebarNavigationScreenTemplatePart from '../sidebar-navigation-screen-template-part';
|
|
16
17
|
import useSyncPathWithURL, { getPathFromURL } from '../sync-state-with-url/use-sync-path-with-url';
|
|
17
18
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
18
19
|
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
@@ -45,8 +46,10 @@ function SidebarScreens() {
|
|
|
45
46
|
}, createElement(SidebarNavigationScreenTemplates, null)), createElement(NavigatorScreen, {
|
|
46
47
|
path: "/:postType(wp_template|wp_template_part)/all"
|
|
47
48
|
}, createElement(SidebarNavigationScreenTemplatesBrowse, null)), createElement(NavigatorScreen, {
|
|
48
|
-
path: "/:postType(wp_template
|
|
49
|
-
}, createElement(SidebarNavigationScreenTemplate, null))
|
|
49
|
+
path: "/:postType(wp_template)/:postId"
|
|
50
|
+
}, createElement(SidebarNavigationScreenTemplate, null)), createElement(NavigatorScreen, {
|
|
51
|
+
path: "/:postType(wp_template_part)/:postId"
|
|
52
|
+
}, createElement(SidebarNavigationScreenTemplatePart, null)));
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
function Sidebar() {
|
|
@@ -57,9 +60,7 @@ function Sidebar() {
|
|
|
57
60
|
return createElement(Fragment, null, createElement(NavigatorProvider, {
|
|
58
61
|
className: "edit-site-sidebar__content",
|
|
59
62
|
initialPath: initialPath.current
|
|
60
|
-
}, createElement(SidebarScreens, null)), createElement(
|
|
61
|
-
className: "edit-site-sidebar__footer"
|
|
62
|
-
}, createElement(SaveHub, null)));
|
|
63
|
+
}, createElement(SidebarScreens, null)), createElement(SaveHub, null));
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
export default memo(Sidebar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPage","useLocation","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,oBAA7B;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,kBAAP,IACCC,cADD,QAEO,+CAFP;AAGA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,4BAAP,MAAyC,oCAAzC;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBH,MAAM,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenTemplatePart","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPage","useLocation","SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,MAAf,QAA6B,oBAA7B;AACA,SACCC,+BAA+B,IAAIC,iBADpC,EAECC,6BAA6B,IAAIC,eAFlC,QAGO,uBAHP;AAIA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AACA,OAAOC,gCAAP,MAA6C,wCAA7C;AACA,OAAOC,+BAAP,MAA4C,uCAA5C;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,kBAAP,IACCC,cADD,QAEO,+CAFP;AAGA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,qCAAP,MAAkD,8CAAlD;AACA,OAAOC,mCAAP,MAAgD,4CAAhD;AACA,OAAOC,sCAAP,MAAmD,+CAAnD;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,OAAOC,4BAAP,MAAyC,oCAAzC;AACA,OAAOC,2BAAP,MAAwC,mCAAxC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBH,MAAM,CAAEZ,iBAAF,CAA9B;;AAEA,SAASgB,cAAT,GAA0B;AACzBX,EAAAA,kBAAkB;AAElB,SACC,8BACC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CADD,EAIC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAJD,EAOC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,qCAAD,OADD,CAPD,EAUC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,mCAAD,OADD,CAVD,EAaC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,4BAAD,OADD,CAbD,EAgBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,2BAAD,OADD,CAhBD,EAmBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,gCAAD,OADD,CAnBD,EAsBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,sCAAD,OADD,CAtBD,EAyBC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,+BAAD,OADD,CAzBD,EA4BC,cAAC,eAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,cAAC,mCAAD,OADD,CA5BD,CADD;AAkCA;;AAED,SAASY,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwBJ,WAAW,EAAzC;AACA,QAAMK,WAAW,GAAG1B,MAAM,CAAEY,cAAc,CAAEa,SAAF,CAAhB,CAA1B;AAEA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,cAAC,cAAD,OAJD,CADD,EAOC,cAAC,OAAD,OAPD,CADD;AAWA;;AAED,eAAe5B,IAAI,CAAEwB,OAAF,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenTemplatePart from '../sidebar-navigation-screen-template-part';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../private-apis';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template_part)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplatePart />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -10,18 +10,17 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { store as editSiteStore } from '../../store';
|
|
13
|
-
export default function DefaultSidebar(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
13
|
+
export default function DefaultSidebar({
|
|
14
|
+
className,
|
|
15
|
+
identifier,
|
|
16
|
+
title,
|
|
17
|
+
icon,
|
|
18
|
+
children,
|
|
19
|
+
closeLabel,
|
|
20
|
+
header,
|
|
21
|
+
headerClassName,
|
|
22
|
+
panelClassName
|
|
23
|
+
}) {
|
|
25
24
|
const showIconLabels = useSelect(select => select(editSiteStore).getSettings().showIconLabels, []);
|
|
26
25
|
return createElement(Fragment, null, createElement(ComplementaryArea, {
|
|
27
26
|
className: className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/default-sidebar.js"],"names":["ComplementaryArea","ComplementaryAreaMoreMenuItem","useSelect","store","editSiteStore","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","showIconLabels","select","getSettings"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6BAFD,QAGO,sBAHP;AAIA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/default-sidebar.js"],"names":["ComplementaryArea","ComplementaryAreaMoreMenuItem","useSelect","store","editSiteStore","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","showIconLabels","select","getSettings"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6BAFD,QAGO,sBAHP;AAIA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,cAAT,CAAyB;AACvCC,EAAAA,SADuC;AAEvCC,EAAAA,UAFuC;AAGvCC,EAAAA,KAHuC;AAIvCC,EAAAA,IAJuC;AAKvCC,EAAAA,QALuC;AAMvCC,EAAAA,UANuC;AAOvCC,EAAAA,MAPuC;AAQvCC,EAAAA,eARuC;AASvCC,EAAAA;AATuC,CAAzB,EAUX;AACH,QAAMC,cAAc,GAAGb,SAAS,CAC7Bc,MAAF,IAAcA,MAAM,CAAEZ,aAAF,CAAN,CAAwBa,WAAxB,GAAsCF,cADrB,EAE/B,EAF+B,CAAhC;AAKA,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAGT,SADb;AAEC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGC,UAHd;AAIC,IAAA,KAAK,EAAGC,KAJT;AAKC,IAAA,IAAI,EAAGC,IALR;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,MAAM,EAAGC,MAPV;AAQC,IAAA,eAAe,EAAGC,eARnB;AASC,IAAA,cAAc,EAAGC,cATlB;AAUC,IAAA,cAAc,EAAGC;AAVlB,KAYGL,QAZH,CADD,EAeC,cAAC,6BAAD;AACC,IAAA,KAAK,EAAC,gBADP;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,IAAI,EAAGE;AAHR,KAKGD,KALH,CAfD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tComplementaryArea,\n\tComplementaryAreaMoreMenuItem,\n} from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) => select( editSiteStore ).getSettings().showIconLabels,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { createSlotFill
|
|
6
|
+
import { createSlotFill } from '@wordpress/components';
|
|
7
7
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
8
8
|
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
9
9
|
import { useEffect } from '@wordpress/element';
|
|
@@ -18,8 +18,8 @@ import DefaultSidebar from './default-sidebar';
|
|
|
18
18
|
import GlobalStylesSidebar from './global-styles-sidebar';
|
|
19
19
|
import { STORE_NAME } from '../../store/constants';
|
|
20
20
|
import SettingsHeader from './settings-header';
|
|
21
|
-
import
|
|
22
|
-
import
|
|
21
|
+
import PagePanels from './page-panels';
|
|
22
|
+
import TemplatePanel from './template-panel';
|
|
23
23
|
import PluginTemplateSettingPanel from '../plugin-template-setting-panel';
|
|
24
24
|
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';
|
|
25
25
|
import { store as editSiteStore } from '../../store';
|
|
@@ -33,7 +33,8 @@ export function SidebarComplementaryAreaFills() {
|
|
|
33
33
|
sidebar,
|
|
34
34
|
isEditorSidebarOpened,
|
|
35
35
|
hasBlockSelection,
|
|
36
|
-
supportsGlobalStyles
|
|
36
|
+
supportsGlobalStyles,
|
|
37
|
+
hasPageContentLock
|
|
37
38
|
} = useSelect(select => {
|
|
38
39
|
const _sidebar = select(interfaceStore).getActiveComplementaryArea(STORE_NAME);
|
|
39
40
|
|
|
@@ -44,21 +45,26 @@ export function SidebarComplementaryAreaFills() {
|
|
|
44
45
|
sidebar: _sidebar,
|
|
45
46
|
isEditorSidebarOpened: _isEditorSidebarOpened,
|
|
46
47
|
hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart(),
|
|
47
|
-
supportsGlobalStyles: !
|
|
48
|
+
supportsGlobalStyles: !settings?.supportsTemplatePartsMode,
|
|
49
|
+
hasPageContentLock: select(editSiteStore).hasPageContentLock()
|
|
48
50
|
};
|
|
49
51
|
}, []);
|
|
50
52
|
const {
|
|
51
53
|
enableComplementaryArea
|
|
52
54
|
} = useDispatch(interfaceStore);
|
|
53
55
|
useEffect(() => {
|
|
54
|
-
|
|
56
|
+
// Don't automatically switch tab when the sidebar is closed or when we
|
|
57
|
+
// are focused on page content.
|
|
58
|
+
if (!isEditorSidebarOpened || hasPageContentLock) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
55
61
|
|
|
56
62
|
if (hasBlockSelection) {
|
|
57
63
|
enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
|
|
58
64
|
} else {
|
|
59
65
|
enableComplementaryArea(STORE_NAME, SIDEBAR_TEMPLATE);
|
|
60
66
|
}
|
|
61
|
-
}, [hasBlockSelection, isEditorSidebarOpened]);
|
|
67
|
+
}, [hasBlockSelection, isEditorSidebarOpened, hasPageContentLock]);
|
|
62
68
|
let sidebarName = sidebar;
|
|
63
69
|
|
|
64
70
|
if (!isEditorSidebarOpened) {
|
|
@@ -74,10 +80,7 @@ export function SidebarComplementaryAreaFills() {
|
|
|
74
80
|
sidebarName: sidebarName
|
|
75
81
|
}),
|
|
76
82
|
headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
|
|
77
|
-
}, sidebarName === SIDEBAR_TEMPLATE && createElement(Fragment, null, createElement(
|
|
78
|
-
header: __('Editing history'),
|
|
79
|
-
className: "edit-site-template-revisions"
|
|
80
|
-
}, createElement(LastRevision, null))), createElement(PluginTemplateSettingPanel.Slot, null)), sidebarName === SIDEBAR_BLOCK && createElement(InspectorSlot, {
|
|
83
|
+
}, sidebarName === SIDEBAR_TEMPLATE && createElement(Fragment, null, hasPageContentLock ? createElement(PagePanels, null) : createElement(TemplatePanel, null), createElement(PluginTemplateSettingPanel.Slot, null)), sidebarName === SIDEBAR_BLOCK && createElement(InspectorSlot, {
|
|
81
84
|
bubblesVirtually: true
|
|
82
85
|
})), supportsGlobalStyles && createElement(GlobalStylesSidebar, null));
|
|
83
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"names":["createSlotFill","isRTL","__","drawerLeft","drawerRight","useEffect","useSelect","useDispatch","store","interfaceStore","blockEditorStore","DefaultSidebar","GlobalStylesSidebar","STORE_NAME","SettingsHeader","PagePanels","TemplatePanel","PluginTemplateSettingPanel","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","editSiteStore","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","supportsGlobalStyles","hasPageContentLock","select","_sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","settings","getSettings","getBlockSelectionStart","supportsTemplatePartsMode","enableComplementaryArea","sidebarName"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport PagePanels from './page-panels';\nimport TemplatePanel from './template-panel';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\nimport { store as editSiteStore } from '../../store';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst {\n\t\tsidebar,\n\t\tisEditorSidebarOpened,\n\t\thasBlockSelection,\n\t\tsupportsGlobalStyles,\n\t\thasPageContentLock,\n\t} = useSelect( ( select ) => {\n\t\tconst _sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( STORE_NAME );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tSIDEBAR_BLOCK,\n\t\t\tSIDEBAR_TEMPLATE,\n\t\t].includes( _sidebar );\n\t\tconst settings = select( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tsidebar: _sidebar,\n\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tsupportsGlobalStyles: ! settings?.supportsTemplatePartsMode,\n\t\t\thasPageContentLock: select( editSiteStore ).hasPageContentLock(),\n\t\t};\n\t}, [] );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Don't automatically switch tab when the sidebar is closed or when we\n\t\t// are focused on page content.\n\t\tif ( ! isEditorSidebarOpened || hasPageContentLock ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened, hasPageContentLock ] );\n\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ hasPageContentLock ? (\n\t\t\t\t\t\t\t<PagePanels />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<TemplatePanel />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
+
import { Button, __experimentalVStack as VStack, __experimentalHStack as HStack, FlexItem } from '@wordpress/components';
|
|
8
|
+
import { getBlockType, __experimentalGetBlockLabel } from '@wordpress/blocks';
|
|
9
|
+
import { store as blockEditorStore, BlockIcon } from '@wordpress/block-editor';
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { CONTENT_BLOCK_TYPES } from '../../page-content-lock/constants'; // TODO: This overlaps a lot with BlockInspectorLockedBlocks in
|
|
15
|
+
// @wordpress/block-editor. DRY them into a single component.
|
|
16
|
+
|
|
17
|
+
export default function ContentBlocksList() {
|
|
18
|
+
const contentBlocks = useSelect(select => {
|
|
19
|
+
const {
|
|
20
|
+
getClientIdsWithDescendants,
|
|
21
|
+
getBlockName,
|
|
22
|
+
getBlock,
|
|
23
|
+
isBlockSelected,
|
|
24
|
+
hasSelectedInnerBlock
|
|
25
|
+
} = select(blockEditorStore);
|
|
26
|
+
return getClientIdsWithDescendants().flatMap(clientId => {
|
|
27
|
+
const blockName = getBlockName(clientId);
|
|
28
|
+
|
|
29
|
+
if (!CONTENT_BLOCK_TYPES.includes(blockName)) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return [{
|
|
34
|
+
block: getBlock(clientId),
|
|
35
|
+
isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId,
|
|
36
|
+
/* deep: */
|
|
37
|
+
true)
|
|
38
|
+
}];
|
|
39
|
+
});
|
|
40
|
+
}, []);
|
|
41
|
+
const {
|
|
42
|
+
selectBlock
|
|
43
|
+
} = useDispatch(blockEditorStore);
|
|
44
|
+
|
|
45
|
+
if (!contentBlocks.length) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return createElement(VStack, {
|
|
50
|
+
spacing: 1
|
|
51
|
+
}, contentBlocks.map(({
|
|
52
|
+
block,
|
|
53
|
+
isSelected
|
|
54
|
+
}) => {
|
|
55
|
+
const blockType = getBlockType(block.name);
|
|
56
|
+
return createElement(Button, {
|
|
57
|
+
key: block.clientId,
|
|
58
|
+
isPressed: isSelected,
|
|
59
|
+
onClick: () => selectBlock(block.clientId)
|
|
60
|
+
}, createElement(HStack, {
|
|
61
|
+
justify: "flex-start"
|
|
62
|
+
}, createElement(BlockIcon, {
|
|
63
|
+
icon: blockType.icon
|
|
64
|
+
}), createElement(FlexItem, null, __experimentalGetBlockLabel(blockType, block.attributes, 'list-view'))));
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=content-blocks-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js"],"names":["useSelect","useDispatch","Button","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","getBlockType","__experimentalGetBlockLabel","store","blockEditorStore","BlockIcon","CONTENT_BLOCK_TYPES","ContentBlocksList","contentBlocks","select","getClientIdsWithDescendants","getBlockName","getBlock","isBlockSelected","hasSelectedInnerBlock","flatMap","clientId","blockName","includes","block","isSelected","selectBlock","length","map","blockType","name","icon","attributes"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,MADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,QAKO,uBALP;AAMA,SAASC,YAAT,EAAuBC,2BAAvB,QAA0D,mBAA1D;AACA,SAASC,KAAK,IAAIC,gBAAlB,EAAoCC,SAApC,QAAqD,yBAArD;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,mCAApC,C,CAEA;AACA;;AACA,eAAe,SAASC,iBAAT,GAA6B;AAC3C,QAAMC,aAAa,GAAGf,SAAS,CAAIgB,MAAF,IAAc;AAC9C,UAAM;AACLC,MAAAA,2BADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,QAHK;AAILC,MAAAA,eAJK;AAKLC,MAAAA;AALK,QAMFL,MAAM,CAAEL,gBAAF,CANV;AAOA,WAAOM,2BAA2B,GAAGK,OAA9B,CAAyCC,QAAF,IAAgB;AAC7D,YAAMC,SAAS,GAAGN,YAAY,CAAEK,QAAF,CAA9B;;AACA,UAAK,CAAEV,mBAAmB,CAACY,QAApB,CAA8BD,SAA9B,CAAP,EAAmD;AAClD,eAAO,EAAP;AACA;;AACD,aAAO,CACN;AACCE,QAAAA,KAAK,EAAEP,QAAQ,CAAEI,QAAF,CADhB;AAECI,QAAAA,UAAU,EACTP,eAAe,CAAEG,QAAF,CAAf,IACAF,qBAAqB,CAAEE,QAAF;AAAY;AAAY,YAAxB;AAJvB,OADM,CAAP;AAQA,KAbM,CAAP;AAcA,GAtB8B,EAsB5B,EAtB4B,CAA/B;AAwBA,QAAM;AAAEK,IAAAA;AAAF,MAAkB3B,WAAW,CAAEU,gBAAF,CAAnC;;AAEA,MAAK,CAAEI,aAAa,CAACc,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACGd,aAAa,CAACe,GAAd,CAAmB,CAAE;AAAEJ,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF,KAA6B;AACjD,UAAMI,SAAS,GAAGvB,YAAY,CAAEkB,KAAK,CAACM,IAAR,CAA9B;AACA,WACC,cAAC,MAAD;AACC,MAAA,GAAG,EAAGN,KAAK,CAACH,QADb;AAEC,MAAA,SAAS,EAAGI,UAFb;AAGC,MAAA,OAAO,EAAG,MAAMC,WAAW,CAAEF,KAAK,CAACH,QAAR;AAH5B,OAKC,cAAC,MAAD;AAAQ,MAAA,OAAO,EAAC;AAAhB,OACC,cAAC,SAAD;AAAW,MAAA,IAAI,EAAGQ,SAAS,CAACE;AAA5B,MADD,EAEC,cAAC,QAAD,QACGxB,2BAA2B,CAC5BsB,SAD4B,EAE5BL,KAAK,CAACQ,UAFsB,EAG5B,WAH4B,CAD9B,CAFD,CALD,CADD;AAkBA,GApBC,CADH,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { getBlockType, __experimentalGetBlockLabel } from '@wordpress/blocks';\nimport { store as blockEditorStore, BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { CONTENT_BLOCK_TYPES } from '../../page-content-lock/constants';\n\n// TODO: This overlaps a lot with BlockInspectorLockedBlocks in\n// @wordpress/block-editor. DRY them into a single component.\nexport default function ContentBlocksList() {\n\tconst contentBlocks = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetClientIdsWithDescendants,\n\t\t\tgetBlockName,\n\t\t\tgetBlock,\n\t\t\tisBlockSelected,\n\t\t\thasSelectedInnerBlock,\n\t\t} = select( blockEditorStore );\n\t\treturn getClientIdsWithDescendants().flatMap( ( clientId ) => {\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tif ( ! CONTENT_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\t\tisSelected:\n\t\t\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\t\t\thasSelectedInnerBlock( clientId, /* deep: */ true ),\n\t\t\t\t},\n\t\t\t];\n\t\t} );\n\t}, [] );\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! contentBlocks.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 }>\n\t\t\t{ contentBlocks.map( ( { block, isSelected } ) => {\n\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ block.clientId }\n\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\tonClick={ () => selectBlock( block.clientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t{ __experimentalGetBlockLabel(\n\t\t\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\t\t\t'list-view'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { PanelBody, __experimentalVStack as VStack, Button } from '@wordpress/components';
|
|
7
|
+
import { page as pageIcon } from '@wordpress/icons';
|
|
8
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
import { humanTimeDiff } from '@wordpress/date';
|
|
10
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
+
import { useEntityRecord } from '@wordpress/core-data';
|
|
12
|
+
import { BlockContextProvider, BlockPreview } from '@wordpress/block-editor';
|
|
13
|
+
import { useMemo } from '@wordpress/element';
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { store as editSiteStore } from '../../../store';
|
|
19
|
+
import useEditedEntityRecord from '../../use-edited-entity-record';
|
|
20
|
+
import SidebarCard from '../sidebar-card';
|
|
21
|
+
import ContentBlocksList from './content-blocks-list';
|
|
22
|
+
export default function PagePanels() {
|
|
23
|
+
const context = useSelect(select => select(editSiteStore).getEditedPostContext(), []);
|
|
24
|
+
const {
|
|
25
|
+
hasResolved: hasPageResolved,
|
|
26
|
+
editedRecord: page
|
|
27
|
+
} = useEntityRecord('postType', context.postType, context.postId);
|
|
28
|
+
const {
|
|
29
|
+
isLoaded: isTemplateLoaded,
|
|
30
|
+
getTitle: getTemplateTitle,
|
|
31
|
+
record: template
|
|
32
|
+
} = useEditedEntityRecord();
|
|
33
|
+
const {
|
|
34
|
+
setHasPageContentLock
|
|
35
|
+
} = useDispatch(editSiteStore);
|
|
36
|
+
const blockContext = useMemo(() => ({ ...context,
|
|
37
|
+
postType: null,
|
|
38
|
+
postId: null
|
|
39
|
+
}), [context]);
|
|
40
|
+
|
|
41
|
+
if (!hasPageResolved || !isTemplateLoaded) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return createElement(Fragment, null, createElement(PanelBody, null, createElement(SidebarCard, {
|
|
46
|
+
title: page.title,
|
|
47
|
+
icon: pageIcon,
|
|
48
|
+
description: sprintf( // translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
49
|
+
__('Last edited %s'), humanTimeDiff(page.modified))
|
|
50
|
+
})), createElement(PanelBody, {
|
|
51
|
+
title: __('Content')
|
|
52
|
+
}, createElement(ContentBlocksList, null)), createElement(PanelBody, {
|
|
53
|
+
title: __('Template')
|
|
54
|
+
}, createElement(VStack, null, createElement("div", null, getTemplateTitle()), createElement("div", {
|
|
55
|
+
className: "edit-site-page-panels__edit-template-preview"
|
|
56
|
+
}, createElement(BlockContextProvider, {
|
|
57
|
+
value: blockContext
|
|
58
|
+
}, createElement(BlockPreview, {
|
|
59
|
+
viewportWidth: 1024,
|
|
60
|
+
blocks: template.blocks
|
|
61
|
+
}))), createElement(Button, {
|
|
62
|
+
className: "edit-site-page-panels__edit-template-button",
|
|
63
|
+
variant: "secondary",
|
|
64
|
+
onClick: () => setHasPageContentLock(false)
|
|
65
|
+
}, __('Edit template')))));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"names":["PanelBody","__experimentalVStack","VStack","Button","page","pageIcon","__","sprintf","humanTimeDiff","useSelect","useDispatch","useEntityRecord","BlockContextProvider","BlockPreview","useMemo","store","editSiteStore","useEditedEntityRecord","SidebarCard","ContentBlocksList","PagePanels","context","select","getEditedPostContext","hasResolved","hasPageResolved","editedRecord","postType","postId","isLoaded","isTemplateLoaded","getTitle","getTemplateTitle","record","template","setHasPageContentLock","blockContext","title","modified","blocks"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,SADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,MAHD,QAIO,uBAJP;AAKA,SAASC,IAAI,IAAIC,QAAjB,QAAiC,kBAAjC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,oBAAT,EAA+BC,YAA/B,QAAmD,yBAAnD;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,qBAAP,MAAkC,gCAAlC;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAGZ,SAAS,CACtBa,MAAF,IAAcA,MAAM,CAAEN,aAAF,CAAN,CAAwBO,oBAAxB,EADU,EAExB,EAFwB,CAAzB;AAKA,QAAM;AAAEC,IAAAA,WAAW,EAAEC,eAAf;AAAgCC,IAAAA,YAAY,EAAEtB;AAA9C,MACLO,eAAe,CAAE,UAAF,EAAcU,OAAO,CAACM,QAAtB,EAAgCN,OAAO,CAACO,MAAxC,CADhB;AAGA,QAAM;AACLC,IAAAA,QAAQ,EAAEC,gBADL;AAELC,IAAAA,QAAQ,EAAEC,gBAFL;AAGLC,IAAAA,MAAM,EAAEC;AAHH,MAIFjB,qBAAqB,EAJzB;AAMA,QAAM;AAAEkB,IAAAA;AAAF,MAA4BzB,WAAW,CAAEM,aAAF,CAA7C;AAEA,QAAMoB,YAAY,GAAGtB,OAAO,CAC3B,OAAQ,EAAE,GAAGO,OAAL;AAAcM,IAAAA,QAAQ,EAAE,IAAxB;AAA8BC,IAAAA,MAAM,EAAE;AAAtC,GAAR,CAD2B,EAE3B,CAAEP,OAAF,CAF2B,CAA5B;;AAKA,MAAK,CAAEI,eAAF,IAAqB,CAAEK,gBAA5B,EAA+C;AAC9C,WAAO,IAAP;AACA;;AAED,SACC,8BACC,cAAC,SAAD,QACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAG1B,IAAI,CAACiC,KADd;AAEC,IAAA,IAAI,EAAGhC,QAFR;AAGC,IAAA,WAAW,EAAGE,OAAO,EACpB;AACAD,IAAAA,EAAE,CAAE,gBAAF,CAFkB,EAGpBE,aAAa,CAAEJ,IAAI,CAACkC,QAAP,CAHO;AAHtB,IADD,CADD,EAYC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGhC,EAAE,CAAE,SAAF;AAArB,KACC,cAAC,iBAAD,OADD,CAZD,EAeC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGA,EAAE,CAAE,UAAF;AAArB,KACC,cAAC,MAAD,QACC,2BAAO0B,gBAAgB,EAAvB,CADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,oBAAD;AAAsB,IAAA,KAAK,EAAGI;AAA9B,KACC,cAAC,YAAD;AACC,IAAA,aAAa,EAAG,IADjB;AAEC,IAAA,MAAM,EAAGF,QAAQ,CAACK;AAFnB,IADD,CADD,CAFD,EAUC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,OAAO,EAAG,MAAMJ,qBAAqB,CAAE,KAAF;AAHtC,KAKG7B,EAAE,CAAE,eAAF,CALL,CAVD,CADD,CAfD,CADD;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { page as pageIcon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { BlockContextProvider, BlockPreview } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport useEditedEntityRecord from '../../use-edited-entity-record';\nimport SidebarCard from '../sidebar-card';\nimport ContentBlocksList from './content-blocks-list';\n\nexport default function PagePanels() {\n\tconst context = useSelect(\n\t\t( select ) => select( editSiteStore ).getEditedPostContext(),\n\t\t[]\n\t);\n\n\tconst { hasResolved: hasPageResolved, editedRecord: page } =\n\t\tuseEntityRecord( 'postType', context.postType, context.postId );\n\n\tconst {\n\t\tisLoaded: isTemplateLoaded,\n\t\tgetTitle: getTemplateTitle,\n\t\trecord: template,\n\t} = useEditedEntityRecord();\n\n\tconst { setHasPageContentLock } = useDispatch( editSiteStore );\n\n\tconst blockContext = useMemo(\n\t\t() => ( { ...context, postType: null, postId: null } ),\n\t\t[ context ]\n\t);\n\n\tif ( ! hasPageResolved || ! isTemplateLoaded ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody>\n\t\t\t\t<SidebarCard\n\t\t\t\t\ttitle={ page.title }\n\t\t\t\t\ticon={ pageIcon }\n\t\t\t\t\tdescription={ sprintf(\n\t\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t\t__( 'Last edited %s' ),\n\t\t\t\t\t\thumanTimeDiff( page.modified )\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t<ContentBlocksList />\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Template' ) }>\n\t\t\t\t<VStack>\n\t\t\t\t\t<div>{ getTemplateTitle() }</div>\n\t\t\t\t\t<div className=\"edit-site-page-panels__edit-template-preview\">\n\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tviewportWidth={ 1024 }\n\t\t\t\t\t\t\t\tblocks={ template.blocks }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-page-panels__edit-template-button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => setHasPageContentLock( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t</>\n\t);\n}\n"]}
|