@wordpress/block-editor 12.10.1 → 12.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/build/components/block-patterns-list/index.js +2 -2
  2. package/build/components/block-patterns-list/index.js.map +1 -1
  3. package/build/components/block-patterns-paging/index.js +1 -1
  4. package/build/components/block-patterns-paging/index.js.map +1 -1
  5. package/build/components/global-styles/hooks.js +1 -1
  6. package/build/components/global-styles/hooks.js.map +1 -1
  7. package/build/components/global-styles/use-global-styles-output.js +17 -5
  8. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  9. package/build/components/global-styles/utils.js +22 -0
  10. package/build/components/global-styles/utils.js.map +1 -1
  11. package/build/components/inserter/block-patterns-explorer/patterns-list.js +3 -3
  12. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  13. package/build/components/inserter/block-patterns-tab.js +1 -1
  14. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  15. package/build/components/inserter/search-results.js +1 -1
  16. package/build/components/inserter/search-results.js.map +1 -1
  17. package/build/components/link-control/search-item.js +36 -1
  18. package/build/components/link-control/search-item.js.map +1 -1
  19. package/build/components/tool-selector/index.js +2 -1
  20. package/build/components/tool-selector/index.js.map +1 -1
  21. package/build/hooks/block-rename-ui.js +5 -2
  22. package/build/hooks/block-rename-ui.js.map +1 -1
  23. package/build-module/components/block-patterns-list/index.js +2 -2
  24. package/build-module/components/block-patterns-list/index.js.map +1 -1
  25. package/build-module/components/block-patterns-paging/index.js +1 -1
  26. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  27. package/build-module/components/global-styles/hooks.js +1 -1
  28. package/build-module/components/global-styles/hooks.js.map +1 -1
  29. package/build-module/components/global-styles/use-global-styles-output.js +17 -6
  30. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  31. package/build-module/components/global-styles/utils.js +21 -0
  32. package/build-module/components/global-styles/utils.js.map +1 -1
  33. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +4 -4
  34. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  35. package/build-module/components/inserter/block-patterns-tab.js +1 -1
  36. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  37. package/build-module/components/inserter/search-results.js +1 -1
  38. package/build-module/components/inserter/search-results.js.map +1 -1
  39. package/build-module/components/link-control/search-item.js +37 -2
  40. package/build-module/components/link-control/search-item.js.map +1 -1
  41. package/build-module/components/tool-selector/index.js +2 -1
  42. package/build-module/components/tool-selector/index.js.map +1 -1
  43. package/build-module/hooks/block-rename-ui.js +5 -2
  44. package/build-module/hooks/block-rename-ui.js.map +1 -1
  45. package/build-style/style-rtl.css +1 -0
  46. package/build-style/style.css +1 -0
  47. package/package.json +32 -32
  48. package/src/components/block-patterns-list/index.js +2 -4
  49. package/src/components/block-patterns-paging/index.js +57 -54
  50. package/src/components/global-styles/hooks.js +1 -1
  51. package/src/components/global-styles/test/use-global-styles-output.js +39 -0
  52. package/src/components/global-styles/use-global-styles-output.js +26 -6
  53. package/src/components/global-styles/utils.js +21 -0
  54. package/src/components/inserter/block-patterns-explorer/patterns-list.js +11 -9
  55. package/src/components/inserter/block-patterns-tab.js +1 -1
  56. package/src/components/inserter/search-results.js +1 -1
  57. package/src/components/inserter/style.scss +1 -0
  58. package/src/components/link-control/search-item.js +55 -2
  59. package/src/components/tool-selector/index.js +1 -1
  60. package/src/hooks/block-rename-ui.js +14 -10
@@ -128,7 +128,7 @@ function BlockPatternList({
128
128
  onHover,
129
129
  onClickPattern,
130
130
  orientation,
131
- label = (0, _i18n.__)('Block Patterns'),
131
+ label = (0, _i18n.__)('Block patterns'),
132
132
  showTitlesAsTooltip,
133
133
  pagingProps
134
134
  }, ref) {
@@ -154,7 +154,7 @@ function BlockPatternList({
154
154
  }) : (0, _element.createElement)(BlockPatternPlaceholder, {
155
155
  key: pattern.name
156
156
  });
157
- }), pagingProps && pagingProps.numPages > 1 && (0, _element.createElement)(_blockPatternsPaging.default, {
157
+ }), pagingProps && (0, _element.createElement)(_blockPatternsPaging.default, {
158
158
  ...pagingProps
159
159
  }));
160
160
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_components","_compose","_i18n","_icons","_blockPreview","_inserterDraggableBlocks","_blockPatternsPaging","WithToolTip","showTooltip","title","children","createElement","Tooltip","text","Fragment","BlockPattern","isDraggable","pattern","onClick","onHover","composite","isDragging","setIsDragging","useState","blocks","viewportWidth","instanceId","useInstanceId","descriptionId","default","isEnabled","isPattern","draggable","onDragStart","onDragEnd","className","event","id","__unstableCompositeItem","role","as","classnames","syncStatus","onMouseEnter","onMouseLeave","description","undefined","__experimentalHStack","Icon","icon","symbol","VisuallyHidden","BlockPatternPlaceholder","BlockPatternList","blockPatterns","shownPatterns","onClickPattern","orientation","label","__","showTitlesAsTooltip","pagingProps","ref","useCompositeState","__unstableComposite","map","isShown","includes","key","name","numPages","_default","forwardRef","exports"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, forwardRef } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n\tTooltip,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tcomposite,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tisPattern={ !! pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={ showTooltip && ! pattern.id }\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t\t{ ...composite }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\tpattern.id && ! pattern.syncStatus,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t{ pattern.id && ! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ( ! showTooltip || pattern.id ) && (\n\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</HStack>\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block Patterns' ),\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst composite = useCompositeState( { orientation } );\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && pagingProps.numPages > 1 && (\n\t\t\t\t<BlockPatternsPaging { ...pagingProps } />\n\t\t\t) }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternList );\n"],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AiB,EAAE;IAAEN;EAAY,CAAE,CAAC;EACtD,OACC,IAAA7D,QAAA,CAAAe,aAAA,EAACX,WAAA,CAAAgE,mBAAS;IAAA,GACJ5C,SAAS;IACdmB,IAAI,EAAC,SAAS;IACdJ,SAAS,EAAC,kCAAkC;IAC5C,cAAauB,KAAO;IACpBI,GAAG,EAAGA;EAAK,GAETR,aAAa,CAACW,GAAG,CAAIhD,OAAO,IAAM;IACnC,MAAMiD,OAAO,GAAGX,aAAa,CAACY,QAAQ,CAAElD,OAAQ,CAAC;IACjD,OAAOiD,OAAO,GACb,IAAAtE,QAAA,CAAAe,aAAA,EAACI,YAAY;MACZqD,GAAG,EAAGnD,OAAO,CAACoD,IAAM;MACpBpD,OAAO,EAAGA,OAAS;MACnBC,OAAO,EAAGsC,cAAgB;MAC1BrC,OAAO,EAAGA,OAAS;MACnBH,WAAW,EAAGA,WAAa;MAC3BI,SAAS,EAAGA,SAAW;MACvBZ,WAAW,EAAGoD;IAAqB,CACnC,CAAC,GAEF,IAAAhE,QAAA,CAAAe,aAAA,EAACyC,uBAAuB;MAACgB,GAAG,EAAGnD,OAAO,CAACoD;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDR,WAAW,IAAIA,WAAW,CAACS,QAAQ,GAAG,CAAC,IACxC,IAAA1E,QAAA,CAAAe,aAAA,EAACL,oBAAA,CAAAuB,OAAmB;IAAA,GAAMgC;EAAW,CAAI,CAEhC,CAAC;AAEd;AAAC,IAAAU,QAAA,GAEc,IAAAC,mBAAU,EAAEnB,gBAAiB,CAAC;AAAAoB,OAAA,CAAA5C,OAAA,GAAA0C,QAAA"}
1
+ {"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_components","_compose","_i18n","_icons","_blockPreview","_inserterDraggableBlocks","_blockPatternsPaging","WithToolTip","showTooltip","title","children","createElement","Tooltip","text","Fragment","BlockPattern","isDraggable","pattern","onClick","onHover","composite","isDragging","setIsDragging","useState","blocks","viewportWidth","instanceId","useInstanceId","descriptionId","default","isEnabled","isPattern","draggable","onDragStart","onDragEnd","className","event","id","__unstableCompositeItem","role","as","classnames","syncStatus","onMouseEnter","onMouseLeave","description","undefined","__experimentalHStack","Icon","icon","symbol","VisuallyHidden","BlockPatternPlaceholder","BlockPatternList","blockPatterns","shownPatterns","onClickPattern","orientation","label","__","showTitlesAsTooltip","pagingProps","ref","useCompositeState","__unstableComposite","map","isShown","includes","key","name","_default","forwardRef","exports"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, forwardRef } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n\tTooltip,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tcomposite,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tisPattern={ !! pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={ showTooltip && ! pattern.id }\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t\t{ ...composite }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\tpattern.id && ! pattern.syncStatus,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t{ pattern.id && ! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ( ! showTooltip || pattern.id ) && (\n\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</HStack>\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block patterns' ),\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst composite = useCompositeState( { orientation } );\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternList );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AALA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,wBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,oBAAA,GAAAP,sBAAA,CAAAF,OAAA;AA1BA;AAC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,CAAAe,aAAA,EAACI,YAAY;MACZqD,GAAG,EAAGnD,OAAO,CAACoD,IAAM;MACpBpD,OAAO,EAAGA,OAAS;MACnBC,OAAO,EAAGsC,cAAgB;MAC1BrC,OAAO,EAAGA,OAAS;MACnBH,WAAW,EAAGA,WAAa;MAC3BI,SAAS,EAAGA,SAAW;MACvBZ,WAAW,EAAGoD;IAAqB,CACnC,CAAC,GAEF,IAAAhE,QAAA,CAAAe,aAAA,EAACyC,uBAAuB;MAACgB,GAAG,EAAGnD,OAAO,CAACoD;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDR,WAAW,IAAI,IAAAjE,QAAA,CAAAe,aAAA,EAACL,oBAAA,CAAAuB,OAAmB;IAAA,GAAMgC;EAAW,CAAI,CAChD,CAAC;AAEd;AAAC,IAAAS,QAAA,GAEc,IAAAC,mBAAU,EAAElB,gBAAiB,CAAC;AAAAmB,OAAA,CAAA3C,OAAA,GAAAyC,QAAA"}
@@ -25,7 +25,7 @@ function Pagination({
25
25
  // translators: %s: Total number of patterns.
26
26
  (0, _i18n.sprintf)(
27
27
  // translators: %s: Total number of patterns.
28
- (0, _i18n._n)('%s item', '%s items', totalItems), totalItems)), (0, _element.createElement)(_components.__experimentalHStack, {
28
+ (0, _i18n._n)('%s item', '%s items', totalItems), totalItems)), numPages > 1 && (0, _element.createElement)(_components.__experimentalHStack, {
29
29
  expanded: false,
30
30
  spacing: 3,
31
31
  justify: "flex-start",
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","Pagination","currentPage","numPages","changePage","totalItems","_element","createElement","__experimentalVStack","className","__experimentalText","variant","sprintf","_n","__experimentalHStack","expanded","spacing","justify","Button","onClick","disabled","__","_x","size"],"sources":["@wordpress/block-editor/src/components/block-patterns-paging/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-patterns__grid-pagination-wrapper\">\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\t\ttotalItems\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Text>\n\t\t\t<HStack\n\t\t\t\texpanded={ false }\n\t\t\t\tspacing={ 3 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"block-editor-patterns__grid-pagination\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\texpanded={ false }\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-previous\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>«</span>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>‹</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %1$s: Current page number, %2$s: Total number of pages.\n\t\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\t\tcurrentPage,\n\t\t\t\t\t\tnumPages\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t<HStack\n\t\t\t\t\texpanded={ false }\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-next\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>›</span>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\taria-label={ __( 'Last page' ) }\n\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>»</span>\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AATA;AACA;AACA;;AASe,SAASE,UAAUA,CAAE;EACnCC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,oBAAM;IAACC,SAAS,EAAC;EAAgD,GACjE,IAAAH,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,kBAAI;IAACC,OAAO,EAAC;EAAO;EAEnB;EACA,IAAAC,aAAO;EACN;EACA,IAAAC,QAAE,EAAE,SAAS,EAAE,UAAU,EAAER,UAAW,CAAC,EACvCA,UACD,CAEI,CAAC,EACP,IAAAC,QAAA,CAAAC,aAAA,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CAAAoB,MAAM;IACNP,OAAO,EAAC,UAAU;IAClBQ,OAAO,EAAGA,CAAA,KAAMf,UAAU,CAAEF,WAAW,GAAG,CAAE,CAAG;IAC/CkB,QAAQ,EAAGlB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAkB,QAAE,EAAE,WAAY;EAAG,GAEhC,IAAAf,QAAA,CAAAC,aAAA,gBAAM,QAAO,CACN,CAAC,EACT,IAAAD,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoB,MAAM;IACNP,OAAO,EAAC,UAAU;IAClBQ,OAAO,EAAGA,CAAA,KAAMf,UAAU,CAAED,QAAS,CAAG;IACxCiB,QAAQ,EAAGlB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAkB,QAAE,EAAE,WAAY,CAAG;IAChCE,IAAI,EAAC;EAAS,GAEd,IAAAjB,QAAA,CAAAC,aAAA,gBAAM,MAAO,CACN,CACD,CACD,CACD,CAAC;AAEX"}
1
+ {"version":3,"names":["_components","require","_i18n","Pagination","currentPage","numPages","changePage","totalItems","_element","createElement","__experimentalVStack","className","__experimentalText","variant","sprintf","_n","__experimentalHStack","expanded","spacing","justify","Button","onClick","disabled","__","_x","size"],"sources":["@wordpress/block-editor/src/components/block-patterns-paging/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-patterns__grid-pagination-wrapper\">\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\t\ttotalItems\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Text>\n\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<HStack\n\t\t\t\t\texpanded={ false }\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination\"\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-previous\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>«</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>‹</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %1$s: Current page number, %2$s: Total number of pages.\n\t\t\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\t\t\tcurrentPage,\n\t\t\t\t\t\t\tnumPages\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-next\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>›</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Last page' ) }\n\t\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>»</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AATA;AACA;AACA;;AASe,SAASE,UAAUA,CAAE;EACnCC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,oBAAM;IAACC,SAAS,EAAC;EAAgD,GACjE,IAAAH,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,kBAAI;IAACC,OAAO,EAAC;EAAO;EAEnB;EACA,IAAAC,aAAO;EACN;EACA,IAAAC,QAAE,EAAE,SAAS,EAAE,UAAU,EAAER,UAAW,CAAC,EACvCA,UACD,CAEI,CAAC,EAELF,QAAQ,GAAG,CAAC,IACb,IAAAG,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAgB,oBAAM;IACNC,QAAQ,EAAG,KAAO;IAClBC,OAAO,EAAG,CAAG;IACbC,OAAO,EAAC,YAAY;IACpBR,SAA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C/CkB,QAAQ,EAAGlB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAkB,QAAE,EAAE,WAAY;EAAG,GAEhC,IAAAf,QAAA,CAAAC,aAAA,gBAAM,QAAO,CACN,CAAC,EACT,IAAAD,QAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoB,MAAM;IACNP,OAAO,EAAC,UAAU;IAClBQ,OAAO,EAAGA,CAAA,KAAMf,UAAU,CAAED,QAAS,CAAG;IACxCiB,QAAQ,EAAGlB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAkB,QAAE,EAAE,WAAY,CAAG;IAChCE,IAAI,EAAC;EAAS,GAEd,IAAAjB,QAAA,CAAAC,aAAA,gBAAM,MAAO,CACN,CACD,CACD,CAEF,CAAC;AAEX"}
@@ -68,7 +68,7 @@ function useGlobalSetting(propertyPath, blockName, source = 'all') {
68
68
  VALID_SETTINGS.forEach(setting => {
69
69
  var _getValueFromObjectPa2;
70
70
  const value = (_getValueFromObjectPa2 = (0, _object.getValueFromObjectPath)(configToUse, `settings${appendedBlockPath}.${setting}`)) !== null && _getValueFromObjectPa2 !== void 0 ? _getValueFromObjectPa2 : (0, _object.getValueFromObjectPath)(configToUse, `settings.${setting}`);
71
- if (value) {
71
+ if (value !== undefined) {
72
72
  result = (0, _object.setImmutably)(result, setting.split('.'), value);
73
73
  }
74
74
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_es","_interopRequireDefault","require","_element","_data","_blocks","_i18n","_utils","_object","_context","_lockUnlock","EMPTY_CONFIG","settings","styles","VALID_SETTINGS","useGlobalStylesReset","user","config","setUserConfig","useContext","GlobalStylesContext","canReset","fastDeepEqual","useCallback","exports","useGlobalSetting","propertyPath","blockName","source","configs","appendedBlockPath","appendedPropertyPath","contextualPath","globalPath","sourceKey","settingValue","useMemo","configToUse","_getValueFromObjectPa","getValueFromObjectPath","result","forEach","setting","_getValueFromObjectPa2","value","setImmutably","split","setSetting","newValue","currentConfig","useGlobalStyle","path","shouldDecodeEncode","merged","mergedConfig","base","baseConfig","userConfig","appendedPath","finalPath","setStyle","getPresetVariableFromValue","rawResult","getValueFromVariable","useSettingsForBlockElement","parentSettings","element","supportedStyles","supports","useSelect","select","unlock","blocksStore","getSupportedStyles","getBlockType","updatedSettings","includes","typography","fontSizes","customFontSize","fontFamilies","color","text","background","button","heading","link","caption","gradients","customGradient","defaultDuotone","customDuotone","key","textColumns","layout","spacing","sides","Array","isArray","length","dimensions","minHeight","charAt","toUpperCase","slice","border","shadow","useColorsPerOrigin","customColors","palette","custom","themeColors","theme","defaultColors","default","shouldDisplayDefaultColors","defaultPalette","push","name","_x","colors","useGradientsPerOrigin","customGradients","themeGradients","defaultGradients","shouldDisplayDefaultGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useCallback, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getValueFromVariable, getPresetVariableFromValue } from './utils';\nimport { getValueFromObjectPath, setImmutably } from '../../utils/object';\nimport { GlobalStylesContext } from './context';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_CONFIG = { settings: {}, styles: {} };\n\nconst VALID_SETTINGS = [\n\t'appearanceTools',\n\t'useRootPaddingAwareAlignments',\n\t'border.color',\n\t'border.radius',\n\t'border.style',\n\t'border.width',\n\t'shadow.presets',\n\t'shadow.defaultPresets',\n\t'color.background',\n\t'color.button',\n\t'color.caption',\n\t'color.custom',\n\t'color.customDuotone',\n\t'color.customGradient',\n\t'color.defaultDuotone',\n\t'color.defaultGradients',\n\t'color.defaultPalette',\n\t'color.duotone',\n\t'color.gradients',\n\t'color.heading',\n\t'color.link',\n\t'color.palette',\n\t'color.text',\n\t'custom',\n\t'dimensions.minHeight',\n\t'layout.contentSize',\n\t'layout.definitions',\n\t'layout.wideSize',\n\t'lightbox.enabled',\n\t'lightbox.allowEditing',\n\t'position.fixed',\n\t'position.sticky',\n\t'spacing.customSpacingSize',\n\t'spacing.spacingSizes',\n\t'spacing.spacingScale',\n\t'spacing.blockGap',\n\t'spacing.margin',\n\t'spacing.padding',\n\t'spacing.units',\n\t'typography.fluid',\n\t'typography.customFontSize',\n\t'typography.dropCap',\n\t'typography.fontFamilies',\n\t'typography.fontSizes',\n\t'typography.fontStyle',\n\t'typography.fontWeight',\n\t'typography.letterSpacing',\n\t'typography.lineHeight',\n\t'typography.textColumns',\n\t'typography.textDecoration',\n\t'typography.textTransform',\n\t'typography.writingMode',\n];\n\nexport const useGlobalStylesReset = () => {\n\tconst { user: config, setUserConfig } = useContext( GlobalStylesContext );\n\tconst canReset = !! config && ! fastDeepEqual( config, EMPTY_CONFIG );\n\treturn [\n\t\tcanReset,\n\t\tuseCallback(\n\t\t\t() => setUserConfig( () => EMPTY_CONFIG ),\n\t\t\t[ setUserConfig ]\n\t\t),\n\t];\n};\n\nexport function useGlobalSetting( propertyPath, blockName, source = 'all' ) {\n\tconst { setUserConfig, ...configs } = useContext( GlobalStylesContext );\n\tconst appendedBlockPath = blockName ? '.blocks.' + blockName : '';\n\tconst appendedPropertyPath = propertyPath ? '.' + propertyPath : '';\n\tconst contextualPath = `settings${ appendedBlockPath }${ appendedPropertyPath }`;\n\tconst globalPath = `settings${ appendedPropertyPath }`;\n\tconst sourceKey = source === 'all' ? 'merged' : source;\n\n\tconst settingValue = useMemo( () => {\n\t\tconst configToUse = configs[ sourceKey ];\n\t\tif ( ! configToUse ) {\n\t\t\tthrow 'Unsupported source';\n\t\t}\n\n\t\tif ( propertyPath ) {\n\t\t\treturn (\n\t\t\t\tgetValueFromObjectPath( configToUse, contextualPath ) ??\n\t\t\t\tgetValueFromObjectPath( configToUse, globalPath )\n\t\t\t);\n\t\t}\n\n\t\tlet result = {};\n\t\tVALID_SETTINGS.forEach( ( setting ) => {\n\t\t\tconst value =\n\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\tconfigToUse,\n\t\t\t\t\t`settings${ appendedBlockPath }.${ setting }`\n\t\t\t\t) ??\n\t\t\t\tgetValueFromObjectPath( configToUse, `settings.${ setting }` );\n\t\t\tif ( value ) {\n\t\t\t\tresult = setImmutably( result, setting.split( '.' ), value );\n\t\t\t}\n\t\t} );\n\t\treturn result;\n\t}, [\n\t\tconfigs,\n\t\tsourceKey,\n\t\tpropertyPath,\n\t\tcontextualPath,\n\t\tglobalPath,\n\t\tappendedBlockPath,\n\t] );\n\n\tconst setSetting = ( newValue ) => {\n\t\tsetUserConfig( ( currentConfig ) =>\n\t\t\tsetImmutably( currentConfig, contextualPath.split( '.' ), newValue )\n\t\t);\n\t};\n\treturn [ settingValue, setSetting ];\n}\n\nexport function useGlobalStyle(\n\tpath,\n\tblockName,\n\tsource = 'all',\n\t{ shouldDecodeEncode = true } = {}\n) {\n\tconst {\n\t\tmerged: mergedConfig,\n\t\tbase: baseConfig,\n\t\tuser: userConfig,\n\t\tsetUserConfig,\n\t} = useContext( GlobalStylesContext );\n\tconst appendedPath = path ? '.' + path : '';\n\tconst finalPath = ! blockName\n\t\t? `styles${ appendedPath }`\n\t\t: `styles.blocks.${ blockName }${ appendedPath }`;\n\n\tconst setStyle = ( newValue ) => {\n\t\tsetUserConfig( ( currentConfig ) =>\n\t\t\tsetImmutably(\n\t\t\t\tcurrentConfig,\n\t\t\t\tfinalPath.split( '.' ),\n\t\t\t\tshouldDecodeEncode\n\t\t\t\t\t? getPresetVariableFromValue(\n\t\t\t\t\t\t\tmergedConfig.settings,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tnewValue\n\t\t\t\t\t )\n\t\t\t\t\t: newValue\n\t\t\t)\n\t\t);\n\t};\n\n\tlet rawResult, result;\n\tswitch ( source ) {\n\t\tcase 'all':\n\t\t\trawResult = getValueFromObjectPath( mergedConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( mergedConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tcase 'user':\n\t\t\trawResult = getValueFromObjectPath( userConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( mergedConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tcase 'base':\n\t\t\trawResult = getValueFromObjectPath( baseConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( baseConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Unsupported source';\n\t}\n\n\treturn [ result, setStyle ];\n}\n\n/**\n * React hook that overrides a global settings object with block and element specific settings.\n *\n * @param {Object} parentSettings Settings object.\n * @param {blockName?} blockName Block name.\n * @param {element?} element Element name.\n *\n * @return {Object} Merge of settings and supports.\n */\nexport function useSettingsForBlockElement(\n\tparentSettings,\n\tblockName,\n\telement\n) {\n\tconst { supportedStyles, supports } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedStyles: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( blockName, element ),\n\t\t\t\tsupports:\n\t\t\t\t\tselect( blocksStore ).getBlockType( blockName )?.supports,\n\t\t\t};\n\t\t},\n\t\t[ blockName, element ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst updatedSettings = { ...parentSettings };\n\n\t\tif ( ! supportedStyles.includes( 'fontSize' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\tfontSizes: {},\n\t\t\t\tcustomFontSize: false,\n\t\t\t};\n\t\t}\n\n\t\tif ( ! supportedStyles.includes( 'fontFamily' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\tfontFamilies: {},\n\t\t\t};\n\t\t}\n\n\t\tupdatedSettings.color = {\n\t\t\t...updatedSettings.color,\n\t\t\ttext:\n\t\t\t\tupdatedSettings.color?.text &&\n\t\t\t\tsupportedStyles.includes( 'color' ),\n\t\t\tbackground:\n\t\t\t\tupdatedSettings.color?.background &&\n\t\t\t\t( supportedStyles.includes( 'background' ) ||\n\t\t\t\t\tsupportedStyles.includes( 'backgroundColor' ) ),\n\t\t\tbutton:\n\t\t\t\tupdatedSettings.color?.button &&\n\t\t\t\tsupportedStyles.includes( 'buttonColor' ),\n\t\t\theading:\n\t\t\t\tupdatedSettings.color?.heading &&\n\t\t\t\tsupportedStyles.includes( 'headingColor' ),\n\t\t\tlink:\n\t\t\t\tupdatedSettings.color?.link &&\n\t\t\t\tsupportedStyles.includes( 'linkColor' ),\n\t\t\tcaption:\n\t\t\t\tupdatedSettings.color?.caption &&\n\t\t\t\tsupportedStyles.includes( 'captionColor' ),\n\t\t};\n\n\t\t// Some blocks can enable background colors but disable gradients.\n\t\tif ( ! supportedStyles.includes( 'background' ) ) {\n\t\t\tupdatedSettings.color.gradients = [];\n\t\t\tupdatedSettings.color.customGradient = false;\n\t\t}\n\n\t\t// If filters are not supported by the block/element, disable duotone.\n\t\tif ( ! supportedStyles.includes( 'filter' ) ) {\n\t\t\tupdatedSettings.color.defaultDuotone = false;\n\t\t\tupdatedSettings.color.customDuotone = false;\n\t\t}\n\n\t\t[\n\t\t\t'lineHeight',\n\t\t\t'fontStyle',\n\t\t\t'fontWeight',\n\t\t\t'letterSpacing',\n\t\t\t'textTransform',\n\t\t\t'textDecoration',\n\t\t\t'writingMode',\n\t\t].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.typography = {\n\t\t\t\t\t...updatedSettings.typography,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\t// The column-count style is named text column to reduce confusion with\n\t\t// the columns block and manage expectations from the support.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/33587\n\t\tif ( ! supportedStyles.includes( 'columnCount' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\ttextColumns: false,\n\t\t\t};\n\t\t}\n\n\t\t[ 'contentSize', 'wideSize' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.layout = {\n\t\t\t\t\t...updatedSettings.layout,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\t[ 'padding', 'margin', 'blockGap' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.spacing = {\n\t\t\t\t\t...updatedSettings.spacing,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst sides = Array.isArray( supports?.spacing?.[ key ] )\n\t\t\t\t? supports?.spacing?.[ key ]\n\t\t\t\t: supports?.spacing?.[ key ]?.sides;\n\t\t\t// Check if spacing type is supported before adding sides.\n\t\t\tif ( sides?.length && updatedSettings.spacing?.[ key ] ) {\n\t\t\t\tupdatedSettings.spacing = {\n\t\t\t\t\t...updatedSettings.spacing,\n\t\t\t\t\t[ key ]: {\n\t\t\t\t\t\t...updatedSettings.spacing?.[ key ],\n\t\t\t\t\t\tsides,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\tif ( ! supportedStyles.includes( 'minHeight' ) ) {\n\t\t\tupdatedSettings.dimensions = {\n\t\t\t\t...updatedSettings.dimensions,\n\t\t\t\tminHeight: false,\n\t\t\t};\n\t\t}\n\n\t\t[ 'radius', 'color', 'style', 'width' ].forEach( ( key ) => {\n\t\t\tif (\n\t\t\t\t! supportedStyles.includes(\n\t\t\t\t\t'border' + key.charAt( 0 ).toUpperCase() + key.slice( 1 )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tupdatedSettings.border = {\n\t\t\t\t\t...updatedSettings.border,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\tupdatedSettings.shadow = supportedStyles.includes( 'shadow' )\n\t\t\t? updatedSettings.shadow\n\t\t\t: false;\n\n\t\treturn updatedSettings;\n\t}, [ parentSettings, supportedStyles, supports ] );\n}\n\nexport function useColorsPerOrigin( settings ) {\n\tconst customColors = settings?.color?.palette?.custom;\n\tconst themeColors = settings?.color?.palette?.theme;\n\tconst defaultColors = settings?.color?.palette?.default;\n\tconst shouldDisplayDefaultColors = settings?.color?.defaultPalette;\n\n\treturn useMemo( () => {\n\t\tconst result = [];\n\t\tif ( themeColors && themeColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates this palette comes from the theme.'\n\t\t\t\t),\n\t\t\t\tcolors: themeColors,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tshouldDisplayDefaultColors &&\n\t\t\tdefaultColors &&\n\t\t\tdefaultColors.length\n\t\t) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates this palette comes from WordPress.'\n\t\t\t\t),\n\t\t\t\tcolors: defaultColors,\n\t\t\t} );\n\t\t}\n\t\tif ( customColors && customColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates this palette is created by the user.'\n\t\t\t\t),\n\t\t\t\tcolors: customColors,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [\n\t\tcustomColors,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tshouldDisplayDefaultColors,\n\t] );\n}\n\nexport function useGradientsPerOrigin( settings ) {\n\tconst customGradients = settings?.color?.gradients?.custom;\n\tconst themeGradients = settings?.color?.gradients?.theme;\n\tconst defaultGradients = settings?.color?.gradients?.default;\n\tconst shouldDisplayDefaultGradients = settings?.color?.defaultGradients;\n\n\treturn useMemo( () => {\n\t\tconst result = [];\n\t\tif ( themeGradients && themeGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates this palette comes from the theme.'\n\t\t\t\t),\n\t\t\t\tgradients: themeGradients,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tshouldDisplayDefaultGradients &&\n\t\t\tdefaultGradients &&\n\t\t\tdefaultGradients.length\n\t\t) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates this palette comes from WordPress.'\n\t\t\t\t),\n\t\t\t\tgradients: defaultGradients,\n\t\t\t} );\n\t\t}\n\t\tif ( customGradients && customGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates this palette is created by the user.'\n\t\t\t\t),\n\t\t\t\tgradients: customGradients,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [\n\t\tcustomGradients,\n\t\tthemeGradients,\n\t\tdefaultGradients,\n\t\tshouldDisplayDefaultGradients,\n\t] );\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAMA,MAAMS,YAAY,GAAG;EAAEC,QAAQ,EAAE,CAAC,CAAC;EAAEC,MAAM,EAAE,CAAC;AAAE,CAAC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qE,KAAK,EAAEO,SAAS,EAAEsB,MAAM;EAC1D,MAAMa,cAAc,GAAG/G,QAAQ,EAAEqE,KAAK,EAAEO,SAAS,EAAEwB,KAAK;EACxD,MAAMY,gBAAgB,GAAGhH,QAAQ,EAAEqE,KAAK,EAAEO,SAAS,EAAE0B,OAAO;EAC5D,MAAMW,6BAA6B,GAAGjH,QAAQ,EAAEqE,KAAK,EAAE2C,gBAAgB;EAEvE,OAAO,IAAAxF,gBAAO,EAAE,MAAM;IACrB,MAAMI,MAAM,GAAG,EAAE;IACjB,IAAKmF,cAAc,IAAIA,cAAc,CAACxB,MAAM,EAAG;MAC9C3D,MAAM,CAAC6E,IAAI,CAAE;QACZC,IAAI,EAAE,IAAAC,QAAE,EACP,OAAO,EACP,8CACD,CAAC;QACD/B,SAAS,EAAEmC;MACZ,CAAE,CAAC;IACJ;IACA,IACCE,6BAA6B,IAC7BD,gBAAgB,IAChBA,gBAAgB,CAACzB,MAAM,EACtB;MACD3D,MAAM,CAAC6E,IAAI,CAAE;QACZC,IAAI,EAAE,IAAAC,QAAE,EACP,SAAS,EACT,8CACD,CAAC;QACD/B,SAAS,EAAEoC;MACZ,CAAE,CAAC;IACJ;IACA,IAAKF,eAAe,IAAIA,eAAe,CAACvB,MAAM,EAAG;MAChD3D,MAAM,CAAC6E,IAAI,CAAE;QACZC,IAAI,EAAE,IAAAC,QAAE,EACP,QAAQ,EACR,gDACD,CAAC;QACD/B,SAAS,EAAEkC;MACZ,CAAE,CAAC;IACJ;IACA,OAAOlF,MAAM;EACd,CAAC,EAAE,CACFkF,eAAe,EACfC,cAAc,EACdC,gBAAgB,EAChBC,6BAA6B,CAC5B,CAAC;AACJ"}
1
+ {"version":3,"names":["_es","_interopRequireDefault","require","_element","_data","_blocks","_i18n","_utils","_object","_context","_lockUnlock","EMPTY_CONFIG","settings","styles","VALID_SETTINGS","useGlobalStylesReset","user","config","setUserConfig","useContext","GlobalStylesContext","canReset","fastDeepEqual","useCallback","exports","useGlobalSetting","propertyPath","blockName","source","configs","appendedBlockPath","appendedPropertyPath","contextualPath","globalPath","sourceKey","settingValue","useMemo","configToUse","_getValueFromObjectPa","getValueFromObjectPath","result","forEach","setting","_getValueFromObjectPa2","value","undefined","setImmutably","split","setSetting","newValue","currentConfig","useGlobalStyle","path","shouldDecodeEncode","merged","mergedConfig","base","baseConfig","userConfig","appendedPath","finalPath","setStyle","getPresetVariableFromValue","rawResult","getValueFromVariable","useSettingsForBlockElement","parentSettings","element","supportedStyles","supports","useSelect","select","unlock","blocksStore","getSupportedStyles","getBlockType","updatedSettings","includes","typography","fontSizes","customFontSize","fontFamilies","color","text","background","button","heading","link","caption","gradients","customGradient","defaultDuotone","customDuotone","key","textColumns","layout","spacing","sides","Array","isArray","length","dimensions","minHeight","charAt","toUpperCase","slice","border","shadow","useColorsPerOrigin","customColors","palette","custom","themeColors","theme","defaultColors","default","shouldDisplayDefaultColors","defaultPalette","push","name","_x","colors","useGradientsPerOrigin","customGradients","themeGradients","defaultGradients","shouldDisplayDefaultGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/hooks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useCallback, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getValueFromVariable, getPresetVariableFromValue } from './utils';\nimport { getValueFromObjectPath, setImmutably } from '../../utils/object';\nimport { GlobalStylesContext } from './context';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_CONFIG = { settings: {}, styles: {} };\n\nconst VALID_SETTINGS = [\n\t'appearanceTools',\n\t'useRootPaddingAwareAlignments',\n\t'border.color',\n\t'border.radius',\n\t'border.style',\n\t'border.width',\n\t'shadow.presets',\n\t'shadow.defaultPresets',\n\t'color.background',\n\t'color.button',\n\t'color.caption',\n\t'color.custom',\n\t'color.customDuotone',\n\t'color.customGradient',\n\t'color.defaultDuotone',\n\t'color.defaultGradients',\n\t'color.defaultPalette',\n\t'color.duotone',\n\t'color.gradients',\n\t'color.heading',\n\t'color.link',\n\t'color.palette',\n\t'color.text',\n\t'custom',\n\t'dimensions.minHeight',\n\t'layout.contentSize',\n\t'layout.definitions',\n\t'layout.wideSize',\n\t'lightbox.enabled',\n\t'lightbox.allowEditing',\n\t'position.fixed',\n\t'position.sticky',\n\t'spacing.customSpacingSize',\n\t'spacing.spacingSizes',\n\t'spacing.spacingScale',\n\t'spacing.blockGap',\n\t'spacing.margin',\n\t'spacing.padding',\n\t'spacing.units',\n\t'typography.fluid',\n\t'typography.customFontSize',\n\t'typography.dropCap',\n\t'typography.fontFamilies',\n\t'typography.fontSizes',\n\t'typography.fontStyle',\n\t'typography.fontWeight',\n\t'typography.letterSpacing',\n\t'typography.lineHeight',\n\t'typography.textColumns',\n\t'typography.textDecoration',\n\t'typography.textTransform',\n\t'typography.writingMode',\n];\n\nexport const useGlobalStylesReset = () => {\n\tconst { user: config, setUserConfig } = useContext( GlobalStylesContext );\n\tconst canReset = !! config && ! fastDeepEqual( config, EMPTY_CONFIG );\n\treturn [\n\t\tcanReset,\n\t\tuseCallback(\n\t\t\t() => setUserConfig( () => EMPTY_CONFIG ),\n\t\t\t[ setUserConfig ]\n\t\t),\n\t];\n};\n\nexport function useGlobalSetting( propertyPath, blockName, source = 'all' ) {\n\tconst { setUserConfig, ...configs } = useContext( GlobalStylesContext );\n\tconst appendedBlockPath = blockName ? '.blocks.' + blockName : '';\n\tconst appendedPropertyPath = propertyPath ? '.' + propertyPath : '';\n\tconst contextualPath = `settings${ appendedBlockPath }${ appendedPropertyPath }`;\n\tconst globalPath = `settings${ appendedPropertyPath }`;\n\tconst sourceKey = source === 'all' ? 'merged' : source;\n\n\tconst settingValue = useMemo( () => {\n\t\tconst configToUse = configs[ sourceKey ];\n\t\tif ( ! configToUse ) {\n\t\t\tthrow 'Unsupported source';\n\t\t}\n\n\t\tif ( propertyPath ) {\n\t\t\treturn (\n\t\t\t\tgetValueFromObjectPath( configToUse, contextualPath ) ??\n\t\t\t\tgetValueFromObjectPath( configToUse, globalPath )\n\t\t\t);\n\t\t}\n\n\t\tlet result = {};\n\t\tVALID_SETTINGS.forEach( ( setting ) => {\n\t\t\tconst value =\n\t\t\t\tgetValueFromObjectPath(\n\t\t\t\t\tconfigToUse,\n\t\t\t\t\t`settings${ appendedBlockPath }.${ setting }`\n\t\t\t\t) ??\n\t\t\t\tgetValueFromObjectPath( configToUse, `settings.${ setting }` );\n\t\t\tif ( value !== undefined ) {\n\t\t\t\tresult = setImmutably( result, setting.split( '.' ), value );\n\t\t\t}\n\t\t} );\n\t\treturn result;\n\t}, [\n\t\tconfigs,\n\t\tsourceKey,\n\t\tpropertyPath,\n\t\tcontextualPath,\n\t\tglobalPath,\n\t\tappendedBlockPath,\n\t] );\n\n\tconst setSetting = ( newValue ) => {\n\t\tsetUserConfig( ( currentConfig ) =>\n\t\t\tsetImmutably( currentConfig, contextualPath.split( '.' ), newValue )\n\t\t);\n\t};\n\treturn [ settingValue, setSetting ];\n}\n\nexport function useGlobalStyle(\n\tpath,\n\tblockName,\n\tsource = 'all',\n\t{ shouldDecodeEncode = true } = {}\n) {\n\tconst {\n\t\tmerged: mergedConfig,\n\t\tbase: baseConfig,\n\t\tuser: userConfig,\n\t\tsetUserConfig,\n\t} = useContext( GlobalStylesContext );\n\tconst appendedPath = path ? '.' + path : '';\n\tconst finalPath = ! blockName\n\t\t? `styles${ appendedPath }`\n\t\t: `styles.blocks.${ blockName }${ appendedPath }`;\n\n\tconst setStyle = ( newValue ) => {\n\t\tsetUserConfig( ( currentConfig ) =>\n\t\t\tsetImmutably(\n\t\t\t\tcurrentConfig,\n\t\t\t\tfinalPath.split( '.' ),\n\t\t\t\tshouldDecodeEncode\n\t\t\t\t\t? getPresetVariableFromValue(\n\t\t\t\t\t\t\tmergedConfig.settings,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tnewValue\n\t\t\t\t\t )\n\t\t\t\t\t: newValue\n\t\t\t)\n\t\t);\n\t};\n\n\tlet rawResult, result;\n\tswitch ( source ) {\n\t\tcase 'all':\n\t\t\trawResult = getValueFromObjectPath( mergedConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( mergedConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tcase 'user':\n\t\t\trawResult = getValueFromObjectPath( userConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( mergedConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tcase 'base':\n\t\t\trawResult = getValueFromObjectPath( baseConfig, finalPath );\n\t\t\tresult = shouldDecodeEncode\n\t\t\t\t? getValueFromVariable( baseConfig, blockName, rawResult )\n\t\t\t\t: rawResult;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Unsupported source';\n\t}\n\n\treturn [ result, setStyle ];\n}\n\n/**\n * React hook that overrides a global settings object with block and element specific settings.\n *\n * @param {Object} parentSettings Settings object.\n * @param {blockName?} blockName Block name.\n * @param {element?} element Element name.\n *\n * @return {Object} Merge of settings and supports.\n */\nexport function useSettingsForBlockElement(\n\tparentSettings,\n\tblockName,\n\telement\n) {\n\tconst { supportedStyles, supports } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedStyles: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( blockName, element ),\n\t\t\t\tsupports:\n\t\t\t\t\tselect( blocksStore ).getBlockType( blockName )?.supports,\n\t\t\t};\n\t\t},\n\t\t[ blockName, element ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst updatedSettings = { ...parentSettings };\n\n\t\tif ( ! supportedStyles.includes( 'fontSize' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\tfontSizes: {},\n\t\t\t\tcustomFontSize: false,\n\t\t\t};\n\t\t}\n\n\t\tif ( ! supportedStyles.includes( 'fontFamily' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\tfontFamilies: {},\n\t\t\t};\n\t\t}\n\n\t\tupdatedSettings.color = {\n\t\t\t...updatedSettings.color,\n\t\t\ttext:\n\t\t\t\tupdatedSettings.color?.text &&\n\t\t\t\tsupportedStyles.includes( 'color' ),\n\t\t\tbackground:\n\t\t\t\tupdatedSettings.color?.background &&\n\t\t\t\t( supportedStyles.includes( 'background' ) ||\n\t\t\t\t\tsupportedStyles.includes( 'backgroundColor' ) ),\n\t\t\tbutton:\n\t\t\t\tupdatedSettings.color?.button &&\n\t\t\t\tsupportedStyles.includes( 'buttonColor' ),\n\t\t\theading:\n\t\t\t\tupdatedSettings.color?.heading &&\n\t\t\t\tsupportedStyles.includes( 'headingColor' ),\n\t\t\tlink:\n\t\t\t\tupdatedSettings.color?.link &&\n\t\t\t\tsupportedStyles.includes( 'linkColor' ),\n\t\t\tcaption:\n\t\t\t\tupdatedSettings.color?.caption &&\n\t\t\t\tsupportedStyles.includes( 'captionColor' ),\n\t\t};\n\n\t\t// Some blocks can enable background colors but disable gradients.\n\t\tif ( ! supportedStyles.includes( 'background' ) ) {\n\t\t\tupdatedSettings.color.gradients = [];\n\t\t\tupdatedSettings.color.customGradient = false;\n\t\t}\n\n\t\t// If filters are not supported by the block/element, disable duotone.\n\t\tif ( ! supportedStyles.includes( 'filter' ) ) {\n\t\t\tupdatedSettings.color.defaultDuotone = false;\n\t\t\tupdatedSettings.color.customDuotone = false;\n\t\t}\n\n\t\t[\n\t\t\t'lineHeight',\n\t\t\t'fontStyle',\n\t\t\t'fontWeight',\n\t\t\t'letterSpacing',\n\t\t\t'textTransform',\n\t\t\t'textDecoration',\n\t\t\t'writingMode',\n\t\t].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.typography = {\n\t\t\t\t\t...updatedSettings.typography,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\t// The column-count style is named text column to reduce confusion with\n\t\t// the columns block and manage expectations from the support.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/33587\n\t\tif ( ! supportedStyles.includes( 'columnCount' ) ) {\n\t\t\tupdatedSettings.typography = {\n\t\t\t\t...updatedSettings.typography,\n\t\t\t\ttextColumns: false,\n\t\t\t};\n\t\t}\n\n\t\t[ 'contentSize', 'wideSize' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.layout = {\n\t\t\t\t\t...updatedSettings.layout,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\t[ 'padding', 'margin', 'blockGap' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.spacing = {\n\t\t\t\t\t...updatedSettings.spacing,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst sides = Array.isArray( supports?.spacing?.[ key ] )\n\t\t\t\t? supports?.spacing?.[ key ]\n\t\t\t\t: supports?.spacing?.[ key ]?.sides;\n\t\t\t// Check if spacing type is supported before adding sides.\n\t\t\tif ( sides?.length && updatedSettings.spacing?.[ key ] ) {\n\t\t\t\tupdatedSettings.spacing = {\n\t\t\t\t\t...updatedSettings.spacing,\n\t\t\t\t\t[ key ]: {\n\t\t\t\t\t\t...updatedSettings.spacing?.[ key ],\n\t\t\t\t\t\tsides,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\tif ( ! supportedStyles.includes( 'minHeight' ) ) {\n\t\t\tupdatedSettings.dimensions = {\n\t\t\t\t...updatedSettings.dimensions,\n\t\t\t\tminHeight: false,\n\t\t\t};\n\t\t}\n\n\t\t[ 'radius', 'color', 'style', 'width' ].forEach( ( key ) => {\n\t\t\tif (\n\t\t\t\t! supportedStyles.includes(\n\t\t\t\t\t'border' + key.charAt( 0 ).toUpperCase() + key.slice( 1 )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tupdatedSettings.border = {\n\t\t\t\t\t...updatedSettings.border,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\n\t\tupdatedSettings.shadow = supportedStyles.includes( 'shadow' )\n\t\t\t? updatedSettings.shadow\n\t\t\t: false;\n\n\t\treturn updatedSettings;\n\t}, [ parentSettings, supportedStyles, supports ] );\n}\n\nexport function useColorsPerOrigin( settings ) {\n\tconst customColors = settings?.color?.palette?.custom;\n\tconst themeColors = settings?.color?.palette?.theme;\n\tconst defaultColors = settings?.color?.palette?.default;\n\tconst shouldDisplayDefaultColors = settings?.color?.defaultPalette;\n\n\treturn useMemo( () => {\n\t\tconst result = [];\n\t\tif ( themeColors && themeColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates this palette comes from the theme.'\n\t\t\t\t),\n\t\t\t\tcolors: themeColors,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tshouldDisplayDefaultColors &&\n\t\t\tdefaultColors &&\n\t\t\tdefaultColors.length\n\t\t) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates this palette comes from WordPress.'\n\t\t\t\t),\n\t\t\t\tcolors: defaultColors,\n\t\t\t} );\n\t\t}\n\t\tif ( customColors && customColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates this palette is created by the user.'\n\t\t\t\t),\n\t\t\t\tcolors: customColors,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [\n\t\tcustomColors,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tshouldDisplayDefaultColors,\n\t] );\n}\n\nexport function useGradientsPerOrigin( settings ) {\n\tconst customGradients = settings?.color?.gradients?.custom;\n\tconst themeGradients = settings?.color?.gradients?.theme;\n\tconst defaultGradients = settings?.color?.gradients?.default;\n\tconst shouldDisplayDefaultGradients = settings?.color?.defaultGradients;\n\n\treturn useMemo( () => {\n\t\tconst result = [];\n\t\tif ( themeGradients && themeGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates this palette comes from the theme.'\n\t\t\t\t),\n\t\t\t\tgradients: themeGradients,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tshouldDisplayDefaultGradients &&\n\t\t\tdefaultGradients &&\n\t\t\tdefaultGradients.length\n\t\t) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates this palette comes from WordPress.'\n\t\t\t\t),\n\t\t\t\tgradients: defaultGradients,\n\t\t\t} );\n\t\t}\n\t\tif ( customGradients && customGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates this palette is created by the user.'\n\t\t\t\t),\n\t\t\t\tgradients: customGradients,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [\n\t\tcustomGradients,\n\t\tthemeGradients,\n\t\tdefaultGradients,\n\t\tshouldDisplayDefaultGradients,\n\t] );\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAA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,6BAA6B,CAC5B,CAAC;AACJ"}
@@ -8,6 +8,7 @@ exports.getBlockSelectors = void 0;
8
8
  exports.getLayoutStyles = getLayoutStyles;
9
9
  exports.getNodesWithStyles = exports.getNodesWithSettings = void 0;
10
10
  exports.getStylesDeclarations = getStylesDeclarations;
11
+ exports.processCSSNesting = processCSSNesting;
11
12
  exports.toStyles = exports.toCustomProperties = void 0;
12
13
  exports.toSvgFilters = toSvgFilters;
13
14
  exports.useGlobalStylesOutput = useGlobalStylesOutput;
@@ -817,18 +818,29 @@ function updateConfigWithSeparator(config) {
817
818
  }
818
819
  return config;
819
820
  }
820
- const processCSSNesting = (css, blockSelector) => {
821
+ function processCSSNesting(css, blockSelector) {
821
822
  let processedCSS = '';
822
823
 
823
824
  // Split CSS nested rules.
824
825
  const parts = css.split('&');
825
826
  parts.forEach(part => {
826
- processedCSS += !part.includes('{') ? blockSelector + '{' + part + '}' // If the part doesn't contain braces, it applies to the root level.
827
- : blockSelector + part; // Prepend the selector, which effectively replaces the "&" character.
827
+ const isRootCss = !part.includes('{');
828
+ if (isRootCss) {
829
+ // If the part doesn't contain braces, it applies to the root level.
830
+ processedCSS += `${blockSelector}{${part.trim()}}`;
831
+ } else {
832
+ // If the part contains braces, it's a nested CSS rule.
833
+ const splittedPart = part.replace('}', '').split('{');
834
+ if (splittedPart.length !== 2) {
835
+ return;
836
+ }
837
+ const [nestedSelector, cssValue] = splittedPart;
838
+ const combinedSelector = nestedSelector.startsWith(' ') ? (0, _utils.scopeSelector)(blockSelector, nestedSelector) : (0, _utils.appendToSelector)(blockSelector, nestedSelector);
839
+ processedCSS += `${combinedSelector}{${cssValue.trim()}}`;
840
+ }
828
841
  });
829
-
830
842
  return processedCSS;
831
- };
843
+ }
832
844
 
833
845
  /**
834
846
  * Returns the global styles output using a global styles configuration.