@wordpress/edit-site 5.3.1 → 5.3.3
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 +1 -0
- package/build/components/add-new-template/new-template-part.js +8 -5
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +8 -5
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +3 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +3 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +26 -38
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +10 -12
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -2
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +2 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +9 -2
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +2 -2
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +2 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +2 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +2 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -2
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +2 -2
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-border.js +0 -6
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +2 -2
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +2 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-effects.js +53 -0
- package/build/components/global-styles/screen-effects.js.map +1 -0
- package/build/components/global-styles/screen-heading-color.js +2 -2
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +2 -2
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -2
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +2 -2
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +3 -3
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +10 -10
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +6 -3
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/layout/index.js +13 -24
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/table.js +1 -0
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +2 -2
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-panel/index.js +78 -0
- package/build/components/save-panel/index.js.map +1 -0
- package/build/components/sidebar/index.js +42 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +28 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +72 -0
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +70 -0
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +32 -82
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +43 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build/components/site-hub/index.js +14 -49
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -3
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -20
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -3
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +12 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build/components/use-edited-entity-record/index.js +6 -2
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +2 -2
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/utils/get-is-list-page.js +5 -6
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +7 -4
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +7 -4
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +3 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +28 -41
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +10 -11
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +3 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +9 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +3 -3
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +3 -3
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -3
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +3 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +3 -3
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +0 -5
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +3 -3
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +3 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +5 -5
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-effects.js +35 -0
- package/build-module/components/global-styles/screen-effects.js.map +1 -0
- package/build-module/components/global-styles/screen-heading-color.js +3 -3
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +3 -3
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +3 -3
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +3 -3
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +3 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +4 -4
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +3 -3
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +3 -3
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +10 -11
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +3 -3
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -3
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/layout/index.js +12 -24
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/table.js +1 -0
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +3 -3
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-panel/index.js +64 -0
- package/build-module/components/save-panel/index.js.map +1 -0
- package/build-module/components/sidebar/index.js +36 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +27 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +55 -0
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +53 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +34 -81
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +14 -46
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +11 -4
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -21
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +11 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build-module/components/use-edited-entity-record/index.js +6 -2
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +3 -3
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +5 -6
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +100 -62
- package/build-style/style.css +100 -62
- package/package.json +20 -20
- package/src/components/add-new-template/new-template-part.js +7 -4
- package/src/components/add-new-template/new-template.js +8 -6
- package/src/components/block-editor/editor-canvas.js +1 -1
- package/src/components/block-editor/index.js +3 -3
- package/src/components/editor/index.js +32 -71
- package/src/components/editor/style.scss +2 -2
- package/src/components/global-styles/block-preview-panel.js +8 -12
- package/src/components/global-styles/border-panel.js +3 -3
- package/src/components/global-styles/color-palette-panel.js +3 -3
- package/src/components/global-styles/context-menu.js +14 -2
- package/src/components/global-styles/custom-css.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +3 -3
- package/src/components/global-styles/global-styles-provider.js +3 -3
- package/src/components/global-styles/gradients-palette-panel.js +3 -3
- package/src/components/global-styles/header.js +2 -2
- package/src/components/global-styles/hooks.js +3 -3
- package/src/components/global-styles/navigation-button.js +4 -2
- package/src/components/global-styles/palette.js +3 -3
- package/src/components/global-styles/preview.js +3 -3
- package/src/components/global-styles/screen-background-color.js +3 -3
- package/src/components/global-styles/screen-border.js +0 -5
- package/src/components/global-styles/screen-button-color.js +3 -3
- package/src/components/global-styles/screen-colors.js +3 -3
- package/src/components/global-styles/screen-css.js +14 -7
- package/src/components/global-styles/screen-effects.js +28 -0
- package/src/components/global-styles/screen-heading-color.js +3 -3
- package/src/components/global-styles/screen-link-color.js +3 -3
- package/src/components/global-styles/screen-root.js +3 -3
- package/src/components/global-styles/screen-style-variations.js +3 -3
- package/src/components/global-styles/screen-text-color.js +3 -3
- package/src/components/global-styles/screen-typography.js +3 -3
- package/src/components/global-styles/shadow-panel.js +4 -4
- package/src/components/global-styles/style.scss +2 -5
- package/src/components/global-styles/typography-panel.js +3 -3
- package/src/components/global-styles/typography-preview.js +3 -3
- package/src/components/global-styles/ui.js +8 -8
- package/src/components/global-styles-renderer/index.js +3 -3
- package/src/components/header-edit-mode/index.js +6 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/src/components/layout/index.js +38 -48
- package/src/components/layout/style.scss +36 -26
- package/src/components/list/actions/rename-menu-item.js +1 -1
- package/src/components/list/table.js +4 -0
- package/src/components/navigation-inspector/navigation-menu.js +3 -3
- package/src/components/save-panel/index.js +68 -0
- package/src/components/save-panel/style.scss +5 -0
- package/src/components/sidebar/index.js +36 -8
- package/src/components/sidebar/style.scss +15 -0
- package/src/components/sidebar-navigation-screen/index.js +27 -11
- package/src/components/sidebar-navigation-screen/style.scss +4 -6
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +52 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +52 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +49 -83
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/src/components/site-hub/index.js +67 -122
- package/src/components/site-hub/style.scss +1 -10
- package/src/components/style-book/index.js +11 -7
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +48 -14
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +10 -10
- package/src/components/use-edited-entity-record/index.js +6 -2
- package/src/hooks/push-changes-to-global-styles/index.js +3 -3
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/store/index.js +1 -1
- package/src/style.scss +1 -0
- package/src/utils/get-is-list-page.js +5 -5
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build/experiments.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo } from '@wordpress/element';
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import {
|
|
7
|
-
import { EntityProvider
|
|
6
|
+
import { Notice } from '@wordpress/components';
|
|
7
|
+
import { EntityProvider } from '@wordpress/core-data';
|
|
8
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
9
|
import {
|
|
10
10
|
BlockContextProvider,
|
|
@@ -16,12 +16,8 @@ import {
|
|
|
16
16
|
ComplementaryArea,
|
|
17
17
|
store as interfaceStore,
|
|
18
18
|
} from '@wordpress/interface';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
EditorSnackbars,
|
|
22
|
-
EntitiesSavedStates,
|
|
23
|
-
} from '@wordpress/editor';
|
|
24
|
-
import { __ } from '@wordpress/i18n';
|
|
19
|
+
import { EditorNotices, EditorSnackbars } from '@wordpress/editor';
|
|
20
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
25
21
|
|
|
26
22
|
/**
|
|
27
23
|
* Internal dependencies
|
|
@@ -38,7 +34,8 @@ import { GlobalStylesRenderer } from '../global-styles-renderer';
|
|
|
38
34
|
import { GlobalStylesProvider } from '../global-styles/global-styles-provider';
|
|
39
35
|
import useTitle from '../routes/use-title';
|
|
40
36
|
import CanvasSpinner from '../canvas-spinner';
|
|
41
|
-
import { unlock } from '../../
|
|
37
|
+
import { unlock } from '../../private-apis';
|
|
38
|
+
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
42
39
|
|
|
43
40
|
const interfaceLabels = {
|
|
44
41
|
/* translators: accessibility text for the editor content landmark region. */
|
|
@@ -53,58 +50,42 @@ const interfaceLabels = {
|
|
|
53
50
|
|
|
54
51
|
export default function Editor() {
|
|
55
52
|
const {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
record: editedPost,
|
|
54
|
+
getTitle,
|
|
55
|
+
isLoaded: hasLoadedPost,
|
|
56
|
+
} = useEditedEntityRecord();
|
|
57
|
+
|
|
58
|
+
const { id: editedPostId, type: editedPostType } = editedPost;
|
|
59
|
+
|
|
60
|
+
const {
|
|
59
61
|
context,
|
|
60
|
-
hasLoadedPost,
|
|
61
62
|
editorMode,
|
|
62
63
|
canvasMode,
|
|
63
64
|
blockEditorMode,
|
|
64
65
|
isRightSidebarOpen,
|
|
65
66
|
isInserterOpen,
|
|
66
67
|
isListViewOpen,
|
|
67
|
-
isSaveViewOpen,
|
|
68
68
|
showIconLabels,
|
|
69
69
|
} = useSelect( ( select ) => {
|
|
70
70
|
const {
|
|
71
|
-
getEditedPostType,
|
|
72
|
-
getEditedPostId,
|
|
73
71
|
getEditedPostContext,
|
|
74
72
|
getEditorMode,
|
|
75
73
|
getCanvasMode,
|
|
76
74
|
isInserterOpened,
|
|
77
75
|
isListViewOpened,
|
|
78
|
-
isSaveViewOpened,
|
|
79
76
|
} = unlock( select( editSiteStore ) );
|
|
80
|
-
const { hasFinishedResolution, getEntityRecord } = select( coreStore );
|
|
81
77
|
const { __unstableGetEditorMode } = select( blockEditorStore );
|
|
82
78
|
const { getActiveComplementaryArea } = select( interfaceStore );
|
|
83
|
-
const postType = getEditedPostType();
|
|
84
|
-
const postId = getEditedPostId();
|
|
85
79
|
|
|
86
80
|
// The currently selected entity to display.
|
|
87
81
|
// Typically template or template part in the site editor.
|
|
88
82
|
return {
|
|
89
|
-
editedPostId: postId,
|
|
90
|
-
editedPostType: postType,
|
|
91
|
-
editedPost: postId
|
|
92
|
-
? getEntityRecord( 'postType', postType, postId )
|
|
93
|
-
: null,
|
|
94
83
|
context: getEditedPostContext(),
|
|
95
|
-
hasLoadedPost: postId
|
|
96
|
-
? hasFinishedResolution( 'getEntityRecord', [
|
|
97
|
-
'postType',
|
|
98
|
-
postType,
|
|
99
|
-
postId,
|
|
100
|
-
] )
|
|
101
|
-
: false,
|
|
102
84
|
editorMode: getEditorMode(),
|
|
103
85
|
canvasMode: getCanvasMode(),
|
|
104
86
|
blockEditorMode: __unstableGetEditorMode(),
|
|
105
87
|
isInserterOpen: isInserterOpened(),
|
|
106
88
|
isListViewOpen: isListViewOpened(),
|
|
107
|
-
isSaveViewOpen: isSaveViewOpened(),
|
|
108
89
|
isRightSidebarOpen: getActiveComplementaryArea(
|
|
109
90
|
editSiteStore.name
|
|
110
91
|
),
|
|
@@ -114,8 +95,7 @@ export default function Editor() {
|
|
|
114
95
|
),
|
|
115
96
|
};
|
|
116
97
|
}, [] );
|
|
117
|
-
const {
|
|
118
|
-
useDispatch( editSiteStore );
|
|
98
|
+
const { setEditedPostContext } = useDispatch( editSiteStore );
|
|
119
99
|
|
|
120
100
|
const isViewMode = canvasMode === 'view';
|
|
121
101
|
const isEditMode = canvasMode === 'edit';
|
|
@@ -142,15 +122,28 @@ export default function Editor() {
|
|
|
142
122
|
} ),
|
|
143
123
|
],
|
|
144
124
|
} ),
|
|
145
|
-
[ context ]
|
|
125
|
+
[ context, setEditedPostContext ]
|
|
146
126
|
);
|
|
147
|
-
|
|
127
|
+
|
|
128
|
+
let title;
|
|
129
|
+
if ( hasLoadedPost ) {
|
|
130
|
+
const type =
|
|
131
|
+
editedPostType === 'wp_template'
|
|
132
|
+
? __( 'Template' )
|
|
133
|
+
: __( 'Template Part' );
|
|
134
|
+
title = sprintf(
|
|
135
|
+
// translators: A breadcrumb trail in browser tab. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
|
|
136
|
+
__( '%1$s ‹ %2$s ‹ Editor' ),
|
|
137
|
+
getTitle(),
|
|
138
|
+
type
|
|
139
|
+
);
|
|
140
|
+
}
|
|
148
141
|
|
|
149
142
|
// Only announce the title once the editor is ready to prevent "Replace"
|
|
150
143
|
// action in <URlQueryController> from double-announcing.
|
|
151
|
-
useTitle(
|
|
144
|
+
useTitle( hasLoadedPost && title );
|
|
152
145
|
|
|
153
|
-
if ( !
|
|
146
|
+
if ( ! hasLoadedPost ) {
|
|
154
147
|
return <CanvasSpinner />;
|
|
155
148
|
}
|
|
156
149
|
|
|
@@ -211,38 +204,6 @@ export default function Editor() {
|
|
|
211
204
|
<ComplementaryArea.Slot scope="core/edit-site" />
|
|
212
205
|
)
|
|
213
206
|
}
|
|
214
|
-
actions={
|
|
215
|
-
isEditMode && (
|
|
216
|
-
<>
|
|
217
|
-
{ isSaveViewOpen ? (
|
|
218
|
-
<EntitiesSavedStates
|
|
219
|
-
close={ () =>
|
|
220
|
-
setIsSaveViewOpened(
|
|
221
|
-
false
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
/>
|
|
225
|
-
) : (
|
|
226
|
-
<div className="edit-site-editor__toggle-save-panel">
|
|
227
|
-
<Button
|
|
228
|
-
variant="secondary"
|
|
229
|
-
className="edit-site-editor__toggle-save-panel-button"
|
|
230
|
-
onClick={ () =>
|
|
231
|
-
setIsSaveViewOpened(
|
|
232
|
-
true
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
aria-expanded={ false }
|
|
236
|
-
>
|
|
237
|
-
{ __(
|
|
238
|
-
'Open save panel'
|
|
239
|
-
) }
|
|
240
|
-
</Button>
|
|
241
|
-
</div>
|
|
242
|
-
) }
|
|
243
|
-
</>
|
|
244
|
-
)
|
|
245
|
-
}
|
|
246
207
|
footer={
|
|
247
208
|
showBlockBreakcrumb && (
|
|
248
209
|
<BlockBreadcrumb
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
|
|
10
|
-
.
|
|
11
|
-
.
|
|
10
|
+
.edit-site-layout__actions:focus &,
|
|
11
|
+
.edit-site-layout__actions:focus-within & {
|
|
12
12
|
top: auto;
|
|
13
13
|
bottom: 0;
|
|
14
14
|
}
|
|
@@ -3,14 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BlockPreview } from '@wordpress/block-editor';
|
|
5
5
|
import { getBlockType, getBlockFromExample } from '@wordpress/blocks';
|
|
6
|
-
import { useResizeObserver } from '@wordpress/compose';
|
|
7
6
|
import { __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
8
7
|
|
|
9
8
|
const BlockPreviewPanel = ( { name, variation = '' } ) => {
|
|
10
|
-
const [
|
|
11
|
-
containerResizeListener,
|
|
12
|
-
{ width: containerWidth, height: containerHeight },
|
|
13
|
-
] = useResizeObserver();
|
|
14
9
|
const blockExample = getBlockType( name )?.example;
|
|
15
10
|
const blockExampleWithVariation = {
|
|
16
11
|
...blockExample,
|
|
@@ -25,23 +20,24 @@ const BlockPreviewPanel = ( { name, variation = '' } ) => {
|
|
|
25
20
|
name,
|
|
26
21
|
variation ? blockExampleWithVariation : blockExample
|
|
27
22
|
);
|
|
28
|
-
const viewportWidth = blockExample?.viewportWidth ||
|
|
29
|
-
const
|
|
23
|
+
const viewportWidth = blockExample?.viewportWidth || null;
|
|
24
|
+
const previewHeight = '150px';
|
|
30
25
|
|
|
31
26
|
return ! blockExample ? null : (
|
|
32
27
|
<Spacer marginX={ 4 } marginBottom={ 4 }>
|
|
33
|
-
<div
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
<div
|
|
29
|
+
className="edit-site-global-styles__block-preview-panel"
|
|
30
|
+
style={ { maxHeight: previewHeight, boxSizing: 'initial' } }
|
|
31
|
+
>
|
|
36
32
|
<BlockPreview
|
|
37
33
|
blocks={ blocks }
|
|
38
34
|
viewportWidth={ viewportWidth }
|
|
39
|
-
minHeight={
|
|
35
|
+
minHeight={ previewHeight }
|
|
40
36
|
additionalStyles={ [
|
|
41
37
|
{
|
|
42
38
|
css: `
|
|
43
39
|
body{
|
|
44
|
-
min-height:${
|
|
40
|
+
min-height:${ previewHeight };
|
|
45
41
|
display:flex;align-items:center;justify-content:center;
|
|
46
42
|
}
|
|
47
43
|
`,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalBorderRadiusControl as BorderRadiusControl,
|
|
6
|
-
|
|
6
|
+
privateApis as blockEditorPrivateApis,
|
|
7
7
|
} from '@wordpress/block-editor';
|
|
8
8
|
import {
|
|
9
9
|
__experimentalBorderBoxControl as BorderBoxControl,
|
|
@@ -19,9 +19,9 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
|
|
22
|
-
import { unlock } from '../../
|
|
22
|
+
import { unlock } from '../../private-apis';
|
|
23
23
|
|
|
24
|
-
const { useGlobalSetting, useGlobalStyle } = unlock(
|
|
24
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
25
25
|
|
|
26
26
|
export function useHasBorderPanel( name ) {
|
|
27
27
|
const controls = [
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
__experimentalVStack as VStack,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import {
|
|
9
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { unlock } from '../../
|
|
14
|
+
import { unlock } from '../../private-apis';
|
|
15
15
|
|
|
16
|
-
const { useGlobalSetting } = unlock(
|
|
16
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
17
17
|
|
|
18
18
|
export default function ColorPalettePanel( { name } ) {
|
|
19
19
|
const [ themeColors, setThemeColors ] = useGlobalSetting(
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
typography,
|
|
14
14
|
border,
|
|
15
|
+
shadow,
|
|
15
16
|
color,
|
|
16
17
|
layout,
|
|
17
18
|
chevronLeft,
|
|
@@ -32,11 +33,13 @@ import { useHasVariationsPanel } from './variations-panel';
|
|
|
32
33
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
33
34
|
import { IconWithCurrentColor } from './icon-with-current-color';
|
|
34
35
|
import { ScreenVariations } from './screen-variations';
|
|
36
|
+
import { useHasShadowControl } from './shadow-panel';
|
|
35
37
|
|
|
36
38
|
function ContextMenu( { name, parentMenu = '' } ) {
|
|
37
39
|
const hasTypographyPanel = useHasTypographyPanel( name );
|
|
38
40
|
const hasColorPanel = useHasColorPanel( name );
|
|
39
41
|
const hasBorderPanel = useHasBorderPanel( name );
|
|
42
|
+
const hasEffectsPanel = useHasShadowControl( name );
|
|
40
43
|
const hasDimensionsPanel = useHasDimensionsPanel( name );
|
|
41
44
|
const hasLayoutPanel = hasDimensionsPanel;
|
|
42
45
|
const hasVariationsPanel = useHasVariationsPanel( name, parentMenu );
|
|
@@ -85,9 +88,18 @@ function ContextMenu( { name, parentMenu = '' } ) {
|
|
|
85
88
|
<NavigationButtonAsItem
|
|
86
89
|
icon={ border }
|
|
87
90
|
path={ parentMenu + '/border' }
|
|
88
|
-
aria-label={ __( 'Border
|
|
91
|
+
aria-label={ __( 'Border' ) }
|
|
89
92
|
>
|
|
90
|
-
{ __( 'Border
|
|
93
|
+
{ __( 'Border' ) }
|
|
94
|
+
</NavigationButtonAsItem>
|
|
95
|
+
) }
|
|
96
|
+
{ hasEffectsPanel && (
|
|
97
|
+
<NavigationButtonAsItem
|
|
98
|
+
icon={ shadow }
|
|
99
|
+
path={ parentMenu + '/effects' }
|
|
100
|
+
aria-label={ __( 'Shadow' ) }
|
|
101
|
+
>
|
|
102
|
+
{ __( 'Shadow' ) }
|
|
91
103
|
</NavigationButtonAsItem>
|
|
92
104
|
) }
|
|
93
105
|
{ hasLayoutPanel && (
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@wordpress/components';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
privateApis as blockEditorPrivateApis,
|
|
16
16
|
transformStyles,
|
|
17
17
|
} from '@wordpress/block-editor';
|
|
18
18
|
import { info } from '@wordpress/icons';
|
|
@@ -20,10 +20,10 @@ import { info } from '@wordpress/icons';
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
|
-
import { unlock } from '../../
|
|
23
|
+
import { unlock } from '../../private-apis';
|
|
24
24
|
import Subtitle from './subtitle';
|
|
25
25
|
|
|
26
|
-
const { useGlobalStyle } = unlock(
|
|
26
|
+
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
27
27
|
function CustomCSSControl( { blockName } ) {
|
|
28
28
|
// If blockName is defined, we are customizing CSS at the block level:
|
|
29
29
|
// styles.blocks.blockName.css
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
__experimentalUseCustomSides as useCustomSides,
|
|
21
21
|
HeightControl,
|
|
22
22
|
__experimentalSpacingSizesControl as SpacingSizesControl,
|
|
23
|
-
|
|
23
|
+
privateApis as blockEditorPrivateApis,
|
|
24
24
|
} from '@wordpress/block-editor';
|
|
25
25
|
import { Icon, positionCenter, stretchWide } from '@wordpress/icons';
|
|
26
26
|
|
|
@@ -28,9 +28,9 @@ import { Icon, positionCenter, stretchWide } from '@wordpress/icons';
|
|
|
28
28
|
* Internal dependencies
|
|
29
29
|
*/
|
|
30
30
|
import { getSupportedGlobalStylesPanels } from './hooks';
|
|
31
|
-
import { unlock } from '../../
|
|
31
|
+
import { unlock } from '../../private-apis';
|
|
32
32
|
|
|
33
|
-
const { useGlobalSetting, useGlobalStyle } = unlock(
|
|
33
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
34
34
|
|
|
35
35
|
const AXIAL_SIDES = [ 'horizontal', 'vertical' ];
|
|
36
36
|
|
|
@@ -9,15 +9,15 @@ import { mergeWith, isEmpty, mapValues } from 'lodash';
|
|
|
9
9
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
-
import {
|
|
12
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import CanvasSpinner from '../canvas-spinner';
|
|
18
|
-
import { unlock } from '../../
|
|
18
|
+
import { unlock } from '../../private-apis';
|
|
19
19
|
|
|
20
|
-
const { GlobalStylesContext } = unlock(
|
|
20
|
+
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
21
21
|
|
|
22
22
|
function mergeTreesCustomizer( _, srcValue ) {
|
|
23
23
|
// We only pass as arrays the presets,
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
DuotonePicker,
|
|
9
9
|
} from '@wordpress/components';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import {
|
|
11
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import Subtitle from './subtitle';
|
|
17
|
-
import { unlock } from '../../
|
|
17
|
+
import { unlock } from '../../private-apis';
|
|
18
18
|
|
|
19
|
-
const { useGlobalSetting } = unlock(
|
|
19
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
20
20
|
|
|
21
21
|
const noop = () => {};
|
|
22
22
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__experimentalSpacer as Spacer,
|
|
8
8
|
__experimentalHeading as Heading,
|
|
9
9
|
__experimentalView as View,
|
|
10
|
-
|
|
10
|
+
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
13
13
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
@@ -18,7 +18,7 @@ function ScreenHeader( { title, description } ) {
|
|
|
18
18
|
<View>
|
|
19
19
|
<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
|
|
20
20
|
<HStack spacing={ 2 }>
|
|
21
|
-
<
|
|
21
|
+
<NavigatorToParentButton
|
|
22
22
|
style={
|
|
23
23
|
// TODO: This style override is also used in ToolsPanelHeader.
|
|
24
24
|
// It should be supported out-of-the-box by Button.
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
getBlockType,
|
|
15
15
|
__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,
|
|
16
16
|
} from '@wordpress/blocks';
|
|
17
|
-
import {
|
|
17
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
|
-
import { unlock } from '../../
|
|
22
|
+
import { unlock } from '../../private-apis';
|
|
23
23
|
|
|
24
|
-
const { useGlobalSetting } = unlock(
|
|
24
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
25
25
|
|
|
26
26
|
// Enable colord's a11y plugin.
|
|
27
27
|
extend( [ a11yPlugin ] );
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalNavigatorButton as NavigatorButton,
|
|
6
|
-
|
|
6
|
+
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
7
7
|
__experimentalItem as Item,
|
|
8
8
|
FlexItem,
|
|
9
9
|
__experimentalHStack as HStack,
|
|
@@ -33,7 +33,9 @@ function NavigationButtonAsItem( props ) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function NavigationBackButtonAsItem( props ) {
|
|
36
|
-
return
|
|
36
|
+
return (
|
|
37
|
+
<NavigatorToParentButton as={ GenericNavigationButton } { ...props } />
|
|
38
|
+
);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
export { NavigationButtonAsItem, NavigationBackButtonAsItem };
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
14
14
|
import { shuffle } from '@wordpress/icons';
|
|
15
15
|
import { useMemo } from '@wordpress/element';
|
|
16
|
-
import {
|
|
16
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
@@ -22,9 +22,9 @@ import Subtitle from './subtitle';
|
|
|
22
22
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
23
23
|
import { useColorRandomizer } from './hooks';
|
|
24
24
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
25
|
-
import { unlock } from '../../
|
|
25
|
+
import { unlock } from '../../private-apis';
|
|
26
26
|
|
|
27
|
-
const { useGlobalSetting } = unlock(
|
|
27
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
28
28
|
|
|
29
29
|
const EMPTY_COLORS = [];
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__unstableIframe as Iframe,
|
|
6
6
|
__unstableEditorStyles as EditorStyles,
|
|
7
|
-
|
|
7
|
+
privateApis as blockEditorPrivateApis,
|
|
8
8
|
} from '@wordpress/block-editor';
|
|
9
9
|
import {
|
|
10
10
|
__unstableMotion as motion,
|
|
@@ -17,10 +17,10 @@ import { useState, useMemo } from '@wordpress/element';
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
|
-
import { unlock } from '../../
|
|
20
|
+
import { unlock } from '../../private-apis';
|
|
21
21
|
|
|
22
22
|
const { useGlobalSetting, useGlobalStyle, useGlobalStylesOutput } = unlock(
|
|
23
|
-
|
|
23
|
+
blockEditorPrivateApis
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
const firstFrame = {
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
10
|
import {
|
|
11
11
|
__experimentalColorGradientControl as ColorGradientControl,
|
|
12
|
-
|
|
12
|
+
privateApis as blockEditorPrivateApis,
|
|
13
13
|
} from '@wordpress/block-editor';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
useColorsPerOrigin,
|
|
22
22
|
useGradientsPerOrigin,
|
|
23
23
|
} from './hooks';
|
|
24
|
-
import { unlock } from '../../
|
|
24
|
+
import { unlock } from '../../private-apis';
|
|
25
25
|
|
|
26
|
-
const { useGlobalSetting, useGlobalStyle } = unlock(
|
|
26
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
27
27
|
|
|
28
28
|
function ScreenBackgroundColor( { name, variation = '' } ) {
|
|
29
29
|
const prefix = variation ? `variations.${ variation }.` : '';
|
|
@@ -10,12 +10,10 @@ import ScreenHeader from './header';
|
|
|
10
10
|
import BorderPanel, { useHasBorderPanel } from './border-panel';
|
|
11
11
|
import BlockPreviewPanel from './block-preview-panel';
|
|
12
12
|
import { getVariationClassName } from './utils';
|
|
13
|
-
import ShadowPanel, { useHasShadowControl } from './shadow-panel';
|
|
14
13
|
|
|
15
14
|
function ScreenBorder( { name, variation = '' } ) {
|
|
16
15
|
const hasBorderPanel = useHasBorderPanel( name );
|
|
17
16
|
const variationClassName = getVariationClassName( variation );
|
|
18
|
-
const hasShadowPanel = useHasShadowControl( name );
|
|
19
17
|
return (
|
|
20
18
|
<>
|
|
21
19
|
<ScreenHeader title={ __( 'Border & Shadow' ) } />
|
|
@@ -23,9 +21,6 @@ function ScreenBorder( { name, variation = '' } ) {
|
|
|
23
21
|
{ hasBorderPanel && (
|
|
24
22
|
<BorderPanel name={ name } variation={ variation } />
|
|
25
23
|
) }
|
|
26
|
-
{ hasShadowPanel && (
|
|
27
|
-
<ShadowPanel name={ name } variation={ variation } />
|
|
28
|
-
) }
|
|
29
24
|
</>
|
|
30
25
|
);
|
|
31
26
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
__experimentalColorGradientControl as ColorGradientControl,
|
|
7
|
-
|
|
7
|
+
privateApis as blockEditorPrivateApis,
|
|
8
8
|
} from '@wordpress/block-editor';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
*/
|
|
13
13
|
import ScreenHeader from './header';
|
|
14
14
|
import { getSupportedGlobalStylesPanels, useColorsPerOrigin } from './hooks';
|
|
15
|
-
import { unlock } from '../../
|
|
15
|
+
import { unlock } from '../../private-apis';
|
|
16
16
|
|
|
17
|
-
const { useGlobalSetting, useGlobalStyle } = unlock(
|
|
17
|
+
const { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
18
18
|
|
|
19
19
|
function ScreenButtonColor( { name, variation = '' } ) {
|
|
20
20
|
const prefix = variation ? `variations.${ variation }.` : '';
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
FlexItem,
|
|
11
11
|
ColorIndicator,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
|
-
import {
|
|
13
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -23,9 +23,9 @@ import Subtitle from './subtitle';
|
|
|
23
23
|
import ColorIndicatorWrapper from './color-indicator-wrapper';
|
|
24
24
|
import BlockPreviewPanel from './block-preview-panel';
|
|
25
25
|
import { getVariationClassName } from './utils';
|
|
26
|
-
import { unlock } from '../../
|
|
26
|
+
import { unlock } from '../../private-apis';
|
|
27
27
|
|
|
28
|
-
const { useGlobalStyle } = unlock(
|
|
28
|
+
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
29
29
|
|
|
30
30
|
function BackgroundColorItem( { name, parentMenu, variation = '' } ) {
|
|
31
31
|
const prefix = variation ? `variations.${ variation }.` : '';
|
|
@@ -32,13 +32,20 @@ function ScreenCSS( { name } ) {
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<>
|
|
35
|
-
<ScreenHeader
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
<ScreenHeader
|
|
36
|
+
title={ __( 'CSS' ) }
|
|
37
|
+
description={
|
|
38
|
+
<>
|
|
39
|
+
{ description }
|
|
40
|
+
<ExternalLink
|
|
41
|
+
href="https://wordpress.org/support/article/css/"
|
|
42
|
+
className="edit-site-global-styles-screen-css-help-link"
|
|
43
|
+
>
|
|
44
|
+
{ __( 'Learn more about CSS' ) }
|
|
45
|
+
</ExternalLink>
|
|
46
|
+
</>
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
42
49
|
<div className="edit-site-global-styles-screen-css">
|
|
43
50
|
<CustomCSSControl blockName={ name } />
|
|
44
51
|
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import ScreenHeader from './header';
|
|
10
|
+
import BlockPreviewPanel from './block-preview-panel';
|
|
11
|
+
import { getVariationClassName } from './utils';
|
|
12
|
+
import ShadowPanel, { useHasShadowControl } from './shadow-panel';
|
|
13
|
+
|
|
14
|
+
function ScreenEffects( { name, variation = '' } ) {
|
|
15
|
+
const variationClassName = getVariationClassName( variation );
|
|
16
|
+
const hasShadowPanel = useHasShadowControl( name );
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<ScreenHeader title={ __( 'Shadow' ) } />
|
|
20
|
+
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
|
+
{ hasShadowPanel && (
|
|
22
|
+
<ShadowPanel name={ name } variation={ variation } />
|
|
23
|
+
) }
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default ScreenEffects;
|