@wordpress/edit-site 6.4.0 → 6.5.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-pattern/index.js +6 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +2 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +2 -2
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/editor/index.js +71 -20
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +3 -4
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +25 -5
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -8
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +21 -6
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/screen-typeset.js +40 -0
- package/build/components/global-styles/screen-typeset.js.map +1 -0
- package/build/components/global-styles/screen-typography-element.js +14 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +50 -59
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/typeset-button.js +97 -0
- package/build/components/global-styles/typeset-button.js.map +1 -0
- package/build/components/global-styles/typeset.js +80 -0
- package/build/components/global-styles/typeset.js.map +1 -0
- package/build/components/global-styles/ui.js +4 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +10 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/page-patterns/fields.js +230 -0
- package/build/components/page-patterns/fields.js.map +1 -0
- package/build/components/page-patterns/index.js +8 -226
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +26 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/fields.js +169 -0
- package/build/components/page-templates/fields.js.map +1 -0
- package/build/components/page-templates/index.js +10 -177
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +18 -6
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +19 -15
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +125 -67
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +81 -81
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -42
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/site-hub/index.js +6 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +22 -25
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- 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 +2 -3
- 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 +2 -4
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +6 -1
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +2 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +2 -2
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/editor/index.js +73 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +3 -4
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -5
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +26 -6
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +1 -8
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +21 -6
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/screen-typeset.js +34 -0
- package/build-module/components/global-styles/screen-typeset.js.map +1 -0
- package/build-module/components/global-styles/screen-typography-element.js +14 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +4 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +51 -60
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/typeset-button.js +89 -0
- package/build-module/components/global-styles/typeset-button.js.map +1 -0
- package/build-module/components/global-styles/typeset.js +71 -0
- package/build-module/components/global-styles/typeset.js.map +1 -0
- package/build-module/components/global-styles/ui.js +4 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +10 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +223 -0
- package/build-module/components/page-patterns/fields.js.map +1 -0
- package/build-module/components/page-patterns/index.js +11 -229
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +26 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/fields.js +160 -0
- package/build-module/components/page-templates/fields.js.map +1 -0
- package/build-module/components/page-templates/index.js +12 -178
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +20 -8
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +19 -15
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +127 -69
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +81 -81
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +3 -42
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +7 -4
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +23 -26
- 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 +5 -0
- 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 +2 -3
- 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 +2 -3
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +0 -2
- package/build-module/index.js.map +1 -1
- package/build-style/posts-rtl.css +190 -11
- package/build-style/posts.css +190 -11
- package/build-style/style-rtl.css +296 -55
- package/build-style/style.css +296 -55
- package/package.json +41 -41
- package/src/components/add-new-pattern/index.js +8 -3
- package/src/components/add-new-post/index.js +2 -1
- package/src/components/add-new-template/utils.js +10 -6
- package/src/components/editor/index.js +80 -22
- package/src/components/editor/style.scss +59 -1
- package/src/components/global-styles/font-families.js +3 -5
- package/src/components/global-styles/font-library-modal/context.js +0 -5
- package/src/components/global-styles/font-library-modal/font-collection.js +34 -10
- package/src/components/global-styles/font-library-modal/index.js +2 -7
- package/src/components/global-styles/font-library-modal/installed-fonts.js +23 -5
- package/src/components/global-styles/font-library-modal/style.scss +1 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -2
- package/src/components/global-styles/screen-typeset.js +42 -0
- package/src/components/global-styles/screen-typography-element.js +14 -0
- package/src/components/global-styles/screen-typography.js +4 -4
- package/src/components/global-styles/shadows-edit-panel.js +66 -73
- package/src/components/global-styles/style.scss +4 -7
- package/src/components/global-styles/typeset-button.js +93 -0
- package/src/components/global-styles/typeset.js +73 -0
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/utils.js +13 -1
- package/src/components/layout/style.scss +8 -0
- package/src/components/page-patterns/fields.js +251 -0
- package/src/components/page-patterns/index.js +15 -244
- package/src/components/page-patterns/style.scss +82 -85
- package/src/components/page-patterns/use-patterns.js +31 -1
- package/src/components/page-templates/fields.js +157 -0
- package/src/components/page-templates/index.js +19 -170
- package/src/components/page-templates/style.scss +14 -5
- package/src/components/post-edit/index.js +27 -8
- package/src/components/post-fields/index.js +29 -17
- package/src/components/post-list/index.js +134 -74
- package/src/components/sidebar-dataviews/add-new-view.js +2 -4
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +95 -95
- package/src/components/sidebar-dataviews/index.js +3 -37
- package/src/components/site-hub/index.js +11 -2
- package/src/components/site-icon/style.scss +4 -1
- package/src/components/style-book/index.js +27 -32
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- package/src/hooks/push-changes-to-global-styles/index.js +2 -3
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -3
- package/src/index.js +0 -2
- package/build/utils/clone-deep.js +0 -15
- package/build/utils/clone-deep.js.map +0 -1
- package/build-module/utils/clone-deep.js +0 -9
- package/build-module/utils/clone-deep.js.map +0 -1
- package/src/utils/clone-deep.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","privateApis","blockEditorPrivateApis","editorPrivateApis","useContext","FontLibraryProvider","FontLibraryContext","FontLibraryModal","FontFamilyItem","Subtitle","getFontFamilies","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","GlobalStylesContext","mergeBaseAndUserConfigs","Typesets","modalTabOpen","setModalTabOpen","base","user","userConfig","config","allFontFamilies","hasFonts","filter","font","length","children","onRequestClose","defaultTabId","spacing","justify","level","isBordered","isSeparated","map","slug","props"],"sources":["@wordpress/edit-site/src/components/global-styles/typeset.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} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\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';\nimport { getFontFamilies } from './utils';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\nfunction Typesets() {\n\tconst { modalTabOpen, setModalTabOpen } = useContext( FontLibraryContext );\n\tconst { base } = useContext( GlobalStylesContext );\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst config = mergeBaseAndUserConfigs( base, userConfig );\n\tconst allFontFamilies = getFontFamilies( config );\n\tconst hasFonts =\n\t\tallFontFamilies.filter( ( font ) => font !== null ).length > 0;\n\n\treturn (\n\t\thasFonts && (\n\t\t\t<>\n\t\t\t\t{ !! modalTabOpen && (\n\t\t\t\t\t<FontLibraryModal\n\t\t\t\t\t\tonRequestClose={ () => setModalTabOpen( null ) }\n\t\t\t\t\t\tdefaultTabId={ modalTabOpen }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t\t{ allFontFamilies.map(\n\t\t\t\t\t\t\t( font ) =>\n\t\t\t\t\t\t\t\tfont && (\n\t\t\t\t\t\t\t\t\t<FontFamilyItem\n\t\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\t\tfont={ font }\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) }\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t</VStack>\n\t\t\t</>\n\t\t)\n\t);\n}\n\nexport default ( { ...props } ) => (\n\t<FontLibraryProvider>\n\t\t<Typesets { ...props } />\n\t</FontLibraryProvider>\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD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Gb;IAAc,CAC7B,CACD,eAEDN,KAAA,CAACjB,MAAM;MAACqC,OAAO,EAAG,CAAG;MAAAH,QAAA,gBACpBnB,IAAA,CAACb,MAAM;QAACoC,OAAO,EAAC,eAAe;QAAAJ,QAAA,eAC9BnB,IAAA,CAACJ,QAAQ;UAAC4B,KAAK,EAAG,CAAG;UAAAL,QAAA,EAAGtC,EAAE,CAAE,OAAQ;QAAC,CAAY;MAAC,CAC3C,CAAC,eACTmB,IAAA,CAACjB,SAAS;QAAC0C,UAAU;QAACC,WAAW;QAAAP,QAAA,EAC9BL,eAAe,CAACa,GAAG,CAClBV,IAAI,IACLA,IAAI,iBACHjB,IAAA,CAACL,cAAc;UAEdsB,IAAI,EAAGA;QAAM,GADPA,IAAI,CAACW,IAEX,CAEJ;MAAC,CACS,CAAC;IAAA,CACL,CAAC;EAAA,CACR,CACF;AAEH;AAEA,gBAAe,CAAE;EAAE,GAAGC;AAAM,CAAC,kBAC5B7B,IAAA,CAACR,mBAAmB;EAAA2B,QAAA,eACnBnB,IAAA,CAACO,QAAQ;IAAA,GAAMsB;EAAK,CAAI;AAAC,CACL,CACrB","ignoreList":[]}
|
|
@@ -18,6 +18,7 @@ import ScreenRoot from './screen-root';
|
|
|
18
18
|
import { useBlockHasGlobalStyles, default as ScreenBlockList } from './screen-block-list';
|
|
19
19
|
import ScreenBlock from './screen-block';
|
|
20
20
|
import ScreenTypography from './screen-typography';
|
|
21
|
+
import ScreenTypeset from './screen-typeset';
|
|
21
22
|
import ScreenTypographyElement from './screen-typography-element';
|
|
22
23
|
import FontSize from './font-sizes/font-size';
|
|
23
24
|
import FontSizes from './font-sizes/font-sizes';
|
|
@@ -276,6 +277,9 @@ function GlobalStylesUI() {
|
|
|
276
277
|
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
277
278
|
path: "/typography/font-sizes/:origin/:slug",
|
|
278
279
|
children: /*#__PURE__*/_jsx(FontSize, {})
|
|
280
|
+
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
281
|
+
path: "/typography/typeset",
|
|
282
|
+
children: /*#__PURE__*/_jsx(ScreenTypeset, {})
|
|
279
283
|
}), /*#__PURE__*/_jsx(GlobalStylesNavigationScreen, {
|
|
280
284
|
path: "/typography/text",
|
|
281
285
|
children: /*#__PURE__*/_jsx(ScreenTypographyElement, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypographyElement","FontSize","FontSizes","ScreenColors","ScreenColorPalette","ScreenShadows","ScreenShadowsEdit","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","goTo","loadCustomCSS","children","icon","label","toggleProps","size","onClose","onClick","disabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\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\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,IAAIC,sBAAsB,EACrCL,KAAK,IAAIM,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,SACCC,uBAAuB,EACvBC,OAAO,IAAIC,eAAe,QACpB,qBAAqB;AAC5B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,uBAAuB,MAAM,6BAA6B;AACjE,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,SAAS,MA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C,4BAA4B;MAACa,IAAI,EAAC,MAAM;MAAArB,QAAA,eACxC1B,IAAA,CAACL,SAAS,IAAE;IAAC,CACgB,CAAC,eAE/BK,IAAA,CAACkC,4BAA4B;MAACa,IAAI,EAAC,YAAY;MAAArB,QAAA,eAC9C1B,IAAA,CAACJ,eAAe,IAAE;IAAC,CACU,CAAC,EAE7BgF,MAAM,CAAChC,GAAG,CAAImC,KAAK,iBACpB/E,IAAA,CAACkC,4BAA4B;MAE5Ba,IAAI,EAAG,UAAU,GAAGW,kBAAkB,CAAEqB,KAAK,CAAC/B,IAAK,CAAG;MAAAtB,QAAA,eAEtD1B,IAAA,CAACjB,WAAW;QAACiE,IAAI,EAAG+B,KAAK,CAAC/B;MAAM,CAAE;IAAC,GAH7B,aAAa,GAAG+B,KAAK,CAAC/B,IAIC,CAC7B,CAAC,eAEHhD,IAAA,CAACkD,cAAc,IAAE,CAAC,EAEhB0B,MAAM,CAAChC,GAAG,CAAImC,KAAK,iBACpB/E,IAAA,CAACkD,cAAc;MAEdF,IAAI,EAAG+B,KAAK,CAAC/B,IAAM;MACnBP,UAAU,EAAG,UAAU,GAAGiB,kBAAkB,CAAEqB,KAAK,CAAC/B,IAAK;IAAG,GAFtD,gBAAgB,GAAG+B,KAAK,CAAC/B,IAG/B,CACA,CAAC,EAED,YAAY,KAAKwB,yBAAyB,iBAC3CxE,IAAA,CAACsD,qBAAqB,IAAE,CACxB,eAEDtD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAAC6D,qBAAqB,IAAE,CAAC,eACzB7D,IAAA,CAACuE,qCAAqC,IAAE,CAAC;EAAA,CACvB,CAAC;AAEtB;AACA,SAAS/D,oBAAoB;AAC7B,eAAemE,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","__experimentalUseNavigator","useNavigator","createSlotFill","DropdownMenu","MenuGroup","MenuItem","getBlockTypes","store","blocksStore","useSelect","useDispatch","privateApis","blockEditorPrivateApis","blockEditorStore","__","preferencesStore","moreVertical","coreStore","useEffect","ScreenRoot","useBlockHasGlobalStyles","default","ScreenBlockList","ScreenBlock","ScreenTypography","ScreenTypeset","ScreenTypographyElement","FontSize","FontSizes","ScreenColors","ScreenColorPalette","ScreenShadows","ScreenShadowsEdit","ScreenLayout","ScreenStyleVariations","StyleBook","ScreenCSS","ScreenRevisions","unlock","editSiteStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_FILL_NAME","useGlobalStylesReset","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","canReset","onReset","toggle","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","setEditorCanvasContainerView","goTo","loadCustomCSS","children","icon","label","toggleProps","size","onClose","onClick","disabled","GlobalStylesNavigationScreen","className","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","isRevisionsOpen","GlobalStylesUI","blocks","initialPath","element","block"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypeset from './screen-typeset';\nimport ScreenTypographyElement from './screen-typography-element';\nimport FontSize from './font-sizes/font-size';\nimport FontSizes from './font-sizes/font-sizes';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\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\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => {\n\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\tgoTo( '/css' );\n\t};\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\ttoggleProps={ { size: 'compact' } }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tonClose();\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{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset styles' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\tconst path = location?.path;\n\tconst isRevisionsOpen = path === '/revisions';\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tswitch ( editorCanvasContainerView ) {\n\t\t\tcase 'global-styles-revisions':\n\t\t\tcase 'global-styles-revisions:style-book':\n\t\t\t\tgoTo( '/revisions' );\n\t\t\t\tbreak;\n\t\t\tcase 'global-styles-css':\n\t\t\t\tgoTo( '/css' );\n\t\t\t\tbreak;\n\t\t\tcase 'style-book':\n\t\t\t\t/*\n\t\t\t\t * The stand-alone style book is open\n\t\t\t\t * and the revisions panel is open,\n\t\t\t\t * close the revisions panel.\n\t\t\t\t * Otherwise keep the style book open while\n\t\t\t\t * browsing global styles panel.\n\t\t\t\t */\n\t\t\t\tif ( isRevisionsOpen ) {\n\t\t\t\t\tgoTo( '/' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/*\n\t\t\t\t * Example: the user has navigated to \"Browse styles\" or elsewhere\n\t\t\t\t * and changes the editorCanvasContainerView, e.g., closes the style book.\n\t\t\t\t * The panel should not be affected.\n\t\t\t\t * Exclude revisions panel from this behavior,\n\t\t\t\t * as it should close when the editorCanvasContainerView doesn't correspond.\n\t\t\t\t */\n\t\t\t\tif ( path !== '/' && ! isRevisionsOpen ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tgoTo( '/' );\n\t\t\t\tbreak;\n\t\t}\n\t}, [ editorCanvasContainerView, isRevisionsOpen, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/\">\n\t\t\t\t<FontSizes />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/font-sizes/:origin/:slug\">\n\t\t\t\t<FontSize />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/typeset\">\n\t\t\t\t<ScreenTypeset />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows\">\n\t\t\t\t<ScreenShadows />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/shadows/edit/:category/:slug\">\n\t\t\t\t<ScreenShadowsEdit />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/revisions\">\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,EAChDC,0BAA0B,IAAIC,YAAY,EAC1CC,cAAc,EACdC,YAAY,EACZC,SAAS,EACTC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACvE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,IAAIC,sBAAsB,EACrCL,KAAK,IAAIM,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,SACCC,uBAAuB,EACvBC,OAAO,IAAIC,eAAe,QACpB,qBAAqB;AAC5B,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,uBAAuB,MAAM,6BAA6B;AACjE,OAAOC,QAAQ,MAAM,wBAAwB;AAC7C,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,kBAAkB;AACnE,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,OAAOC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AC,eAE/BK,IAAA,CAACkC,4BAA4B;MAACa,IAAI,EAAC,YAAY;MAAArB,QAAA,eAC9C1B,IAAA,CAACJ,eAAe,IAAE;IAAC,CACU,CAAC,EAE7BgF,MAAM,CAAChC,GAAG,CAAImC,KAAK,iBACpB/E,IAAA,CAACkC,4BAA4B;MAE5Ba,IAAI,EAAG,UAAU,GAAGW,kBAAkB,CAAEqB,KAAK,CAAC/B,IAAK,CAAG;MAAAtB,QAAA,eAEtD1B,IAAA,CAAClB,WAAW;QAACkE,IAAI,EAAG+B,KAAK,CAAC/B;MAAM,CAAE;IAAC,GAH7B,aAAa,GAAG+B,KAAK,CAAC/B,IAIC,CAC7B,CAAC,eAEHhD,IAAA,CAACkD,cAAc,IAAE,CAAC,EAEhB0B,MAAM,CAAChC,GAAG,CAAImC,KAAK,iBACpB/E,IAAA,CAACkD,cAAc;MAEdF,IAAI,EAAG+B,KAAK,CAAC/B,IAAM;MACnBP,UAAU,EAAG,UAAU,GAAGiB,kBAAkB,CAAEqB,KAAK,CAAC/B,IAAK;IAAG,GAFtD,gBAAgB,GAAG+B,KAAK,CAAC/B,IAG/B,CACA,CAAC,EAED,YAAY,KAAKwB,yBAAyB,iBAC3CxE,IAAA,CAACsD,qBAAqB,IAAE,CACxB,eAEDtD,IAAA,CAACW,sBAAsB,IAAE,CAAC,eAC1BX,IAAA,CAAC6D,qBAAqB,IAAE,CAAC,eACzB7D,IAAA,CAACuE,qCAAqC,IAAE,CAAC;EAAA,CACvB,CAAC;AAEtB;AACA,SAAS/D,oBAAoB;AAC7B,eAAemE,cAAc","ignoreList":[]}
|
|
@@ -46,7 +46,16 @@ function getFontFamilyFromSetting(fontFamilies, setting) {
|
|
|
46
46
|
return fontFamilies.find(fontFamily => fontFamily.slug === fontFamilySlug);
|
|
47
47
|
}
|
|
48
48
|
export function getFontFamilies(themeJson) {
|
|
49
|
-
const
|
|
49
|
+
const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme;
|
|
50
|
+
const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom;
|
|
51
|
+
let fontFamilies = [];
|
|
52
|
+
if (themeFontFamilies && customFontFamilies) {
|
|
53
|
+
fontFamilies = [...themeFontFamilies, ...customFontFamilies];
|
|
54
|
+
} else if (themeFontFamilies) {
|
|
55
|
+
fontFamilies = themeFontFamilies;
|
|
56
|
+
} else if (customFontFamilies) {
|
|
57
|
+
fontFamilies = customFontFamilies;
|
|
58
|
+
}
|
|
50
59
|
const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
|
|
51
60
|
const bodyFontFamily = getFontFamilyFromSetting(fontFamilies, bodyFontFamilySetting);
|
|
52
61
|
const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getVariationClassName","variation","getNewIndexFromPresets","presets","slugPrefix","nameRegex","RegExp","highestPresetValue","reduce","currentHighest","preset","slug","matches","match","id","parseInt","getFontFamilyFromSetting","fontFamilies","setting","Array","isArray","fontFamilyVariable","replace","fontFamilySlug","split","slice","find","fontFamily","getFontFamilies","themeJson","settings","typography","theme","bodyFontFamilySetting","styles","bodyFontFamily","headingFontFamilySetting","elements","heading","headingFontFamily"],"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"sourcesContent":["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param {Array} presets The array of preset objects, each potentially containing a slug property.\n * @param {string} slugPrefix The prefix to look for in the preset slugs.\n *\n * @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\nexport function getNewIndexFromPresets( presets, slugPrefix ) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\nfunction getFontFamilyFromSetting( fontFamilies, setting ) {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\nexport function getFontFamilies( themeJson ) {\n\tconst fontFamilies
|
|
1
|
+
{"version":3,"names":["getVariationClassName","variation","getNewIndexFromPresets","presets","slugPrefix","nameRegex","RegExp","highestPresetValue","reduce","currentHighest","preset","slug","matches","match","id","parseInt","getFontFamilyFromSetting","fontFamilies","setting","Array","isArray","fontFamilyVariable","replace","fontFamilySlug","split","slice","find","fontFamily","getFontFamilies","themeJson","themeFontFamilies","settings","typography","theme","customFontFamilies","custom","bodyFontFamilySetting","styles","bodyFontFamily","headingFontFamilySetting","elements","heading","headingFontFamily"],"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"sourcesContent":["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param {Array} presets The array of preset objects, each potentially containing a slug property.\n * @param {string} slugPrefix The prefix to look for in the preset slugs.\n *\n * @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\nexport function getNewIndexFromPresets( presets, slugPrefix ) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\nfunction getFontFamilyFromSetting( fontFamilies, setting ) {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\nexport function getFontFamilies( themeJson ) {\n\tconst themeFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.theme;\n\tconst customFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.custom;\n\n\tlet fontFamilies = [];\n\tif ( themeFontFamilies && customFontFamilies ) {\n\t\tfontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];\n\t} else if ( themeFontFamilies ) {\n\t\tfontFamilies = themeFontFamilies;\n\t} else if ( customFontFamilies ) {\n\t\tfontFamilies = customFontFamilies;\n\t}\n\tconst bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;\n\tconst bodyFontFamily = getFontFamilyFromSetting(\n\t\tfontFamilies,\n\t\tbodyFontFamilySetting\n\t);\n\n\tconst headingFontFamilySetting =\n\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily;\n\n\tlet headingFontFamily;\n\tif ( ! headingFontFamilySetting ) {\n\t\theadingFontFamily = bodyFontFamily;\n\t} else {\n\t\theadingFontFamily = getFontFamilyFromSetting(\n\t\t\tfontFamilies,\n\t\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily\n\t\t);\n\t}\n\n\treturn [ bodyFontFamily, headingFontFamily ];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,qBAAqBA,CAAEC,SAAS,EAAG;EAClD,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,EAAE;EACV;EACA,OAAQ,YAAYA,SAAW,EAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAEC,OAAO,EAAEC,UAAU,EAAG;EAC7D,MAAMC,SAAS,GAAG,IAAIC,MAAM,CAAG,IAAIF,UAAY,WAAW,CAAC;EAC3D,MAAMG,kBAAkB,GAAGJ,OAAO,CAACK,MAAM,CAAE,CAAEC,cAAc,EAAEC,MAAM,KAAM;IACxE,IAAK,OAAOA,MAAM,EAAEC,IAAI,KAAK,QAAQ,EAAG;MACvC,MAAMC,OAAO,GAAGF,MAAM,EAAEC,IAAI,CAACE,KAAK,CAAER,SAAU,CAAC;MAC/C,IAAKO,OAAO,EAAG;QACd,MAAME,EAAE,GAAGC,QAAQ,CAAEH,OAAO,CAAE,CAAC,CAAE,EAAE,EAAG,CAAC;QACvC,IAAKE,EAAE,GAAGL,cAAc,EAAG;UAC1B,OAAOK,EAAE;QACV;MACD;IACD;IACA,OAAOL,cAAc;EACtB,CAAC,EAAE,CAAE,CAAC;EACN,OAAOF,kBAAkB,GAAG,CAAC;AAC9B;AAEA,SAASS,wBAAwBA,CAAEC,YAAY,EAAEC,OAAO,EAA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AAiB;EACrB,IAAK,CAAEH,wBAAwB,EAAG;IACjCG,iBAAiB,GAAGJ,cAAc;EACnC,CAAC,MAAM;IACNI,iBAAiB,GAAG1B,wBAAwB,CAC3CC,YAAY,EACZY,SAAS,EAAEQ,MAAM,EAAEG,QAAQ,EAAEC,OAAO,EAAET,UAAU,EAAEL,UACnD,CAAC;EACF;EAEA,OAAO,CAAEW,cAAc,EAAEI,iBAAiB,CAAE;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { __experimentalHStack as HStack, Button, Tooltip, Flex } from '@wordpress/components';
|
|
10
|
+
import { __, _x } from '@wordpress/i18n';
|
|
11
|
+
import { useState, useMemo, useId } from '@wordpress/element';
|
|
12
|
+
import { BlockPreview, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
13
|
+
import { Icon, lockSmall } from '@wordpress/icons';
|
|
14
|
+
import { parse } from '@wordpress/blocks';
|
|
15
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
import { Async } from '../async';
|
|
21
|
+
import { PATTERN_TYPES, TEMPLATE_PART_POST_TYPE, PATTERN_SYNC_TYPES, OPERATOR_IS } from '../../utils/constants';
|
|
22
|
+
import { unlock } from '../../lock-unlock';
|
|
23
|
+
import { useLink } from '../routes/link';
|
|
24
|
+
import { useAddedBy } from '../page-templates/hooks';
|
|
25
|
+
import { defaultGetTitle } from './search-items';
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
const {
|
|
29
|
+
useGlobalStyle
|
|
30
|
+
} = unlock(blockEditorPrivateApis);
|
|
31
|
+
function PreviewWrapper({
|
|
32
|
+
item,
|
|
33
|
+
onClick,
|
|
34
|
+
ariaDescribedBy,
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
37
|
+
return /*#__PURE__*/_jsx("button", {
|
|
38
|
+
className: "page-patterns-preview-field__button",
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: item.type !== PATTERN_TYPES.theme ? onClick : undefined,
|
|
41
|
+
"aria-label": item.title,
|
|
42
|
+
"aria-describedby": ariaDescribedBy,
|
|
43
|
+
"aria-disabled": item.type === PATTERN_TYPES.theme,
|
|
44
|
+
children: children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function PreviewField({
|
|
48
|
+
item
|
|
49
|
+
}) {
|
|
50
|
+
const descriptionId = useId();
|
|
51
|
+
const description = item.description || item?.excerpt?.raw;
|
|
52
|
+
const isUserPattern = item.type === PATTERN_TYPES.user;
|
|
53
|
+
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
|
|
54
|
+
const [backgroundColor] = useGlobalStyle('color.background');
|
|
55
|
+
const {
|
|
56
|
+
onClick
|
|
57
|
+
} = useLink({
|
|
58
|
+
postType: item.type,
|
|
59
|
+
postId: isUserPattern || isTemplatePart ? item.id : item.name,
|
|
60
|
+
canvas: 'edit'
|
|
61
|
+
});
|
|
62
|
+
const blocks = useMemo(() => {
|
|
63
|
+
var _item$blocks;
|
|
64
|
+
return (_item$blocks = item.blocks) !== null && _item$blocks !== void 0 ? _item$blocks : parse(item.content.raw, {
|
|
65
|
+
__unstableSkipMigrationLogs: true
|
|
66
|
+
});
|
|
67
|
+
}, [item?.content?.raw, item.blocks]);
|
|
68
|
+
const isEmpty = !blocks?.length;
|
|
69
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
70
|
+
className: "page-patterns-preview-field",
|
|
71
|
+
style: {
|
|
72
|
+
backgroundColor
|
|
73
|
+
},
|
|
74
|
+
children: [/*#__PURE__*/_jsxs(PreviewWrapper, {
|
|
75
|
+
item: item,
|
|
76
|
+
onClick: onClick,
|
|
77
|
+
ariaDescribedBy: !!description ? descriptionId : undefined,
|
|
78
|
+
children: [isEmpty && isTemplatePart && __('Empty template part'), isEmpty && !isTemplatePart && __('Empty pattern'), !isEmpty && /*#__PURE__*/_jsx(Async, {
|
|
79
|
+
children: /*#__PURE__*/_jsx(BlockPreview, {
|
|
80
|
+
blocks: blocks,
|
|
81
|
+
viewportWidth: item.viewportWidth
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
}), !!description && /*#__PURE__*/_jsx("div", {
|
|
85
|
+
hidden: true,
|
|
86
|
+
id: descriptionId,
|
|
87
|
+
children: description
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
export const previewField = {
|
|
92
|
+
label: __('Preview'),
|
|
93
|
+
id: 'preview',
|
|
94
|
+
render: PreviewField,
|
|
95
|
+
enableSorting: false
|
|
96
|
+
};
|
|
97
|
+
function TitleField({
|
|
98
|
+
item
|
|
99
|
+
}) {
|
|
100
|
+
const isUserPattern = item.type === PATTERN_TYPES.user;
|
|
101
|
+
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
|
|
102
|
+
const {
|
|
103
|
+
onClick
|
|
104
|
+
} = useLink({
|
|
105
|
+
postType: item.type,
|
|
106
|
+
postId: isUserPattern || isTemplatePart ? item.id : item.name,
|
|
107
|
+
canvas: 'edit'
|
|
108
|
+
});
|
|
109
|
+
const title = decodeEntities(defaultGetTitle(item));
|
|
110
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
111
|
+
alignment: "center",
|
|
112
|
+
justify: "flex-start",
|
|
113
|
+
spacing: 2,
|
|
114
|
+
children: [/*#__PURE__*/_jsx(Flex, {
|
|
115
|
+
as: "div",
|
|
116
|
+
gap: 0,
|
|
117
|
+
justify: "left",
|
|
118
|
+
className: "edit-site-patterns__pattern-title",
|
|
119
|
+
children: item.type === PATTERN_TYPES.theme ? title : /*#__PURE__*/_jsx(Button, {
|
|
120
|
+
variant: "link",
|
|
121
|
+
onClick: onClick
|
|
122
|
+
// Required for the grid's roving tab index system.
|
|
123
|
+
// See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243.
|
|
124
|
+
,
|
|
125
|
+
tabIndex: "-1",
|
|
126
|
+
children: title
|
|
127
|
+
})
|
|
128
|
+
}), item.type === PATTERN_TYPES.theme && /*#__PURE__*/_jsx(Tooltip, {
|
|
129
|
+
placement: "top",
|
|
130
|
+
text: __('This pattern cannot be edited.'),
|
|
131
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
132
|
+
className: "edit-site-patterns__pattern-lock-icon",
|
|
133
|
+
icon: lockSmall,
|
|
134
|
+
size: 24
|
|
135
|
+
})
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export const titleField = {
|
|
140
|
+
label: __('Title'),
|
|
141
|
+
id: 'title',
|
|
142
|
+
getValue: ({
|
|
143
|
+
item
|
|
144
|
+
}) => item.title?.raw || item.title,
|
|
145
|
+
render: TitleField,
|
|
146
|
+
enableHiding: false
|
|
147
|
+
};
|
|
148
|
+
const SYNC_FILTERS = [{
|
|
149
|
+
value: PATTERN_SYNC_TYPES.full,
|
|
150
|
+
label: _x('Synced', 'pattern (singular)'),
|
|
151
|
+
description: __('Patterns that are kept in sync across the site.')
|
|
152
|
+
}, {
|
|
153
|
+
value: PATTERN_SYNC_TYPES.unsynced,
|
|
154
|
+
label: _x('Not synced', 'pattern (singular)'),
|
|
155
|
+
description: __('Patterns that can be changed freely without affecting the site.')
|
|
156
|
+
}];
|
|
157
|
+
export const patternStatusField = {
|
|
158
|
+
label: __('Sync status'),
|
|
159
|
+
id: 'sync-status',
|
|
160
|
+
render: ({
|
|
161
|
+
item
|
|
162
|
+
}) => {
|
|
163
|
+
const syncStatus = 'wp_pattern_sync_status' in item ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full : PATTERN_SYNC_TYPES.unsynced;
|
|
164
|
+
// User patterns can have their sync statuses checked directly.
|
|
165
|
+
// Non-user patterns are all unsynced for the time being.
|
|
166
|
+
return /*#__PURE__*/_jsx("span", {
|
|
167
|
+
className: `edit-site-patterns__field-sync-status-${syncStatus}`,
|
|
168
|
+
children: SYNC_FILTERS.find(({
|
|
169
|
+
value
|
|
170
|
+
}) => value === syncStatus).label
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
elements: SYNC_FILTERS,
|
|
174
|
+
filterBy: {
|
|
175
|
+
operators: [OPERATOR_IS],
|
|
176
|
+
isPrimary: true
|
|
177
|
+
},
|
|
178
|
+
enableSorting: false
|
|
179
|
+
};
|
|
180
|
+
function AuthorField({
|
|
181
|
+
item
|
|
182
|
+
}) {
|
|
183
|
+
const [isImageLoaded, setIsImageLoaded] = useState(false);
|
|
184
|
+
const {
|
|
185
|
+
text,
|
|
186
|
+
icon,
|
|
187
|
+
imageUrl
|
|
188
|
+
} = useAddedBy(item.type, item.id);
|
|
189
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
190
|
+
alignment: "left",
|
|
191
|
+
spacing: 0,
|
|
192
|
+
children: [imageUrl && /*#__PURE__*/_jsx("div", {
|
|
193
|
+
className: clsx('page-templates-author-field__avatar', {
|
|
194
|
+
'is-loaded': isImageLoaded
|
|
195
|
+
}),
|
|
196
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
197
|
+
onLoad: () => setIsImageLoaded(true),
|
|
198
|
+
alt: "",
|
|
199
|
+
src: imageUrl
|
|
200
|
+
})
|
|
201
|
+
}), !imageUrl && /*#__PURE__*/_jsx("div", {
|
|
202
|
+
className: "page-templates-author-field__icon",
|
|
203
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
204
|
+
icon: icon
|
|
205
|
+
})
|
|
206
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
207
|
+
className: "page-templates-author-field__name",
|
|
208
|
+
children: text
|
|
209
|
+
})]
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
export const templatePartAuthorField = {
|
|
213
|
+
label: __('Author'),
|
|
214
|
+
id: 'author',
|
|
215
|
+
getValue: ({
|
|
216
|
+
item
|
|
217
|
+
}) => item.author_text,
|
|
218
|
+
render: AuthorField,
|
|
219
|
+
filterBy: {
|
|
220
|
+
isPrimary: true
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clsx","__experimentalHStack","HStack","Button","Tooltip","Flex","__","_x","useState","useMemo","useId","BlockPreview","privateApis","blockEditorPrivateApis","Icon","lockSmall","parse","decodeEntities","Async","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","OPERATOR_IS","unlock","useLink","useAddedBy","defaultGetTitle","jsx","_jsx","jsxs","_jsxs","useGlobalStyle","PreviewWrapper","item","onClick","ariaDescribedBy","children","className","type","theme","undefined","title","PreviewField","descriptionId","description","excerpt","raw","isUserPattern","user","isTemplatePart","backgroundColor","postType","postId","id","name","canvas","blocks","_item$blocks","content","__unstableSkipMigrationLogs","isEmpty","length","style","viewportWidth","hidden","previewField","label","render","enableSorting","TitleField","alignment","justify","spacing","as","gap","variant","tabIndex","placement","text","icon","size","titleField","getValue","enableHiding","SYNC_FILTERS","value","full","unsynced","patternStatusField","syncStatus","wp_pattern_sync_status","find","elements","filterBy","operators","isPrimary","AuthorField","isImageLoaded","setIsImageLoaded","imageUrl","onLoad","alt","src","templatePartAuthorField","author_text"],"sources":["@wordpress/edit-site/src/components/page-patterns/fields.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTooltip,\n\tFlex,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useState, useMemo, useId } from '@wordpress/element';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Icon, lockSmall } from '@wordpress/icons';\nimport { parse } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { Async } from '../async';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tOPERATOR_IS,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useLink } from '../routes/link';\nimport { useAddedBy } from '../page-templates/hooks';\nimport { defaultGetTitle } from './search-items';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction PreviewWrapper( { item, onClick, ariaDescribedBy, children } ) {\n\treturn (\n\t\t<button\n\t\t\tclassName=\"page-patterns-preview-field__button\"\n\t\t\ttype=\"button\"\n\t\t\tonClick={ item.type !== PATTERN_TYPES.theme ? onClick : undefined }\n\t\t\taria-label={ item.title }\n\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\taria-disabled={ item.type === PATTERN_TYPES.theme }\n\t\t>\n\t\t\t{ children }\n\t\t</button>\n\t);\n}\n\nfunction PreviewField( { item } ) {\n\tconst descriptionId = useId();\n\tconst description = item.description || item?.excerpt?.raw;\n\tconst isUserPattern = item.type === PATTERN_TYPES.user;\n\tconst isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst { onClick } = useLink( {\n\t\tpostType: item.type,\n\t\tpostId: isUserPattern || isTemplatePart ? item.id : item.name,\n\t\tcanvas: 'edit',\n\t} );\n\tconst blocks = useMemo( () => {\n\t\treturn (\n\t\t\titem.blocks ??\n\t\t\tparse( item.content.raw, {\n\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t} )\n\t\t);\n\t}, [ item?.content?.raw, item.blocks ] );\n\tconst isEmpty = ! blocks?.length;\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"page-patterns-preview-field\"\n\t\t\tstyle={ { backgroundColor } }\n\t\t>\n\t\t\t<PreviewWrapper\n\t\t\t\titem={ item }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tariaDescribedBy={ !! description ? descriptionId : undefined }\n\t\t\t>\n\t\t\t\t{ isEmpty && isTemplatePart && __( 'Empty template part' ) }\n\t\t\t\t{ isEmpty && ! isTemplatePart && __( 'Empty pattern' ) }\n\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t<Async>\n\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\tviewportWidth={ item.viewportWidth }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Async>\n\t\t\t\t) }\n\t\t\t</PreviewWrapper>\n\t\t\t{ !! description && (\n\t\t\t\t<div hidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n\nfunction TitleField( { item } ) {\n\tconst isUserPattern = item.type === PATTERN_TYPES.user;\n\tconst isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;\n\tconst { onClick } = useLink( {\n\t\tpostType: item.type,\n\t\tpostId: isUserPattern || isTemplatePart ? item.id : item.name,\n\t\tcanvas: 'edit',\n\t} );\n\tconst title = decodeEntities( defaultGetTitle( item ) );\n\treturn (\n\t\t<HStack alignment=\"center\" justify=\"flex-start\" spacing={ 2 }>\n\t\t\t<Flex\n\t\t\t\tas=\"div\"\n\t\t\t\tgap={ 0 }\n\t\t\t\tjustify=\"left\"\n\t\t\t\tclassName=\"edit-site-patterns__pattern-title\"\n\t\t\t>\n\t\t\t\t{ item.type === PATTERN_TYPES.theme ? (\n\t\t\t\t\ttitle\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t// Required for the grid's roving tab index system.\n\t\t\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243.\n\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</Flex>\n\t\t\t{ item.type === PATTERN_TYPES.theme && (\n\t\t\t\t<Tooltip\n\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\ttext={ __( 'This pattern cannot be edited.' ) }\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-patterns__pattern-lock-icon\"\n\t\t\t\t\t\ticon={ lockSmall }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n\nexport const titleField = {\n\tlabel: __( 'Title' ),\n\tid: 'title',\n\tgetValue: ( { item } ) => item.title?.raw || item.title,\n\trender: TitleField,\n\tenableHiding: false,\n};\n\nconst SYNC_FILTERS = [\n\t{\n\t\tvalue: PATTERN_SYNC_TYPES.full,\n\t\tlabel: _x( 'Synced', 'pattern (singular)' ),\n\t\tdescription: __( 'Patterns that are kept in sync across the site.' ),\n\t},\n\t{\n\t\tvalue: PATTERN_SYNC_TYPES.unsynced,\n\t\tlabel: _x( 'Not synced', 'pattern (singular)' ),\n\t\tdescription: __(\n\t\t\t'Patterns that can be changed freely without affecting the site.'\n\t\t),\n\t},\n];\n\nexport const patternStatusField = {\n\tlabel: __( 'Sync status' ),\n\tid: 'sync-status',\n\trender: ( { item } ) => {\n\t\tconst syncStatus =\n\t\t\t'wp_pattern_sync_status' in item\n\t\t\t\t? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full\n\t\t\t\t: PATTERN_SYNC_TYPES.unsynced;\n\t\t// User patterns can have their sync statuses checked directly.\n\t\t// Non-user patterns are all unsynced for the time being.\n\t\treturn (\n\t\t\t<span\n\t\t\t\tclassName={ `edit-site-patterns__field-sync-status-${ syncStatus }` }\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\tSYNC_FILTERS.find( ( { value } ) => value === syncStatus )\n\t\t\t\t\t\t.label\n\t\t\t\t}\n\t\t\t</span>\n\t\t);\n\t},\n\telements: SYNC_FILTERS,\n\tfilterBy: {\n\t\toperators: [ OPERATOR_IS ],\n\t\tisPrimary: true,\n\t},\n\tenableSorting: false,\n};\n\nfunction AuthorField( { item } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport const templatePartAuthorField = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\tgetValue: ( { item } ) => item.author_text,\n\trender: AuthorField,\n\tfilterBy: {\n\t\tisPrimary: true,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,OAAO,EACPC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,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