@wordpress/edit-site 4.19.0 → 5.0.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 +6 -0
- package/build/components/add-new-template/add-custom-template-modal.js +1 -0
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/index.js +8 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +21 -6
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +12 -8
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +15 -30
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +64 -0
- package/build/components/block-editor/editor-canvas.js.map +1 -0
- package/build/components/block-editor/index.js +61 -59
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +10 -44
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/editor/index.js +80 -127
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +42 -0
- package/build/components/global-styles/block-preview-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +6 -2
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +61 -0
- package/build/components/global-styles/custom-css.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +2 -6
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +15 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +10 -2
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-border.js +43 -0
- package/build/components/global-styles/screen-border.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +42 -0
- package/build/components/global-styles/screen-css.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +0 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-root.js +14 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -3
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/ui.js +50 -4
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +5 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +3 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -8
- package/build/components/global-styles-renderer/index.js.map +1 -0
- package/build/components/header-edit-mode/document-actions/index.js +12 -5
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +19 -12
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +11 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +231 -0
- package/build/components/layout/index.js.map +1 -0
- package/build/components/list/header.js +5 -1
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +4 -22
- package/build/components/list/index.js.map +1 -1
- package/build/components/navigate-to-link/index.js +1 -3
- package/build/components/navigate-to-link/index.js.map +1 -1
- package/build/components/routes/index.js +1 -1
- package/build/components/routes/index.js.map +1 -1
- package/build/components/sidebar/index.js +42 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +24 -4
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +53 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +49 -0
- package/build/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js +76 -0
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +188 -0
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build/components/site-icon/index.js +70 -0
- package/build/components/site-icon/index.js.map +1 -0
- package/build/components/site-title/index.js +55 -0
- package/build/components/site-title/index.js.map +1 -0
- package/build/components/style-book/index.js +173 -0
- package/build/components/style-book/index.js.map +1 -0
- package/build/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +5 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +53 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build/index.js +2 -45
- package/build/index.js.map +1 -1
- package/build/store/actions.js +93 -43
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +35 -107
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +69 -78
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/index.js +7 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +18 -6
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +13 -9
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +15 -28
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +51 -0
- package/build-module/components/block-editor/editor-canvas.js.map +1 -0
- package/build-module/components/block-editor/index.js +61 -60
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +11 -40
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/editor/index.js +81 -124
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +32 -0
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +7 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +51 -0
- package/build-module/components/global-styles/custom-css.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +3 -7
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +15 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +5 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +2 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +8 -2
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +27 -0
- package/build-module/components/global-styles/screen-border.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +28 -0
- package/build-module/components/global-styles/screen-css.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +0 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +14 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +2 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/ui.js +48 -5
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +5 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +4 -4
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -7
- package/build-module/components/global-styles-renderer/index.js.map +1 -0
- package/build-module/components/header-edit-mode/document-actions/index.js +13 -6
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +10 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +203 -0
- package/build-module/components/layout/index.js.map +1 -0
- package/build-module/components/list/header.js +5 -1
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +4 -19
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/navigate-to-link/index.js +1 -3
- package/build-module/components/navigate-to-link/index.js.map +1 -1
- package/build-module/components/routes/index.js +1 -1
- package/build-module/components/routes/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +30 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +27 -7
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +3 -3
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +40 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +39 -0
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +165 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build-module/components/site-icon/index.js +55 -0
- package/build-module/components/site-icon/index.js.map +1 -0
- package/build-module/components/site-title/index.js +43 -0
- package/build-module/components/site-title/index.js.map +1 -0
- package/build-module/components/style-book/index.js +156 -0
- package/build-module/components/style-book/index.js.map +1 -0
- package/build-module/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +4 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +43 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build-module/index.js +5 -36
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +87 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +35 -102
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +60 -72
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +550 -346
- package/build-style/style.css +550 -346
- package/package.json +32 -31
- package/src/components/add-new-template/add-custom-template-modal.js +1 -0
- package/src/components/add-new-template/index.js +6 -3
- package/src/components/add-new-template/new-template-part.js +15 -3
- package/src/components/add-new-template/new-template.js +14 -7
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/app/index.js +14 -43
- package/src/components/block-editor/editor-canvas.js +69 -0
- package/src/components/block-editor/index.js +102 -87
- package/src/components/block-editor/resizable-editor.js +9 -64
- package/src/components/block-editor/style.scss +25 -1
- package/src/components/code-editor/style.scss +1 -1
- package/src/components/editor/index.js +170 -236
- package/src/components/editor/style.scss +0 -22
- package/src/components/global-styles/block-preview-panel.js +29 -0
- package/src/components/global-styles/context-menu.js +11 -2
- package/src/components/global-styles/custom-css.js +73 -0
- package/src/components/global-styles/dimensions-panel.js +2 -5
- package/src/components/global-styles/global-styles-provider.js +39 -17
- package/src/components/global-styles/hooks.js +8 -3
- package/src/components/global-styles/palette.js +1 -1
- package/src/components/global-styles/screen-block-list.js +2 -1
- package/src/components/global-styles/screen-block.js +9 -1
- package/src/components/global-styles/screen-border.js +23 -0
- package/src/components/global-styles/screen-colors.js +2 -1
- package/src/components/global-styles/screen-css.js +33 -0
- package/src/components/global-styles/screen-layout.js +0 -3
- package/src/components/global-styles/screen-root.js +30 -1
- package/src/components/global-styles/screen-style-variations.js +5 -2
- package/src/components/global-styles/style.scss +31 -2
- package/src/components/global-styles/ui.js +47 -4
- package/src/components/global-styles/use-global-styles-output.js +5 -0
- package/src/components/global-styles/utils.js +8 -5
- package/src/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +3 -9
- package/src/components/header-edit-mode/document-actions/index.js +14 -9
- package/src/components/header-edit-mode/document-actions/style.scss +8 -1
- package/src/components/header-edit-mode/index.js +96 -78
- package/src/components/header-edit-mode/style.scss +5 -33
- package/src/components/keyboard-shortcuts/index.js +13 -0
- package/src/components/layout/index.js +278 -0
- package/src/components/layout/style.scss +176 -0
- package/src/components/list/header.js +5 -1
- package/src/components/list/index.js +12 -31
- package/src/components/list/style.scss +10 -4
- package/src/components/navigate-to-link/index.js +2 -8
- package/src/components/routes/index.js +1 -1
- package/src/components/sidebar/index.js +34 -0
- package/src/components/sidebar/style.scss +8 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -7
- package/src/components/sidebar-edit-mode/index.js +3 -3
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +21 -3
- package/src/components/sidebar-edit-mode/settings-header/style.scss +47 -34
- package/src/components/sidebar-edit-mode/style.scss +0 -13
- package/src/components/sidebar-navigation-item/index.js +51 -0
- package/src/components/sidebar-navigation-item/style.scss +17 -0
- package/src/components/sidebar-navigation-screen/index.js +55 -0
- package/src/components/sidebar-navigation-screen/style.scss +41 -0
- package/src/components/sidebar-navigation-screen-main/index.js +72 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +181 -0
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
- package/src/components/site-icon/index.js +56 -0
- package/src/components/site-icon/style.scss +10 -0
- package/src/components/site-title/index.js +39 -0
- package/src/components/style-book/index.js +193 -0
- package/src/components/style-book/style.scss +78 -0
- package/src/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +3 -3
- package/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +36 -0
- package/src/components/template-details/style.scss +4 -0
- package/src/index.js +3 -53
- package/src/store/actions.js +93 -48
- package/src/store/reducer.js +29 -91
- package/src/store/selectors.js +61 -101
- package/src/store/test/actions.js +3 -15
- package/src/store/test/reducer.js +8 -192
- package/src/store/test/selectors.js +3 -42
- package/src/style.scss +19 -3
- package/build/components/editor/global-styles-renderer.js.map +0 -1
- package/build/components/navigation-sidebar/index.js +0 -62
- package/build/components/navigation-sidebar/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +0 -77
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +0 -152
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +0 -124
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build/components/url-query-controller/index.js.map +0 -1
- package/build-module/components/editor/global-styles-renderer.js.map +0 -1
- package/build-module/components/navigation-sidebar/index.js +0 -45
- package/build-module/components/navigation-sidebar/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +0 -49
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +0 -131
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -66
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +0 -108
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build-module/components/url-query-controller/index.js.map +0 -1
- package/src/components/navigation-sidebar/index.js +0 -46
- package/src/components/navigation-sidebar/navigation-panel/constants.js +0 -94
- package/src/components/navigation-sidebar/navigation-panel/index.js +0 -142
- package/src/components/navigation-sidebar/navigation-panel/style.scss +0 -152
- package/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/src/components/navigation-sidebar/navigation-toggle/index.js +0 -114
- package/src/components/navigation-sidebar/navigation-toggle/style.scss +0 -71
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +0 -65
|
@@ -3,39 +3,32 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { useMemo } from '@wordpress/element';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import {
|
|
8
|
+
import { Button, Notice } from '@wordpress/components';
|
|
9
9
|
import { EntityProvider, store as coreStore } from '@wordpress/core-data';
|
|
10
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
10
11
|
import { BlockContextProvider, BlockBreadcrumb, store as blockEditorStore } from '@wordpress/block-editor';
|
|
11
12
|
import { InterfaceSkeleton, ComplementaryArea, store as interfaceStore } from '@wordpress/interface';
|
|
12
13
|
import { EditorNotices, EditorSnackbars, EntitiesSavedStates } from '@wordpress/editor';
|
|
13
14
|
import { __ } from '@wordpress/i18n';
|
|
14
|
-
import {
|
|
15
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
|
+
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import Header from '../header-edit-mode';
|
|
21
20
|
import { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';
|
|
22
|
-
import NavigationSidebar from '../navigation-sidebar';
|
|
23
21
|
import BlockEditor from '../block-editor';
|
|
24
22
|
import CodeEditor from '../code-editor';
|
|
25
23
|
import KeyboardShortcuts from '../keyboard-shortcuts';
|
|
26
|
-
import URLQueryController from '../url-query-controller';
|
|
27
24
|
import InserterSidebar from '../secondary-sidebar/inserter-sidebar';
|
|
28
25
|
import ListViewSidebar from '../secondary-sidebar/list-view-sidebar';
|
|
29
|
-
import ErrorBoundary from '../error-boundary';
|
|
30
26
|
import WelcomeGuide from '../welcome-guide';
|
|
31
27
|
import { store as editSiteStore } from '../../store';
|
|
32
|
-
import { GlobalStylesRenderer } from '
|
|
28
|
+
import { GlobalStylesRenderer } from '../global-styles-renderer';
|
|
33
29
|
import { GlobalStylesProvider } from '../global-styles/global-styles-provider';
|
|
34
30
|
import useTitle from '../routes/use-title';
|
|
35
31
|
const interfaceLabels = {
|
|
36
|
-
/* translators: accessibility text for the editor top bar landmark region. */
|
|
37
|
-
header: __('Editor top bar'),
|
|
38
|
-
|
|
39
32
|
/* translators: accessibility text for the editor content landmark region. */
|
|
40
33
|
body: __('Editor content'),
|
|
41
34
|
|
|
@@ -46,44 +39,35 @@ const interfaceLabels = {
|
|
|
46
39
|
actions: __('Editor publish'),
|
|
47
40
|
|
|
48
41
|
/* translators: accessibility text for the editor footer landmark region. */
|
|
49
|
-
footer: __('Editor footer')
|
|
50
|
-
|
|
51
|
-
/* translators: accessibility text for the navigation sidebar landmark region. */
|
|
52
|
-
drawer: __('Navigation Sidebar')
|
|
42
|
+
footer: __('Editor footer')
|
|
53
43
|
};
|
|
54
|
-
|
|
55
|
-
function Editor(_ref) {
|
|
56
|
-
let {
|
|
57
|
-
onError
|
|
58
|
-
} = _ref;
|
|
44
|
+
export default function Editor() {
|
|
59
45
|
const {
|
|
46
|
+
editedPostId,
|
|
47
|
+
editedPostType,
|
|
48
|
+
editedPost,
|
|
49
|
+
context,
|
|
50
|
+
hasLoadedPost,
|
|
51
|
+
editorMode,
|
|
52
|
+
canvasMode,
|
|
53
|
+
blockEditorMode,
|
|
54
|
+
isRightSidebarOpen,
|
|
60
55
|
isInserterOpen,
|
|
61
56
|
isListViewOpen,
|
|
62
57
|
isSaveViewOpen,
|
|
63
|
-
sidebarIsOpened,
|
|
64
|
-
settings,
|
|
65
|
-
entityId,
|
|
66
|
-
templateType,
|
|
67
|
-
page,
|
|
68
|
-
template,
|
|
69
|
-
templateResolved,
|
|
70
|
-
isNavigationOpen,
|
|
71
58
|
previousShortcut,
|
|
72
59
|
nextShortcut,
|
|
73
|
-
|
|
74
|
-
showIconLabels,
|
|
75
|
-
blockEditorMode
|
|
60
|
+
showIconLabels
|
|
76
61
|
} = useSelect(select => {
|
|
77
62
|
const {
|
|
78
|
-
isInserterOpened,
|
|
79
|
-
isListViewOpened,
|
|
80
|
-
isSaveViewOpened,
|
|
81
|
-
getSettings,
|
|
82
63
|
getEditedPostType,
|
|
83
64
|
getEditedPostId,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
65
|
+
getEditedPostContext,
|
|
66
|
+
getEditorMode,
|
|
67
|
+
__unstableGetCanvasMode,
|
|
68
|
+
isInserterOpened,
|
|
69
|
+
isListViewOpened,
|
|
70
|
+
isSaveViewOpened
|
|
87
71
|
} = select(editSiteStore);
|
|
88
72
|
const {
|
|
89
73
|
hasFinishedResolution,
|
|
@@ -92,112 +76,84 @@ function Editor(_ref) {
|
|
|
92
76
|
const {
|
|
93
77
|
__unstableGetEditorMode
|
|
94
78
|
} = select(blockEditorStore);
|
|
79
|
+
const {
|
|
80
|
+
getAllShortcutKeyCombinations
|
|
81
|
+
} = select(keyboardShortcutsStore);
|
|
82
|
+
const {
|
|
83
|
+
getActiveComplementaryArea
|
|
84
|
+
} = select(interfaceStore);
|
|
95
85
|
const postType = getEditedPostType();
|
|
96
|
-
const postId = getEditedPostId(); // The currently selected entity to display.
|
|
86
|
+
const postId = getEditedPostId(); // The currently selected entity to display.
|
|
87
|
+
// Typically template or template part in the site editor.
|
|
97
88
|
|
|
98
89
|
return {
|
|
90
|
+
editedPostId: postId,
|
|
91
|
+
editedPostType: postType,
|
|
92
|
+
editedPost: postId ? getEntityRecord('postType', postType, postId) : null,
|
|
93
|
+
context: getEditedPostContext(),
|
|
94
|
+
hasLoadedPost: postId ? hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) : false,
|
|
95
|
+
editorMode: getEditorMode(),
|
|
96
|
+
canvasMode: __unstableGetCanvasMode(),
|
|
97
|
+
blockEditorMode: __unstableGetEditorMode(),
|
|
99
98
|
isInserterOpen: isInserterOpened(),
|
|
100
99
|
isListViewOpen: isListViewOpened(),
|
|
101
100
|
isSaveViewOpen: isSaveViewOpened(),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
template: postId ? getEntityRecord('postType', postType, postId) : null,
|
|
107
|
-
templateResolved: postId ? hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) : false,
|
|
108
|
-
entityId: postId,
|
|
109
|
-
isNavigationOpen: isNavigationOpened(),
|
|
110
|
-
previousShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
111
|
-
nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
112
|
-
editorMode: getEditorMode(),
|
|
113
|
-
showIconLabels: select(preferencesStore).get('core/edit-site', 'showIconLabels'),
|
|
114
|
-
blockEditorMode: __unstableGetEditorMode()
|
|
101
|
+
isRightSidebarOpen: getActiveComplementaryArea(editSiteStore.name),
|
|
102
|
+
previousShortcut: getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
103
|
+
nextShortcut: getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
104
|
+
showIconLabels: select(preferencesStore).get('core/edit-site', 'showIconLabels')
|
|
115
105
|
};
|
|
116
106
|
}, []);
|
|
117
107
|
const {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setIsSaveViewOpened
|
|
108
|
+
setIsSaveViewOpened,
|
|
109
|
+
setEditedPostContext
|
|
121
110
|
} = useDispatch(editSiteStore);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
111
|
+
const isViewMode = canvasMode === 'view';
|
|
112
|
+
const isEditMode = canvasMode === 'edit';
|
|
113
|
+
const showVisualEditor = isViewMode || editorMode === 'visual';
|
|
114
|
+
const showBlockBreakcrumb = isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
|
|
115
|
+
const shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;
|
|
116
|
+
const shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;
|
|
117
|
+
const secondarySidebarLabel = isListViewOpen ? __('List View') : __('Block Library');
|
|
118
|
+
const blockContext = useMemo(() => ({ ...context,
|
|
119
|
+
queryContext: [(context === null || context === void 0 ? void 0 : context.queryContext) || {
|
|
127
120
|
page: 1
|
|
128
|
-
}, newQueryContext =>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
...newQueryContext
|
|
132
|
-
}
|
|
121
|
+
}, newQueryContext => setEditedPostContext({ ...context,
|
|
122
|
+
queryContext: { ...(context === null || context === void 0 ? void 0 : context.queryContext),
|
|
123
|
+
...newQueryContext
|
|
133
124
|
}
|
|
134
125
|
})]
|
|
135
|
-
}), [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
document.body.classList.add('is-navigation-sidebar-open');
|
|
139
|
-
} else {
|
|
140
|
-
document.body.classList.remove('is-navigation-sidebar-open');
|
|
141
|
-
}
|
|
142
|
-
}, [isNavigationOpen]);
|
|
143
|
-
useEffect(function openGlobalStylesOnLoad() {
|
|
144
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
145
|
-
|
|
146
|
-
if (searchParams.get('styles') === 'open') {
|
|
147
|
-
enableComplementaryArea('core/edit-site', 'edit-site/global-styles');
|
|
148
|
-
}
|
|
149
|
-
}, [enableComplementaryArea]); // Don't render the Editor until the settings are set and loaded.
|
|
150
|
-
|
|
151
|
-
const isReady = (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && templateType !== undefined && entityId !== undefined;
|
|
152
|
-
const secondarySidebarLabel = isListViewOpen ? __('List View') : __('Block Library');
|
|
153
|
-
|
|
154
|
-
const secondarySidebar = () => {
|
|
155
|
-
if (editorMode === 'visual' && isInserterOpen) {
|
|
156
|
-
return createElement(InserterSidebar, null);
|
|
157
|
-
}
|
|
126
|
+
}), [context]);
|
|
127
|
+
const isReady = editedPostType !== undefined && editedPostId !== undefined; // Only announce the title once the editor is ready to prevent "Replace"
|
|
128
|
+
// action in <URlQueryController> from double-announcing.
|
|
158
129
|
|
|
159
|
-
|
|
160
|
-
return createElement(ListViewSidebar, null);
|
|
161
|
-
}
|
|
130
|
+
useTitle(isReady && __('Editor (beta)'));
|
|
162
131
|
|
|
132
|
+
if (!isReady) {
|
|
163
133
|
return null;
|
|
164
|
-
}
|
|
165
|
-
// action in <URlQueryController> from double-announcing.
|
|
134
|
+
}
|
|
166
135
|
|
|
167
|
-
|
|
168
|
-
useTitle(isReady && __('Editor (beta)'));
|
|
169
|
-
return createElement(Fragment, null, createElement(URLQueryController, null), isReady && createElement(ShortcutProvider, null, createElement(EntityProvider, {
|
|
136
|
+
return createElement(Fragment, null, isEditMode && createElement(WelcomeGuide, null), createElement(KeyboardShortcuts.Register, null), createElement(EntityProvider, {
|
|
170
137
|
kind: "root",
|
|
171
138
|
type: "site"
|
|
172
139
|
}, createElement(EntityProvider, {
|
|
173
140
|
kind: "postType",
|
|
174
|
-
type:
|
|
175
|
-
id:
|
|
141
|
+
type: editedPostType,
|
|
142
|
+
id: editedPostId
|
|
176
143
|
}, createElement(GlobalStylesProvider, null, createElement(BlockContextProvider, {
|
|
177
144
|
value: blockContext
|
|
178
|
-
}, createElement(
|
|
179
|
-
onError: onError
|
|
180
|
-
}, createElement(KeyboardShortcuts.Register, null), createElement(SidebarComplementaryAreaFills, null), createElement(InterfaceSkeleton, {
|
|
181
|
-
labels: { ...interfaceLabels,
|
|
182
|
-
secondarySidebar: secondarySidebarLabel
|
|
183
|
-
},
|
|
145
|
+
}, createElement(SidebarComplementaryAreaFills, null), createElement(InterfaceSkeleton, {
|
|
184
146
|
className: showIconLabels && 'show-icon-labels',
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
scope: "core/edit-site"
|
|
188
|
-
}),
|
|
189
|
-
drawer: createElement(NavigationSidebar.Slot, null),
|
|
190
|
-
header: createElement(Header, {
|
|
191
|
-
showIconLabels: showIconLabels
|
|
192
|
-
}),
|
|
193
|
-
notices: createElement(EditorSnackbars, null),
|
|
194
|
-
content: createElement(Fragment, null, createElement(EditorNotices, null), editorMode === 'visual' && template && createElement(BlockEditor, {
|
|
195
|
-
setIsInserterOpen: setIsInserterOpened
|
|
196
|
-
}), editorMode === 'text' && template && createElement(CodeEditor, null), templateResolved && !template && (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && entityId && createElement(Notice, {
|
|
147
|
+
notices: isEditMode && createElement(EditorSnackbars, null),
|
|
148
|
+
content: createElement(Fragment, null, createElement(GlobalStylesRenderer, null), createElement(EditorNotices, null), showVisualEditor && editedPost && createElement(BlockEditor, null), editorMode === 'text' && editedPost && createElement(CodeEditor, null), hasLoadedPost && !editedPost && createElement(Notice, {
|
|
197
149
|
status: "warning",
|
|
198
150
|
isDismissible: false
|
|
199
|
-
}, __("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), createElement(KeyboardShortcuts, null)),
|
|
200
|
-
|
|
151
|
+
}, __("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), isEditMode && createElement(KeyboardShortcuts, null)),
|
|
152
|
+
secondarySidebar: isEditMode && (shouldShowInserter && createElement(InserterSidebar, null) || shouldShowListView && createElement(ListViewSidebar, null)),
|
|
153
|
+
sidebar: isEditMode && isRightSidebarOpen && createElement(ComplementaryArea.Slot, {
|
|
154
|
+
scope: "core/edit-site"
|
|
155
|
+
}),
|
|
156
|
+
actions: isEditMode && createElement(Fragment, null, isSaveViewOpen ? createElement(EntitiesSavedStates, {
|
|
201
157
|
close: () => setIsSaveViewOpened(false)
|
|
202
158
|
}) : createElement("div", {
|
|
203
159
|
className: "edit-site-editor__toggle-save-panel"
|
|
@@ -207,15 +163,16 @@ function Editor(_ref) {
|
|
|
207
163
|
onClick: () => setIsSaveViewOpened(true),
|
|
208
164
|
"aria-expanded": false
|
|
209
165
|
}, __('Open save panel')))),
|
|
210
|
-
footer:
|
|
166
|
+
footer: showBlockBreakcrumb && createElement(BlockBreadcrumb, {
|
|
211
167
|
rootLabelText: __('Template')
|
|
212
|
-
})
|
|
168
|
+
}),
|
|
213
169
|
shortcuts: {
|
|
214
170
|
previous: previousShortcut,
|
|
215
171
|
next: nextShortcut
|
|
172
|
+
},
|
|
173
|
+
labels: { ...interfaceLabels,
|
|
174
|
+
secondarySidebar: secondarySidebarLabel
|
|
216
175
|
}
|
|
217
|
-
})
|
|
176
|
+
}))))));
|
|
218
177
|
}
|
|
219
|
-
|
|
220
|
-
export default Editor;
|
|
221
178
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["useEffect","useMemo","useSelect","useDispatch","Popover","Button","Notice","EntityProvider","store","coreStore","BlockContextProvider","BlockBreadcrumb","blockEditorStore","InterfaceSkeleton","ComplementaryArea","interfaceStore","EditorNotices","EditorSnackbars","EntitiesSavedStates","__","ShortcutProvider","keyboardShortcutsStore","preferencesStore","Header","SidebarComplementaryAreaFills","NavigationSidebar","BlockEditor","CodeEditor","KeyboardShortcuts","URLQueryController","InserterSidebar","ListViewSidebar","ErrorBoundary","WelcomeGuide","editSiteStore","GlobalStylesRenderer","GlobalStylesProvider","useTitle","interfaceLabels","header","body","sidebar","actions","footer","drawer","Editor","onError","isInserterOpen","isListViewOpen","isSaveViewOpen","sidebarIsOpened","settings","entityId","templateType","page","template","templateResolved","isNavigationOpen","previousShortcut","nextShortcut","editorMode","showIconLabels","blockEditorMode","select","isInserterOpened","isListViewOpened","isSaveViewOpened","getSettings","getEditedPostType","getEditedPostId","getPage","isNavigationOpened","getEditorMode","hasFinishedResolution","getEntityRecord","__unstableGetEditorMode","postType","postId","getActiveComplementaryArea","name","getAllShortcutKeyCombinations","get","setPage","setIsInserterOpened","setIsSaveViewOpened","enableComplementaryArea","blockContext","context","queryContext","newQueryContext","document","classList","add","remove","openGlobalStylesOnLoad","searchParams","URLSearchParams","window","location","search","isReady","siteUrl","undefined","secondarySidebarLabel","secondarySidebar","previous","next"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,oBAAnC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,OAAT,EAAkBC,MAAlB,EAA0BC,MAA1B,QAAwC,uBAAxC;AACA,SAASC,cAAT,EAAyBC,KAAK,IAAIC,SAAlC,QAAmD,sBAAnD;AACA,SACCC,oBADD,EAECC,eAFD,EAGCH,KAAK,IAAII,gBAHV,QAIO,yBAJP;AAKA,SACCC,iBADD,EAECC,iBAFD,EAGCN,KAAK,IAAIO,cAHV,QAIO,sBAJP;AAKA,SACCC,aADD,EAECC,eAFD,EAGCC,mBAHD,QAIO,mBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,gBADD,EAECZ,KAAK,IAAIa,sBAFV,QAGO,+BAHP;AAIA,SAASb,KAAK,IAAIc,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,SAASC,6BAAT,QAA8C,sBAA9C;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AAC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Z;AAHF,OAMGjC,EAAE,CACH,2EADG,CANL,CAlBH,EA6BC,cAAC,iBAAD,OA7BD,CA5BF;AA4DC,IAAA,OAAO,EACN,8BACG8B,cAAc,GACf,cAAC,mBAAD;AACC,MAAA,KAAK,EAAG,MACPmC,mBAAmB,CAClB,KADkB;AAFrB,MADe,GASf;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,MAAD;AACC,MAAA,OAAO,EAAC,WADT;AAEC,MAAA,SAAS,EAAC,4CAFX;AAGC,MAAA,OAAO,EAAG,MACTA,mBAAmB,CAClB,IADkB,CAJrB;AAQC,uBACC;AATF,OAYGjE,EAAE,CACH,iBADG,CAZL,CADD,CAVF,CA7DF;AA4FC,IAAA,MAAM,EACL2C,eAAe,KACf,UADA,GAEC,cAAC,eAAD;AACC,MAAA,aAAa,EAAG3C,EAAE,CACjB,UADiB;AADnB,MAFD,GAOImF,SApGN;AAsGC,IAAA,SAAS,EAAG;AACXG,MAAAA,QAAQ,EAAE/C,gBADC;AAEXgD,MAAAA,IAAI,EAAE/C;AAFK;AAtGb,IAHD,EA8GC,cAAC,YAAD,OA9GD,EA+GC,cAAC,OAAD,CAAS,IAAT,OA/GD,CAFD,CADD,CALD,CADD,CADD,CAHF,CADD;AAuIA;;AACD,eAAed,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Popover, Button, Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tEntitiesSavedStates,\n} from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tShortcutProvider,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header-edit-mode';\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport NavigationSidebar from '../navigation-sidebar';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport URLQueryController from '../url-query-controller';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport ErrorBoundary from '../error-boundary';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from './global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n\t/* translators: accessibility text for the navigation sidebar landmark region. */\n\tdrawer: __( 'Navigation Sidebar' ),\n};\n\nfunction Editor( { onError } ) {\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisSaveViewOpen,\n\t\tsidebarIsOpened,\n\t\tsettings,\n\t\tentityId,\n\t\ttemplateType,\n\t\tpage,\n\t\ttemplate,\n\t\ttemplateResolved,\n\t\tisNavigationOpen,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\teditorMode,\n\t\tshowIconLabels,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tisSaveViewOpened,\n\t\t\tgetSettings,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetPage,\n\t\t\tisNavigationOpened,\n\t\t\tgetEditorMode,\n\t\t} = select( editSiteStore );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\n\t\t// The currently selected entity to display. Typically template or template part.\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tsidebarIsOpened: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editSiteStore.name ),\n\t\t\tsettings: getSettings(),\n\t\t\ttemplateType: postType,\n\t\t\tpage: getPage(),\n\t\t\ttemplate: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\ttemplateResolved: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\tentityId: postId,\n\t\t\tisNavigationOpen: isNavigationOpened(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst { setPage, setIsInserterOpened, setIsSaveViewOpened } =\n\t\tuseDispatch( editSiteStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...page?.context,\n\t\t\tqueryContext: [\n\t\t\t\tpage?.context.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetPage( {\n\t\t\t\t\t\t...page,\n\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t...page?.context,\n\t\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t\t...page?.context.queryContext,\n\t\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ page?.context ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( isNavigationOpen ) {\n\t\t\tdocument.body.classList.add( 'is-navigation-sidebar-open' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-navigation-sidebar-open' );\n\t\t}\n\t}, [ isNavigationOpen ] );\n\n\tuseEffect(\n\t\tfunction openGlobalStylesOnLoad() {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tif ( searchParams.get( 'styles' ) === 'open' ) {\n\t\t\t\tenableComplementaryArea(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'edit-site/global-styles'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\t// Don't render the Editor until the settings are set and loaded.\n\tconst isReady =\n\t\tsettings?.siteUrl &&\n\t\ttemplateType !== undefined &&\n\t\tentityId !== undefined;\n\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst secondarySidebar = () => {\n\t\tif ( editorMode === 'visual' && isInserterOpen ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( editorMode === 'visual' && isListViewOpen ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URlQueryController> from double-announcing.\n\tuseTitle( isReady && __( 'Editor (beta)' ) );\n\n\treturn (\n\t\t<>\n\t\t\t<URLQueryController />\n\t\t\t{ isReady && (\n\t\t\t\t<ShortcutProvider>\n\t\t\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\t\t\ttype={ templateType }\n\t\t\t\t\t\t\tid={ entityId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t<ErrorBoundary onError={ onError }>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\t\t\t\t\tsecondarySidebar:\n\t\t\t\t\t\t\t\t\t\t\t\t\tsecondarySidebarLabel,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t\t\tshowIconLabels &&\n\t\t\t\t\t\t\t\t\t\t\t\t'show-icon-labels'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\t\t\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t\t\t\t\t\tsidebarIsOpened && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdrawer={\n\t\t\t\t\t\t\t\t\t\t\t\t<NavigationSidebar.Slot />\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\t\t\t\t\t<Header\n\t\t\t\t\t\t\t\t\t\t\t\t\tshowIconLabels={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowIconLabels\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ editorMode === 'visual' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttemplate && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<BlockEditor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpen={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpened\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttemplate && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ templateResolved &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! template &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsettings?.siteUrl &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityId && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<EntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclose={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-expanded={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open save panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\t\t\t\t\t\tblockEditorMode !==\n\t\t\t\t\t\t\t\t\t\t\t\t'zoom-out' ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trootLabelText={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Template'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tshortcuts={ {\n\t\t\t\t\t\t\t\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\t\t\t\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t\t\t\t\t\t\t<Popover.Slot />\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</EntityProvider>\n\t\t\t\t</ShortcutProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\nexport default Editor;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["useMemo","useSelect","useDispatch","Button","Notice","EntityProvider","store","coreStore","preferencesStore","BlockContextProvider","BlockBreadcrumb","blockEditorStore","InterfaceSkeleton","ComplementaryArea","interfaceStore","EditorNotices","EditorSnackbars","EntitiesSavedStates","__","keyboardShortcutsStore","SidebarComplementaryAreaFills","BlockEditor","CodeEditor","KeyboardShortcuts","InserterSidebar","ListViewSidebar","WelcomeGuide","editSiteStore","GlobalStylesRenderer","GlobalStylesProvider","useTitle","interfaceLabels","body","sidebar","actions","footer","Editor","editedPostId","editedPostType","editedPost","context","hasLoadedPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isSaveViewOpen","previousShortcut","nextShortcut","showIconLabels","select","getEditedPostType","getEditedPostId","getEditedPostContext","getEditorMode","__unstableGetCanvasMode","isInserterOpened","isListViewOpened","isSaveViewOpened","hasFinishedResolution","getEntityRecord","__unstableGetEditorMode","getAllShortcutKeyCombinations","getActiveComplementaryArea","postType","postId","name","get","setIsSaveViewOpened","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","showBlockBreakcrumb","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","queryContext","page","newQueryContext","isReady","undefined","previous","next","secondarySidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,uBAA/B;AACA,SAASC,cAAT,EAAyBC,KAAK,IAAIC,SAAlC,QAAmD,sBAAnD;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,oBADD,EAECC,eAFD,EAGCJ,KAAK,IAAIK,gBAHV,QAIO,yBAJP;AAKA,SACCC,iBADD,EAECC,iBAFD,EAGCP,KAAK,IAAIQ,cAHV,QAIO,sBAJP;AAKA,SACCC,aADD,EAECC,eAFD,EAGCC,mBAHD,QAIO,mBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASZ,KAAK,IAAIa,sBAAlB,QAAgD,+BAAhD;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,sBAA9C;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,eAAP,MAA4B,wCAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASpB,KAAK,IAAIqB,aAAlB,QAAuC,aAAvC;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,oBAAT,QAAqC,yCAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AAEA,MAAMC,eAAe,GAAG;AACvB;AACAC,EAAAA,IAAI,EAAEd,EAAE,CAAE,gBAAF,CAFe;;AAGvB;AACAe,E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AClB,cAAC,eAAD;AACC,MAAA,aAAa,EAAGzD,EAAE,CAAE,UAAF;AADnB,MA5EH;AAiFC,IAAA,SAAS,EAAG;AACXmE,MAAAA,QAAQ,EAAEpC,gBADC;AAEXqC,MAAAA,IAAI,EAAEpC;AAFK,KAjFb;AAqFC,IAAA,MAAM,EAAG,EACR,GAAGnB,eADK;AAERwD,MAAAA,gBAAgB,EAAET;AAFV;AArFV,IAFD,CADD,CALD,CADD,CAHD,CADD;AA6GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tEntitiesSavedStates,\n} from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function Editor() {\n\tconst {\n\t\teditedPostId,\n\t\teditedPostType,\n\t\teditedPost,\n\t\tcontext,\n\t\thasLoadedPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisSaveViewOpen,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\t__unstableGetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tisSaveViewOpened,\n\t\t} = select( editSiteStore );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\teditedPostId: postId,\n\t\t\teditedPostType: postType,\n\t\t\teditedPost: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\tcontext: getEditedPostContext(),\n\t\t\thasLoadedPost: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: __unstableGetCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened, setEditedPostContext } =\n\t\tuseDispatch( editSiteStore );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst showBlockBreakcrumb =\n\t\tisEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...context,\n\t\t\tqueryContext: [\n\t\t\t\tcontext?.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetEditedPostContext( {\n\t\t\t\t\t\t...context,\n\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t...context?.queryContext,\n\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ context ]\n\t);\n\tconst isReady = editedPostType !== undefined && editedPostId !== undefined;\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URlQueryController> from double-announcing.\n\tuseTitle( isReady && __( 'Editor (beta)' ) );\n\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ editedPostType }\n\t\t\t\t\tid={ editedPostId }\n\t\t\t\t>\n\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tshowIconLabels && 'show-icon-labels'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnotices={ isEditMode && <EditorSnackbars /> }\n\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t\t\t\t\t\t{ showVisualEditor && editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockEditor />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\t\teditedPost && <CodeEditor /> }\n\t\t\t\t\t\t\t\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ isEditMode && <KeyboardShortcuts /> }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t\t\t<InserterSidebar />\n\t\t\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t\t\t<ListViewSidebar />\n\t\t\t\t\t\t\t\t\t\t) ) )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\tisEditMode && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<EntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\tclose={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open save panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\t\t\tshowBlockBreakcrumb && (\n\t\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\t\trootLabelText={ __( 'Template' ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcuts={ {\n\t\t\t\t\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\t\t\t\t\tnext: nextShortcut,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { BlockPreview } from '@wordpress/block-editor';
|
|
7
|
+
import { getBlockType, getBlockFromExample } from '@wordpress/blocks';
|
|
8
|
+
import { useResizeObserver } from '@wordpress/compose';
|
|
9
|
+
|
|
10
|
+
const BlockPreviewPanel = _ref => {
|
|
11
|
+
var _getBlockType;
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
name
|
|
15
|
+
} = _ref;
|
|
16
|
+
const blockExample = (_getBlockType = getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.example;
|
|
17
|
+
const [containerResizeListener, {
|
|
18
|
+
width: containerWidth,
|
|
19
|
+
height: containerHeight
|
|
20
|
+
}] = useResizeObserver();
|
|
21
|
+
const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) || containerWidth;
|
|
22
|
+
return !blockExample ? null : createElement("div", {
|
|
23
|
+
className: "edit-site-global-styles__block-preview-panel"
|
|
24
|
+
}, containerResizeListener, createElement(BlockPreview, {
|
|
25
|
+
viewportWidth: viewportWidth,
|
|
26
|
+
__experimentalMinHeight: containerHeight,
|
|
27
|
+
blocks: getBlockFromExample(name, blockExample)
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default BlockPreviewPanel;
|
|
32
|
+
//# sourceMappingURL=block-preview-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/block-preview-panel.js"],"names":["BlockPreview","getBlockType","getBlockFromExample","useResizeObserver","BlockPreviewPanel","name","blockExample","example","containerResizeListener","width","containerWidth","height","containerHeight","viewportWidth"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,yBAA7B;AACA,SAASC,YAAT,EAAuBC,mBAAvB,QAAkD,mBAAlD;AACA,SAASC,iBAAT,QAAkC,oBAAlC;;AAEA,MAAMC,iBAAiB,GAAG,QAAgB;AAAA;;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACzC,QAAMC,YAAY,oBAAGL,YAAY,CAAEI,IAAF,CAAf,kDAAG,cAAsBE,OAA3C;AACA,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC,cAAT;AAAyBC,IAAAA,MAAM,EAAEC;AAAjC,GAFK,IAGFT,iBAAiB,EAHrB;AAIA,QAAMU,aAAa,GAAG,CAAAP,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEO,aAAd,KAA+BH,cAArD;AAEA,SAAO,CAAEJ,YAAF,GAAiB,IAAjB,GACN;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,uBADH,EAGC,cAAC,YAAD;AACC,IAAA,aAAa,EAAGK,aADjB;AAEC,IAAA,uBAAuB,EAAGD,eAF3B;AAGC,IAAA,MAAM,EAAGV,mBAAmB,CAAEG,IAAF,EAAQC,YAAR;AAH7B,IAHD,CADD;AAWA,CAnBD;;AAqBA,eAAeF,iBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockPreview } from '@wordpress/block-editor';\nimport { getBlockType, getBlockFromExample } from '@wordpress/blocks';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst BlockPreviewPanel = ( { name } ) => {\n\tconst blockExample = getBlockType( name )?.example;\n\tconst [\n\t\tcontainerResizeListener,\n\t\t{ width: containerWidth, height: containerHeight },\n\t] = useResizeObserver();\n\tconst viewportWidth = blockExample?.viewportWidth || containerWidth;\n\n\treturn ! blockExample ? null : (\n\t\t<div className=\"edit-site-global-styles__block-preview-panel\">\n\t\t\t{ containerResizeListener }\n\n\t\t\t<BlockPreview\n\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t__experimentalMinHeight={ containerHeight }\n\t\t\t\tblocks={ getBlockFromExample( name, blockExample ) }\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default BlockPreviewPanel;\n"]}
|
|
@@ -4,7 +4,7 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
7
|
-
import { typography, color, layout } from '@wordpress/icons';
|
|
7
|
+
import { typography, border, color, layout } from '@wordpress/icons';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
@@ -25,7 +25,7 @@ function ContextMenu(_ref) {
|
|
|
25
25
|
const hasColorPanel = useHasColorPanel(name);
|
|
26
26
|
const hasBorderPanel = useHasBorderPanel(name);
|
|
27
27
|
const hasDimensionsPanel = useHasDimensionsPanel(name);
|
|
28
|
-
const hasLayoutPanel =
|
|
28
|
+
const hasLayoutPanel = hasDimensionsPanel;
|
|
29
29
|
return createElement(ItemGroup, null, hasTypographyPanel && createElement(NavigationButtonAsItem, {
|
|
30
30
|
icon: typography,
|
|
31
31
|
path: parentMenu + '/typography',
|
|
@@ -34,7 +34,11 @@ function ContextMenu(_ref) {
|
|
|
34
34
|
icon: color,
|
|
35
35
|
path: parentMenu + '/colors',
|
|
36
36
|
"aria-label": __('Colors styles')
|
|
37
|
-
}, __('Colors')),
|
|
37
|
+
}, __('Colors')), hasBorderPanel && createElement(NavigationButtonAsItem, {
|
|
38
|
+
icon: border,
|
|
39
|
+
path: parentMenu + '/border',
|
|
40
|
+
"aria-label": __('Border styles')
|
|
41
|
+
}, __('Border')), hasLayoutPanel && createElement(NavigationButtonAsItem, {
|
|
38
42
|
icon: layout,
|
|
39
43
|
path: parentMenu + '/layout',
|
|
40
44
|
"aria-label": __('Layout styles')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","typography","color","layout","__","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","NavigationButtonAsItem","ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAApC,QAAqD,uBAArD;AACA,SAASC,UAAT,EAAqBC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","typography","border","color","layout","__","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","NavigationButtonAsItem","ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAApC,QAAqD,uBAArD;AACA,SAASC,UAAT,EAAqBC,MAArB,EAA6BC,KAA7B,EAAoCC,MAApC,QAAkD,kBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,gBAAlC;AACA,SAASC,gBAAT,QAAiC,eAAjC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,SAASC,qBAAT,QAAsC,oBAAtC;AACA,SAASC,sBAAT,QAAuC,qBAAvC;;AAEA,SAASC,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAU,GAAG;AAArB,GAA4B;AACjD,QAAMC,kBAAkB,GAAGL,qBAAqB,CAAEG,IAAF,CAAhD;AACA,QAAMG,aAAa,GAAGR,gBAAgB,CAAEK,IAAF,CAAtC;AACA,QAAMI,cAAc,GAAGV,iBAAiB,CAAEM,IAAF,CAAxC;AACA,QAAMK,kBAAkB,GAAGT,qBAAqB,CAAEI,IAAF,CAAhD;AACA,QAAMM,cAAc,GAAGD,kBAAvB;AAEA,SACC,cAAC,SAAD,QACGH,kBAAkB,IACnB,cAAC,sBAAD;AACC,IAAA,IAAI,EAAGb,UADR;AAEC,IAAA,IAAI,EAAGY,UAAU,GAAG,aAFrB;AAGC,kBAAaR,EAAE,CAAE,mBAAF;AAHhB,KAKGA,EAAE,CAAE,YAAF,CALL,CAFF,EAUGU,aAAa,IACd,cAAC,sBAAD;AACC,IAAA,IAAI,EAAGZ,KADR;AAEC,IAAA,IAAI,EAAGU,UAAU,GAAG,SAFrB;AAGC,kBAAaR,EAAE,CAAE,eAAF;AAHhB,KAKGA,EAAE,CAAE,QAAF,CALL,CAXF,EAmBGW,cAAc,IACf,cAAC,sBAAD;AACC,IAAA,IAAI,EAAGd,MADR;AAEC,IAAA,IAAI,EAAGW,UAAU,GAAG,SAFrB;AAGC,kBAAaR,EAAE,CAAE,eAAF;AAHhB,KAKGA,EAAE,CAAE,QAAF,CALL,CApBF,EA4BGa,cAAc,IACf,cAAC,sBAAD;AACC,IAAA,IAAI,EAAGd,MADR;AAEC,IAAA,IAAI,EAAGS,UAAU,GAAG,SAFrB;AAGC,kBAAaR,EAAE,CAAE,eAAF;AAHhB,KAKGA,EAAE,CAAE,QAAF,CALL,CA7BF,CADD;AAwCA;;AAED,eAAeM,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { typography, border, color, layout } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-utils';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( name );\n\tconst hasColorPanel = useHasColorPanel( name );\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\n\treturn (\n\t\t<ItemGroup>\n\t\t\t{ hasTypographyPanel && (\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\ticon={ typography }\n\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t) }\n\t\t\t{ hasColorPanel && (\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\ticon={ color }\n\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t) }\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\ticon={ border }\n\t\t\t\t\tpath={ parentMenu + '/border' }\n\t\t\t\t\taria-label={ __( 'Border styles' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Border' ) }\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t) }\n\t\t\t{ hasLayoutPanel && (\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default ContextMenu;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { TextareaControl, Panel, PanelBody } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useStyle } from './hooks';
|
|
13
|
+
|
|
14
|
+
function CustomCSSControl() {
|
|
15
|
+
const [customCSS, setCustomCSS] = useStyle('css');
|
|
16
|
+
const [themeCSS] = useStyle('css', null, 'base');
|
|
17
|
+
const ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */'; // If there is custom css from theme.json show it in the edit box
|
|
18
|
+
// so the user can selectively overwrite it, rather than have the user CSS
|
|
19
|
+
// completely overwrite the theme CSS by default.
|
|
20
|
+
|
|
21
|
+
const themeCustomCSS = !customCSS && themeCSS ? `/* ${__('Theme Custom CSS start')} */\n${themeCSS}\n/* ${__('Theme Custom CSS end')} */` : undefined;
|
|
22
|
+
|
|
23
|
+
function handleOnChange(value) {
|
|
24
|
+
// If there is theme custom CSS, but the user clears the input box then save the
|
|
25
|
+
// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.
|
|
26
|
+
if (themeCSS && value === '') {
|
|
27
|
+
setCustomCSS(ignoreThemeCustomCSS);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setCustomCSS(value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const originalThemeCustomCSS = themeCSS && customCSS && themeCustomCSS !== customCSS ? themeCSS : undefined;
|
|
35
|
+
return createElement(Fragment, null, createElement(TextareaControl, {
|
|
36
|
+
value: (customCSS === null || customCSS === void 0 ? void 0 : customCSS.replace(ignoreThemeCustomCSS, '')) || themeCustomCSS,
|
|
37
|
+
onChange: value => handleOnChange(value),
|
|
38
|
+
rows: 15,
|
|
39
|
+
className: "edit-site-global-styles__custom-css-input",
|
|
40
|
+
spellCheck: false,
|
|
41
|
+
help: __("Enter your custom CSS in the textarea and preview in the editor. Changes won't take effect until you've saved the template.")
|
|
42
|
+
}), originalThemeCustomCSS && createElement(Panel, null, createElement(PanelBody, {
|
|
43
|
+
title: __('Original Theme Custom CSS'),
|
|
44
|
+
initialOpen: false
|
|
45
|
+
}, createElement("pre", {
|
|
46
|
+
className: "edit-site-global-styles__custom-css-theme-css"
|
|
47
|
+
}, originalThemeCustomCSS))));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default CustomCSSControl;
|
|
51
|
+
//# sourceMappingURL=custom-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/custom-css.js"],"names":["TextareaControl","Panel","PanelBody","__","useStyle","CustomCSSControl","customCSS","setCustomCSS","themeCSS","ignoreThemeCustomCSS","themeCustomCSS","undefined","handleOnChange","value","originalThemeCustomCSS","replace"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,eAAT,EAA0BC,KAA1B,EAAiCC,SAAjC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,SAAzB;;AAEA,SAASC,gBAAT,GAA4B;AAC3B,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8BH,QAAQ,CAAE,KAAF,CAA5C;AACA,QAAM,CAAEI,QAAF,IAAeJ,QAAQ,CAAE,KAAF,EAAS,IAAT,EAAe,MAAf,CAA7B;AACA,QAAMK,oBAAoB,GAAG,4BAA7B,CAH2B,CAK3B;AACA;AACA;;AACA,QAAMC,cAAc,GACnB,CAAEJ,SAAF,IAAeE,QAAf,GACI,MAAML,EAAE,CACT,wBADS,CAEN,QAAQK,QAAU,QAAQL,EAAE,CAAE,sBAAF,CAA4B,KAH9D,GAIGQ,SALJ;;AAOA,WAASC,cAAT,CAAyBC,KAAzB,EAAiC;AAChC;AACA;AACA,QAAKL,QAAQ,IAAIK,KAAK,KAAK,EAA3B,EAAgC;AAC/BN,MAAAA,YAAY,CAAEE,oBAAF,CAAZ;AACA;AACA;;AACDF,IAAAA,YAAY,CAAEM,KAAF,CAAZ;AACA;;AAED,QAAMC,sBAAsB,GAC3BN,QAAQ,IAAIF,SAAZ,IAAyBI,cAAc,KAAKJ,SAA5C,GACGE,QADH,GAEGG,SAHJ;AAKA,SACC,8BACC,cAAC,eAAD;AACC,IAAA,KAAK,EACJ,CAAAL,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAES,OAAX,CAAoBN,oBAApB,EAA0C,EAA1C,MACAC,cAHF;AAKC,IAAA,QAAQ,EAAKG,KAAF,IAAaD,cAAc,CAAEC,KAAF,CALvC;AAMC,IAAA,IAAI,EAAG,EANR;AAOC,IAAA,SAAS,EAAC,2CAPX;AAQC,IAAA,UAAU,EAAG,KARd;AASC,IAAA,IAAI,EAAGV,EAAE,CACR,6HADQ;AATV,IADD,EAcGW,sBAAsB,IACvB,cAAC,KAAD,QACC,cAAC,SAAD;AACC,IAAA,KAAK,EAAGX,EAAE,CAAE,2BAAF,CADX;AAEC,IAAA,WAAW,EAAG;AAFf,KAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGW,sBADH,CAJD,CADD,CAfF,CADD;AA6BA;;AAED,eAAeT,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { TextareaControl, Panel, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\n\nfunction CustomCSSControl() {\n\tconst [ customCSS, setCustomCSS ] = useStyle( 'css' );\n\tconst [ themeCSS ] = useStyle( 'css', null, 'base' );\n\tconst ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */';\n\n\t// If there is custom css from theme.json show it in the edit box\n\t// so the user can selectively overwrite it, rather than have the user CSS\n\t// completely overwrite the theme CSS by default.\n\tconst themeCustomCSS =\n\t\t! customCSS && themeCSS\n\t\t\t? `/* ${ __(\n\t\t\t\t\t'Theme Custom CSS start'\n\t\t\t ) } */\\n${ themeCSS }\\n/* ${ __( 'Theme Custom CSS end' ) } */`\n\t\t\t: undefined;\n\n\tfunction handleOnChange( value ) {\n\t\t// If there is theme custom CSS, but the user clears the input box then save the\n\t\t// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.\n\t\tif ( themeCSS && value === '' ) {\n\t\t\tsetCustomCSS( ignoreThemeCustomCSS );\n\t\t\treturn;\n\t\t}\n\t\tsetCustomCSS( value );\n\t}\n\n\tconst originalThemeCustomCSS =\n\t\tthemeCSS && customCSS && themeCustomCSS !== customCSS\n\t\t\t? themeCSS\n\t\t\t: undefined;\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\tvalue={\n\t\t\t\t\tcustomCSS?.replace( ignoreThemeCustomCSS, '' ) ||\n\t\t\t\t\tthemeCustomCSS\n\t\t\t\t}\n\t\t\t\tonChange={ ( value ) => handleOnChange( value ) }\n\t\t\t\trows={ 15 }\n\t\t\t\tclassName=\"edit-site-global-styles__custom-css-input\"\n\t\t\t\tspellCheck={ false }\n\t\t\t\thelp={ __(\n\t\t\t\t\t\"Enter your custom CSS in the textarea and preview in the editor. Changes won't take effect until you've saved the template.\"\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ originalThemeCustomCSS && (\n\t\t\t\t<Panel>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\ttitle={ __( 'Original Theme Custom CSS' ) }\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<pre className=\"edit-site-global-styles__custom-css-theme-css\">\n\t\t\t\t\t\t\t{ originalThemeCustomCSS }\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</Panel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default CustomCSSControl;\n"]}
|
|
@@ -10,7 +10,7 @@ import classnames from 'classnames';
|
|
|
10
10
|
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalBoxControl as BoxControl, __experimentalHStack as HStack, __experimentalUnitControl as UnitControl, __experimentalUseCustomUnits as useCustomUnits, __experimentalView as View } from '@wordpress/components';
|
|
13
|
-
import { __experimentalUseCustomSides as useCustomSides, __experimentalSpacingSizesControl as SpacingSizesControl } from '@wordpress/block-editor';
|
|
13
|
+
import { __experimentalUseCustomSides as useCustomSides, __experimentalHeightControl as HeightControl, __experimentalSpacingSizesControl as SpacingSizesControl } from '@wordpress/block-editor';
|
|
14
14
|
import { Icon, positionCenter, stretchWide } from '@wordpress/icons';
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -472,18 +472,14 @@ export default function DimensionsPanel(_ref) {
|
|
|
472
472
|
allowReset: false,
|
|
473
473
|
splitOnAxis: isAxialGap
|
|
474
474
|
})), showMinHeightControl && createElement(ToolsPanelItem, {
|
|
475
|
-
className: "single-column",
|
|
476
475
|
hasValue: hasMinHeightValue,
|
|
477
476
|
label: __('Min. height'),
|
|
478
477
|
onDeselect: resetMinHeightValue,
|
|
479
478
|
isShownByDefault: true
|
|
480
|
-
}, createElement(
|
|
479
|
+
}, createElement(HeightControl, {
|
|
481
480
|
label: __('Min. height'),
|
|
482
481
|
value: minHeightValue,
|
|
483
|
-
onChange: setMinHeightValue
|
|
484
|
-
units: units,
|
|
485
|
-
min: 0,
|
|
486
|
-
size: '__unstable-large'
|
|
482
|
+
onChange: setMinHeightValue
|
|
487
483
|
})));
|
|
488
484
|
}
|
|
489
485
|
//# sourceMappingURL=dimensions-panel.js.map
|