@wordpress/edit-site 5.10.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-page/index.js +105 -0
- package/build/components/add-new-page/index.js.map +1 -0
- package/build/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +9 -25
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +28 -41
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/index.js +4 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +9 -12
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +106 -80
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +71 -120
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/back-button.js +1 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +3 -4
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +6 -7
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +14 -13
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +25 -42
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +6 -7
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +5 -7
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +5 -6
- package/build/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +30 -35
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +37 -53
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +15 -9
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +8 -10
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +7 -10
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +3 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +1 -3
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +8 -10
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +3 -4
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -5
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +4 -5
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +5 -6
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +10 -14
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +41 -51
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +4 -7
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +88 -12
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +3 -4
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +10 -17
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -33
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -35
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +5 -5
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +3 -4
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +11 -16
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +4 -5
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +4 -5
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +5 -6
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +49 -30
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +5 -6
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +99 -95
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -7
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +49 -53
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +5 -14
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +41 -51
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +33 -94
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +13 -23
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +4 -7
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +2 -4
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +35 -40
- package/build/components/list/table.js.map +1 -1
- package/build/components/page-actions/delete-page-menu-item.js +70 -0
- package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build/components/page-actions/index.js +43 -0
- package/build/components/page-actions/index.js.map +1 -0
- package/build/components/page-content-lock/constants.js +9 -0
- package/build/components/page-content-lock/constants.js.map +1 -0
- package/build/components/page-content-lock/index.js +29 -0
- package/build/components/page-content-lock/index.js.map +1 -0
- package/build/components/page-content-lock/use-disable-non-content-blocks.js +49 -0
- package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
- package/build/components/page-content-lock/use-page-content-lock-notifications.js +112 -0
- package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
- package/build/components/preferences-modal/index.js +4 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +250 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +13 -15
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +8 -12
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +1 -5
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +13 -7
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +97 -5
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +63 -17
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +12 -6
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +11 -9
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +11 -12
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +13 -10
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +79 -0
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +86 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +39 -21
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -18
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +7 -8
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +21 -14
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +166 -12
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +24 -33
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +159 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +51 -107
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +84 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +16 -74
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +52 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/index.js +81 -10
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +148 -0
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js +110 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +128 -17
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +22 -16
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template-part/index.js +105 -0
- package/build/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +44 -24
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +3 -4
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -1
- package/build/components/site-hub/index.js +20 -15
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +4 -5
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +15 -21
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +107 -37
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/{list/actions → template-actions}/index.js +39 -33
- package/build/components/template-actions/index.js.map +1 -0
- package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build/components/template-actions/rename-menu-item.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +4 -5
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +8 -10
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +12 -18
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -5
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +103 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +11 -8
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +5 -6
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +3 -6
- package/build/index.js.map +1 -1
- package/build/store/actions.js +131 -125
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +7 -10
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +32 -33
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +35 -11
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +1 -3
- package/build/store/utils.js.map +1 -1
- package/build/utils/get-is-list-page.js +3 -4
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -3
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-revertable.js +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build-module/components/add-new-page/index.js +93 -0
- package/build-module/components/add-new-page/index.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +10 -23
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +30 -42
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/index.js +4 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +9 -12
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +105 -82
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +71 -120
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +1 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +3 -4
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +6 -7
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +13 -13
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +25 -42
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +6 -7
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +5 -7
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +5 -6
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +31 -36
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -56
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +12 -9
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +8 -10
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +7 -10
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +3 -4
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +8 -10
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -4
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +4 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +4 -5
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +5 -6
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +10 -14
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +41 -51
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +4 -7
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +90 -13
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +3 -4
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +10 -17
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +26 -34
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +20 -34
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +5 -5
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +3 -4
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +12 -17
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +4 -5
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +4 -5
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +5 -6
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +50 -31
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +5 -6
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +99 -97
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -8
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +5 -13
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -49
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +34 -97
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +13 -23
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/header.js +4 -7
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +2 -4
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +34 -39
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/page-actions/delete-page-menu-item.js +58 -0
- package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build-module/components/page-actions/index.js +30 -0
- package/build-module/components/page-actions/index.js.map +1 -0
- package/build-module/components/page-content-lock/constants.js +2 -0
- package/build-module/components/page-content-lock/constants.js.map +1 -0
- package/build-module/components/page-content-lock/index.js +14 -0
- package/build-module/components/page-content-lock/index.js.map +1 -0
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js +36 -0
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +1 -0
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +98 -0
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +4 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +236 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +13 -14
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +8 -12
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -5
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +13 -7
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +95 -8
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +62 -19
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +12 -6
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +9 -8
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +11 -12
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +14 -11
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +67 -0
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +67 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -5
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +36 -22
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +3 -4
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/index.js +20 -19
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +7 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +22 -15
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +161 -15
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +21 -32
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +3 -5
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +138 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +49 -106
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +68 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -74
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +39 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js +79 -14
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +97 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +125 -19
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +22 -17
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template-part/index.js +86 -0
- package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +43 -24
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +3 -4
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +21 -16
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +4 -5
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +15 -21
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +107 -38
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -10
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +92 -0
- package/build-module/components/template-actions/index.js.map +1 -0
- package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +8 -10
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +12 -18
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +4 -5
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +84 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +11 -8
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -6
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +3 -6
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +127 -126
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +7 -10
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +30 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +31 -11
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +1 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +3 -4
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -3
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +477 -232
- package/build-style/style.css +478 -232
- package/package.json +40 -37
- package/src/components/add-new-page/index.js +105 -0
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +13 -26
- package/src/components/add-new-template/new-template.js +141 -154
- package/src/components/add-new-template/style.scss +79 -66
- package/src/components/block-editor/index.js +27 -17
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +30 -53
- package/src/components/editor/style.scss +11 -1
- package/src/components/editor-canvas-container/index.js +28 -19
- package/src/components/global-styles/screen-block.js +74 -3
- package/src/components/global-styles/screen-revisions/index.js +3 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +33 -25
- package/src/components/global-styles/screen-revisions/style.scss +3 -2
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +16 -3
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +22 -24
- package/src/components/global-styles/screen-root.js +5 -3
- package/src/components/global-styles/style-variations-container.js +13 -18
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/global-styles/ui.js +39 -9
- package/src/components/header-edit-mode/document-actions/index.js +112 -121
- package/src/components/header-edit-mode/document-actions/style.scss +78 -54
- package/src/components/header-edit-mode/index.js +18 -0
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +47 -122
- package/src/components/layout/style.scss +8 -2
- package/src/components/list/style.scss +1 -0
- package/src/components/list/table.js +6 -2
- package/src/components/page-actions/delete-page-menu-item.js +71 -0
- package/src/components/page-actions/index.js +36 -0
- package/src/components/page-content-lock/constants.js +5 -0
- package/src/components/page-content-lock/index.js +14 -0
- package/src/components/page-content-lock/use-disable-non-content-blocks.js +44 -0
- package/src/components/page-content-lock/use-page-content-lock-notifications.js +128 -0
- package/src/components/resizable-frame/index.js +263 -0
- package/src/components/resizable-frame/style.scss +71 -0
- package/src/components/revisions/index.js +7 -7
- package/src/components/save-button/index.js +6 -0
- package/src/components/save-hub/index.js +143 -38
- package/src/components/save-hub/style.scss +6 -0
- package/src/components/save-panel/index.js +62 -15
- package/src/components/secondary-sidebar/list-view-sidebar.js +10 -2
- package/src/components/sidebar/index.js +10 -8
- package/src/components/sidebar/style.scss +3 -4
- package/src/components/sidebar-edit-mode/index.js +16 -14
- package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +77 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +10 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +51 -28
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
- package/src/components/sidebar-edit-mode/{template-card → template-panel}/index.js +22 -19
- package/src/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +1 -2
- package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
- package/src/components/sidebar-navigation-item/style.scss +9 -0
- package/src/components/sidebar-navigation-screen/index.js +74 -50
- package/src/components/sidebar-navigation-screen/style.scss +46 -6
- package/src/components/sidebar-navigation-screen-global-styles/index.js +212 -21
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-main/index.js +35 -52
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -117
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -72
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +7 -21
- package/src/components/sidebar-navigation-screen-page/index.js +137 -24
- package/src/components/sidebar-navigation-screen-page/page-details.js +163 -0
- package/src/components/sidebar-navigation-screen-page/status-label.js +101 -0
- package/src/components/sidebar-navigation-screen-page/style.scss +80 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +180 -44
- package/src/components/sidebar-navigation-screen-template/index.js +25 -22
- package/src/components/sidebar-navigation-screen-template-part/index.js +103 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +52 -13
- package/src/components/sidebar-navigation-subtitle/style.scss +2 -2
- package/src/components/site-hub/index.js +29 -15
- package/src/components/site-hub/style.scss +26 -0
- package/src/components/start-template-options/style.scss +20 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/{list/actions → template-actions}/index.js +31 -11
- package/src/components/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/hooks/push-changes-to-global-styles/index.js +13 -7
- package/src/store/actions.js +24 -6
- package/src/store/reducer.js +20 -0
- package/src/store/selectors.js +24 -0
- package/src/store/test/actions.js +31 -0
- package/src/store/test/reducer.js +44 -0
- package/src/store/test/selectors.js +57 -0
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +6 -3
- package/src/utils/is-previewing-theme.js +1 -4
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -135
- package/build/components/global-styles/border-panel.js.map +0 -1
- package/build/components/list/actions/index.js.map +0 -1
- package/build/components/list/actions/rename-menu-item.js.map +0 -1
- package/build/components/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -166
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -125
- package/build-module/components/global-styles/border-panel.js.map +0 -1
- package/build-module/components/list/actions/index.js +0 -86
- package/build-module/components/list/actions/index.js.map +0 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
- package/build-module/components/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -145
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -114
- package/src/components/navigate-to-link/index.js +0 -46
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -167
- package/src/components/template-details/template-part-area-selector.js +0 -39
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
- /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
|
@@ -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":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,kBAAxC;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,UAAT,QAA2B,uBAA3B;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,aAAhD;AACA,SAASX,KAAK,IAAIY,aAAlB,QAAuC,aAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+CxB,cAAc,CAClE,0BADkE,CAAnE;AAGA,OAAO,MAAMyB,oBAAoB,GAAGD,aAA7B;AAEP,OAAO,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,qBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,oBAJK;AAKLC,IAAAA;AALK,MAMFzB,SAAS,CAAI0B,MAAF,IAAc;AAC5B,UAAMC,QAAQ,GACbD,MAAM,CAAEvB,cAAF,CAAN,CAAyByB,0BAAzB,CAAqDrB,UAArD,CADD;;AAEA,UAAMsB,sBAAsB,GAAG,CAC9BjB,aAD8B,EAE9BC,gBAF8B,EAG7BiB,QAH6B,CAGnBH,QAHmB,CAA/B;;AAIA,UAAMI,QAAQ,GAAGL,MAAM,CAAEZ,aAAF,CAAN,CAAwBkB,WAAxB,EAAjB;AACA,WAAO;AACNX,MAAAA,OAAO,EAAEM,QADH;AAENL,MAAAA,qBAAqB,EAAEO,sBAFjB;AAGNN,MAAAA,iBAAiB,EAChB,CAAC,CAAEG,MAAM,CAAEtB,gBAAF,CAAN,CAA2B6B,sBAA3B,EAJE;AAKNT,MAAAA,oBAAoB,EAAE,CAAEO,QAAQ,EAAEG,yBAL5B;AAMNT,MAAAA,kBAAkB,EAAEC,MAAM,CAAEZ,aAAF,CAAN,CAAwBW,kBAAxB;AANd,KAAP;AAQA,GAhBY,EAgBV,EAhBU,CANb;AAuBA,QAAM;AAAEU,IAAAA;AAAF,MAA8BlC,WAAW,CAAEE,cAAF,CAA/C;AAEAJ,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA;AACA,QAAK,CAAEuB,qBAAF,IAA2BG,kBAAhC,EAAqD;AACpD;AACA;;AACD,QAAKF,iBAAL,EAAyB;AACxBY,MAAAA,uBAAuB,CAAE5B,UAAF,EAAcK,aAAd,CAAvB;AACA,KAFD,MAEO;AACNuB,MAAAA,uBAAuB,CAAE5B,UAAF,EAAcM,gBAAd,CAAvB;AACA;AACD,GAXQ,EAWN,CAAEU,iBAAF,EAAqBD,qBAArB,EAA4CG,kBAA5C,CAXM,CAAT;AAaA,MAAIW,WAAW,GAAGf,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9Bc,IAAAA,WAAW,GAAGb,iBAAiB,GAAGX,aAAH,GAAmBC,gBAAlD;AACA;;AAED,SACC,8BACC,cAAC,cAAD;AACC,IAAA,UAAU,EAAGuB,WADd;AAEC,IAAA,KAAK,EAAGxC,EAAE,CAAE,UAAF,CAFX;AAGC,IAAA,IAAI,EAAGD,KAAK,KAAKE,UAAL,GAAkBC,WAH/B;AAIC,IAAA,UAAU,EAAGF,EAAE,CAAE,gBAAF,CAJhB;AAKC,IAAA,MAAM,EAAG,cAAC,cAAD;AAAgB,MAAA,WAAW,EAAGwC;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKvB,gBAAhB,IACD,8BACGY,kBAAkB,GACnB,cAAC,UAAD,OADmB,GAGnB,cAAC,aAAD,OAJF,EAMC,cAAC,0BAAD,CAA4B,IAA5B,OAND,CATF,EAkBGW,WAAW,KAAKxB,aAAhB,IACD,cAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAnBF,CADD,EAuBGY,oBAAoB,IAAI,cAAC,mBAAD,OAvB3B,CADD;AA2BA","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"]}
|
|
@@ -77,11 +77,10 @@ import { store as editSiteStore } from '../../../store';
|
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
|
-
export default function PluginSidebarEditSite(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} = _ref;
|
|
80
|
+
export default function PluginSidebarEditSite({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
85
84
|
const showIconLabels = useSelect(select => select(editSiteStore).getSettings().showIconLabels, []);
|
|
86
85
|
return createElement(ComplementaryArea, _extends({
|
|
87
86
|
panelClassName: className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/plugin-sidebar/index.js"],"names":["ComplementaryArea","useSelect","store","editSiteStore","PluginSidebarEditSite","className","props","showIconLabels","select","getSettings"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,sBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/plugin-sidebar/index.js"],"names":["ComplementaryArea","useSelect","store","editSiteStore","PluginSidebarEditSite","className","props","showIconLabels","select","getSettings"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,sBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,CAAgC;AAAEC,EAAAA,SAAF;AAAa,KAAGC;AAAhB,CAAhC,EAA0D;AACxE,QAAMC,cAAc,GAAGN,SAAS,CAC7BO,MAAF,IAAcA,MAAM,CAAEL,aAAF,CAAN,CAAwBM,WAAxB,GAAsCF,cADrB,EAE/B,EAF+B,CAAhC;AAKA,SACC,cAAC,iBAAD;AACC,IAAA,cAAc,EAAGF,SADlB;AAEC,IAAA,SAAS,EAAC,6BAFX;AAGC,IAAA,KAAK,EAAC,gBAHP;AAIC,IAAA,cAAc,EAAGE;AAJlB,KAKMD,KALN,EADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) => select( editSiteStore ).getSettings().showIconLabels,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar-edit-mode\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import classnames from 'classnames';
|
|
3
7
|
/**
|
|
4
8
|
* WordPress dependencies
|
|
5
9
|
*/
|
|
10
|
+
|
|
6
11
|
import { Button } from '@wordpress/components';
|
|
7
12
|
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { useDispatch } from '@wordpress/data';
|
|
13
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
14
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
15
|
/**
|
|
11
16
|
* Internal dependencies
|
|
@@ -13,11 +18,12 @@ import { store as interfaceStore } from '@wordpress/interface';
|
|
|
13
18
|
|
|
14
19
|
import { STORE_NAME } from '../../../store/constants';
|
|
15
20
|
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';
|
|
21
|
+
import { store as editSiteStore } from '../../../store';
|
|
16
22
|
|
|
17
|
-
const SettingsHeader =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
const SettingsHeader = ({
|
|
24
|
+
sidebarName
|
|
25
|
+
}) => {
|
|
26
|
+
const hasPageContentLock = useSelect(select => select(editSiteStore).hasPageContentLock());
|
|
21
27
|
const {
|
|
22
28
|
enableComplementaryArea
|
|
23
29
|
} = useDispatch(interfaceStore);
|
|
@@ -26,29 +32,37 @@ const SettingsHeader = _ref => {
|
|
|
26
32
|
|
|
27
33
|
const openBlockSettings = () => enableComplementaryArea(STORE_NAME, SIDEBAR_BLOCK);
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
let templateAriaLabel;
|
|
36
|
+
|
|
37
|
+
if (hasPageContentLock) {
|
|
38
|
+
templateAriaLabel = sidebarName === SIDEBAR_TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
|
|
39
|
+
__('Page (selected)') : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
|
|
40
|
+
__('Page');
|
|
41
|
+
} else {
|
|
42
|
+
templateAriaLabel = sidebarName === SIDEBAR_TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
|
|
43
|
+
__('Template (selected)') : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
|
|
44
|
+
__('Template');
|
|
45
|
+
}
|
|
35
46
|
/* Use a list so screen readers will announce how many tabs there are. */
|
|
36
47
|
|
|
48
|
+
|
|
37
49
|
return createElement("ul", null, createElement("li", null, createElement(Button, {
|
|
38
50
|
onClick: openTemplateSettings,
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
,
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
__('Template'))), createElement("li", null, createElement(Button, {
|
|
51
|
+
className: classnames('edit-site-sidebar-edit-mode__panel-tab', {
|
|
52
|
+
'is-active': sidebarName === SIDEBAR_TEMPLATE
|
|
53
|
+
}),
|
|
54
|
+
"aria-label": templateAriaLabel,
|
|
55
|
+
"data-label": hasPageContentLock ? __('Page') : __('Template')
|
|
56
|
+
}, hasPageContentLock ? __('Page') : __('Template'))), createElement("li", null, createElement(Button, {
|
|
45
57
|
onClick: openBlockSettings,
|
|
46
|
-
className:
|
|
47
|
-
|
|
48
|
-
,
|
|
58
|
+
className: classnames('edit-site-sidebar-edit-mode__panel-tab', {
|
|
59
|
+
'is-active': sidebarName === SIDEBAR_BLOCK
|
|
60
|
+
}),
|
|
61
|
+
"aria-label": sidebarName === SIDEBAR_BLOCK ? // translators: ARIA label for the Block Settings Sidebar tab, selected.
|
|
62
|
+
__('Block (selected)') : // translators: ARIA label for the Block Settings Sidebar tab, not selected.
|
|
63
|
+
__('Block'),
|
|
49
64
|
"data-label": __('Block')
|
|
50
|
-
},
|
|
51
|
-
__('Block'))));
|
|
65
|
+
}, __('Block'))));
|
|
52
66
|
};
|
|
53
67
|
|
|
54
68
|
export default SettingsHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["Button","__","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["classnames","Button","__","useSelect","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","editSiteStore","SettingsHeader","sidebarName","hasPageContentLock","select","enableComplementaryArea","openTemplateSettings","openBlockSettings","templateAriaLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,0BAA3B;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,cAAhD;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,gBAAvC;;AAEA,MAAMC,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAMC,kBAAkB,GAAGV,SAAS,CAAIW,MAAF,IACrCA,MAAM,CAAEJ,aAAF,CAAN,CAAwBG,kBAAxB,EADmC,CAApC;AAIA,QAAM;AAAEE,IAAAA;AAAF,MAA8BX,WAAW,CAAEE,cAAF,CAA/C;;AACA,QAAMU,oBAAoB,GAAG,MAC5BD,uBAAuB,CAAER,UAAF,EAAcE,gBAAd,CADxB;;AAEA,QAAMQ,iBAAiB,GAAG,MACzBF,uBAAuB,CAAER,UAAF,EAAcC,aAAd,CADxB;;AAGA,MAAIU,iBAAJ;;AACA,MAAKL,kBAAL,EAA0B;AACzBK,IAAAA,iBAAiB,GAChBN,WAAW,KAAKH,gBAAhB,GACG;AACAP,IAAAA,EAAE,CAAE,iBAAF,CAFL,GAGG;AACAA,IAAAA,EAAE,CAAE,MAAF,CALN;AAMA,GAPD,MAOO;AACNgB,IAAAA,iBAAiB,GAChBN,WAAW,KAAKH,gBAAhB,GACG;AACAP,IAAAA,EAAE,CAAE,qBAAF,CAFL,GAGG;AACAA,IAAAA,EAAE,CAAE,UAAF,CALN;AAMA;AAED;;;AACA,SACC,0BACC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGc,oBADX;AAEC,IAAA,SAAS,EAAGhB,UAAU,CACrB,wCADqB,EAErB;AACC,mBAAaY,WAAW,KAAKH;AAD9B,KAFqB,CAFvB;AAQC,kBAAaS,iBARd;AASC,kBACCL,kBAAkB,GAAGX,EAAE,CAAE,MAAF,CAAL,GAAkBA,EAAE,CAAE,UAAF;AAVxC,KAaGW,kBAAkB,GAAGX,EAAE,CAAE,MAAF,CAAL,GAAkBA,EAAE,CAAE,UAAF,CAbzC,CADD,CADD,EAkBC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGe,iBADX;AAEC,IAAA,SAAS,EAAGjB,UAAU,CACrB,wCADqB,EAErB;AACC,mBAAaY,WAAW,KAAKJ;AAD9B,KAFqB,CAFvB;AAQC,kBACCI,WAAW,KAAKJ,aAAhB,GACG;AACAN,IAAAA,EAAE,CAAE,kBAAF,CAFL,GAGG;AACAA,IAAAA,EAAE,CAAE,OAAF,CAbP;AAeC,kBAAaA,EAAE,CAAE,OAAF;AAfhB,KAiBGA,EAAE,CAAE,OAAF,CAjBL,CADD,CAlBD,CADD;AA0CA,CAvED;;AAyEA,eAAeS,cAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\nimport { store as editSiteStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst hasPageContentLock = useSelect( ( select ) =>\n\t\tselect( editSiteStore ).hasPageContentLock()\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tlet templateAriaLabel;\n\tif ( hasPageContentLock ) {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t __( 'Page (selected)' )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t __( 'Page' );\n\t} else {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t __( 'Template (selected)' )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t __( 'Template' );\n\t}\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_TEMPLATE,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\tdata-label={\n\t\t\t\t\t\thasPageContentLock ? __( 'Page' ) : __( 'Template' )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ hasPageContentLock ? __( 'Page' ) : __( 'Template' ) }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_BLOCK,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t\t\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t\t\t\t\t __( 'Block (selected)' )\n\t\t\t\t\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t\t\t\t\t __( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Block' ) }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import classnames from 'classnames';
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Icon } from '@wordpress/components';
|
|
12
|
+
export default function SidebarCard({
|
|
13
|
+
className,
|
|
14
|
+
title,
|
|
15
|
+
icon,
|
|
16
|
+
description,
|
|
17
|
+
actions,
|
|
18
|
+
children
|
|
19
|
+
}) {
|
|
20
|
+
return createElement("div", {
|
|
21
|
+
className: classnames('edit-site-sidebar-card', className)
|
|
22
|
+
}, createElement(Icon, {
|
|
23
|
+
className: "edit-site-sidebar-card__icon",
|
|
24
|
+
icon: icon
|
|
25
|
+
}), createElement("div", {
|
|
26
|
+
className: "edit-site-sidebar-card__content"
|
|
27
|
+
}, createElement("div", {
|
|
28
|
+
className: "edit-site-sidebar-card__header"
|
|
29
|
+
}, createElement("h2", {
|
|
30
|
+
className: "edit-site-sidebar-card__title"
|
|
31
|
+
}, title), actions), createElement("div", {
|
|
32
|
+
className: "edit-site-sidebar-card__description"
|
|
33
|
+
}, description), children));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-card/index.js"],"names":["classnames","Icon","SidebarCard","className","title","icon","description","actions","children"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AAEA,eAAe,SAASC,WAAT,CAAsB;AACpCC,EAAAA,SADoC;AAEpCC,EAAAA,KAFoC;AAGpCC,EAAAA,IAHoC;AAIpCC,EAAAA,WAJoC;AAKpCC,EAAAA,OALoC;AAMpCC,EAAAA;AANoC,CAAtB,EAOX;AACH,SACC;AAAK,IAAA,SAAS,EAAGR,UAAU,CAAE,wBAAF,EAA4BG,SAA5B;AAA3B,KACC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC,8BAAhB;AAA+C,IAAA,IAAI,EAAGE;AAAtD,IADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KAAgDD,KAAhD,CADD,EAEGG,OAFH,CADD,EAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGD,WADH,CALD,EAQGE,QARH,CAFD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\n\nexport default function SidebarCard( {\n\tclassName,\n\ttitle,\n\ticon,\n\tdescription,\n\tactions,\n\tchildren,\n} ) {\n\treturn (\n\t\t<div className={ classnames( 'edit-site-sidebar-card', className ) }>\n\t\t\t<Icon className=\"edit-site-sidebar-card__icon\" icon={ icon } />\n\t\t\t<div className=\"edit-site-sidebar-card__content\">\n\t\t\t\t<div className=\"edit-site-sidebar-card__header\">\n\t\t\t\t\t<h2 className=\"edit-site-sidebar-card__title\">{ title }</h2>\n\t\t\t\t\t{ actions }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-site-sidebar-card__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -17,10 +17,9 @@ const {
|
|
|
17
17
|
Slot: SidebarFixedBottomSlot,
|
|
18
18
|
Fill: SidebarFixedBottomFill
|
|
19
19
|
} = createPrivateSlotFill(SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME);
|
|
20
|
-
export default function SidebarFixedBottom(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _ref;
|
|
20
|
+
export default function SidebarFixedBottom({
|
|
21
|
+
children
|
|
22
|
+
}) {
|
|
24
23
|
return createElement(SidebarFixedBottomFill, null, createElement("div", {
|
|
25
24
|
className: "edit-site-sidebar-fixed-bottom-slot"
|
|
26
25
|
}, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js"],"names":["privateApis","componentsPrivateApis","unlock","createPrivateSlotFill","SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME","Slot","SidebarFixedBottomSlot","Fill","SidebarFixedBottomFill","SidebarFixedBottom","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAxB,QAAqD,uBAArD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAED,qBAAF,CAAxC;AACA,MAAMG,mCAAmC,GAAG,oBAA5C;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,sBAAR;AAAgCC,EAAAA,IAAI,EAAEC;AAAtC,IACLL,qBAAqB,CAAEC,mCAAF,CADtB;AAGA,eAAe,SAASK,kBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js"],"names":["privateApis","componentsPrivateApis","unlock","createPrivateSlotFill","SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME","Slot","SidebarFixedBottomSlot","Fill","SidebarFixedBottomFill","SidebarFixedBottom","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAxB,QAAqD,uBAArD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAED,qBAAF,CAAxC;AACA,MAAMG,mCAAmC,GAAG,oBAA5C;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,sBAAR;AAAgCC,EAAAA,IAAI,EAAEC;AAAtC,IACLL,qBAAqB,CAAEC,mCAAF,CADtB;AAGA,eAAe,SAASK,kBAAT,CAA6B;AAAEC,EAAAA;AAAF,CAA7B,EAA4C;AAC1D,SACC,cAAC,sBAAD,QACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,QADH,CADD,CADD;AAOA;AAED,SAASJ,sBAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom';\nconst { Slot: SidebarFixedBottomSlot, Fill: SidebarFixedBottomFill } =\n\tcreatePrivateSlotFill( SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME );\n\nexport default function SidebarFixedBottom( { children } ) {\n\treturn (\n\t\t<SidebarFixedBottomFill>\n\t\t\t<div className=\"edit-site-sidebar-fixed-bottom-slot\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</SidebarFixedBottomFill>\n\t);\n}\n\nexport { SidebarFixedBottomSlot };\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { createElement
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import {
|
|
7
|
+
import { PanelRow, PanelBody } from '@wordpress/components';
|
|
8
8
|
import { store as editorStore } from '@wordpress/editor';
|
|
9
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
13
14
|
*/
|
|
@@ -15,7 +16,9 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
15
16
|
import { store as editSiteStore } from '../../../store';
|
|
16
17
|
import TemplateActions from './template-actions';
|
|
17
18
|
import TemplateAreas from './template-areas';
|
|
18
|
-
|
|
19
|
+
import LastRevision from './last-revision';
|
|
20
|
+
import SidebarCard from '../sidebar-card';
|
|
21
|
+
export default function TemplatePanel() {
|
|
19
22
|
const {
|
|
20
23
|
info: {
|
|
21
24
|
title,
|
|
@@ -48,21 +51,19 @@ export default function TemplateCard() {
|
|
|
48
51
|
return null;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
return createElement(
|
|
52
|
-
className: "edit-site-template-
|
|
53
|
-
}, createElement(
|
|
54
|
-
className: "edit-site-template-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
className: "edit-site-template-card__description"
|
|
66
|
-
}, decodeEntities(description)), createElement(TemplateAreas, null))));
|
|
54
|
+
return createElement(PanelBody, {
|
|
55
|
+
className: "edit-site-template-panel"
|
|
56
|
+
}, createElement(SidebarCard, {
|
|
57
|
+
className: "edit-site-template-card",
|
|
58
|
+
title: decodeEntities(title),
|
|
59
|
+
icon: icon,
|
|
60
|
+
description: decodeEntities(description),
|
|
61
|
+
actions: createElement(TemplateActions, {
|
|
62
|
+
template: template
|
|
63
|
+
})
|
|
64
|
+
}, createElement(TemplateAreas, null)), createElement(PanelRow, {
|
|
65
|
+
header: __('Editing history'),
|
|
66
|
+
className: "edit-site-template-revisions"
|
|
67
|
+
}, createElement(LastRevision, null)));
|
|
67
68
|
}
|
|
68
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"names":["useSelect","PanelRow","PanelBody","store","editorStore","coreStore","decodeEntities","__","editSiteStore","TemplateActions","TemplateAreas","LastRevision","SidebarCard","TemplatePanel","info","title","description","icon","template","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","postType","postId","record"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,uBAApC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,eAAe,SAASC,aAAT,GAAyB;AACvC,QAAM;AACLC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,WAAT;AAAsBC,MAAAA;AAAtB,KADD;AAELC,IAAAA;AAFK,MAGFlB,SAAS,CAAImB,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,QAAyCF,MAAM,CAAEX,aAAF,CAArD;AACA,UAAM;AAAEc,MAAAA;AAAF,QAA4BH,MAAM,CAAEd,SAAF,CAAxC;AACA,UAAM;AAAEkB,MAAAA,6BAA6B,EAAEC;AAAjC,QACLL,MAAM,CAAEf,WAAF,CADP;AAGA,UAAMqB,QAAQ,GAAGL,iBAAiB,EAAlC;AACA,UAAMM,MAAM,GAAGL,eAAe,EAA9B;AACA,UAAMM,MAAM,GAAGL,qBAAqB,CAAE,UAAF,EAAcG,QAAd,EAAwBC,MAAxB,CAApC;AAEA,UAAMZ,IAAI,GAAGa,MAAM,GAAGH,eAAe,CAAEG,MAAF,CAAlB,GAA+B,EAAlD;AAEA,WAAO;AAAEb,MAAAA,IAAF;AAAQI,MAAAA,QAAQ,EAAES;AAAlB,KAAP;AACA,GAbY,EAaV,EAbU,CAHb;;AAkBA,MAAK,CAAEZ,KAAF,IAAW,CAAEC,WAAlB,EAAgC;AAC/B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,WAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,KAAK,EAAGV,cAAc,CAAES,KAAF,CAFvB;AAGC,IAAA,IAAI,EAAGE,IAHR;AAIC,IAAA,WAAW,EAAGX,cAAc,CAAEU,WAAF,CAJ7B;AAKC,IAAA,OAAO,EAAG,cAAC,eAAD;AAAiB,MAAA,QAAQ,EAAGE;AAA5B;AALX,KAOC,cAAC,aAAD,OAPD,CADD,EAUC,cAAC,QAAD;AACC,IAAA,MAAM,EAAGX,EAAE,CAAE,iBAAF,CADZ;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,cAAC,YAAD,OAJD,CAVD,CADD;AAmBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PanelRow, PanelBody } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport TemplateActions from './template-actions';\nimport TemplateAreas from './template-areas';\nimport LastRevision from './last-revision';\nimport SidebarCard from '../sidebar-card';\n\nexport default function TemplatePanel() {\n\tconst {\n\t\tinfo: { title, description, icon },\n\t\ttemplate,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\tselect( editorStore );\n\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', postType, postId );\n\n\t\tconst info = record ? getTemplateInfo( record ) : {};\n\n\t\treturn { info, template: record };\n\t}, [] );\n\n\tif ( ! title && ! description ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody className=\"edit-site-template-panel\">\n\t\t\t<SidebarCard\n\t\t\t\tclassName=\"edit-site-template-card\"\n\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\ticon={ icon }\n\t\t\t\tdescription={ decodeEntities( description ) }\n\t\t\t\tactions={ <TemplateActions template={ template } /> }\n\t\t\t>\n\t\t\t\t<TemplateAreas />\n\t\t\t</SidebarCard>\n\t\t\t<PanelRow\n\t\t\t\theader={ __( 'Editing history' ) }\n\t\t\t\tclassName=\"edit-site-template-revisions\"\n\t\t\t>\n\t\t\t\t<LastRevision />\n\t\t\t</PanelRow>\n\t\t</PanelBody>\n\t);\n}\n"]}
|