@wordpress/edit-site 5.31.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-editor/editor-canvas.js +8 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +15 -4
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/editor/index.js +12 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -2
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +38 -0
- package/build/components/global-styles/background-panel.js.map +1 -0
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +38 -9
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +20 -2
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/root-menu.js +8 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +34 -0
- package/build/components/global-styles/screen-background.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +2 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +6 -4
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -37
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +6 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/ui.js +4 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +10 -3
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +9 -2
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/layout/animation.js +129 -0
- package/build/components/layout/animation.js.map +1 -0
- package/build/components/layout/index.js +9 -17
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +21 -18
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +19 -17
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/index.js +18 -28
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +16 -58
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-templates-template-parts/actions.js +54 -41
- package/build/components/page-templates-template-parts/actions.js.map +1 -1
- package/build/components/page-templates-template-parts/index.js +26 -59
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +12 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/save-button/index.js +45 -16
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +8 -112
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +1 -1
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +5 -15
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +10 -16
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +10 -5
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/style-book/index.js +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/store/selectors.js +1 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +8 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +15 -4
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/editor/index.js +13 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +31 -0
- package/build-module/components/global-styles/background-panel.js.map +1 -0
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +38 -9
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +20 -2
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +9 -3
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +26 -0
- package/build-module/components/global-styles/screen-background.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +2 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +6 -4
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +4 -38
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +10 -3
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +9 -2
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/layout/animation.js +122 -0
- package/build-module/components/layout/animation.js.map +1 -0
- package/build-module/components/layout/index.js +9 -17
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +21 -18
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +19 -17
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +20 -30
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +14 -55
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-templates-template-parts/actions.js +54 -40
- package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
- package/build-module/components/page-templates-template-parts/index.js +29 -62
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +12 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/save-button/index.js +46 -17
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -114
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -2
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +8 -18
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +11 -17
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +5 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +10 -5
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -1
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/store/selectors.js +1 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +116 -104
- package/build-style/style.css +116 -104
- package/package.json +44 -44
- package/src/components/block-editor/editor-canvas.js +14 -2
- package/src/components/block-editor/site-editor-canvas.js +10 -7
- package/src/components/editor/index.js +11 -4
- package/src/components/editor-canvas-container/index.js +0 -1
- package/src/components/global-styles/background-panel.js +34 -0
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +43 -14
- package/src/components/global-styles/font-library-modal/style.scss +1 -1
- package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
- package/src/components/global-styles/palette.js +3 -1
- package/src/components/global-styles/preview-colors.js +2 -2
- package/src/components/global-styles/root-menu.js +12 -1
- package/src/components/global-styles/screen-background.js +29 -0
- package/src/components/global-styles/screen-color-palette.js +2 -2
- package/src/components/global-styles/screen-colors.js +4 -4
- package/src/components/global-styles/screen-style-variations.js +4 -36
- package/src/components/global-styles/screen-typography.js +6 -9
- package/src/components/global-styles/style-variations-container.js +2 -1
- package/src/components/global-styles/style.scss +14 -12
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/variations/style.scss +32 -17
- package/src/components/global-styles/variations/variations-color.js +4 -2
- package/src/components/global-styles/variations/variations-typography.js +4 -1
- package/src/components/header-edit-mode/style.scss +28 -17
- package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
- package/src/components/layout/animation.js +122 -0
- package/src/components/layout/index.js +12 -27
- package/src/components/layout/router.js +25 -19
- package/src/components/layout/style.scss +2 -0
- package/src/components/page-pages/index.js +27 -43
- package/src/components/page-patterns/index.js +20 -28
- package/src/components/page-patterns/search-items.js +13 -58
- package/src/components/page-templates-template-parts/actions.js +106 -91
- package/src/components/page-templates-template-parts/index.js +34 -78
- package/src/components/page-templates-template-parts/style.scss +5 -0
- package/src/components/plugin-template-setting-panel/index.js +14 -1
- package/src/components/save-button/index.js +55 -26
- package/src/components/save-hub/index.js +20 -164
- package/src/components/sidebar/index.js +0 -5
- package/src/components/sidebar-dataviews/default-views.js +1 -1
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-edit-mode/index.js +0 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +29 -60
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +23 -33
- package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
- package/src/components/sidebar-navigation-screen/style.scss +12 -9
- package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +7 -13
- package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
- package/src/components/style-book/index.js +1 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -2
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/src/hooks/index.js +0 -1
- package/src/store/selectors.js +3 -15
- package/src/style.scss +0 -1
- package/build/components/actions/index.js +0 -319
- package/build/components/actions/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -48
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
- package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build/hooks/template-part-edit.js +0 -82
- package/build/hooks/template-part-edit.js.map +0 -1
- package/build/store/utils.js +0 -71
- package/build/store/utils.js.map +0 -1
- package/build-module/components/actions/index.js +0 -308
- package/build-module/components/actions/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -40
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build-module/hooks/template-part-edit.js +0 -75
- package/build-module/hooks/template-part-edit.js.map +0 -1
- package/build-module/store/utils.js +0 -64
- package/build-module/store/utils.js.map +0 -1
- package/src/components/actions/index.js +0 -409
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -53
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
- package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
- package/src/hooks/template-part-edit.js +0 -89
- package/src/store/test/utils.js +0 -191
- package/src/store/utils.js +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -36,6 +36,7 @@ function EditorCanvas({
|
|
|
36
36
|
enableResizing,
|
|
37
37
|
settings,
|
|
38
38
|
children,
|
|
39
|
+
onClick,
|
|
39
40
|
...props
|
|
40
41
|
}) {
|
|
41
42
|
const {
|
|
@@ -90,7 +91,13 @@ function EditorCanvas({
|
|
|
90
91
|
setCanvasMode('edit');
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
onClick: () =>
|
|
94
|
+
onClick: () => {
|
|
95
|
+
if (!!onClick) {
|
|
96
|
+
onClick();
|
|
97
|
+
} else {
|
|
98
|
+
setCanvasMode('edit');
|
|
99
|
+
}
|
|
100
|
+
},
|
|
94
101
|
readonly: true
|
|
95
102
|
};
|
|
96
103
|
const isTemplateTypeNavigation = templateType === _constants.NAVIGATION_POST_TYPE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_data","_keycodes","_element","_i18n","_editor","_lockUnlock","_store","_constants","_math","EditorCanvas","EditorCanvasRoot","unlock","editorPrivateApis","enableResizing","settings","children","props","hasBlocks","isFocusMode","templateType","canvasMode","isZoomOutMode","useSelect","select","getBlockCount","__unstableGetEditorMode","blockEditorStore","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","setCanvasMode","useDispatch","isFocused","setIsFocused","useState","useEffect","viewModeIframeProps","__","title","role","tabIndex","onFocus","onBlur","onKeyDown","event","keyCode","ENTER","SPACE","preventDefault","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_blockEditor","_data","_keycodes","_element","_i18n","_editor","_lockUnlock","_store","_constants","_math","EditorCanvas","EditorCanvasRoot","unlock","editorPrivateApis","enableResizing","settings","children","onClick","props","hasBlocks","isFocusMode","templateType","canvasMode","isZoomOutMode","useSelect","select","getBlockCount","__unstableGetEditorMode","blockEditorStore","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","setCanvasMode","useDispatch","isFocused","setIsFocused","useState","useEffect","viewModeIframeProps","__","title","role","tabIndex","onFocus","onBlur","onKeyDown","event","keyCode","ENTER","SPACE","preventDefault","readonly","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","showBlockAppender","undefined","styles","useMemo","css","frameSize","scale","contentWidth","computeIFrameScale","width","_react","createElement","className","classnames","renderAppender","iframeProps","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/block-editor/editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\nimport { computeIFrameScale } from '../../utils/math';\n\nconst { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );\n\nfunction EditorCanvas( {\n\tenableResizing,\n\tsettings,\n\tchildren,\n\tonClick,\n\t...props\n} ) {\n\tconst { hasBlocks, isFocusMode, templateType, canvasMode, isZoomOutMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getBlockCount, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusMode: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\thasBlocks: !! getBlockCount(),\n\t\t\t};\n\t\t}, [] );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( canvasMode === 'edit' ) {\n\t\t\tsetIsFocused( false );\n\t\t}\n\t}, [ canvasMode ] );\n\n\t// In view mode, make the canvas iframe be perceived and behave as a button\n\t// to switch to edit mode, with a meaningful label and no title attribute.\n\tconst viewModeIframeProps = {\n\t\t'aria-label': __( 'Edit' ),\n\t\ttitle: null,\n\t\trole: 'button',\n\t\ttabIndex: 0,\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t}\n\t\t},\n\t\tonClick: () => {\n\t\t\tif ( !! onClick ) {\n\t\t\t\tonClick();\n\t\t\t} else {\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\t// Hide the appender when:\n\t// - In navigation focus mode (should only allow the root Nav block).\n\t// - In view mode (i.e. not editing).\n\tconst showBlockAppender =\n\t\t( isNavigationFocusMode && hasBlocks ) || canvasMode === 'view'\n\t\t\t? false\n\t\t\t: undefined;\n\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}body{position:relative; ${\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? 'cursor: pointer; min-height: 100vh;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}}`,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, enableResizing, canvasMode ]\n\t);\n\n\tconst frameSize = isZoomOutMode ? 20 : undefined;\n\n\tconst scale = isZoomOutMode\n\t\t? ( contentWidth ) =>\n\t\t\t\tcomputeIFrameScale(\n\t\t\t\t\t{ width: 1000, scale: 0.45 },\n\t\t\t\t\t{ width: 400, scale: 0.9 },\n\t\t\t\t\tcontentWidth\n\t\t\t\t)\n\t\t: undefined;\n\n\treturn (\n\t\t<EditorCanvasRoot\n\t\t\tclassName={ classnames( 'edit-site-editor-canvas__block-list', {\n\t\t\t\t'is-navigation-block': isTemplateTypeNavigation,\n\t\t\t} ) }\n\t\t\trenderAppender={ showBlockAppender }\n\t\t\tstyles={ styles }\n\t\t\tiframeProps={ {\n\t\t\t\tscale,\n\t\t\t\tframeSize,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'edit-site-visual-editor__editor-canvas',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-focused': isFocused && canvasMode === 'view',\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\t...props,\n\t\t\t\t...( canvasMode === 'view' ? viewModeIframeProps : {} ),\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</EditorCanvasRoot>\n\t);\n}\n\nexport default EditorCanvas;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAIA,IAAAU,KAAA,GAAAV,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AASA,MAAM;EAAEW,YAAY,EAAEC;AAAiB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEtE,SAASH,YAAYA,CAAE;EACtBI,cAAc;EACdC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACP,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAEC,SAAS;IAAEC,WAAW;IAAEC,YAAY;IAAEC,UAAU;IAAEC;EAAc,CAAC,GACxE,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxB,MAA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AE,qCAAqC,EAAE;MAC9D,qBAAqB,EAAEhB;IACxB,CAAE,CAAG;IACLiB,cAAc,EAAGd,iBAAmB;IACpCE,MAAM,EAAGA,MAAQ;IACjBa,WAAW,EAAG;MACbT,KAAK;MACLD,SAAS;MACTO,SAAS,EAAE,IAAAC,mBAAU,EACpB,wCAAwC,EACxC;QACC,YAAY,EAAElC,SAAS,IAAIf,UAAU,KAAK;MAC3C,CACD,CAAC;MACD,GAAGJ,KAAK;MACR,IAAKI,UAAU,KAAK,MAAM,GAAGmB,mBAAmB,GAAG,CAAC,CAAC;IACtD;EAAG,GAEDzB,QACe,CAAC;AAErB;AAAC,IAAA0D,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclE,YAAY"}
|
|
@@ -9,6 +9,7 @@ var _react = require("react");
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _compose = require("@wordpress/compose");
|
|
12
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
12
13
|
var _resizableEditor = _interopRequireDefault(require("./resizable-editor"));
|
|
13
14
|
var _editorCanvas = _interopRequireDefault(require("./editor-canvas"));
|
|
14
15
|
var _editorCanvasContainer = _interopRequireDefault(require("../editor-canvas-container"));
|
|
@@ -32,22 +33,29 @@ var _router = require("@wordpress/router");
|
|
|
32
33
|
const {
|
|
33
34
|
useLocation
|
|
34
35
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
35
|
-
function SiteEditorCanvas(
|
|
36
|
+
function SiteEditorCanvas({
|
|
37
|
+
onClick
|
|
38
|
+
}) {
|
|
36
39
|
const location = useLocation();
|
|
37
40
|
const {
|
|
38
41
|
templateType,
|
|
39
42
|
isFocusableEntity,
|
|
40
|
-
isViewMode
|
|
43
|
+
isViewMode,
|
|
44
|
+
isZoomOutMode
|
|
41
45
|
} = (0, _data.useSelect)(select => {
|
|
42
46
|
const {
|
|
43
47
|
getEditedPostType,
|
|
44
48
|
getCanvasMode
|
|
45
49
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
50
|
+
const {
|
|
51
|
+
__unstableGetEditorMode
|
|
52
|
+
} = select(_blockEditor.store);
|
|
46
53
|
const _templateType = getEditedPostType();
|
|
47
54
|
return {
|
|
48
55
|
templateType: _templateType,
|
|
49
56
|
isFocusableEntity: _constants.FOCUSABLE_ENTITIES.includes(_templateType),
|
|
50
|
-
isViewMode: getCanvasMode() === 'view'
|
|
57
|
+
isViewMode: getCanvasMode() === 'view',
|
|
58
|
+
isZoomOutMode: __unstableGetEditorMode() === 'zoom-out'
|
|
51
59
|
};
|
|
52
60
|
}, []);
|
|
53
61
|
const isFocusMode = location.params.focusMode || isFocusableEntity;
|
|
@@ -57,6 +65,8 @@ function SiteEditorCanvas() {
|
|
|
57
65
|
const enableResizing = isFocusMode && !isViewMode &&
|
|
58
66
|
// Disable resizing in mobile viewport.
|
|
59
67
|
!isMobileViewport &&
|
|
68
|
+
// Dsiable resizing in zoomed-out mode.
|
|
69
|
+
!isZoomOutMode &&
|
|
60
70
|
// Disable resizing when editing a template in focus mode.
|
|
61
71
|
templateType !== _constants.TEMPLATE_POST_TYPE;
|
|
62
72
|
const isTemplateTypeNavigation = templateType === _constants.NAVIGATION_POST_TYPE;
|
|
@@ -74,7 +84,8 @@ function SiteEditorCanvas() {
|
|
|
74
84
|
height: sizes.height && !forceFullHeight ? sizes.height : '100%'
|
|
75
85
|
}, (0, _react.createElement)(_editorCanvas.default, {
|
|
76
86
|
enableResizing: enableResizing,
|
|
77
|
-
settings: settings
|
|
87
|
+
settings: settings,
|
|
88
|
+
onClick: onClick
|
|
78
89
|
}, resizeObserver))));
|
|
79
90
|
}
|
|
80
91
|
//# sourceMappingURL=site-editor-canvas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_compose","_resizableEditor","_editorCanvas","_editorCanvasContainer","_useSiteEditorSettings","_store","_constants","_lockUnlock","_router","useLocation","unlock","routerPrivateApis","SiteEditorCanvas","location","templateType","isFocusableEntity","isViewMode","useSelect","select","getEditedPostType","getCanvasMode","editSiteStore","_templateType","FOCUSABLE_ENTITIES","includes","isFocusMode","params","focusMode","resizeObserver","sizes","useResizeObserver","settings","useSiteEditorSettings","isMobileViewport","useViewportMatch","enableResizing","TEMPLATE_POST_TYPE","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","forceFullHeight","_react","createElement","default","Slot","editorCanvasView","className","classnames","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas() {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode }
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_compose","_blockEditor","_resizableEditor","_editorCanvas","_editorCanvasContainer","_useSiteEditorSettings","_store","_constants","_lockUnlock","_router","useLocation","unlock","routerPrivateApis","SiteEditorCanvas","onClick","location","templateType","isFocusableEntity","isViewMode","isZoomOutMode","useSelect","select","getEditedPostType","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","_templateType","FOCUSABLE_ENTITIES","includes","isFocusMode","params","focusMode","resizeObserver","sizes","useResizeObserver","settings","useSiteEditorSettings","isMobileViewport","useViewportMatch","enableResizing","TEMPLATE_POST_TYPE","isTemplateTypeNavigation","NAVIGATION_POST_TYPE","isNavigationFocusMode","forceFullHeight","_react","createElement","default","Slot","editorCanvasView","className","classnames","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas( { onClick } ) {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode, isZoomOutMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusableEntity: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisViewMode: getCanvasMode() === 'view',\n\t\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t\t};\n\t\t}, [] );\n\tconst isFocusMode = location.params.focusMode || isFocusableEntity;\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\n\tconst settings = useSiteEditorSettings();\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst enableResizing =\n\t\tisFocusMode &&\n\t\t! isViewMode &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomOutMode &&\n\t\t// Disable resizing when editing a template in focus mode.\n\t\ttemplateType !== TEMPLATE_POST_TYPE;\n\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\tconst forceFullHeight = isNavigationFocusMode;\n\n\treturn (\n\t\t<EditorCanvasContainer.Slot>\n\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t<div className=\"edit-site-visual-editor is-focus-mode\">\n\t\t\t\t\t\t{ editorCanvasView }\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'edit-site-visual-editor', {\n\t\t\t\t\t\t\t'is-focus-mode': isFocusMode || !! editorCanvasView,\n\t\t\t\t\t\t\t'is-view-mode': isViewMode,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResizableEditor\n\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\tsizes.height && ! forceFullHeight\n\t\t\t\t\t\t\t\t\t? sizes.height\n\t\t\t\t\t\t\t\t\t: '100%'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditorCanvas\n\t\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ resizeObserver }\n\t\t\t\t\t\t\t</EditorCanvas>\n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AM,IAAI,CAAER,eAAe,GAC9BX,KAAK,CAACmB,MAAM,GACZ;EACH,GAED,IAAAP,MAAA,CAAAC,aAAA,EAAC5C,aAAA,CAAA6C,OAAY;IACZR,cAAc,EAAGA,cAAgB;IACjCJ,QAAQ,EAAGA,QAAU;IACrBtB,OAAO,EAAGA;EAAS,GAEjBmB,cACW,CACE,CACb,CAGoB,CAAC;AAE/B"}
|
|
@@ -60,7 +60,8 @@ const interfaceLabels = {
|
|
|
60
60
|
footer: (0, _i18n.__)('Editor footer')
|
|
61
61
|
};
|
|
62
62
|
function Editor({
|
|
63
|
-
isLoading
|
|
63
|
+
isLoading,
|
|
64
|
+
onClick
|
|
64
65
|
}) {
|
|
65
66
|
const {
|
|
66
67
|
record: editedPost,
|
|
@@ -146,6 +147,9 @@ function Editor({
|
|
|
146
147
|
// action in <URLQueryController> from double-announcing.
|
|
147
148
|
(0, _useTitle.default)(hasLoadedPost && title);
|
|
148
149
|
const loadingProgressId = (0, _compose.useInstanceId)(_canvasLoader.default, 'edit-site-editor__loading-progress');
|
|
150
|
+
const {
|
|
151
|
+
closeGeneralSidebar
|
|
152
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
149
153
|
const settings = (0, _useSiteEditorSettings.useSpecificEditorSettings)();
|
|
150
154
|
const isReady = !isLoading && (postWithTemplate && !!contextPost && !!editedPost || !postWithTemplate && !!editedPost);
|
|
151
155
|
return (0, _react.createElement)(_react.Fragment, null, !isReady ? (0, _react.createElement)(_canvasLoader.default, {
|
|
@@ -167,8 +171,13 @@ function Editor({
|
|
|
167
171
|
notices: (0, _react.createElement)(_editor.EditorSnackbars, null),
|
|
168
172
|
content: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_globalStylesRenderer.GlobalStylesRenderer, null), isEditMode && (0, _react.createElement)(_editor.EditorNotices, null), showVisualEditor && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_templatePartConverter.default, null), (0, _react.createElement)(_sidebarEditMode.SidebarInspectorFill, null, (0, _react.createElement)(_blockEditor.BlockInspector, null)), !isLargeViewport && (0, _react.createElement)(_blockEditor.BlockToolbar, {
|
|
169
173
|
hideDragHandle: true
|
|
170
|
-
}), (0, _react.createElement)(_siteEditorCanvas.default,
|
|
171
|
-
|
|
174
|
+
}), (0, _react.createElement)(_siteEditorCanvas.default, {
|
|
175
|
+
onClick: onClick
|
|
176
|
+
}), (0, _react.createElement)(_patternModal.default, null)), editorMode === 'text' && isEditMode && (0, _react.createElement)(_codeEditor.default, null), isEditMode && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_editMode.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null))),
|
|
177
|
+
secondarySidebar: isEditMode && (shouldShowInserter && (0, _react.createElement)(InserterSidebar, {
|
|
178
|
+
closeGeneralSidebar: closeGeneralSidebar,
|
|
179
|
+
isRightSidebarOpen: isRightSidebarOpen
|
|
180
|
+
}) || shouldShowListView && (0, _react.createElement)(ListViewSidebar, null)),
|
|
172
181
|
sidebar: !isDistractionFree && isEditMode && isRightSidebarOpen && !isDistractionFree && (0, _react.createElement)(_interface.ComplementaryArea.Slot, {
|
|
173
182
|
scope: "core/edit-site"
|
|
174
183
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","unlock","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","useSelect","select","get","preferencesStore","getEditedPostContext","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","editorStore","_context","postId","postType","undefined","name","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","secondarySidebar","ComplementaryArea","Slot","scope","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n} = unlock( editorPrivateApis );\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( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\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\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== '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 postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\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( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\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) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\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\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\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</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && <InserterSidebar /> ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAC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interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","unlock","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","Editor","isLoading","onClick","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isDistractionFree","showIconLabels","showBlockBreadcrumbs","postTypeLabel","useSelect","select","get","preferencesStore","getEditedPostContext","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","isInserterOpened","isListViewOpened","getPostTypeLabel","getEditorMode","editorStore","_context","postId","postType","undefined","name","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","closeGeneralSidebar","useDispatch","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","secondarySidebar","ComplementaryArea","Slot","scope","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n} = unlock( editorPrivateApis );\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( { isLoading, onClick } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t\tpostTypeLabel,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetPostTypeLabel,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\t\tconst _context = getEditedPostContext();\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\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tpostTypeLabel: getPostTypeLabel(),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\t! isDistractionFree &&\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== '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 postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\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( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\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) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas onClick={ onClick } />\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\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\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\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</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t<InserterSidebar\n\t\t\t\t\t\t\t\t\tcloseGeneralSidebar={ closeGeneralSidebar }\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen={ isRightSidebarOpen }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen &&\n\t\t\t\t\t\t\t! isDistractionFree && (\n\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={ postTypeLabel }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAMA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAP,OAAA;AAQA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,qBAAA,GAAAhB,OAAA;AACA,IAAAiB,SAAA,GAAAlB,sBAAA,CAAAC,OAAA;AACA,IAAAkB,aAAA,GAAAnB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H,+BAA+B,MAAE,CAAC,EACnC,IAAAzB,MAAA,CAAAC,aAAA,EAACtG,OAAA,CAAA+H,uBAAuB,MAAE,CACzB,CAEF,CACF;IACDC,gBAAgB,EACfhD,UAAU,KACNG,kBAAkB,IACrB,IAAAkB,MAAA,CAAAC,aAAA,EAACjF,eAAe;MACf2E,mBAAmB,EAAGA,mBAAqB;MAC3C/C,kBAAkB,EAAGA;IAAoB,CACzC,CACD,IACEmC,kBAAkB,IAAI,IAAAiB,MAAA,CAAAC,aAAA,EAAChF,eAAe,MAAE,CAAG,CAC9C;IACDM,OAAO,EACN,CAAEwB,iBAAiB,IACnB4B,UAAU,IACV/B,kBAAkB,IAClB,CAAEG,iBAAiB,IAClB,IAAAiD,MAAA,CAAAC,aAAA,EAACvG,UAAA,CAAAkI,iBAAiB,CAACC,IAAI;MAACC,KAAK,EAAC;IAAgB,CAAE,CAEjD;IACDrG,MAAM,EACLoD,0BAA0B,IACzB,IAAAmB,MAAA,CAAAC,aAAA,EAACxG,YAAA,CAAAsI,eAAe;MACfC,aAAa,EAAG9E;IAAe,CAC/B,CAEF;IACD+E,MAAM,EAAG;MACR,GAAG7G,eAAe;MAClBuG,gBAAgB,EAAE3C;IACnB;EAAG,CACH,CACc,CAEhB,CAAC;AAEL"}
|
|
@@ -118,8 +118,7 @@ function EditorCanvasContainer({
|
|
|
118
118
|
className: "edit-site-editor-canvas-container__close-button",
|
|
119
119
|
icon: _icons.closeSmall,
|
|
120
120
|
label: closeButtonLabel || (0, _i18n.__)('Close'),
|
|
121
|
-
onClick: onCloseContainer
|
|
122
|
-
showTooltip: false
|
|
121
|
+
onClick: onCloseContainer
|
|
123
122
|
}), childrenWithProps)));
|
|
124
123
|
}
|
|
125
124
|
function useHasEditorCanvasContainer() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_keycodes","_i18n","_data","_icons","_compose","_preferences","_editor","_lockUnlock","_store","_resizableEditor","_interopRequireDefault","getEditorCanvasContainerTitle","view","__","createPrivateSlotFill","unlock","componentsPrivateApis","SLOT_FILL_NAME","privateKey","Slot","EditorCanvasContainerSlot","Fill","EditorCanvasContainerFill","EditorCanvasContainer","children","closeButtonLabel","onClose","enableResizing","editorCanvasContainerView","showListViewByDefault","useSelect","select","_editorCanvasContainerView","editSiteStore","getEditorCanvasContainerView","_showListViewByDefault","preferencesStore","get","isClosed","setIsClosed","useState","setEditorCanvasContainerView","useDispatch","setIsListViewOpened","editorStore","focusOnMountRef","useFocusOnMount","sectionFocusReturnRef","useFocusReturn","onCloseContainer","undefined","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","childrenWithProps","Array","isArray","Children","map","child","index","cloneElement","ref","title","shouldShowCloseButton","_react","createElement","default","className","onKeyDown","Button","icon","closeSmall","label","onClick","
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_keycodes","_i18n","_data","_icons","_compose","_preferences","_editor","_lockUnlock","_store","_resizableEditor","_interopRequireDefault","getEditorCanvasContainerTitle","view","__","createPrivateSlotFill","unlock","componentsPrivateApis","SLOT_FILL_NAME","privateKey","Slot","EditorCanvasContainerSlot","Fill","EditorCanvasContainerFill","EditorCanvasContainer","children","closeButtonLabel","onClose","enableResizing","editorCanvasContainerView","showListViewByDefault","useSelect","select","_editorCanvasContainerView","editSiteStore","getEditorCanvasContainerView","_showListViewByDefault","preferencesStore","get","isClosed","setIsClosed","useState","setEditorCanvasContainerView","useDispatch","setIsListViewOpened","editorStore","focusOnMountRef","useFocusOnMount","sectionFocusReturnRef","useFocusReturn","onCloseContainer","undefined","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","childrenWithProps","Array","isArray","Children","map","child","index","cloneElement","ref","title","shouldShowCloseButton","_react","createElement","default","className","onKeyDown","Button","icon","closeSmall","label","onClick","useHasEditorCanvasContainer","fills","useSlotFills","length","_default","exports"],"sources":["@wordpress/edit-site/src/components/editor-canvas-container/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport ResizableEditor from '../block-editor/resizable-editor';\n\n/**\n * Returns a translated string for the title of the editor canvas container.\n *\n * @param {string} view Editor canvas container view.\n *\n * @return {string} Translated string corresponding to value of view. Default is ''.\n */\nfunction getEditorCanvasContainerTitle( view ) {\n\tswitch ( view ) {\n\t\tcase 'style-book':\n\t\t\treturn __( 'Style Book' );\n\t\tcase 'global-styles-revisions':\n\t\tcase 'global-styles-revisions:style-book':\n\t\t\treturn __( 'Style Revisions' );\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\n// Creates a private slot fill.\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SLOT_FILL_NAME = 'EditSiteEditorCanvasContainerSlot';\nconst {\n\tprivateKey,\n\tSlot: EditorCanvasContainerSlot,\n\tFill: EditorCanvasContainerFill,\n} = createPrivateSlotFill( SLOT_FILL_NAME );\n\nfunction EditorCanvasContainer( {\n\tchildren,\n\tcloseButtonLabel,\n\tonClose,\n\tenableResizing = false,\n} ) {\n\tconst { editorCanvasContainerView, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _editorCanvasContainerView = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView();\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\teditorCanvasContainerView: _editorCanvasContainerView,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tfunction onCloseContainer() {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tsetEditorCanvasContainerView( undefined );\n\t\tsetIsClosed( true );\n\t\tif ( typeof onClose === 'function' ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseContainer();\n\t\t}\n\t}\n\n\tconst childrenWithProps = Array.isArray( children )\n\t\t? Children.map( children, ( child, index ) =>\n\t\t\t\tindex === 0\n\t\t\t\t\t? cloneElement( child, {\n\t\t\t\t\t\t\tref: sectionFocusReturnRef,\n\t\t\t\t\t } )\n\t\t\t\t\t: child\n\t\t )\n\t\t: cloneElement( children, {\n\t\t\t\tref: sectionFocusReturnRef,\n\t\t } );\n\n\tif ( isClosed ) {\n\t\treturn null;\n\t}\n\n\tconst title = getEditorCanvasContainerTitle( editorCanvasContainerView );\n\tconst shouldShowCloseButton = onClose || closeButtonLabel;\n\n\treturn (\n\t\t<EditorCanvasContainerFill>\n\t\t\t<ResizableEditor enableResizing={ enableResizing }>\n\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t<section\n\t\t\t\t\tclassName=\"edit-site-editor-canvas-container\"\n\t\t\t\t\tref={ shouldShowCloseButton ? focusOnMountRef : null }\n\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\taria-label={ title }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowCloseButton && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__close-button\"\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ closeButtonLabel || __( 'Close' ) }\n\t\t\t\t\t\t\tonClick={ onCloseContainer }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ childrenWithProps }\n\t\t\t\t</section>\n\t\t\t</ResizableEditor>\n\t\t</EditorCanvasContainerFill>\n\t);\n}\nfunction useHasEditorCanvasContainer() {\n\tconst fills = useSlotFills( privateKey );\n\treturn !! fills?.length;\n}\n\nEditorCanvasContainer.Slot = EditorCanvasContainerSlot;\nexport default EditorCanvasContainer;\nexport { useHasEditorCanvasContainer, getEditorCanvasContainerTitle };\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAtBA;AACA;AACA;;AAeA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASa,6BAA6BA,CAAEC,IAAI,EAAG;EAC9C,QAASA,IAAI;IACZ,KAAK,YAAY;MAChB,OAAO,IAAAC,QAAE,EAAE,YAAa,CAAC;IAC1B,KAAK,yBAAyB;IAC9B,KAAK,oCAAoC;MACxC,OAAO,IAAAA,QAAE,EAAE,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E,MAAM;IACNF,SAAS,EAAC,iDAAiD;IAC3DG,IAAI,EAAGC,iBAAY;IACnBC,KAAK,EAAGnD,gBAAgB,IAAI,IAAAZ,QAAE,EAAE,OAAQ,CAAG;IAC3CgE,OAAO,EAAG5B;EAAkB,CAC5B,CACD,EACCQ,iBACM,CACO,CACS,CAAC;AAE9B;AACA,SAASqB,2BAA2BA,CAAA,EAAG;EACtC,MAAMC,KAAK,GAAG,IAAAC,sCAAY,EAAE9D,UAAW,CAAC;EACxC,OAAO,CAAC,CAAE6D,KAAK,EAAEE,MAAM;AACxB;AAEA1D,qBAAqB,CAACJ,IAAI,GAAGC,yBAAyB;AAAC,IAAA8D,QAAA,GAAAC,OAAA,CAAAb,OAAA,GACxC/C,qBAAqB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BackgroundPanel;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
9
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
useGlobalStyle,
|
|
20
|
+
useGlobalSetting,
|
|
21
|
+
BackgroundPanel: StylesBackgroundPanel
|
|
22
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
23
|
+
function BackgroundPanel() {
|
|
24
|
+
const [style] = useGlobalStyle('', undefined, 'user', {
|
|
25
|
+
shouldDecodeEncode: false
|
|
26
|
+
});
|
|
27
|
+
const [inheritedStyle, setStyle] = useGlobalStyle('', undefined, 'all', {
|
|
28
|
+
shouldDecodeEncode: false
|
|
29
|
+
});
|
|
30
|
+
const [settings] = useGlobalSetting('');
|
|
31
|
+
return (0, _react.createElement)(StylesBackgroundPanel, {
|
|
32
|
+
inheritedValue: inheritedStyle,
|
|
33
|
+
value: style,
|
|
34
|
+
onChange: setStyle,
|
|
35
|
+
settings: settings
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=background-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","useGlobalSetting","BackgroundPanel","StylesBackgroundPanel","unlock","blockEditorPrivateApis","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","settings","_react","createElement","inheritedValue","value","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tBackgroundPanel: StylesBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function BackgroundPanel() {\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ settings ] = useGlobalSetting( '' );\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EACLE,cAAc;EACdC,gBAAgB;EAChBC,eAAe,EAAEC;AAClB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAErB,SAASH,eAAeA,CAAA,EAAG;EACzC,MAAM,CAAEI,KAAK,CAAE,GAAGN,cAAc,CAAE,EAAE,EAAEO,SAAS,EAAE,MAAM,EAAE;IACxDC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEC,cAAc,EAAEC,QAAQ,CAAE,GAAGV,cAAc,CAAE,EAAE,EAAEO,SAAS,EAAE,KAAK,EAAE;IAC1EC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEG,QAAQ,CAAE,GAAGV,gBAAgB,CAAE,EAAG,CAAC;EAE3C,OACC,IAAAW,MAAA,CAAAC,aAAA,EAACV,qBAAqB;IACrBW,cAAc,EAAGL,cAAgB;IACjCM,KAAK,EAAGT,KAAO;IACfU,QAAQ,EAAGN,QAAU;IACrBC,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ"}
|
|
@@ -36,7 +36,7 @@ function FontFamilies() {
|
|
|
36
36
|
onRequestClose: () => toggleModal(),
|
|
37
37
|
defaultTabId: modalTabOpen
|
|
38
38
|
}), (0, _react.createElement)(_components.__experimentalVStack, {
|
|
39
|
-
spacing:
|
|
39
|
+
spacing: 2
|
|
40
40
|
}, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
41
41
|
justify: "space-between"
|
|
42
42
|
}, (0, _react.createElement)(_subtitle.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_icons","_element","_context","_interopRequireWildcard","_fontLibraryModal","_interopRequireDefault","_fontFamilyItem","_subtitle","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","FontFamilies","modalTabOpen","toggleModal","themeFonts","customFonts","useContext","FontLibraryContext","hasFonts","length","_react","createElement","Fragment","onRequestClose","defaultTabId","__experimentalVStack","spacing","__experimentalHStack","justify","level","__","Tooltip","text","Button","onClick","icon","settings","size","__experimentalItemGroup","isBordered","isSeparated","map","font","key","slug","className","variant","_default","props","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/font-families.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tButton,\n\tTooltip,\n} from '@wordpress/components';\nimport { settings } from '@wordpress/icons';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider, {\n\tFontLibraryContext,\n} from './font-library-modal/context';\nimport FontLibraryModal from './font-library-modal';\nimport FontFamilyItem from './font-family-item';\nimport Subtitle from './subtitle';\n\nfunction FontFamilies() {\n\tconst { modalTabOpen, toggleModal, themeFonts, customFonts } =\n\t\tuseContext( FontLibraryContext );\n\n\tconst hasFonts = 0 < customFonts.length || 0 < themeFonts.length;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! modalTabOpen && (\n\t\t\t\t<FontLibraryModal\n\t\t\t\t\tonRequestClose={ () => toggleModal() }\n\t\t\t\t\tdefaultTabId={ modalTabOpen }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_icons","_element","_context","_interopRequireWildcard","_fontLibraryModal","_interopRequireDefault","_fontFamilyItem","_subtitle","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","FontFamilies","modalTabOpen","toggleModal","themeFonts","customFonts","useContext","FontLibraryContext","hasFonts","length","_react","createElement","Fragment","onRequestClose","defaultTabId","__experimentalVStack","spacing","__experimentalHStack","justify","level","__","Tooltip","text","Button","onClick","icon","settings","size","__experimentalItemGroup","isBordered","isSeparated","map","font","key","slug","className","variant","_default","props","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/font-families.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tButton,\n\tTooltip,\n} from '@wordpress/components';\nimport { settings } from '@wordpress/icons';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider, {\n\tFontLibraryContext,\n} from './font-library-modal/context';\nimport FontLibraryModal from './font-library-modal';\nimport FontFamilyItem from './font-family-item';\nimport Subtitle from './subtitle';\n\nfunction FontFamilies() {\n\tconst { modalTabOpen, toggleModal, themeFonts, customFonts } =\n\t\tuseContext( FontLibraryContext );\n\n\tconst hasFonts = 0 < customFonts.length || 0 < themeFonts.length;\n\n\treturn (\n\t\t<>\n\t\t\t{ !! modalTabOpen && (\n\t\t\t\t<FontLibraryModal\n\t\t\t\t\tonRequestClose={ () => toggleModal() }\n\t\t\t\t\tdefaultTabId={ modalTabOpen }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t<HStack justify=\"flex-end\">\n\t\t\t\t\t\t<Tooltip text={ __( 'Manage fonts' ) }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggleModal( 'installed-fonts' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-label={ __( 'Manage fonts' ) }\n\t\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\t\tsize={ 'small' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ hasFonts ? (\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t{ customFonts.map( ( font ) => (\n\t\t\t\t\t\t\t<FontFamilyItem key={ font.slug } font={ font } />\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ themeFonts.map( ( font ) => (\n\t\t\t\t\t\t\t<FontFamilyItem key={ font.slug } font={ font } />\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __( 'No fonts installed.' ) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-font-families__add-fonts\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => toggleModal( 'upload-fonts' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Add fonts' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default ( { ...props } ) => (\n\t<FontLibraryProvider>\n\t\t<FontFamilies { ...props } />\n\t</FontLibraryProvider>\n);\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAC,uBAAA,CAAAL,OAAA;AAGA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,SAAA,GAAAF,sBAAA,CAAAP,OAAA;AAAkC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,I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AAAtB,MAAA,CAAAC,aAAA,EAACjC,eAAA,CAAAQ,OAAc;IAAC+C,GAAG,EAAGD,IAAI,CAACE,IAAM;IAACF,IAAI,EAAGA;EAAM,CAAE,CAChD,CACQ,CAAC,GAEZ,IAAAtB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACG,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAC7B,IAAAV,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAoD,MAAM;IACNY,SAAS,EAAC,kDAAkD;IAC5DC,OAAO,EAAC,WAAW;IACnBZ,OAAO,EAAGA,CAAA,KAAMrB,WAAW,CAAE,cAAe;EAAG,GAE7C,IAAAiB,QAAE,EAAE,WAAY,CACX,CACP,CAEI,CACP,CAAC;AAEL;AAAC,IAAAiB,QAAA,GAEcA,CAAE;EAAE,GAAGC;AAAM,CAAC,KAC5B,IAAA5B,MAAA,CAAAC,aAAA,EAACrC,QAAA,CAAAY,OAAmB,QACnB,IAAAwB,MAAA,CAAAC,aAAA,EAACV,YAAY;EAAA,GAAMqC;AAAK,CAAI,CACR,CACrB;AAAAC,OAAA,CAAArD,OAAA,GAAAmD,QAAA"}
|
|
@@ -79,12 +79,23 @@ function FontLibraryProvider({
|
|
|
79
79
|
// Library Fonts
|
|
80
80
|
const [modalTabOpen, setModalTabOpen] = (0, _element.useState)(false);
|
|
81
81
|
const [libraryFontSelected, setLibraryFontSelected] = (0, _element.useState)(null);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
})).sort((a, b) => a.name.localeCompare(b.name)) : [];
|
|
82
|
+
|
|
83
|
+
// Themes Fonts are the fonts defined in the global styles (database persisted theme.json data).
|
|
85
84
|
const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map(f => (0, _utils.setUIValuesNeeded)(f, {
|
|
86
85
|
source: 'theme'
|
|
87
86
|
})).sort((a, b) => a.name.localeCompare(b.name)) : [];
|
|
87
|
+
const themeFontsSlugs = new Set(themeFonts.map(f => f.slug));
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* Base Theme Fonts are the fonts defined in the theme.json *file*.
|
|
91
|
+
*
|
|
92
|
+
* Uses the fonts from global styles + the ones from the theme.json file that hasn't repeated slugs.
|
|
93
|
+
* Avoids incosistencies with the fonts listed in the font library modal as base (unactivated).
|
|
94
|
+
* These inconsistencies can happen when the active theme fonts in global styles aren't defined in theme.json file as when a theme style variation is applied.
|
|
95
|
+
*/
|
|
96
|
+
const baseThemeFonts = baseFontFamilies?.theme ? themeFonts.concat(baseFontFamilies.theme.filter(f => !themeFontsSlugs.has(f.slug)).map(f => (0, _utils.setUIValuesNeeded)(f, {
|
|
97
|
+
source: 'theme'
|
|
98
|
+
})).sort((a, b) => a.name.localeCompare(b.name))) : [];
|
|
88
99
|
const customFonts = fontFamilies?.custom ? fontFamilies.custom.map(f => (0, _utils.setUIValuesNeeded)(f, {
|
|
89
100
|
source: 'custom'
|
|
90
101
|
})).sort((a, b) => a.name.localeCompare(b.name)) : [];
|
|
@@ -104,7 +115,7 @@ function FontLibraryProvider({
|
|
|
104
115
|
setLibraryFontSelected(null);
|
|
105
116
|
return;
|
|
106
117
|
}
|
|
107
|
-
const fonts = font.source === 'theme' ?
|
|
118
|
+
const fonts = font.source === 'theme' ? themeFonts : baseCustomFonts;
|
|
108
119
|
|
|
109
120
|
// Tries to find the font in the installed fonts
|
|
110
121
|
const fontSelected = fonts.find(f => f.slug === font.slug);
|
|
@@ -185,8 +196,10 @@ function FontLibraryProvider({
|
|
|
185
196
|
// Use the sucessfully installed font faces
|
|
186
197
|
// As well as any font faces that were already installed (those will be activated)
|
|
187
198
|
if (sucessfullyInstalledFontFaces?.length > 0 || alreadyInstalledFontFaces?.length > 0) {
|
|
188
|
-
|
|
189
|
-
|
|
199
|
+
// Use font data from REST API not from client to ensure
|
|
200
|
+
// correct font information is used.
|
|
201
|
+
installedFontFamily.fontFace = [...sucessfullyInstalledFontFaces];
|
|
202
|
+
fontFamiliesToActivate.push(installedFontFamily);
|
|
190
203
|
}
|
|
191
204
|
|
|
192
205
|
// If it's a system font but was installed successfully, activate it.
|
|
@@ -258,14 +271,30 @@ function FontLibraryProvider({
|
|
|
258
271
|
}
|
|
259
272
|
};
|
|
260
273
|
const activateCustomFontFamilies = fontsToAdd => {
|
|
261
|
-
//
|
|
274
|
+
// Removes the id from the families and faces to avoid saving that to global styles post content.
|
|
275
|
+
const fontsToActivate = fontsToAdd.map(({
|
|
276
|
+
id: _familyDbId,
|
|
277
|
+
fontFace,
|
|
278
|
+
...font
|
|
279
|
+
}) => ({
|
|
280
|
+
...font,
|
|
281
|
+
...(fontFace && fontFace.length > 0 ? {
|
|
282
|
+
fontFace: fontFace.map(({
|
|
283
|
+
id: _faceDbId,
|
|
284
|
+
...face
|
|
285
|
+
}) => face)
|
|
286
|
+
} : {})
|
|
287
|
+
}));
|
|
288
|
+
|
|
262
289
|
// Activate the fonts by set the new custom fonts array.
|
|
263
290
|
setFontFamilies({
|
|
264
291
|
...fontFamilies,
|
|
265
|
-
custom
|
|
292
|
+
// Merge the existing custom fonts with the new fonts.
|
|
293
|
+
custom: (0, _utils.mergeFontFamilies)(fontFamilies?.custom, fontsToActivate)
|
|
266
294
|
});
|
|
295
|
+
|
|
267
296
|
// Add custom fonts to the browser.
|
|
268
|
-
|
|
297
|
+
fontsToActivate.forEach(font => {
|
|
269
298
|
if (font.fontFace) {
|
|
270
299
|
font.fontFace.forEach(face => {
|
|
271
300
|
// Load font faces just in the iframe because they already are in the document.
|