@wordpress/edit-site 6.2.0 → 6.3.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/{add-new-page → add-new-post}/index.js +21 -17
- package/build/components/add-new-post/index.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +5 -3
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +21 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +0 -5
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +13 -30
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -40
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +47 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block.js +14 -0
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +5 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -2
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +0 -2
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +4 -4
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +4 -3
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +14 -28
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -2
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +16 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +20 -41
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/index.js +43 -39
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +29 -4
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +22 -55
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +18 -19
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +4 -4
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/posts-app/index.js +11 -17
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/{page-pages/index.js → posts-app/posts-list.js} +135 -40
- package/build/components/posts-app/posts-list.js.map +1 -0
- package/build/components/posts-app/router.js +85 -0
- package/build/components/posts-app/router.js.map +1 -0
- package/build/components/revisions/index.js +10 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +1 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +98 -84
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/site-hub/index.js +81 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -42
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +57 -2
- package/build/posts.js.map +1 -1
- package/build/store/private-actions.js +7 -2
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/{add-new-page → add-new-post}/index.js +21 -17
- package/build-module/components/add-new-post/index.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +5 -3
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +21 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +0 -5
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +14 -31
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -38
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +39 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +15 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +5 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -2
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +6 -6
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +0 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +5 -5
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +4 -3
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +16 -29
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -2
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +14 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +20 -41
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/index.js +44 -40
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +28 -4
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -56
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +18 -19
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +4 -4
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/{page-pages/index.js → posts-app/posts-list.js} +134 -39
- package/build-module/components/posts-app/posts-list.js.map +1 -0
- package/build-module/components/posts-app/router.js +77 -0
- package/build-module/components/posts-app/router.js.map +1 -0
- package/build-module/components/revisions/index.js +10 -7
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +96 -83
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +5 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/site-hub/index.js +81 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +61 -38
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +7 -2
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +57 -2
- package/build-module/posts.js.map +1 -1
- package/build-module/store/private-actions.js +7 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/posts-rtl.css +108 -28
- package/build-style/posts.css +108 -28
- package/build-style/style-rtl.css +112 -144
- package/build-style/style.css +112 -144
- package/package.json +41 -41
- package/src/components/{add-new-page → add-new-post}/index.js +28 -22
- package/src/components/block-editor/use-site-editor-settings.js +33 -28
- package/src/components/editor/index.js +21 -5
- package/src/components/global-styles/background-panel.js +0 -8
- package/src/components/global-styles/font-library-modal/font-collection.js +17 -32
- package/src/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/src/components/global-styles/font-library-modal/style.scss +17 -10
- package/src/components/global-styles/hooks.js +0 -41
- package/src/components/global-styles/preview-typography.js +39 -0
- package/src/components/global-styles/screen-block.js +22 -0
- package/src/components/global-styles/screen-layout.js +5 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/shadows-edit-panel.js +1 -2
- package/src/components/global-styles/style-variations-container.js +10 -7
- package/src/components/global-styles/typography-elements.js +0 -4
- package/src/components/global-styles/variations/variation.js +5 -5
- package/src/components/global-styles/variations/variations-color.js +5 -3
- package/src/components/global-styles/variations/variations-typography.js +15 -32
- package/src/components/global-styles-sidebar/index.js +2 -2
- package/src/components/layout/index.js +13 -4
- package/src/components/layout/router.js +20 -36
- package/src/components/layout/style.scss +12 -0
- package/src/components/page-patterns/index.js +47 -56
- package/src/components/page-patterns/search-items.js +37 -3
- package/src/components/page-patterns/style.scss +1 -8
- package/src/components/page-patterns/use-patterns.js +43 -82
- package/src/components/page-templates/index.js +17 -19
- package/src/components/page-templates/style.scss +1 -6
- package/src/components/pagination/index.js +4 -4
- package/src/components/posts-app/index.js +9 -11
- package/src/components/{page-pages/index.js → posts-app/posts-list.js} +126 -39
- package/src/components/posts-app/router.js +69 -0
- package/src/components/{page-pages → posts-app}/style.scss +22 -8
- package/src/components/revisions/index.js +9 -1
- package/src/components/save-panel/index.js +1 -1
- package/src/components/sidebar/style.scss +6 -0
- package/src/components/sidebar-dataviews/add-new-view.js +2 -1
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/src/components/sidebar-dataviews/default-views.js +110 -97
- package/src/components/sidebar-dataviews/index.js +3 -3
- package/src/components/sidebar-navigation-screen-global-styles/index.js +7 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -2
- package/src/components/site-hub/index.js +84 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -2
- package/src/hooks/push-changes-to-global-styles/index.js +1 -1
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +28 -24
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +72 -47
- package/src/index.js +8 -1
- package/src/posts.js +63 -2
- package/src/posts.scss +9 -0
- package/src/store/private-actions.js +7 -3
- package/src/style.scss +1 -2
- package/build/components/add-new-page/index.js.map +0 -1
- package/build/components/page-pages/index.js.map +0 -1
- package/build/components/table/index.js +0 -35
- package/build/components/table/index.js.map +0 -1
- package/build-module/components/add-new-page/index.js.map +0 -1
- package/build-module/components/page-pages/index.js.map +0 -1
- package/build-module/components/table/index.js +0 -30
- package/build-module/components/table/index.js.map +0 -1
- package/src/components/table/index.js +0 -33
- package/src/components/table/style.scss +0 -38
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_keycodes","_i18n","_blockEditor","_editor","_useThemeStyleVariationsByProperty","_lockUnlock","_jsxRuntime","mergeBaseAndUserConfigs","unlock","editorPrivateApis","GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","children","isPill","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_element","_keycodes","_i18n","_blockEditor","_editor","_useThemeStyleVariationsByProperty","_lockUnlock","_jsxRuntime","mergeBaseAndUserConfigs","unlock","editorPrivateApis","GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","Variation","variation","children","isPill","properties","showTooltip","isFocused","setIsFocused","useState","base","user","setUserConfig","useContext","context","useMemo","merged","filterObjectByProperties","selectVariation","selectOnEnter","event","keyCode","ENTER","preventDefault","isActive","label","title","description","sprintf","__","content","jsx","className","clsx","role","onClick","onKeyDown","tabIndex","onFocus","onBlur","Provider","value","Tooltip","text"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variation.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Tooltip } from '@wordpress/components';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { filterObjectByProperties } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { unlock } from '../../../lock-unlock';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function Variation( {\n\tvariation,\n\tchildren,\n\tisPill,\n\tproperties,\n\tshowTooltip,\n} ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\n\tconst context = useMemo( () => {\n\t\tlet merged = mergeBaseAndUserConfigs( base, variation );\n\t\tif ( properties ) {\n\t\t\tmerged = filterObjectByProperties( merged, properties );\n\t\t}\n\t\treturn {\n\t\t\tuser: variation,\n\t\t\tbase,\n\t\t\tmerged,\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base, properties ] );\n\n\tconst selectVariation = () => setUserConfig( variation );\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo(\n\t\t() => areGlobalStyleConfigsEqual( user, variation ),\n\t\t[ user, variation ]\n\t);\n\n\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: %1$s: variation title. %2$s variation description. */\n\t\t\t__( '%1$s (%2$s)' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\n\n\tconst content = (\n\t\t<div\n\t\t\tclassName={ clsx( 'edit-site-global-styles-variations_item', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\trole=\"button\"\n\t\t\tonClick={ selectVariation }\n\t\t\tonKeyDown={ selectOnEnter }\n\t\t\ttabIndex=\"0\"\n\t\t\taria-label={ label }\n\t\t\taria-current={ isActive }\n\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-global-styles-variations_item-preview',\n\t\t\t\t\t{ 'is-pill': isPill }\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children( isFocused ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ showTooltip ? (\n\t\t\t\t<Tooltip text={ variation?.title }>{ content }</Tooltip>\n\t\t\t) : (\n\t\t\t\tcontent\n\t\t\t) }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,kCAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA8C,IAAAS,WAAA,GAAAT,OAAA;AAnB9C;AACA;AACA;;AAGA;AACA;AACA;;A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exports.default = ColorVariations;
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _previewColors = _interopRequireDefault(require("../preview-colors"));
|
|
10
|
-
var
|
|
10
|
+
var _useThemeStyleVariationsByProperty = require("../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property");
|
|
11
11
|
var _subtitle = _interopRequireDefault(require("../subtitle"));
|
|
12
12
|
var _variation = _interopRequireDefault(require("./variation"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -23,7 +23,8 @@ function ColorVariations({
|
|
|
23
23
|
title,
|
|
24
24
|
gap = 2
|
|
25
25
|
}) {
|
|
26
|
-
const
|
|
26
|
+
const propertiesToFilter = ['color'];
|
|
27
|
+
const colorVariations = (0, _useThemeStyleVariationsByProperty.useCurrentMergeThemeStyleVariationsWithUserConfig)(propertiesToFilter);
|
|
27
28
|
|
|
28
29
|
// Return null if there is only one variation (the default).
|
|
29
30
|
if (colorVariations?.length <= 1) {
|
|
@@ -39,7 +40,7 @@ function ColorVariations({
|
|
|
39
40
|
children: colorVariations.map((variation, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_variation.default, {
|
|
40
41
|
variation: variation,
|
|
41
42
|
isPill: true,
|
|
42
|
-
|
|
43
|
+
properties: propertiesToFilter,
|
|
43
44
|
showTooltip: true,
|
|
44
45
|
children: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_previewColors.default, {})
|
|
45
46
|
}, index))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_previewColors","_interopRequireDefault","
|
|
1
|
+
{"version":3,"names":["_components","require","_previewColors","_interopRequireDefault","_useThemeStyleVariationsByProperty","_subtitle","_variation","_jsxRuntime","ColorVariations","title","gap","propertiesToFilter","colorVariations","useCurrentMergeThemeStyleVariationsWithUserConfig","length","jsxs","__experimentalVStack","spacing","children","jsx","default","level","__experimentalGrid","map","variation","index","isPill","properties","showTooltip"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variations-color.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalGrid as Grid,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StylesPreviewColors from '../preview-colors';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Subtitle from '../subtitle';\nimport Variation from './variation';\n\nexport default function ColorVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'color' ];\n\tconst colorVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( colorVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid spacing={ gap }>\n\t\t\t\t{ colorVariations.map( ( variation, index ) => (\n\t\t\t\t\t<Variation\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\tisPill\n\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t{ () => <StylesPreviewColors /> }\n\t\t\t\t\t</Variation>\n\t\t\t\t) ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kCAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAoC,IAAAM,WAAA,GAAAN,OAAA;AAdpC;AACA;AACA;;AAMA;AACA;AACA;;AAMe,SAASO,eAAeA,CAAE;EAAEC,KAAK;EAAEC,GAAG,GAAG;AAAE,CAAC,EAAG;EAC7D,MAAMC,kBAAkB,GAAG,CAAE,OAAO,CAAE;EACtC,MAAMC,eAAe,GACpB,IAAAC,oFAAiD,EAAEF,kBAAmB,CAAC;;EAExE;EACA,IAAKC,eAAe,EAAEE,MAAM,IAAI,CAAC,EAAG;IACnC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAP,WAAA,CAAAQ,IAAA,EAACf,WAAA,CAAAgB,oBAAM;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,GAClBT,KAAK,iBAAI,IAAAF,WAAA,CAAAY,GAAA,EAACd,SAAA,CAAAe,OAAQ;MAACC,KAAK,EAAG,CAAG;MAAAH,QAAA,EAAGT;IAAK,CAAY,CAAC,eACrD,IAAAF,WAAA,CAAAY,GAAA,EAACnB,WAAA,CAAAsB,kBAAI;MAACL,OAAO,EAAGP,GAAK;MAAAQ,QAAA,EAClBN,eAAe,CAACW,GAAG,CAAE,CAAEC,SAAS,EAAEC,KAAK,kBACxC,IAAAlB,WAAA,CAAAY,GAAA,EAACb,UAAA,CAAAc,OAAS;QAETI,SAAS,EAAGA,SAAW;QACvBE,MAAM;QACNC,UAAU,EAAGhB,kBAAoB;QACjCiB,WAAW;QAAAV,QAAA,EAETA,CAAA,kBAAM,IAAAX,WAAA,CAAAY,GAAA,EAACjB,cAAA,CAAAkB,OAAmB,IAAE;MAAC,GANzBK,KAOI,CACV;IAAC,CACE,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = TypographyVariations;
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _previewIframe = _interopRequireDefault(require("../preview-iframe"));
|
|
9
|
+
var _previewTypography = _interopRequireDefault(require("../preview-typography"));
|
|
10
|
+
var _useThemeStyleVariationsByProperty = require("../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property");
|
|
12
11
|
var _variation = _interopRequireDefault(require("./variation"));
|
|
13
12
|
var _subtitle = _interopRequireDefault(require("../subtitle"));
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -24,7 +23,8 @@ function TypographyVariations({
|
|
|
24
23
|
title,
|
|
25
24
|
gap = 2
|
|
26
25
|
}) {
|
|
27
|
-
const
|
|
26
|
+
const propertiesToFilter = ['typography'];
|
|
27
|
+
const typographyVariations = (0, _useThemeStyleVariationsByProperty.useCurrentMergeThemeStyleVariationsWithUserConfig)(propertiesToFilter);
|
|
28
28
|
|
|
29
29
|
// Return null if there is only one variation (the default).
|
|
30
30
|
if (typographyVariations?.length <= 1) {
|
|
@@ -39,30 +39,16 @@ function TypographyVariations({
|
|
|
39
39
|
columns: 3,
|
|
40
40
|
gap: gap,
|
|
41
41
|
className: "edit-site-global-styles-style-variations-container",
|
|
42
|
-
children: typographyVariations
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
53
|
-
spacing: 10 * ratio,
|
|
54
|
-
justify: "center",
|
|
55
|
-
style: {
|
|
56
|
-
height: '100%',
|
|
57
|
-
overflow: 'hidden'
|
|
58
|
-
},
|
|
59
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typographyExample.default, {
|
|
60
|
-
variation: variation,
|
|
61
|
-
fontSize: 85 * ratio
|
|
62
|
-
})
|
|
63
|
-
}, key)
|
|
64
|
-
})
|
|
65
|
-
}, index))
|
|
42
|
+
children: typographyVariations.map((variation, index) => {
|
|
43
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_variation.default, {
|
|
44
|
+
variation: variation,
|
|
45
|
+
properties: propertiesToFilter,
|
|
46
|
+
showTooltip: true,
|
|
47
|
+
children: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_previewTypography.default, {
|
|
48
|
+
variation: variation
|
|
49
|
+
})
|
|
50
|
+
}, index);
|
|
51
|
+
})
|
|
66
52
|
})]
|
|
67
53
|
});
|
|
68
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","
|
|
1
|
+
{"version":3,"names":["_components","require","_previewTypography","_interopRequireDefault","_useThemeStyleVariationsByProperty","_variation","_subtitle","_jsxRuntime","TypographyVariations","title","gap","propertiesToFilter","typographyVariations","useCurrentMergeThemeStyleVariationsWithUserConfig","length","jsxs","__experimentalVStack","spacing","children","jsx","default","level","__experimentalGrid","columns","className","map","variation","index","properties","showTooltip"],"sources":["@wordpress/edit-site/src/components/global-styles/variations/variations-typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGrid as Grid,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\n\nimport StylesPreviewTypography from '../preview-typography';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Variation from './variation';\nimport Subtitle from '../subtitle';\n\nexport default function TypographyVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'typography' ];\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( typographyVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid\n\t\t\t\tcolumns={ 3 }\n\t\t\t\tgap={ gap }\n\t\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\t>\n\t\t\t\t{ typographyVariations.map( ( variation, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Variation\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t<StylesPreviewTypography\n\t\t\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Variation>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kCAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAmC,IAAAM,WAAA,GAAAN,OAAA;AAfnC;AACA;AACA;;AAMA;AACA;AACA;;AAOe,SAASO,oBAAoBA,CAAE;EAAEC,KAAK;EAAEC,GAAG,GAAG;AAAE,CAAC,EAAG;EAClE,MAAMC,kBAAkB,GAAG,CAAE,YAAY,CAAE;EAC3C,MAAMC,oBAAoB,GACzB,IAAAC,oFAAiD,EAAEF,kBAAmB,CAAC;;EAExE;EACA,IAAKC,oBAAoB,EAAEE,MAAM,IAAI,CAAC,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAP,WAAA,CAAAQ,IAAA,EAACf,WAAA,CAAAgB,oBAAM;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,GAClBT,KAAK,iBAAI,IAAAF,WAAA,CAAAY,GAAA,EAACb,SAAA,CAAAc,OAAQ;MAACC,KAAK,EAAG,CAAG;MAAAH,QAAA,EAAGT;IAAK,CAAY,CAAC,eACrD,IAAAF,WAAA,CAAAY,GAAA,EAACnB,WAAA,CAAAsB,kBAAI;MACJC,OAAO,EAAG,CAAG;MACbb,GAAG,EAAGA,GAAK;MACXc,SAAS,EAAC,oDAAoD;MAAAN,QAAA,EAE5DN,oBAAoB,CAACa,GAAG,CAAE,CAAEC,SAAS,EAAEC,KAAK,KAAM;QACnD,oBACC,IAAApB,WAAA,CAAAY,GAAA,EAACd,UAAA,CAAAe,OAAS;UAETM,SAAS,EAAGA,SAAW;UACvBE,UAAU,EAAGjB,kBAAoB;UACjCkB,WAAW;UAAAX,QAAA,EAETA,CAAA,kBACD,IAAAX,WAAA,CAAAY,GAAA,EAACjB,kBAAA,CAAAkB,OAAuB;YACvBM,SAAS,EAAGA;UAAW,CACvB;QACD,GATKC,KAUI,CAAC;MAEd,CAAE;IAAC,CACE,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
|
|
@@ -133,7 +133,7 @@ function GlobalStylesSidebar() {
|
|
|
133
133
|
icon: _icons.seen,
|
|
134
134
|
label: (0, _i18n.__)('Style Book'),
|
|
135
135
|
isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
|
|
136
|
-
|
|
136
|
+
accessibleWhenDisabled: true,
|
|
137
137
|
disabled: shouldClearCanvasContainerView,
|
|
138
138
|
onClick: toggleStyleBook,
|
|
139
139
|
size: "compact"
|
|
@@ -143,7 +143,7 @@ function GlobalStylesSidebar() {
|
|
|
143
143
|
label: (0, _i18n.__)('Revisions'),
|
|
144
144
|
icon: _icons.backup,
|
|
145
145
|
onClick: toggleRevisions,
|
|
146
|
-
|
|
146
|
+
accessibleWhenDisabled: true,
|
|
147
147
|
disabled: !hasRevisions,
|
|
148
148
|
isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
|
|
149
149
|
size: "compact"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_preferences","_editor","_globalStyles","_store","_ui","_lockUnlock","_coreData","_defaultSidebar","_interopRequireDefault","_jsxRuntime","interfaceStore","unlock","editorPrivateApis","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","useSelect","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","editSiteStore","canvasContainerView","_isVisualEditorMode","editorStore","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","useDispatch","useEffect","setIsListViewOpened","goTo","useNavigator","toggleRevisions","toggleStyleBook","jsx","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","jsxs","Flex","gap","children","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","__experimentalIsFocusable","disabled","onClick","size","backup","GlobalStylesMenuSlot","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\nimport DefaultSidebar from './default-sidebar';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA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ACRzD,iBAAiB,IAAII,0BACrB;UACDsD,yBAAyB;UACzBC,QAAQ,EAAG5D,8BAAgC;UAC3C6D,OAAO,EAAG1B,eAAiB;UAC3B2B,IAAI,EAAC;QAAS,CACd;MAAC,CACO,CAAC,eACX,IAAAnE,WAAA,CAAAyC,GAAA,EAACxD,WAAA,CAAA0E,QAAQ;QAAAJ,QAAA,eACR,IAAAvD,WAAA,CAAAyC,GAAA,EAACxD,WAAA,CAAA2E,MAAM;UACNE,KAAK,EAAG,IAAAhB,QAAE,EAAE,WAAY,CAAG;UAC3BC,IAAI,EAAGqB,aAAQ;UACfF,OAAO,EAAG3B,eAAiB;UAC3ByB,yBAAyB;UACzBC,QAAQ,EAAG,CAAEzD,YAAc;UAC3BuD,SAAS,EACRtD,iBAAiB,IAAIC,0BACrB;UACDyD,IAAI,EAAC;QAAS,CACd;MAAC,CACO,CAAC,eACX,IAAAnE,WAAA,CAAAyC,GAAA,EAAC9C,GAAA,CAAA0E,oBAAoB,IAAE,CAAC;IAAA,CACnB,CACN;IAAAd,QAAA,eAED,IAAAvD,WAAA,CAAAyC,GAAA,EAAChD,aAAA,CAAA6E,cAAc,IAAE;EAAC,CACH,CAAC;AAEnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_preferences","_editor","_globalStyles","_store","_ui","_lockUnlock","_coreData","_defaultSidebar","_interopRequireDefault","_jsxRuntime","interfaceStore","unlock","editorPrivateApis","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","useSelect","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","editSiteStore","canvasContainerView","_isVisualEditorMode","editorStore","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","useDispatch","useEffect","setIsListViewOpened","goTo","useNavigator","toggleRevisions","toggleStyleBook","jsx","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","jsxs","Flex","gap","children","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","accessibleWhenDisabled","disabled","onClick","size","backup","GlobalStylesMenuSlot","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/global-styles-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\nimport DefaultSidebar from './default-sidebar';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,GAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAC,sBAAA,CAAAb,OAAA;AAA+C,IAAAc,WAAA,GAAAd,OAAA;AA5B/C;AACA;AACA;;AAkBA;AACA;AACA;;AAQA,MAAM;EAAEe;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CA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ACNE,KAAK,EAAG,IAAAhB,QAAE,EAAE,WAAY,CAAG;UAC3BC,IAAI,EAAGqB,aAAQ;UACfF,OAAO,EAAG3B,eAAiB;UAC3ByB,sBAAsB;UACtBC,QAAQ,EAAG,CAAEzD,YAAc;UAC3BuD,SAAS,EACRtD,iBAAiB,IAAIC,0BACrB;UACDyD,IAAI,EAAC;QAAS,CACd;MAAC,CACO,CAAC,eACX,IAAAnE,WAAA,CAAAyC,GAAA,EAAC9C,GAAA,CAAA0E,oBAAoB,IAAE,CAAC;IAAA,CACnB,CACN;IAAAd,QAAA,eAED,IAAAvD,WAAA,CAAAyC,GAAA,EAAChD,aAAA,CAAA6E,cAAc,IAAE;EAAC,CACH,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -18,18 +18,20 @@ var _editor = require("@wordpress/editor");
|
|
|
18
18
|
var _coreCommands = require("@wordpress/core-commands");
|
|
19
19
|
var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
|
|
20
20
|
var _store = require("../../store");
|
|
21
|
-
var _siteHub =
|
|
21
|
+
var _siteHub = _interopRequireWildcard(require("../site-hub"));
|
|
22
22
|
var _resizableFrame = _interopRequireDefault(require("../resizable-frame"));
|
|
23
23
|
var _lockUnlock = require("../../lock-unlock");
|
|
24
|
-
var _savePanel = _interopRequireDefault(require("../save-panel"));
|
|
25
24
|
var _register = _interopRequireDefault(require("../keyboard-shortcuts/register"));
|
|
26
25
|
var _global = _interopRequireDefault(require("../keyboard-shortcuts/global"));
|
|
27
26
|
var _hooks = require("./hooks");
|
|
28
27
|
var _animation = _interopRequireDefault(require("./animation"));
|
|
29
28
|
var _sidebar = _interopRequireDefault(require("../sidebar"));
|
|
30
29
|
var _saveHub = _interopRequireDefault(require("../save-hub"));
|
|
30
|
+
var _savePanel = _interopRequireDefault(require("../save-panel"));
|
|
31
31
|
var _useSyncCanvasModeWithUrl = _interopRequireDefault(require("../sync-state-with-url/use-sync-canvas-mode-with-url"));
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
34
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
35
|
/**
|
|
34
36
|
* External dependencies
|
|
35
37
|
*/
|
|
@@ -111,13 +113,13 @@ function Layout({
|
|
|
111
113
|
return null;
|
|
112
114
|
}
|
|
113
115
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
114
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_commands.CommandMenu, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_register.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_global.default, {}), fullResizer, /*#__PURE__*/(0, _jsxRuntime.
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_commands.CommandMenu, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_register.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_global.default, {}), fullResizer, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
115
117
|
...navigateRegionsProps,
|
|
116
118
|
ref: navigateRegionsProps.ref,
|
|
117
119
|
className: (0, _clsx.default)('edit-site-layout', navigateRegionsProps.className, {
|
|
118
120
|
'is-full-canvas': canvasMode === 'edit'
|
|
119
121
|
}),
|
|
120
|
-
children:
|
|
122
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
121
123
|
className: "edit-site-layout__content",
|
|
122
124
|
children: [(!isMobileViewport || !areas.mobile) && /*#__PURE__*/(0, _jsxRuntime.jsx)(NavigableRegion, {
|
|
123
125
|
ariaLabel: (0, _i18n.__)('Navigation'),
|
|
@@ -147,12 +149,18 @@ function Layout({
|
|
|
147
149
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {
|
|
148
150
|
routeKey: routeKey,
|
|
149
151
|
children: areas.sidebar
|
|
150
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_saveHub.default, {})]
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_saveHub.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePanel.default, {})]
|
|
151
153
|
})
|
|
152
154
|
})
|
|
153
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0, _jsxRuntime.
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
154
156
|
className: "edit-site-layout__mobile",
|
|
155
|
-
children:
|
|
157
|
+
children: [canvasMode !== 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {
|
|
158
|
+
routeKey: routeKey,
|
|
159
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_siteHub.SiteHubMobile, {
|
|
160
|
+
ref: toggleRef,
|
|
161
|
+
isTransparent: isResizableFrameOversized
|
|
162
|
+
})
|
|
163
|
+
}), areas.mobile]
|
|
156
164
|
}), !isMobileViewport && areas.content && canvasMode !== 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
157
165
|
className: "edit-site-layout__area",
|
|
158
166
|
style: {
|
|
@@ -184,7 +192,7 @@ function Layout({
|
|
|
184
192
|
})
|
|
185
193
|
})]
|
|
186
194
|
})]
|
|
187
|
-
})
|
|
195
|
+
})
|
|
188
196
|
})]
|
|
189
197
|
});
|
|
190
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_i18n","_element","_keyboardShortcuts","_commands","_blockEditor","_editor","_coreCommands","_errorBoundary","_store","_siteHub","_resizableFrame","_lockUnlock","_savePanel","_register","_global","_hooks","_animation","_sidebar","_saveHub","_useSyncCanvasModeWithUrl","_jsxRuntime","useCommands","unlock","coreCommandsPrivateApis","useGlobalStyle","blockEditorPrivateApis","NavigableRegion","editorPrivateApis","ANIMATION_DURATION","Layout","route","useSyncCanvasModeWithURL","isMobileViewport","useViewportMatch","toggleRef","useRef","canvasMode","previousShortcut","nextShortcut","useSelect","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","navigateRegionsProps","useNavigateRegions","previous","next","disableMotion","useReducedMotion","canvasResizer","canvasSize","useResizeObserver","fullResizer","isEditorLoading","useIsSiteEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","useState","key","routeKey","areas","widths","animationRef","useMovingAnimation","triggerAnimationOnChange","backgroundColor","gradientValue","previousCanvaMode","usePrevious","useEffect","current","focus","jsxs","Fragment","children","jsx","CommandMenu","default","ref","className","clsx","mobile","ariaLabel","__","__unstableAnimatePresence","__unstableMotion","div","initial","opacity","animate","exit","transition","type","duration","ease","isTransparent","sidebar","EditorSnackbars","content","style","maxWidth","preview","width","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport SidebarContent from '../sidebar';\nimport SaveHub from '../save-hub';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nconst { NavigableRegion } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\n\nexport default function Layout( { route } ) {\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst toggleRef = useRef();\n\tconst { canvasMode, previousShortcut, nextShortcut } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/editor/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/editor/next-region'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst { key: routeKey, areas, widths } = route;\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: canvasMode + '__' + routeKey,\n\t} );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvasMode );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\ttoggleRef.current?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ canvasMode ] );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! areas.mobile ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SiteHub\n\t\t\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<SidebarContent routeKey={ routeKey }>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorSnackbars />\n\n\t\t\t\t\t{ isMobileViewport && areas.mobile && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t{ areas.mobile }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvasMode !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\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{ areas.content }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'edit'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\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;gBACHC,WAAW,EACVpD,yBACA;gBACDqD,cAAc,EACbpD,4BACA;gBACDqD,iBAAiB,EAAG;kBACnBC,UAAU,EACT5C,aAAa,aAAbA,aAAa,cAAbA,aAAa,GACbD;gBACF,CAAG;gBAAAS,QAAA,EAEDd,KAAK,CAACyC;cAAO,CACA;YAAC,CACH;UAAC,CACZ,CACL;QAAA,CACG,CACL;MAAA,CACG,CAAC,eAEN,IAAAnF,WAAA,CAAAyD,GAAA,EAACjE,UAAA,CAAAmE,OAAS,IAAE,CAAC;IAAA,CACT,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_i18n","_element","_keyboardShortcuts","_commands","_blockEditor","_editor","_coreCommands","_errorBoundary","_store","_siteHub","_interopRequireWildcard","_resizableFrame","_lockUnlock","_register","_global","_hooks","_animation","_sidebar","_saveHub","_savePanel","_useSyncCanvasModeWithUrl","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useCommands","unlock","coreCommandsPrivateApis","useGlobalStyle","blockEditorPrivateApis","NavigableRegion","editorPrivateApis","ANIMATION_DURATION","Layout","route","useSyncCanvasModeWithURL","isMobileViewport","useViewportMatch","toggleRef","useRef","canvasMode","previousShortcut","nextShortcut","useSelect","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","navigateRegionsProps","useNavigateRegions","previous","next","disableMotion","useReducedMotion","canvasResizer","canvasSize","useResizeObserver","fullResizer","isEditorLoading","useIsSiteEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","useState","key","routeKey","areas","widths","animationRef","useMovingAnimation","triggerAnimationOnChange","backgroundColor","gradientValue","previousCanvaMode","usePrevious","useEffect","current","focus","jsxs","Fragment","children","jsx","CommandMenu","ref","className","clsx","mobile","ariaLabel","__","__unstableAnimatePresence","__unstableMotion","div","initial","opacity","animate","exit","transition","type","duration","ease","isTransparent","sidebar","EditorSnackbars","SiteHubMobile","content","style","maxWidth","preview","width","isReady","isFullWidth","defaultSize","height","isOversized","setIsOversized","innerContentStyle","background"],"sources":["@wordpress/edit-site/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef, useEffect } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport {\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport { default as SiteHub, SiteHubMobile } from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport SidebarContent from '../sidebar';\nimport SaveHub from '../save-hub';\nimport SavePanel from '../save-panel';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\nconst { NavigableRegion } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\n\nexport default function Layout( { route } ) {\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst toggleRef = useRef();\n\tconst { canvasMode, previousShortcut, nextShortcut } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/editor/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/editor/next-region'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst { key: routeKey, areas, widths } = route;\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: canvasMode + '__' + routeKey,\n\t} );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvasMode );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\ttoggleRef.current?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ canvasMode ] );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! areas.mobile ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SiteHub\n\t\t\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<SidebarContent routeKey={ routeKey }>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorSnackbars />\n\n\t\t\t\t\t{ isMobileViewport && areas.mobile && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t{ canvasMode !== 'edit' && (\n\t\t\t\t\t\t\t\t<SidebarContent routeKey={ routeKey }>\n\t\t\t\t\t\t\t\t\t<SiteHubMobile\n\t\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ areas.mobile }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvasMode !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\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{ areas.content }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'edit'\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AAKA,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9,8 @@ var _router = require("@wordpress/router");
|
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
var _lockUnlock = require("../../lock-unlock");
|
|
12
|
-
var _hooks = require("./hooks");
|
|
13
12
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
14
|
-
var
|
|
13
|
+
var _postsList = _interopRequireDefault(require("../posts-app/posts-list"));
|
|
15
14
|
var _pagePatterns = _interopRequireDefault(require("../page-patterns"));
|
|
16
15
|
var _pageTemplates = _interopRequireDefault(require("../page-templates"));
|
|
17
16
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
@@ -80,7 +79,6 @@ function useRedirectOldPaths() {
|
|
|
80
79
|
}, [history, params]);
|
|
81
80
|
}
|
|
82
81
|
function useLayoutAreas() {
|
|
83
|
-
const isSiteEditorLoading = (0, _hooks.useIsSiteEditorLoading)();
|
|
84
82
|
const {
|
|
85
83
|
params
|
|
86
84
|
} = useLocation();
|
|
@@ -92,6 +90,7 @@ function useLayoutAreas() {
|
|
|
92
90
|
isCustom,
|
|
93
91
|
canvas
|
|
94
92
|
} = params;
|
|
93
|
+
const hasEditCanvasMode = canvas === 'edit';
|
|
95
94
|
useRedirectOldPaths();
|
|
96
95
|
|
|
97
96
|
// Page list
|
|
@@ -105,13 +104,13 @@ function useLayoutAreas() {
|
|
|
105
104
|
backPath: {},
|
|
106
105
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarDataviews.default, {})
|
|
107
106
|
}),
|
|
108
|
-
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
109
|
-
|
|
110
|
-
isLoading: isSiteEditorLoading
|
|
107
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_postsList.default, {
|
|
108
|
+
postType: postType
|
|
111
109
|
}),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
preview: (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
111
|
+
mobile: hasEditCanvasMode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_postsList.default, {
|
|
112
|
+
postType: postType
|
|
113
|
+
})
|
|
115
114
|
},
|
|
116
115
|
widths: {
|
|
117
116
|
content: isListLayout ? 380 : undefined
|
|
@@ -129,10 +128,8 @@ function useLayoutAreas() {
|
|
|
129
128
|
backPath: {}
|
|
130
129
|
}),
|
|
131
130
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageTemplates.default, {}),
|
|
132
|
-
preview: (isListLayout ||
|
|
133
|
-
|
|
134
|
-
}),
|
|
135
|
-
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageTemplates.default, {})
|
|
131
|
+
preview: (isListLayout || hasEditCanvasMode) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
132
|
+
mobile: hasEditCanvasMode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_pageTemplates.default, {})
|
|
136
133
|
},
|
|
137
134
|
widths: {
|
|
138
135
|
content: isListLayout ? 380 : undefined
|
|
@@ -149,10 +146,8 @@ function useLayoutAreas() {
|
|
|
149
146
|
backPath: {}
|
|
150
147
|
}),
|
|
151
148
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pagePatterns.default, {}),
|
|
152
|
-
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_pagePatterns.default, {}),
|
|
153
|
-
preview:
|
|
154
|
-
isLoading: isSiteEditorLoading
|
|
155
|
-
})
|
|
149
|
+
mobile: hasEditCanvasMode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_pagePatterns.default, {}),
|
|
150
|
+
preview: hasEditCanvasMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
156
151
|
}
|
|
157
152
|
};
|
|
158
153
|
}
|
|
@@ -165,12 +160,8 @@ function useLayoutAreas() {
|
|
|
165
160
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.default, {
|
|
166
161
|
backPath: {}
|
|
167
162
|
}),
|
|
168
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
169
|
-
|
|
170
|
-
}),
|
|
171
|
-
mobile: canvas === 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
172
|
-
isLoading: isSiteEditorLoading
|
|
173
|
-
})
|
|
163
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
164
|
+
mobile: hasEditCanvasMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
174
165
|
}
|
|
175
166
|
};
|
|
176
167
|
}
|
|
@@ -186,12 +177,8 @@ function useLayoutAreas() {
|
|
|
186
177
|
postType: _constants.NAVIGATION_POST_TYPE
|
|
187
178
|
}
|
|
188
179
|
}),
|
|
189
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
190
|
-
|
|
191
|
-
}),
|
|
192
|
-
mobile: canvas === 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
193
|
-
isLoading: isSiteEditorLoading
|
|
194
|
-
})
|
|
180
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
181
|
+
mobile: hasEditCanvasMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
195
182
|
}
|
|
196
183
|
};
|
|
197
184
|
}
|
|
@@ -201,12 +188,8 @@ function useLayoutAreas() {
|
|
|
201
188
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.default, {
|
|
202
189
|
backPath: {}
|
|
203
190
|
}),
|
|
204
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
205
|
-
|
|
206
|
-
}),
|
|
207
|
-
mobile: canvas === 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
208
|
-
isLoading: isSiteEditorLoading
|
|
209
|
-
})
|
|
191
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
192
|
+
mobile: hasEditCanvasMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
210
193
|
}
|
|
211
194
|
};
|
|
212
195
|
}
|
|
@@ -216,12 +199,8 @@ function useLayoutAreas() {
|
|
|
216
199
|
key: 'default',
|
|
217
200
|
areas: {
|
|
218
201
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.default, {}),
|
|
219
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
220
|
-
|
|
221
|
-
}),
|
|
222
|
-
mobile: canvas === 'edit' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {
|
|
223
|
-
isLoading: isSiteEditorLoading
|
|
224
|
-
})
|
|
202
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
203
|
+
mobile: hasEditCanvasMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
225
204
|
}
|
|
226
205
|
};
|
|
227
206
|
}
|