@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
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = Editor;
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
@@ -15,6 +15,8 @@ var _components = require("@wordpress/components");
|
|
|
15
15
|
|
|
16
16
|
var _coreData = require("@wordpress/core-data");
|
|
17
17
|
|
|
18
|
+
var _preferences = require("@wordpress/preferences");
|
|
19
|
+
|
|
18
20
|
var _blockEditor = require("@wordpress/block-editor");
|
|
19
21
|
|
|
20
22
|
var _interface = require("@wordpress/interface");
|
|
@@ -25,33 +27,23 @@ var _i18n = require("@wordpress/i18n");
|
|
|
25
27
|
|
|
26
28
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
27
29
|
|
|
28
|
-
var _preferences = require("@wordpress/preferences");
|
|
29
|
-
|
|
30
|
-
var _headerEditMode = _interopRequireDefault(require("../header-edit-mode"));
|
|
31
|
-
|
|
32
30
|
var _sidebarEditMode = require("../sidebar-edit-mode");
|
|
33
31
|
|
|
34
|
-
var _navigationSidebar = _interopRequireDefault(require("../navigation-sidebar"));
|
|
35
|
-
|
|
36
32
|
var _blockEditor2 = _interopRequireDefault(require("../block-editor"));
|
|
37
33
|
|
|
38
34
|
var _codeEditor = _interopRequireDefault(require("../code-editor"));
|
|
39
35
|
|
|
40
36
|
var _keyboardShortcuts2 = _interopRequireDefault(require("../keyboard-shortcuts"));
|
|
41
37
|
|
|
42
|
-
var _urlQueryController = _interopRequireDefault(require("../url-query-controller"));
|
|
43
|
-
|
|
44
38
|
var _inserterSidebar = _interopRequireDefault(require("../secondary-sidebar/inserter-sidebar"));
|
|
45
39
|
|
|
46
40
|
var _listViewSidebar = _interopRequireDefault(require("../secondary-sidebar/list-view-sidebar"));
|
|
47
41
|
|
|
48
|
-
var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
|
|
49
|
-
|
|
50
42
|
var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
|
|
51
43
|
|
|
52
44
|
var _store = require("../../store");
|
|
53
45
|
|
|
54
|
-
var _globalStylesRenderer = require("
|
|
46
|
+
var _globalStylesRenderer = require("../global-styles-renderer");
|
|
55
47
|
|
|
56
48
|
var _globalStylesProvider = require("../global-styles/global-styles-provider");
|
|
57
49
|
|
|
@@ -65,9 +57,6 @@ var _useTitle = _interopRequireDefault(require("../routes/use-title"));
|
|
|
65
57
|
* Internal dependencies
|
|
66
58
|
*/
|
|
67
59
|
const interfaceLabels = {
|
|
68
|
-
/* translators: accessibility text for the editor top bar landmark region. */
|
|
69
|
-
header: (0, _i18n.__)('Editor top bar'),
|
|
70
|
-
|
|
71
60
|
/* translators: accessibility text for the editor content landmark region. */
|
|
72
61
|
body: (0, _i18n.__)('Editor content'),
|
|
73
62
|
|
|
@@ -78,44 +67,36 @@ const interfaceLabels = {
|
|
|
78
67
|
actions: (0, _i18n.__)('Editor publish'),
|
|
79
68
|
|
|
80
69
|
/* translators: accessibility text for the editor footer landmark region. */
|
|
81
|
-
footer: (0, _i18n.__)('Editor footer')
|
|
82
|
-
|
|
83
|
-
/* translators: accessibility text for the navigation sidebar landmark region. */
|
|
84
|
-
drawer: (0, _i18n.__)('Navigation Sidebar')
|
|
70
|
+
footer: (0, _i18n.__)('Editor footer')
|
|
85
71
|
};
|
|
86
72
|
|
|
87
|
-
function Editor(
|
|
88
|
-
let {
|
|
89
|
-
onError
|
|
90
|
-
} = _ref;
|
|
73
|
+
function Editor() {
|
|
91
74
|
const {
|
|
75
|
+
editedPostId,
|
|
76
|
+
editedPostType,
|
|
77
|
+
editedPost,
|
|
78
|
+
context,
|
|
79
|
+
hasLoadedPost,
|
|
80
|
+
editorMode,
|
|
81
|
+
canvasMode,
|
|
82
|
+
blockEditorMode,
|
|
83
|
+
isRightSidebarOpen,
|
|
92
84
|
isInserterOpen,
|
|
93
85
|
isListViewOpen,
|
|
94
86
|
isSaveViewOpen,
|
|
95
|
-
sidebarIsOpened,
|
|
96
|
-
settings,
|
|
97
|
-
entityId,
|
|
98
|
-
templateType,
|
|
99
|
-
page,
|
|
100
|
-
template,
|
|
101
|
-
templateResolved,
|
|
102
|
-
isNavigationOpen,
|
|
103
87
|
previousShortcut,
|
|
104
88
|
nextShortcut,
|
|
105
|
-
|
|
106
|
-
showIconLabels,
|
|
107
|
-
blockEditorMode
|
|
89
|
+
showIconLabels
|
|
108
90
|
} = (0, _data.useSelect)(select => {
|
|
109
91
|
const {
|
|
110
|
-
isInserterOpened,
|
|
111
|
-
isListViewOpened,
|
|
112
|
-
isSaveViewOpened,
|
|
113
|
-
getSettings,
|
|
114
92
|
getEditedPostType,
|
|
115
93
|
getEditedPostId,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
getEditedPostContext,
|
|
95
|
+
getEditorMode,
|
|
96
|
+
__unstableGetCanvasMode,
|
|
97
|
+
isInserterOpened,
|
|
98
|
+
isListViewOpened,
|
|
99
|
+
isSaveViewOpened
|
|
119
100
|
} = select(_store.store);
|
|
120
101
|
const {
|
|
121
102
|
hasFinishedResolution,
|
|
@@ -124,112 +105,84 @@ function Editor(_ref) {
|
|
|
124
105
|
const {
|
|
125
106
|
__unstableGetEditorMode
|
|
126
107
|
} = select(_blockEditor.store);
|
|
108
|
+
const {
|
|
109
|
+
getAllShortcutKeyCombinations
|
|
110
|
+
} = select(_keyboardShortcuts.store);
|
|
111
|
+
const {
|
|
112
|
+
getActiveComplementaryArea
|
|
113
|
+
} = select(_interface.store);
|
|
127
114
|
const postType = getEditedPostType();
|
|
128
|
-
const postId = getEditedPostId(); // The currently selected entity to display.
|
|
115
|
+
const postId = getEditedPostId(); // The currently selected entity to display.
|
|
116
|
+
// Typically template or template part in the site editor.
|
|
129
117
|
|
|
130
118
|
return {
|
|
119
|
+
editedPostId: postId,
|
|
120
|
+
editedPostType: postType,
|
|
121
|
+
editedPost: postId ? getEntityRecord('postType', postType, postId) : null,
|
|
122
|
+
context: getEditedPostContext(),
|
|
123
|
+
hasLoadedPost: postId ? hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) : false,
|
|
124
|
+
editorMode: getEditorMode(),
|
|
125
|
+
canvasMode: __unstableGetCanvasMode(),
|
|
126
|
+
blockEditorMode: __unstableGetEditorMode(),
|
|
131
127
|
isInserterOpen: isInserterOpened(),
|
|
132
128
|
isListViewOpen: isListViewOpened(),
|
|
133
129
|
isSaveViewOpen: isSaveViewOpened(),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
template: postId ? getEntityRecord('postType', postType, postId) : null,
|
|
139
|
-
templateResolved: postId ? hasFinishedResolution('getEntityRecord', ['postType', postType, postId]) : false,
|
|
140
|
-
entityId: postId,
|
|
141
|
-
isNavigationOpen: isNavigationOpened(),
|
|
142
|
-
previousShortcut: select(_keyboardShortcuts.store).getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
143
|
-
nextShortcut: select(_keyboardShortcuts.store).getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
144
|
-
editorMode: getEditorMode(),
|
|
145
|
-
showIconLabels: select(_preferences.store).get('core/edit-site', 'showIconLabels'),
|
|
146
|
-
blockEditorMode: __unstableGetEditorMode()
|
|
130
|
+
isRightSidebarOpen: getActiveComplementaryArea(_store.store.name),
|
|
131
|
+
previousShortcut: getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
132
|
+
nextShortcut: getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
133
|
+
showIconLabels: select(_preferences.store).get('core/edit-site', 'showIconLabels')
|
|
147
134
|
};
|
|
148
135
|
}, []);
|
|
149
136
|
const {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
setIsSaveViewOpened
|
|
137
|
+
setIsSaveViewOpened,
|
|
138
|
+
setEditedPostContext
|
|
153
139
|
} = (0, _data.useDispatch)(_store.store);
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
140
|
+
const isViewMode = canvasMode === 'view';
|
|
141
|
+
const isEditMode = canvasMode === 'edit';
|
|
142
|
+
const showVisualEditor = isViewMode || editorMode === 'visual';
|
|
143
|
+
const showBlockBreakcrumb = isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
|
|
144
|
+
const shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;
|
|
145
|
+
const shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;
|
|
146
|
+
const secondarySidebarLabel = isListViewOpen ? (0, _i18n.__)('List View') : (0, _i18n.__)('Block Library');
|
|
147
|
+
const blockContext = (0, _element.useMemo)(() => ({ ...context,
|
|
148
|
+
queryContext: [(context === null || context === void 0 ? void 0 : context.queryContext) || {
|
|
159
149
|
page: 1
|
|
160
|
-
}, newQueryContext =>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
...newQueryContext
|
|
164
|
-
}
|
|
150
|
+
}, newQueryContext => setEditedPostContext({ ...context,
|
|
151
|
+
queryContext: { ...(context === null || context === void 0 ? void 0 : context.queryContext),
|
|
152
|
+
...newQueryContext
|
|
165
153
|
}
|
|
166
154
|
})]
|
|
167
|
-
}), [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
document.body.classList.add('is-navigation-sidebar-open');
|
|
171
|
-
} else {
|
|
172
|
-
document.body.classList.remove('is-navigation-sidebar-open');
|
|
173
|
-
}
|
|
174
|
-
}, [isNavigationOpen]);
|
|
175
|
-
(0, _element.useEffect)(function openGlobalStylesOnLoad() {
|
|
176
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
177
|
-
|
|
178
|
-
if (searchParams.get('styles') === 'open') {
|
|
179
|
-
enableComplementaryArea('core/edit-site', 'edit-site/global-styles');
|
|
180
|
-
}
|
|
181
|
-
}, [enableComplementaryArea]); // Don't render the Editor until the settings are set and loaded.
|
|
182
|
-
|
|
183
|
-
const isReady = (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && templateType !== undefined && entityId !== undefined;
|
|
184
|
-
const secondarySidebarLabel = isListViewOpen ? (0, _i18n.__)('List View') : (0, _i18n.__)('Block Library');
|
|
185
|
-
|
|
186
|
-
const secondarySidebar = () => {
|
|
187
|
-
if (editorMode === 'visual' && isInserterOpen) {
|
|
188
|
-
return (0, _element.createElement)(_inserterSidebar.default, null);
|
|
189
|
-
}
|
|
155
|
+
}), [context]);
|
|
156
|
+
const isReady = editedPostType !== undefined && editedPostId !== undefined; // Only announce the title once the editor is ready to prevent "Replace"
|
|
157
|
+
// action in <URlQueryController> from double-announcing.
|
|
190
158
|
|
|
191
|
-
|
|
192
|
-
return (0, _element.createElement)(_listViewSidebar.default, null);
|
|
193
|
-
}
|
|
159
|
+
(0, _useTitle.default)(isReady && (0, _i18n.__)('Editor (beta)'));
|
|
194
160
|
|
|
161
|
+
if (!isReady) {
|
|
195
162
|
return null;
|
|
196
|
-
}
|
|
197
|
-
// action in <URlQueryController> from double-announcing.
|
|
163
|
+
}
|
|
198
164
|
|
|
199
|
-
|
|
200
|
-
(0, _useTitle.default)(isReady && (0, _i18n.__)('Editor (beta)'));
|
|
201
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_urlQueryController.default, null), isReady && (0, _element.createElement)(_keyboardShortcuts.ShortcutProvider, null, (0, _element.createElement)(_coreData.EntityProvider, {
|
|
165
|
+
return (0, _element.createElement)(_element.Fragment, null, isEditMode && (0, _element.createElement)(_welcomeGuide.default, null), (0, _element.createElement)(_keyboardShortcuts2.default.Register, null), (0, _element.createElement)(_coreData.EntityProvider, {
|
|
202
166
|
kind: "root",
|
|
203
167
|
type: "site"
|
|
204
168
|
}, (0, _element.createElement)(_coreData.EntityProvider, {
|
|
205
169
|
kind: "postType",
|
|
206
|
-
type:
|
|
207
|
-
id:
|
|
170
|
+
type: editedPostType,
|
|
171
|
+
id: editedPostId
|
|
208
172
|
}, (0, _element.createElement)(_globalStylesProvider.GlobalStylesProvider, null, (0, _element.createElement)(_blockEditor.BlockContextProvider, {
|
|
209
173
|
value: blockContext
|
|
210
|
-
}, (0, _element.createElement)(
|
|
211
|
-
onError: onError
|
|
212
|
-
}, (0, _element.createElement)(_keyboardShortcuts2.default.Register, null), (0, _element.createElement)(_sidebarEditMode.SidebarComplementaryAreaFills, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
|
|
213
|
-
labels: { ...interfaceLabels,
|
|
214
|
-
secondarySidebar: secondarySidebarLabel
|
|
215
|
-
},
|
|
174
|
+
}, (0, _element.createElement)(_sidebarEditMode.SidebarComplementaryAreaFills, null), (0, _element.createElement)(_interface.InterfaceSkeleton, {
|
|
216
175
|
className: showIconLabels && 'show-icon-labels',
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
scope: "core/edit-site"
|
|
220
|
-
}),
|
|
221
|
-
drawer: (0, _element.createElement)(_navigationSidebar.default.Slot, null),
|
|
222
|
-
header: (0, _element.createElement)(_headerEditMode.default, {
|
|
223
|
-
showIconLabels: showIconLabels
|
|
224
|
-
}),
|
|
225
|
-
notices: (0, _element.createElement)(_editor.EditorSnackbars, null),
|
|
226
|
-
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_editor.EditorNotices, null), editorMode === 'visual' && template && (0, _element.createElement)(_blockEditor2.default, {
|
|
227
|
-
setIsInserterOpen: setIsInserterOpened
|
|
228
|
-
}), editorMode === 'text' && template && (0, _element.createElement)(_codeEditor.default, null), templateResolved && !template && (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && entityId && (0, _element.createElement)(_components.Notice, {
|
|
176
|
+
notices: isEditMode && (0, _element.createElement)(_editor.EditorSnackbars, null),
|
|
177
|
+
content: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_globalStylesRenderer.GlobalStylesRenderer, null), (0, _element.createElement)(_editor.EditorNotices, null), showVisualEditor && editedPost && (0, _element.createElement)(_blockEditor2.default, null), editorMode === 'text' && editedPost && (0, _element.createElement)(_codeEditor.default, null), hasLoadedPost && !editedPost && (0, _element.createElement)(_components.Notice, {
|
|
229
178
|
status: "warning",
|
|
230
179
|
isDismissible: false
|
|
231
|
-
}, (0, _i18n.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), (0, _element.createElement)(_keyboardShortcuts2.default, null)),
|
|
232
|
-
|
|
180
|
+
}, (0, _i18n.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), isEditMode && (0, _element.createElement)(_keyboardShortcuts2.default, null)),
|
|
181
|
+
secondarySidebar: isEditMode && (shouldShowInserter && (0, _element.createElement)(_inserterSidebar.default, null) || shouldShowListView && (0, _element.createElement)(_listViewSidebar.default, null)),
|
|
182
|
+
sidebar: isEditMode && isRightSidebarOpen && (0, _element.createElement)(_interface.ComplementaryArea.Slot, {
|
|
183
|
+
scope: "core/edit-site"
|
|
184
|
+
}),
|
|
185
|
+
actions: isEditMode && (0, _element.createElement)(_element.Fragment, null, isSaveViewOpen ? (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
233
186
|
close: () => setIsSaveViewOpened(false)
|
|
234
187
|
}) : (0, _element.createElement)("div", {
|
|
235
188
|
className: "edit-site-editor__toggle-save-panel"
|
|
@@ -239,16 +192,16 @@ function Editor(_ref) {
|
|
|
239
192
|
onClick: () => setIsSaveViewOpened(true),
|
|
240
193
|
"aria-expanded": false
|
|
241
194
|
}, (0, _i18n.__)('Open save panel')))),
|
|
242
|
-
footer:
|
|
195
|
+
footer: showBlockBreakcrumb && (0, _element.createElement)(_blockEditor.BlockBreadcrumb, {
|
|
243
196
|
rootLabelText: (0, _i18n.__)('Template')
|
|
244
|
-
})
|
|
197
|
+
}),
|
|
245
198
|
shortcuts: {
|
|
246
199
|
previous: previousShortcut,
|
|
247
200
|
next: nextShortcut
|
|
201
|
+
},
|
|
202
|
+
labels: { ...interfaceLabels,
|
|
203
|
+
secondarySidebar: secondarySidebarLabel
|
|
248
204
|
}
|
|
249
|
-
})
|
|
205
|
+
}))))));
|
|
250
206
|
}
|
|
251
|
-
|
|
252
|
-
var _default = Editor;
|
|
253
|
-
exports.default = _default;
|
|
254
207
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["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","editSiteStore","hasFinishedResolution","getEntityRecord","coreStore","__unstableGetEditorMode","blockEditorStore","postType","postId","interfaceStore","getActiveComplementaryArea","name","keyboardShortcutsStore","getAllShortcutKeyCombinations","preferencesStore","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":";;;;;;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AC,WADT;AAEC,MAAA,SAAS,EAAC,4CAFX;AAGC,MAAA,OAAO,EAAG,MACTA,mBAAmB,CAClB,IADkB,CAJrB;AAQC,uBACC;AATF,OAYG,cACD,iBADC,CAZH,CADD,CAVF,CA7DF;AA4FC,IAAA,MAAM,EACL5B,eAAe,KACf,UADA,GAEC,4BAAC,4BAAD;AACC,MAAA,aAAa,EAAG,cACf,UADe;AADjB,MAFD,GAOI8C,SApGN;AAsGC,IAAA,SAAS,EAAG;AACXG,MAAAA,QAAQ,EAAErD,gBADC;AAEXsD,MAAAA,IAAI,EAAErD;AAFK;AAtGb,IAHD,EA8GC,4BAAC,qBAAD,OA9GD,EA+GC,4BAAC,mBAAD,CAAS,IAAT,OA/GD,CAFD,CADD,CALD,CADD,CADD,CAHF,CADD;AAuIA;;eACcd,M","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":["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","editSiteStore","hasFinishedResolution","getEntityRecord","coreStore","__unstableGetEditorMode","blockEditorStore","getAllShortcutKeyCombinations","keyboardShortcutsStore","getActiveComplementaryArea","interfaceStore","postType","postId","name","preferencesStore","get","setIsSaveViewOpened","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","showBlockBreakcrumb","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","queryContext","page","newQueryContext","isReady","undefined","previous","next","secondarySidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvCA;AACA;AACA;;AAwBA;AACA;AACA;AAaA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,IAAI,EAAE,cAAI,gBAAJ,CAFiB;;AAGvB;AACAC,EAAAA,OAAO,EAAE,cAAI,iBAAJ,CAJc;;AAKvB;AACAC,EAAAA,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EAAE1C;AAFK,KAjFb;AAqFC,IAAA,MAAM,EAAG,EACR,GAAGnB,eADK;AAER8D,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,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
|
|
12
|
+
var _blocks = require("@wordpress/blocks");
|
|
13
|
+
|
|
14
|
+
var _compose = require("@wordpress/compose");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
const BlockPreviewPanel = _ref => {
|
|
20
|
+
var _getBlockType;
|
|
21
|
+
|
|
22
|
+
let {
|
|
23
|
+
name
|
|
24
|
+
} = _ref;
|
|
25
|
+
const blockExample = (_getBlockType = (0, _blocks.getBlockType)(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.example;
|
|
26
|
+
const [containerResizeListener, {
|
|
27
|
+
width: containerWidth,
|
|
28
|
+
height: containerHeight
|
|
29
|
+
}] = (0, _compose.useResizeObserver)();
|
|
30
|
+
const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) || containerWidth;
|
|
31
|
+
return !blockExample ? null : (0, _element.createElement)("div", {
|
|
32
|
+
className: "edit-site-global-styles__block-preview-panel"
|
|
33
|
+
}, containerResizeListener, (0, _element.createElement)(_blockEditor.BlockPreview, {
|
|
34
|
+
viewportWidth: viewportWidth,
|
|
35
|
+
__experimentalMinHeight: containerHeight,
|
|
36
|
+
blocks: (0, _blocks.getBlockFromExample)(name, blockExample)
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = BlockPreviewPanel;
|
|
41
|
+
exports.default = _default;
|
|
42
|
+
//# 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":["BlockPreviewPanel","name","blockExample","example","containerResizeListener","width","containerWidth","height","containerHeight","viewportWidth"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,iBAAiB,GAAG,QAAgB;AAAA;;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACzC,QAAMC,YAAY,oBAAG,0BAAcD,IAAd,CAAH,kDAAG,cAAsBE,OAA3C;AACA,QAAM,CACLC,uBADK,EAEL;AAAEC,IAAAA,KAAK,EAAEC,cAAT;AAAyBC,IAAAA,MAAM,EAAEC;AAAjC,GAFK,IAGF,iCAHJ;AAIA,QAAMC,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,4BAAC,yBAAD;AACC,IAAA,aAAa,EAAGK,aADjB;AAEC,IAAA,uBAAuB,EAAGD,eAF3B;AAGC,IAAA,MAAM,EAAG,iCAAqBP,IAArB,EAA2BC,YAA3B;AAHV,IAHD,CADD;AAWA,CAnBD;;eAqBeF,iB","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"]}
|
|
@@ -39,7 +39,7 @@ function ContextMenu(_ref) {
|
|
|
39
39
|
const hasColorPanel = (0, _colorUtils.useHasColorPanel)(name);
|
|
40
40
|
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(name);
|
|
41
41
|
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(name);
|
|
42
|
-
const hasLayoutPanel =
|
|
42
|
+
const hasLayoutPanel = hasDimensionsPanel;
|
|
43
43
|
return (0, _element.createElement)(_components.__experimentalItemGroup, null, hasTypographyPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
44
44
|
icon: _icons.typography,
|
|
45
45
|
path: parentMenu + '/typography',
|
|
@@ -48,7 +48,11 @@ function ContextMenu(_ref) {
|
|
|
48
48
|
icon: _icons.color,
|
|
49
49
|
path: parentMenu + '/colors',
|
|
50
50
|
"aria-label": (0, _i18n.__)('Colors styles')
|
|
51
|
-
}, (0, _i18n.__)('Colors')),
|
|
51
|
+
}, (0, _i18n.__)('Colors')), hasBorderPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
52
|
+
icon: _icons.border,
|
|
53
|
+
path: parentMenu + '/border',
|
|
54
|
+
"aria-label": (0, _i18n.__)('Border styles')
|
|
55
|
+
}, (0, _i18n.__)('Border')), hasLayoutPanel && (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
52
56
|
icon: _icons.layout,
|
|
53
57
|
path: parentMenu + '/layout',
|
|
54
58
|
"aria-label": (0, _i18n.__)('Layout styles')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","typography","color","layout"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOA,SAASA,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAU,GAAG;AAArB,GAA4B;AACjD,QAAMC,kBAAkB,GAAG,4CAAuBF,IAAvB,CAA3B;AACA,QAAMG,aAAa,GAAG,kCAAkBH,IAAlB,CAAtB;AACA,QAAMI,cAAc,GAAG,oCAAmBJ,IAAnB,CAAvB;AACA,QAAMK,kBAAkB,GAAG,4CAAuBL,IAAvB,CAA3B;AACA,QAAMM,cAAc,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","typography","color","border","layout"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAKA;AACA;AACA;AAOA,SAASA,WAAT,OAAkD;AAAA,MAA5B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,UAAU,GAAG;AAArB,GAA4B;AACjD,QAAMC,kBAAkB,GAAG,4CAAuBF,IAAvB,CAA3B;AACA,QAAMG,aAAa,GAAG,kCAAkBH,IAAlB,CAAtB;AACA,QAAMI,cAAc,GAAG,oCAAmBJ,IAAnB,CAAvB;AACA,QAAMK,kBAAkB,GAAG,4CAAuBL,IAAvB,CAA3B;AACA,QAAMM,cAAc,GAAGD,kBAAvB;AAEA,SACC,4BAAC,mCAAD,QACGH,kBAAkB,IACnB,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGK,iBADR;AAEC,IAAA,IAAI,EAAGN,UAAU,GAAG,aAFrB;AAGC,kBAAa,cAAI,mBAAJ;AAHd,KAKG,cAAI,YAAJ,CALH,CAFF,EAUGE,aAAa,IACd,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGK,YADR;AAEC,IAAA,IAAI,EAAGP,UAAU,GAAG,SAFrB;AAGC,kBAAa,cAAI,eAAJ;AAHd,KAKG,cAAI,QAAJ,CALH,CAXF,EAmBGG,cAAc,IACf,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGK,aADR;AAEC,IAAA,IAAI,EAAGR,UAAU,GAAG,SAFrB;AAGC,kBAAa,cAAI,eAAJ;AAHd,KAKG,cAAI,QAAJ,CALH,CApBF,EA4BGK,cAAc,IACf,4BAAC,wCAAD;AACC,IAAA,IAAI,EAAGI,aADR;AAEC,IAAA,IAAI,EAAGT,UAAU,GAAG,SAFrB;AAGC,kBAAa,cAAI,eAAJ;AAHd,KAKG,cAAI,QAAJ,CALH,CA7BF,CADD;AAwCA;;eAEcF,W","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,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _hooks = require("./hooks");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
23
|
+
function CustomCSSControl() {
|
|
24
|
+
const [customCSS, setCustomCSS] = (0, _hooks.useStyle)('css');
|
|
25
|
+
const [themeCSS] = (0, _hooks.useStyle)('css', null, 'base');
|
|
26
|
+
const ignoreThemeCustomCSS = '/* IgnoreThemeCustomCSS */'; // If there is custom css from theme.json show it in the edit box
|
|
27
|
+
// so the user can selectively overwrite it, rather than have the user CSS
|
|
28
|
+
// completely overwrite the theme CSS by default.
|
|
29
|
+
|
|
30
|
+
const themeCustomCSS = !customCSS && themeCSS ? `/* ${(0, _i18n.__)('Theme Custom CSS start')} */\n${themeCSS}\n/* ${(0, _i18n.__)('Theme Custom CSS end')} */` : undefined;
|
|
31
|
+
|
|
32
|
+
function handleOnChange(value) {
|
|
33
|
+
// If there is theme custom CSS, but the user clears the input box then save the
|
|
34
|
+
// ignoreThemeCustomCSS string so that the theme custom CSS is not re-applied.
|
|
35
|
+
if (themeCSS && value === '') {
|
|
36
|
+
setCustomCSS(ignoreThemeCustomCSS);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
setCustomCSS(value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const originalThemeCustomCSS = themeCSS && customCSS && themeCustomCSS !== customCSS ? themeCSS : undefined;
|
|
44
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.TextareaControl, {
|
|
45
|
+
value: (customCSS === null || customCSS === void 0 ? void 0 : customCSS.replace(ignoreThemeCustomCSS, '')) || themeCustomCSS,
|
|
46
|
+
onChange: value => handleOnChange(value),
|
|
47
|
+
rows: 15,
|
|
48
|
+
className: "edit-site-global-styles__custom-css-input",
|
|
49
|
+
spellCheck: false,
|
|
50
|
+
help: (0, _i18n.__)("Enter your custom CSS in the textarea and preview in the editor. Changes won't take effect until you've saved the template.")
|
|
51
|
+
}), originalThemeCustomCSS && (0, _element.createElement)(_components.Panel, null, (0, _element.createElement)(_components.PanelBody, {
|
|
52
|
+
title: (0, _i18n.__)('Original Theme Custom CSS'),
|
|
53
|
+
initialOpen: false
|
|
54
|
+
}, (0, _element.createElement)("pre", {
|
|
55
|
+
className: "edit-site-global-styles__custom-css-theme-css"
|
|
56
|
+
}, originalThemeCustomCSS))));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var _default = CustomCSSControl;
|
|
60
|
+
exports.default = _default;
|
|
61
|
+
//# sourceMappingURL=custom-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/custom-css.js"],"names":["CustomCSSControl","customCSS","setCustomCSS","themeCSS","ignoreThemeCustomCSS","themeCustomCSS","undefined","handleOnChange","value","originalThemeCustomCSS","replace"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,gBAAT,GAA4B;AAC3B,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,qBAAU,KAAV,CAApC;AACA,QAAM,CAAEC,QAAF,IAAe,qBAAU,KAAV,EAAiB,IAAjB,EAAuB,MAAvB,CAArB;AACA,QAAMC,oBAAoB,GAAG,4BAA7B,CAH2B,CAK3B;AACA;AACA;;AACA,QAAMC,cAAc,GACnB,CAAEJ,SAAF,IAAeE,QAAf,GACI,MAAM,cACP,wBADO,CAEJ,QAAQA,QAAU,QAAQ,cAAI,sBAAJ,CAA8B,KAH9D,GAIGG,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,qDACC,4BAAC,2BAAD;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,EAAG,cACN,6HADM;AATR,IADD,EAcGC,sBAAsB,IACvB,4BAAC,iBAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,2BAAJ,CADT;AAEC,IAAA,WAAW,EAAG;AAFf,KAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,sBADH,CAJD,CADD,CAfF,CADD;AA6BA;;eAEcT,gB","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"]}
|
|
@@ -489,18 +489,14 @@ function DimensionsPanel(_ref) {
|
|
|
489
489
|
allowReset: false,
|
|
490
490
|
splitOnAxis: isAxialGap
|
|
491
491
|
})), showMinHeightControl && (0, _element.createElement)(_components.__experimentalToolsPanelItem, {
|
|
492
|
-
className: "single-column",
|
|
493
492
|
hasValue: hasMinHeightValue,
|
|
494
493
|
label: (0, _i18n.__)('Min. height'),
|
|
495
494
|
onDeselect: resetMinHeightValue,
|
|
496
495
|
isShownByDefault: true
|
|
497
|
-
}, (0, _element.createElement)(
|
|
496
|
+
}, (0, _element.createElement)(_blockEditor.__experimentalHeightControl, {
|
|
498
497
|
label: (0, _i18n.__)('Min. height'),
|
|
499
498
|
value: minHeightValue,
|
|
500
|
-
onChange: setMinHeightValue
|
|
501
|
-
units: units,
|
|
502
|
-
min: 0,
|
|
503
|
-
size: '__unstable-large'
|
|
499
|
+
onChange: setMinHeightValue
|
|
504
500
|
})));
|
|
505
501
|
}
|
|
506
502
|
//# sourceMappingURL=dimensions-panel.js.map
|