@wordpress/block-editor 13.0.0 → 13.0.1

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 (68) hide show
  1. package/build/components/block-bindings-toolbar-indicator/index.js +1 -1
  2. package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  3. package/build/components/button-block-appender/index.js +4 -1
  4. package/build/components/button-block-appender/index.js.map +1 -1
  5. package/build/components/global-styles/background-panel.js +3 -3
  6. package/build/components/global-styles/background-panel.js.map +1 -1
  7. package/build/components/global-styles/hooks.js +1 -1
  8. package/build/components/global-styles/hooks.js.map +1 -1
  9. package/build/components/inserter/block-types-tab.js +3 -3
  10. package/build/components/inserter/block-types-tab.js.map +1 -1
  11. package/build/components/inserter/hooks/use-block-types-state.js +3 -2
  12. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  13. package/build/components/link-control/link-preview.js +1 -0
  14. package/build/components/link-control/link-preview.js.map +1 -1
  15. package/build/components/link-control/search-input.js +1 -1
  16. package/build/components/link-control/search-input.js.map +1 -1
  17. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +9 -12
  18. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  19. package/build/components/writing-flow/use-clipboard-handler.js +22 -3
  20. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  21. package/build/store/actions.js +1 -1
  22. package/build/store/actions.js.map +1 -1
  23. package/build/store/selectors.js +2 -1
  24. package/build/store/selectors.js.map +1 -1
  25. package/build-module/components/block-bindings-toolbar-indicator/index.js +1 -1
  26. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  27. package/build-module/components/button-block-appender/index.js +4 -1
  28. package/build-module/components/button-block-appender/index.js.map +1 -1
  29. package/build-module/components/global-styles/background-panel.js +4 -4
  30. package/build-module/components/global-styles/background-panel.js.map +1 -1
  31. package/build-module/components/global-styles/hooks.js +1 -1
  32. package/build-module/components/global-styles/hooks.js.map +1 -1
  33. package/build-module/components/inserter/block-types-tab.js +3 -3
  34. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  35. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -3
  36. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  37. package/build-module/components/link-control/link-preview.js +1 -0
  38. package/build-module/components/link-control/link-preview.js.map +1 -1
  39. package/build-module/components/link-control/search-input.js +1 -1
  40. package/build-module/components/link-control/search-input.js.map +1 -1
  41. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +9 -12
  42. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  43. package/build-module/components/writing-flow/use-clipboard-handler.js +23 -4
  44. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  45. package/build-module/store/actions.js +1 -1
  46. package/build-module/store/actions.js.map +1 -1
  47. package/build-module/store/selectors.js +2 -1
  48. package/build-module/store/selectors.js.map +1 -1
  49. package/build-style/content-rtl.css +1 -1
  50. package/build-style/content.css +1 -1
  51. package/build-style/style-rtl.css +6 -2
  52. package/build-style/style.css +6 -2
  53. package/package.json +31 -31
  54. package/src/components/block-bindings-toolbar-indicator/index.js +3 -1
  55. package/src/components/block-canvas/style.scss +2 -2
  56. package/src/components/block-variation-picker/content.scss +1 -1
  57. package/src/components/button-block-appender/index.js +2 -0
  58. package/src/components/global-styles/background-panel.js +13 -4
  59. package/src/components/global-styles/hooks.js +1 -0
  60. package/src/components/inserter/block-types-tab.js +0 -1
  61. package/src/components/inserter/hooks/use-block-types-state.js +10 -5
  62. package/src/components/inserter/style.scss +4 -0
  63. package/src/components/link-control/link-preview.js +1 -0
  64. package/src/components/link-control/search-input.js +1 -1
  65. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +14 -4
  66. package/src/components/writing-flow/use-clipboard-handler.js +29 -7
  67. package/src/store/actions.js +1 -1
  68. package/src/store/selectors.js +3 -1
@@ -51,7 +51,7 @@ export default function BlockBindingsToolbarIndicator({
51
51
  return {
52
52
  icon: _icon,
53
53
  firstBlockName: getBlockAttributes(clientIds[0]).metadata.name,
54
- isConnectedToPatternOverrides: getBlocksByClientId(clientIds).some(block => Object.values(block?.attributes.metadata?.bindings).some(binding => binding.source === 'core/pattern-overrides'))
54
+ isConnectedToPatternOverrides: getBlocksByClientId(clientIds).some(block => Object.values(block?.attributes?.metadata?.bindings || {}).some(binding => binding.source === 'core/pattern-overrides'))
55
55
  };
56
56
  }, [clientIds, isSingleBlockSelected]);
57
57
  const firstBlockTitle = useBlockDisplayTitle({
@@ -1 +1 @@
1
- {"version":3,"names":["useId","__","sprintf","_x","DropdownMenu","ToolbarGroup","ToolbarItem","__experimentalText","Text","store","blocksStore","useSelect","copy","blockEditorStore","BlockIcon","useBlockDisplayTitle","jsx","_jsx","Fragment","_Fragment","BlockBindingsToolbarIndicator","clientIds","isSingleBlockSelected","length","icon","firstBlockName","isConnectedToPatternOverrides","select","getBlockAttributes","getBlockNamesByClientId","getBlocksByClientId","getBlockType","getActiveBlockVariation","blockTypeNames","_firstBlockTypeName","firstBlockType","_icon","match","isSelectionOfSameType","Set","size","metadata","name","some","block","Object","values","attributes","bindings","binding","source","firstBlockTitle","clientId","maximumLength","blockDescription","toLowerCase","descriptionId","children","toggleProps","className","label","popoverProps","placement","showColors","describedBy","menuProps","orientation","id"],"sources":["@wordpress/block-editor/src/components/block-bindings-toolbar-indicator/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useId } from '@wordpress/element';\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\n\nexport default function BlockBindingsToolbarIndicator( { clientIds } ) {\n\tconst isSingleBlockSelected = clientIds.length === 1;\n\tconst { icon, firstBlockName, isConnectedToPatternOverrides } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockNamesByClientId,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockTypeNames = getBlockNamesByClientId( clientIds );\n\t\t\tconst _firstBlockTypeName = blockTypeNames[ 0 ];\n\t\t\tconst firstBlockType = getBlockType( _firstBlockTypeName );\n\t\t\tlet _icon;\n\t\t\tif ( isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\t_firstBlockTypeName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || firstBlockType.icon;\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( blockTypeNames ).size === 1;\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? firstBlockType.icon : copy;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ticon: _icon,\n\t\t\t\tfirstBlockName: getBlockAttributes( clientIds[ 0 ] ).metadata\n\t\t\t\t\t.name,\n\t\t\t\tisConnectedToPatternOverrides: getBlocksByClientId(\n\t\t\t\t\tclientIds\n\t\t\t\t).some( ( block ) =>\n\t\t\t\t\tObject.values( block?.attributes.metadata?.bindings ).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientIds, isSingleBlockSelected ]\n\t);\n\tconst firstBlockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\n\tlet blockDescription = isSingleBlockSelected\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\tif ( isConnectedToPatternOverrides && firstBlockName ) {\n\t\tblockDescription = isSingleBlockSelected\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %1s: The block type's name; %2s: The block's user-provided name (the same as the override name). */\n\t\t\t\t\t__( 'This %1$s is editable using the \"%2$s\" override.' ),\n\t\t\t\t\tfirstBlockTitle.toLowerCase(),\n\t\t\t\t\tfirstBlockName\n\t\t\t )\n\t\t\t: __( 'These blocks are editable using overrides.' );\n\t}\n\tconst descriptionId = useId();\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-bindings-toolbar-indicator\"\n\t\t\t\t\t\tlabel={ firstBlockTitle }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t'block-editor-block-bindings-toolbar-indicator__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-bindings-toolbar-indicator-icon\"\n\t\t\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescribedBy: blockDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ {\n\t\t\t\t\t\t\torientation: 'both',\n\t\t\t\t\t\t\t'aria-describedby': descriptionId,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t\t\t{ blockDescription }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SACCC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;;AAEvC;AACA;AACA;AACA,SAASH,KAAK,IAAII,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,oBAAoB,MAAM,wCAAwC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE1E,eAAe,SAASC,6BAA6BA,CAAE;EAAEC;AAAU,CAAC,EAAG;EACtE,MAAMC,qBAAqB,GAAGD,SAAS,CAACE,MAAM,KAAK,CAAC;EACpD,MAAM;IAAEC,IAAI;IAAEC,cAAc;IAAEC;EAA8B,CAAC,GAAGf,SAAS,CACtEgB,MAAM,IAAM;IACb,MAAM;MACLC,kBAAkB;MAClBC,uBAAuB;MACvBC;IACD,CAAC,GAAGH,MAAM,CAAEd,gBAAiB,CAAC;IAC9B,MAAM;MAAEkB,YAAY;MAAEC;IA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AE,CACF,0BAA0B,EAC1B,4CACA,CAAC,GACDA,EAAE,CACF,6BAA6B,EAC7B,4CACA,CAAC;EACJ,IAAKuB,6BAA6B,IAAID,cAAc,EAAG;IACtD6B,gBAAgB,GAAGhC,qBAAqB,GACrCpB,OAAO,EACP;IACAD,EAAE,CAAE,kDAAmD,CAAC,EACxDkD,eAAe,CAACI,WAAW,CAAC,CAAC,EAC7B9B,cACA,CAAC,GACDxB,EAAE,CAAE,4CAA6C,CAAC;EACtD;EACA,MAAMuD,aAAa,GAAGxD,KAAK,CAAC,CAAC;EAE7B,oBACCiB,IAAA,CAACZ,YAAY;IAAAoD,QAAA,eACZxC,IAAA,CAACX,WAAW;MAAAmD,QAAA,EACPC,WAAW,iBACdzC,IAAA,CAACb,YAAY;QACZuD,SAAS,EAAC,+CAA+C;QACzDC,KAAK,EAAGT,eAAiB;QACzBU,YAAY,EAAG;UACdC,SAAS,EAAE,cAAc;UACzBH,SAAS,EACR;QACF,CAAG;QACHnC,IAAI,eACHP,IAAA,CAAAE,SAAA;UAAAsC,QAAA,eACCxC,IAAA,CAACH,SAAS;YACTU,IAAI,EAAGA,IAAM;YACbmC,SAAS,EAAC,oDAAoD;YAC9DI,UAAU;UAAA,CACV;QAAC,CACD,CACF;QACDL,WAAW,EAAG;UACbM,WAAW,EAAEV,gBAAgB;UAC7B,GAAGI;QACJ,CAAG;QACHO,SAAS,EAAG;UACXC,WAAW,EAAE,MAAM;UACnB,kBAAkB,EAAEV;QACrB,CAAG;QAAAC,QAAA,EAEDA,CAAA,kBACDxC,IAAA,CAACT,IAAI;UAAC2D,EAAE,EAAGX,aAAe;UAAAC,QAAA,EACvBH;QAAgB,CACb;MACN,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["useId","__","sprintf","_x","DropdownMenu","ToolbarGroup","ToolbarItem","__experimentalText","Text","store","blocksStore","useSelect","copy","blockEditorStore","BlockIcon","useBlockDisplayTitle","jsx","_jsx","Fragment","_Fragment","BlockBindingsToolbarIndicator","clientIds","isSingleBlockSelected","length","icon","firstBlockName","isConnectedToPatternOverrides","select","getBlockAttributes","getBlockNamesByClientId","getBlocksByClientId","getBlockType","getActiveBlockVariation","blockTypeNames","_firstBlockTypeName","firstBlockType","_icon","match","isSelectionOfSameType","Set","size","metadata","name","some","block","Object","values","attributes","bindings","binding","source","firstBlockTitle","clientId","maximumLength","blockDescription","toLowerCase","descriptionId","children","toggleProps","className","label","popoverProps","placement","showColors","describedBy","menuProps","orientation","id"],"sources":["@wordpress/block-editor/src/components/block-bindings-toolbar-indicator/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useId } from '@wordpress/element';\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\n\nexport default function BlockBindingsToolbarIndicator( { clientIds } ) {\n\tconst isSingleBlockSelected = clientIds.length === 1;\n\tconst { icon, firstBlockName, isConnectedToPatternOverrides } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockNamesByClientId,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst blockTypeNames = getBlockNamesByClientId( clientIds );\n\t\t\tconst _firstBlockTypeName = blockTypeNames[ 0 ];\n\t\t\tconst firstBlockType = getBlockType( _firstBlockTypeName );\n\t\t\tlet _icon;\n\t\t\tif ( isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\t_firstBlockTypeName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || firstBlockType.icon;\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( blockTypeNames ).size === 1;\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? firstBlockType.icon : copy;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ticon: _icon,\n\t\t\t\tfirstBlockName: getBlockAttributes( clientIds[ 0 ] ).metadata\n\t\t\t\t\t.name,\n\t\t\t\tisConnectedToPatternOverrides: getBlocksByClientId(\n\t\t\t\t\tclientIds\n\t\t\t\t).some( ( block ) =>\n\t\t\t\t\tObject.values(\n\t\t\t\t\t\tblock?.attributes?.metadata?.bindings || {}\n\t\t\t\t\t).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientIds, isSingleBlockSelected ]\n\t);\n\tconst firstBlockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\n\tlet blockDescription = isSingleBlockSelected\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\tif ( isConnectedToPatternOverrides && firstBlockName ) {\n\t\tblockDescription = isSingleBlockSelected\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %1s: The block type's name; %2s: The block's user-provided name (the same as the override name). */\n\t\t\t\t\t__( 'This %1$s is editable using the \"%2$s\" override.' ),\n\t\t\t\t\tfirstBlockTitle.toLowerCase(),\n\t\t\t\t\tfirstBlockName\n\t\t\t )\n\t\t\t: __( 'These blocks are editable using overrides.' );\n\t}\n\tconst descriptionId = useId();\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-bindings-toolbar-indicator\"\n\t\t\t\t\t\tlabel={ firstBlockTitle }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t'block-editor-block-bindings-toolbar-indicator__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-bindings-toolbar-indicator-icon\"\n\t\t\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescribedBy: blockDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ {\n\t\t\t\t\t\t\torientation: 'both',\n\t\t\t\t\t\t\t'aria-describedby': descriptionId,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<Text id={ descriptionId }>\n\t\t\t\t\t\t\t\t{ blockDescription }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,EAAE,EAA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AAA,EACPC,WAAW,iBACdzC,IAAA,CAACb,YAAY;QACZuD,SAAS,EAAC,+CAA+C;QACzDC,KAAK,EAAGT,eAAiB;QACzBU,YAAY,EAAG;UACdC,SAAS,EAAE,cAAc;UACzBH,SAAS,EACR;QACF,CAAG;QACHnC,IAAI,eACHP,IAAA,CAAAE,SAAA;UAAAsC,QAAA,eACCxC,IAAA,CAACH,SAAS;YACTU,IAAI,EAAGA,IAAM;YACbmC,SAAS,EAAC,oDAAoD;YAC9DI,UAAU;UAAA,CACV;QAAC,CACD,CACF;QACDL,WAAW,EAAG;UACbM,WAAW,EAAEV,gBAAgB;UAC7B,GAAGI;QACJ,CAAG;QACHO,SAAS,EAAG;UACXC,WAAW,EAAE,MAAM;UACnB,kBAAkB,EAAEV;QACrB,CAAG;QAAAC,QAAA,EAEDA,CAAA,kBACDxC,IAAA,CAACT,IAAI;UAAC2D,EAAE,EAAGX,aAAe;UAAAC,QAAA,EACvBH;QAAgB,CACb;MACN,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB","ignoreList":[]}
@@ -51,7 +51,10 @@ function ButtonBlockAppender({
51
51
  className: clsx(className, 'block-editor-button-block-appender'),
52
52
  onClick: onToggle,
53
53
  "aria-haspopup": isToggleButton ? 'true' : undefined,
54
- "aria-expanded": isToggleButton ? isOpen : undefined,
54
+ "aria-expanded": isToggleButton ? isOpen : undefined
55
+ // Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.
56
+ // eslint-disable-next-line no-restricted-syntax
57
+ ,
55
58
  disabled: disabled,
56
59
  label: label,
57
60
  children: [!hasSingleBlockType && /*#__PURE__*/_jsx(VisuallyHidden, {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Button","Tooltip","VisuallyHidden","forwardRef","_x","sprintf","Icon","plus","deprecated","Inserter","jsx","_jsx","jsxs","_jsxs","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","ref","position","__experimentalIsQuick","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","label","isToggleButton","inserterButton","onClick","undefined","children","as","icon","text","isAppender","ButtonBlockerAppender","props","alternative","since"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Tooltip, VisuallyHidden } from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex },\n\tref\n) {\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tlet label;\n\t\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\t\tlabel = sprintf(\n\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\t\t\t\tblockTitle\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tlabel = _x(\n\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\n\t\t\t\tlet inserterButton = (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'block-editor-button-block-appender'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup={ isToggleButton ? 'true' : undefined }\n\t\t\t\t\t\taria-expanded={ isToggleButton ? isOpen : undefined }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! hasSingleBlockType && (\n\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">{ label }</VisuallyHidden>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Icon icon={ plus } />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\n\t\t\t\tif ( isToggleButton || hasSingleBlockType ) {\n\t\t\t\t\tinserterButton = (\n\t\t\t\t\t\t<Tooltip text={ label }>{ inserterButton }</Tooltip>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn inserterButton;\n\t\t\t} }\n\t\t\tisAppender\n\t\t/>\n\t);\n}\n\n/**\n * Use `ButtonBlockAppender` instead.\n *\n * @deprecated\n */\nexport const ButtonBlockerAppender = forwardRef( ( props, ref ) => {\n\tdeprecated( `wp.blockEditor.ButtonBlockerAppender`, {\n\t\talternative: 'wp.blockEditor.ButtonBlockAppender',\n\t\tsince: '5.9',\n\t} );\n\n\treturn ButtonBlockAppender( props, ref );\n} );\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default forwardRef( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,OAAO,EAAEC,cAAc,QAAQ,uBAAuB;AACvE,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,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ED,IAAKsB,cAAc,IAAIF,kBAAkB,EAAG;QAC3CG,cAAc,gBACbnB,IAAA,CAACV,OAAO;UAACmC,IAAI,EAAGR,KAAO;UAAAK,QAAA,EAAGH;QAAc,CAAW,CACnD;MACF;MACA,OAAOA,cAAc;IACtB,CAAG;IACHO,UAAU;EAAA,CACV,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGnC,UAAU,CAAE,CAAEoC,KAAK,EAAEpB,GAAG,KAAM;EAClEX,UAAU,CAAG,sCAAqC,EAAE;IACnDgC,WAAW,EAAE,oCAAoC;IACjDC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO3B,mBAAmB,CAAEyB,KAAK,EAAEpB,GAAI,CAAC;AACzC,CAAE,CAAC;;AAEH;AACA;AACA;AACA,eAAehB,UAAU,CAAEW,mBAAoB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","Tooltip","VisuallyHidden","forwardRef","_x","sprintf","Icon","plus","deprecated","Inserter","jsx","_jsx","jsxs","_jsxs","ButtonBlockAppender","rootClientId","className","onFocus","tabIndex","ref","position","__experimentalIsQuick","renderToggle","onToggle","disabled","isOpen","blockTitle","hasSingleBlockType","label","isToggleButton","inserterButton","onClick","undefined","children","as","icon","text","isAppender","ButtonBlockerAppender","props","alternative","since"],"sources":["@wordpress/block-editor/src/components/button-block-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Tooltip, VisuallyHidden } from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\n\nfunction ButtonBlockAppender(\n\t{ rootClientId, className, onFocus, tabIndex },\n\tref\n) {\n\treturn (\n\t\t<Inserter\n\t\t\tposition=\"bottom center\"\n\t\t\trootClientId={ rootClientId }\n\t\t\t__experimentalIsQuick\n\t\t\trenderToggle={ ( {\n\t\t\t\tonToggle,\n\t\t\t\tdisabled,\n\t\t\t\tisOpen,\n\t\t\t\tblockTitle,\n\t\t\t\thasSingleBlockType,\n\t\t\t} ) => {\n\t\t\t\tlet label;\n\t\t\t\tif ( hasSingleBlockType ) {\n\t\t\t\t\tlabel = sprintf(\n\t\t\t\t\t\t// translators: %s: the name of the block when there is only one\n\t\t\t\t\t\t_x( 'Add %s', 'directly add the only allowed block' ),\n\t\t\t\t\t\tblockTitle\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tlabel = _x(\n\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst isToggleButton = ! hasSingleBlockType;\n\n\t\t\t\tlet inserterButton = (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'block-editor-button-block-appender'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup={ isToggleButton ? 'true' : undefined }\n\t\t\t\t\t\taria-expanded={ isToggleButton ? isOpen : undefined }\n\t\t\t\t\t\t// Disable reason: There shouldn't be a case where this button is disabled but not visually hidden.\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! hasSingleBlockType && (\n\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">{ label }</VisuallyHidden>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Icon icon={ plus } />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\n\t\t\t\tif ( isToggleButton || hasSingleBlockType ) {\n\t\t\t\t\tinserterButton = (\n\t\t\t\t\t\t<Tooltip text={ label }>{ inserterButton }</Tooltip>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn inserterButton;\n\t\t\t} }\n\t\t\tisAppender\n\t\t/>\n\t);\n}\n\n/**\n * Use `ButtonBlockAppender` instead.\n *\n * @deprecated\n */\nexport const ButtonBlockerAppender = forwardRef( ( props, ref ) => {\n\tdeprecated( `wp.blockEditor.ButtonBlockerAppender`, {\n\t\talternative: 'wp.blockEditor.ButtonBlockAppender',\n\t\tsince: '5.9',\n\t} );\n\n\treturn ButtonBlockAppender( props, ref );\n} );\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md\n */\nexport default forwardRef( ButtonBlockAppender );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,OAAO,EAAEC,cAAc,QAAQ,uBAAuB;AACvE,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnC,SAASC,mBAAmBA,CAC3B;EAAEC,YAAY;EAAEC,SAAS;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAC9CC,GAAG,EACF;EACD,oBACCR,IAAA,CAACF,QAAQ;IACRW,QAAQ,EAAC,eAAe;IACxBL,YAAY,EAAGA,YAAc;IAC7BM,qBAAqB;IACrBC,YAAY,EAAGA,CAAE;MAChBC,QAAQ;MACRC,QAAQ;MACRC,MAAM;MACNC,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DgC,WAAW,EAAE,oCAAoC;IACjDC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO3B,mBAAmB,CAAEyB,KAAK,EAAEpB,GAAI,CAAC;AACzC,CAAE,CAAC;;AAEH;AACA;AACA;AACA,eAAehB,UAAU,CAAEW,mBAAoB,CAAC","ignoreList":[]}
@@ -7,7 +7,7 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, ToggleControl, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalUnitControl as UnitControl, __experimentalVStack as VStack, DropZone, FlexItem, FocalPointPicker, MenuItem, VisuallyHidden, __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalTruncate as Truncate } from '@wordpress/components';
10
- import { __, sprintf } from '@wordpress/i18n';
10
+ import { __, _x, sprintf } from '@wordpress/i18n';
11
11
  import { store as noticesStore } from '@wordpress/notices';
12
12
  import { getFilename } from '@wordpress/url';
13
13
  import { useCallback, Platform, useRef } from '@wordpress/element';
@@ -404,13 +404,13 @@ function BackgroundSizeToolsPanelItem({
404
404
  help: backgroundSizeHelpText(sizeValue || defaultValues?.backgroundSize),
405
405
  children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
406
406
  value: "cover",
407
- label: __('Cover')
407
+ label: _x('Cover', 'Size option for background image control')
408
408
  }, "cover"), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
409
409
  value: "contain",
410
- label: __('Contain')
410
+ label: _x('Contain', 'Size option for background image control')
411
411
  }, "contain"), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
412
412
  value: "auto",
413
- label: __('Tile')
413
+ label: _x('Tile', 'Size option for background image control')
414
414
  }, "tile")]
415
415
  }), /*#__PURE__*/_jsxs(HStack, {
416
416
  justify: "flex-start",
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__experimentalVStack","VStack","DropZone","FlexItem","FocalPointPicker","MenuItem","VisuallyHidden","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalTruncate","Truncate","__","sprintf","store","noticesStore","getFilename","useCallback","Platform","useRef","useDispatch","useSelect","focus","isBlobURL","TOOLSPANEL_DROPDOWNMENU_PROPS","setImmutably","MediaReplaceFlow","blockEditorStore","getResolvedThemeFilePath","jsx","_jsx","jsxs","_jsxs","IMAGE_BACKGROUND_TYPE","DEFAULT_CONTROLS","backgroundImage","backgroundSize","useHasBackgroundPanel","settings","OS","background","hasBackgroundSizeValue","style","backgroundPosition","undefined","hasBackgroundImageValue","id","url","backgroundSizeHelpText","value","coordsToBackgroundPosition","isNaN","x","y","backgroundPositionToCoords","split","map","v","parseFloat","InspectorImagePreview","label","filename","imgUrl","imgLabel","as","children","justify","className","numberOfLines","BackgroundImageToolsPanelItem","panelId","isShownByDefault","onChange","inheritedValue","themeFileURIs","mediaUpload","select","getSettings","title","replaceContainerRef","createErrorNotice","onUploadError","message","type","resetBackgroundImage","onSelectMedia","media","media_type","sizeValue","positionValue","source","onFilesDrop","filesList","allowedTypes","onFileChange","image","onError","resetAllFilter","previousValue","hasValue","closeAndFocus","toggleButton","tabbable","find","current","click","onRemove","canRemove","onDeselect","ref","mediaId","mediaURL","accept","onSelect","name","variant","onClick","BackgroundSizeToolsPanelItem","defaultValues","repeatValue","backgroundRepeat","imageValue","currentValueForToggle","repeatCheckedValue","updateBackgroundSize","next","nextRepeat","nextPosition","updateBackgroundPosition","toggleIsRepeated","resetBackgroundSize","spacing","__next40pxDefaultSize","size","isBlock","help","__unstableInputWidth","min","placeholder","checked","BackgroundToolsPanel","headerLabel","resetAll","updatedValue","dropdownMenuProps","BackgroundPanel","Wrapper","defaultControls","shouldShowBackgroundSizeControls"],"sources":["@wordpress/block-editor/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalVStack as VStack,\n\tDropZone,\n\tFlexItem,\n\tFocalPointPicker,\n\tMenuItem,\n\tVisuallyHidden,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\nimport { useCallback, Platform, useRef } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport MediaReplaceFlow from '../media-replace-flow';\nimport { store as blockEditorStore } from '../../store';\nimport { getResolvedThemeFilePath } from './theme-file-uri-utils';\n\nconst IMAGE_BACKGROUND_TYPE = 'image';\nconst DEFAULT_CONTROLS = {\n\tbackgroundImage: true,\n\tbackgroundSize: false,\n};\n\n/**\n * Checks site settings to see if the background panel may be used.\n * `settings.background.backgroundSize` exists also,\n * but can only be used if settings?.background?.backgroundImage is `true`.\n *\n * @param {Object} settings Site settings\n * @return {boolean} Whether site settings has activated background panel.\n */\nexport function useHasBackgroundPanel( settings ) {\n\treturn Platform.OS === 'web' && settings?.background?.backgroundImage;\n}\n\n/**\n * Checks if there is a current value in the background size block support\n * attributes. Background size values include background size as well\n * as background position.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background size value set.\n */\nexport function hasBackgroundSizeValue( style ) {\n\treturn (\n\t\tstyle?.background?.backgroundPosition !== undefined ||\n\t\tstyle?.background?.backgroundSize !== undefined\n\t);\n}\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t// Supports url() string values in theme.json.\n\t\t'string' === typeof style?.background?.backgroundImage ||\n\t\t!! style?.background?.backgroundImage?.url\n\t);\n}\n\n/**\n * Get the help text for the background size control.\n *\n * @param {string} value backgroundSize value.\n * @return {string} Translated help text.\n */\nfunction backgroundSizeHelpText( value ) {\n\tif ( value === 'cover' || value === undefined ) {\n\t\treturn __( 'Image covers the space evenly.' );\n\t}\n\tif ( value === 'contain' ) {\n\t\treturn __( 'Image is contained without distortion.' );\n\t}\n\treturn __( 'Image has a fixed width.' );\n}\n\n/**\n * Converts decimal x and y coords from FocalPointPicker to percentage-based values\n * to use as backgroundPosition value.\n *\n * @param {{x?:number, y?:number}} value FocalPointPicker coords.\n * @return {string} \t\t\t\t backgroundPosition value.\n */\nexport const coordsToBackgroundPosition = ( value ) => {\n\tif ( ! value || ( isNaN( value.x ) && isNaN( value.y ) ) ) {\n\t\treturn undefined;\n\t}\n\n\tconst x = isNaN( value.x ) ? 0.5 : value.x;\n\tconst y = isNaN( value.y ) ? 0.5 : value.y;\n\n\treturn `${ x * 100 }% ${ y * 100 }%`;\n};\n\n/**\n * Converts backgroundPosition value to x and y coords for FocalPointPicker.\n *\n * @param {string} value backgroundPosition value.\n * @return {{x?:number, y?:number}} FocalPointPicker coords.\n */\nexport const backgroundPositionToCoords = ( value ) => {\n\tif ( ! value ) {\n\t\treturn { x: undefined, y: undefined };\n\t}\n\n\tlet [ x, y ] = value.split( ' ' ).map( ( v ) => parseFloat( v ) / 100 );\n\tx = isNaN( x ) ? undefined : x;\n\ty = isNaN( y ) ? x : y;\n\n\treturn { x, y };\n};\n\nfunction InspectorImagePreview( { label, filename, url: imgUrl } ) {\n\tconst imgLabel =\n\t\tlabel || getFilename( imgUrl ) || __( 'Add background image' );\n\n\treturn (\n\t\t<ItemGroup as=\"span\">\n\t\t\t<HStack justify={ imgUrl ? 'flex-start' : 'center' } as=\"span\">\n\t\t\t\t{ imgUrl && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-image': imgUrl,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tbackgroundImage: `url(${ imgUrl })`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<FlexItem as=\"span\">\n\t\t\t\t\t<Truncate\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ imgLabel }\n\t\t\t\t\t</Truncate>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ imgUrl\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t\t\t\t\t__( 'Background image: %s' ),\n\t\t\t\t\t\t\t\t\tfilename || imgLabel\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __( 'No background image selected' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t</ItemGroup>\n\t);\n}\n\nfunction BackgroundImageToolsPanelItem( {\n\tpanelId,\n\tisShownByDefault,\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tthemeFileURIs,\n} ) {\n\tconst mediaUpload = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\n\tconst { id, title, url } = style?.background?.backgroundImage || {\n\t\t...inheritedValue?.background?.backgroundImage,\n\t};\n\n\tconst replaceContainerRef = useRef();\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst resetBackgroundImage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundImage' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\n\tconst onSelectMedia = ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tresetBackgroundImage();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// For media selections originated from a file upload.\n\t\tif (\n\t\t\t( media.media_type &&\n\t\t\t\tmedia.media_type !== IMAGE_BACKGROUND_TYPE ) ||\n\t\t\t( ! media.media_type &&\n\t\t\t\tmedia.type &&\n\t\t\t\tmedia.type !== IMAGE_BACKGROUND_TYPE )\n\t\t) {\n\t\t\tonUploadError(\n\t\t\t\t__( 'Only images can be used as a background image.' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sizeValue = style?.background?.backgroundSize;\n\t\tconst positionValue = style?.background?.backgroundPosition;\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundImage: {\n\t\t\t\t\turl: media.url,\n\t\t\t\t\tid: media.id,\n\t\t\t\t\tsource: 'file',\n\t\t\t\t\ttitle: media.title || undefined,\n\t\t\t\t},\n\t\t\t\tbackgroundPosition:\n\t\t\t\t\t! positionValue && ( 'auto' === sizeValue || ! sizeValue )\n\t\t\t\t\t\t? '50% 0'\n\t\t\t\t\t\t: positionValue,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst onFilesDrop = ( filesList ) => {\n\t\tmediaUpload( {\n\t\t\tallowedTypes: [ IMAGE_BACKGROUND_TYPE ],\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonSelectMedia( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t} );\n\t};\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tstyle: {\n\t\t\t\t...previousValue.style,\n\t\t\t\tbackground: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst hasValue = hasBackgroundImageValue( style );\n\n\tconst closeAndFocus = () => {\n\t\tconst [ toggleButton ] = focus.tabbable.find(\n\t\t\treplaceContainerRef.current\n\t\t);\n\t\t// Focus the toggle button and close the dropdown menu.\n\t\t// This ensures similar behaviour as to selecting an image, where the dropdown is\n\t\t// closed and focus is redirected to the dropdown toggle button.\n\t\ttoggleButton?.focus();\n\t\ttoggleButton?.click();\n\t};\n\n\tconst onRemove = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background', 'backgroundImage' ], 'none' )\n\t\t);\n\tconst canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"single-column\"\n\t\t\thasValue={ () => hasValue }\n\t\t\tlabel={ __( 'Background image' ) }\n\t\t\tonDeselect={ resetBackgroundImage }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-container\"\n\t\t\t\tref={ replaceContainerRef }\n\t\t\t>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tonSelect={ onSelectMedia }\n\t\t\t\t\tname={\n\t\t\t\t\t\t<InspectorImagePreview\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tfilename={ title }\n\t\t\t\t\t\t\turl={ getResolvedThemeFilePath(\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\tthemeFileURIs\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t>\n\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ hasValue && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\t\tresetBackgroundImage();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset ' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t<DropZone\n\t\t\t\t\tonFilesDrop={ onFilesDrop }\n\t\t\t\t\tlabel={ __( 'Drop to upload' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nfunction BackgroundSizeToolsPanelItem( {\n\tpanelId,\n\tisShownByDefault,\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tdefaultValues,\n\tthemeFileURIs,\n} ) {\n\tconst sizeValue =\n\t\tstyle?.background?.backgroundSize ||\n\t\tinheritedValue?.background?.backgroundSize;\n\tconst repeatValue =\n\t\tstyle?.background?.backgroundRepeat ||\n\t\tinheritedValue?.background?.backgroundRepeat;\n\tconst imageValue =\n\t\tstyle?.background?.backgroundImage?.url ||\n\t\tinheritedValue?.background?.backgroundImage?.url;\n\tconst positionValue =\n\t\tstyle?.background?.backgroundPosition ||\n\t\tinheritedValue?.background?.backgroundPosition;\n\n\t/*\n\t * An `undefined` value is replaced with any supplied\n\t * default control value for the toggle group control.\n\t * An empty string is treated as `auto` - this allows a user\n\t * to select \"Size\" and then enter a custom value, with an\n\t * empty value being treated as `auto`.\n\t */\n\tconst currentValueForToggle =\n\t\t( sizeValue !== undefined &&\n\t\t\tsizeValue !== 'cover' &&\n\t\t\tsizeValue !== 'contain' ) ||\n\t\tsizeValue === ''\n\t\t\t? 'auto'\n\t\t\t: sizeValue || defaultValues?.backgroundSize;\n\n\t/*\n\t * If the current value is `cover` and the repeat value is `undefined`, then\n\t * the toggle should be unchecked as the default state. Otherwise, the toggle\n\t * should reflect the current repeat value.\n\t */\n\tconst repeatCheckedValue = ! (\n\t\trepeatValue === 'no-repeat' ||\n\t\t( currentValueForToggle === 'cover' && repeatValue === undefined )\n\t);\n\n\tconst hasValue = hasBackgroundSizeValue( style );\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tstyle: {\n\t\t\t\t...previousValue.style,\n\t\t\t\tbackground: {\n\t\t\t\t\t...previousValue.style?.background,\n\t\t\t\t\tbackgroundRepeat: undefined,\n\t\t\t\t\tbackgroundSize: undefined,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst updateBackgroundSize = ( next ) => {\n\t\t// When switching to 'contain' toggle the repeat off.\n\t\tlet nextRepeat = repeatValue;\n\t\tlet nextPosition = positionValue;\n\n\t\tif ( next === 'contain' ) {\n\t\t\tnextRepeat = 'no-repeat';\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif ( next === 'cover' ) {\n\t\t\tnextRepeat = undefined;\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif (\n\t\t\t( currentValueForToggle === 'cover' ||\n\t\t\t\tcurrentValueForToggle === 'contain' ) &&\n\t\t\tnext === 'auto'\n\t\t) {\n\t\t\tnextRepeat = undefined;\n\t\t\t/*\n\t\t\t * A background image uploaded and set in the editor (an image with a record id),\n\t\t\t * receives a default background position of '50% 0',\n\t\t\t * when the toggle switches to \"Tile\". This is to increase the chance that\n\t\t\t * the image's focus point is visible.\n\t\t\t */\n\t\t\tif ( !! style?.background?.backgroundImage?.id ) {\n\t\t\t\tnextPosition = '50% 0';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Next will be null when the input is cleared,\n\t\t * in which case the value should be 'auto'.\n\t\t */\n\t\tif ( ! next && currentValueForToggle === 'auto' ) {\n\t\t\tnext = 'auto';\n\t\t}\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: nextPosition,\n\t\t\t\tbackgroundRepeat: nextRepeat,\n\t\t\t\tbackgroundSize: next,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst updateBackgroundPosition = ( next ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundPosition' ],\n\t\t\t\tcoordsToBackgroundPosition( next )\n\t\t\t)\n\t\t);\n\t};\n\n\tconst toggleIsRepeated = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundRepeat' ],\n\t\t\t\trepeatCheckedValue === true ? 'no-repeat' : 'repeat'\n\t\t\t)\n\t\t);\n\n\tconst resetBackgroundSize = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: undefined,\n\t\t\t\tbackgroundRepeat: undefined,\n\t\t\t\tbackgroundSize: undefined,\n\t\t\t} )\n\t\t);\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\tclassName=\"single-column\"\n\t\t\thasValue={ () => hasValue }\n\t\t\tlabel={ __( 'Size' ) }\n\t\t\tonDeselect={ resetBackgroundSize }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<FocalPointPicker\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\turl={ getResolvedThemeFilePath( imageValue, themeFileURIs ) }\n\t\t\t\tvalue={ backgroundPositionToCoords( positionValue ) }\n\t\t\t\tonChange={ updateBackgroundPosition }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\tvalue={ currentValueForToggle }\n\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\tisBlock\n\t\t\t\thelp={ backgroundSizeHelpText(\n\t\t\t\t\tsizeValue || defaultValues?.backgroundSize\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"cover\"\n\t\t\t\t\tvalue=\"cover\"\n\t\t\t\t\tlabel={ __( 'Cover' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"contain\"\n\t\t\t\t\tvalue=\"contain\"\n\t\t\t\t\tlabel={ __( 'Contain' ) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"tile\"\n\t\t\t\t\tvalue=\"auto\"\n\t\t\t\t\tlabel={ __( 'Tile' ) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 } as=\"span\">\n\t\t\t\t{ currentValueForToggle !== undefined &&\n\t\t\t\tcurrentValueForToggle !== 'cover' &&\n\t\t\t\tcurrentValueForToggle !== 'contain' ? (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\taria-label={ __( 'Background image width' ) }\n\t\t\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\t\t\tvalue={ sizeValue }\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__unstableInputWidth=\"100px\"\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tplaceholder={ __( 'Auto' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ currentValueForToggle !== 'cover' && (\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Repeat' ) }\n\t\t\t\t\t\tchecked={ repeatCheckedValue }\n\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n\nfunction BackgroundToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n\theaderLabel,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanel }\n\t\t\tspacing={ 4 }\n\t\t\tlabel={ headerLabel }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t>\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport default function BackgroundPanel( {\n\tas: Wrapper = BackgroundToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tdefaultValues = {},\n\theaderLabel = __( 'Background image' ),\n\tthemeFileURIs,\n} ) {\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tbackground: {},\n\t\t};\n\t}, [] );\n\tconst shouldShowBackgroundSizeControls =\n\t\tsettings?.background?.backgroundSize;\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t\theaderLabel={ headerLabel }\n\t\t>\n\t\t\t<BackgroundImageToolsPanelItem\n\t\t\t\tonChange={ onChange }\n\t\t\t\tpanelId={ panelId }\n\t\t\t\tisShownByDefault={ defaultControls.backgroundImage }\n\t\t\t\tstyle={ value }\n\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\tthemeFileURIs={ themeFileURIs }\n\t\t\t/>\n\t\t\t{ shouldShowBackgroundSizeControls && (\n\t\t\t\t<BackgroundSizeToolsPanelItem\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\tisShownByDefault={ defaultControls.backgroundSize }\n\t\t\t\t\tstyle={ value }\n\t\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\tthemeFileURIs={ themeFileURIs }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,aAAa,EACbC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,yBAA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,CACD;EAAA,CACO,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","ToggleControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalUnitControl","UnitControl","__experimentalVStack","VStack","DropZone","FlexItem","FocalPointPicker","MenuItem","VisuallyHidden","__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalTruncate","Truncate","__","_x","sprintf","store","noticesStore","getFilename","useCallback","Platform","useRef","useDispatch","useSelect","focus","isBlobURL","TOOLSPANEL_DROPDOWNMENU_PROPS","setImmutably","MediaReplaceFlow","blockEditorStore","getResolvedThemeFilePath","jsx","_jsx","jsxs","_jsxs","IMAGE_BACKGROUND_TYPE","DEFAULT_CONTROLS","backgroundImage","backgroundSize","useHasBackgroundPanel","settings","OS","background","hasBackgroundSizeValue","style","backgroundPosition","undefined","hasBackgroundImageValue","id","url","backgroundSizeHelpText","value","coordsToBackgroundPosition","isNaN","x","y","backgroundPositionToCoords","split","map","v","parseFloat","InspectorImagePreview","label","filename","imgUrl","imgLabel","as","children","justify","className","numberOfLines","BackgroundImageToolsPanelItem","panelId","isShownByDefault","onChange","inheritedValue","themeFileURIs","mediaUpload","select","getSettings","title","replaceContainerRef","createErrorNotice","onUploadError","message","type","resetBackgroundImage","onSelectMedia","media","media_type","sizeValue","positionValue","source","onFilesDrop","filesList","allowedTypes","onFileChange","image","onError","resetAllFilter","previousValue","hasValue","closeAndFocus","toggleButton","tabbable","find","current","click","onRemove","canRemove","onDeselect","ref","mediaId","mediaURL","accept","onSelect","name","variant","onClick","BackgroundSizeToolsPanelItem","defaultValues","repeatValue","backgroundRepeat","imageValue","currentValueForToggle","repeatCheckedValue","updateBackgroundSize","next","nextRepeat","nextPosition","updateBackgroundPosition","toggleIsRepeated","resetBackgroundSize","spacing","__next40pxDefaultSize","size","isBlock","help","__unstableInputWidth","min","placeholder","checked","BackgroundToolsPanel","headerLabel","resetAll","updatedValue","dropdownMenuProps","BackgroundPanel","Wrapper","defaultControls","shouldShowBackgroundSizeControls"],"sources":["@wordpress/block-editor/src/components/global-styles/background-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalVStack as VStack,\n\tDropZone,\n\tFlexItem,\n\tFocalPointPicker,\n\tMenuItem,\n\tVisuallyHidden,\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\nimport { useCallback, Platform, useRef } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport MediaReplaceFlow from '../media-replace-flow';\nimport { store as blockEditorStore } from '../../store';\nimport { getResolvedThemeFilePath } from './theme-file-uri-utils';\n\nconst IMAGE_BACKGROUND_TYPE = 'image';\nconst DEFAULT_CONTROLS = {\n\tbackgroundImage: true,\n\tbackgroundSize: false,\n};\n\n/**\n * Checks site settings to see if the background panel may be used.\n * `settings.background.backgroundSize` exists also,\n * but can only be used if settings?.background?.backgroundImage is `true`.\n *\n * @param {Object} settings Site settings\n * @return {boolean} Whether site settings has activated background panel.\n */\nexport function useHasBackgroundPanel( settings ) {\n\treturn Platform.OS === 'web' && settings?.background?.backgroundImage;\n}\n\n/**\n * Checks if there is a current value in the background size block support\n * attributes. Background size values include background size as well\n * as background position.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background size value set.\n */\nexport function hasBackgroundSizeValue( style ) {\n\treturn (\n\t\tstyle?.background?.backgroundPosition !== undefined ||\n\t\tstyle?.background?.backgroundSize !== undefined\n\t);\n}\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t// Supports url() string values in theme.json.\n\t\t'string' === typeof style?.background?.backgroundImage ||\n\t\t!! style?.background?.backgroundImage?.url\n\t);\n}\n\n/**\n * Get the help text for the background size control.\n *\n * @param {string} value backgroundSize value.\n * @return {string} Translated help text.\n */\nfunction backgroundSizeHelpText( value ) {\n\tif ( value === 'cover' || value === undefined ) {\n\t\treturn __( 'Image covers the space evenly.' );\n\t}\n\tif ( value === 'contain' ) {\n\t\treturn __( 'Image is contained without distortion.' );\n\t}\n\treturn __( 'Image has a fixed width.' );\n}\n\n/**\n * Converts decimal x and y coords from FocalPointPicker to percentage-based values\n * to use as backgroundPosition value.\n *\n * @param {{x?:number, y?:number}} value FocalPointPicker coords.\n * @return {string} \t\t\t\t backgroundPosition value.\n */\nexport const coordsToBackgroundPosition = ( value ) => {\n\tif ( ! value || ( isNaN( value.x ) && isNaN( value.y ) ) ) {\n\t\treturn undefined;\n\t}\n\n\tconst x = isNaN( value.x ) ? 0.5 : value.x;\n\tconst y = isNaN( value.y ) ? 0.5 : value.y;\n\n\treturn `${ x * 100 }% ${ y * 100 }%`;\n};\n\n/**\n * Converts backgroundPosition value to x and y coords for FocalPointPicker.\n *\n * @param {string} value backgroundPosition value.\n * @return {{x?:number, y?:number}} FocalPointPicker coords.\n */\nexport const backgroundPositionToCoords = ( value ) => {\n\tif ( ! value ) {\n\t\treturn { x: undefined, y: undefined };\n\t}\n\n\tlet [ x, y ] = value.split( ' ' ).map( ( v ) => parseFloat( v ) / 100 );\n\tx = isNaN( x ) ? undefined : x;\n\ty = isNaN( y ) ? x : y;\n\n\treturn { x, y };\n};\n\nfunction InspectorImagePreview( { label, filename, url: imgUrl } ) {\n\tconst imgLabel =\n\t\tlabel || getFilename( imgUrl ) || __( 'Add background image' );\n\n\treturn (\n\t\t<ItemGroup as=\"span\">\n\t\t\t<HStack justify={ imgUrl ? 'flex-start' : 'center' } as=\"span\">\n\t\t\t\t{ imgUrl && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-global-styles-background-panel__inspector-image-indicator-wrapper',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-image': imgUrl,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tbackgroundImage: `url(${ imgUrl })`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<FlexItem as=\"span\">\n\t\t\t\t\t<Truncate\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ imgLabel }\n\t\t\t\t\t</Truncate>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ imgUrl\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t\t\t\t\t__( 'Background image: %s' ),\n\t\t\t\t\t\t\t\t\tfilename || imgLabel\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __( 'No background image selected' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t</ItemGroup>\n\t);\n}\n\nfunction BackgroundImageToolsPanelItem( {\n\tpanelId,\n\tisShownByDefault,\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tthemeFileURIs,\n} ) {\n\tconst mediaUpload = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\n\tconst { id, title, url } = style?.background?.backgroundImage || {\n\t\t...inheritedValue?.background?.backgroundImage,\n\t};\n\n\tconst replaceContainerRef = useRef();\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst resetBackgroundImage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundImage' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\n\tconst onSelectMedia = ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tresetBackgroundImage();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// For media selections originated from a file upload.\n\t\tif (\n\t\t\t( media.media_type &&\n\t\t\t\tmedia.media_type !== IMAGE_BACKGROUND_TYPE ) ||\n\t\t\t( ! media.media_type &&\n\t\t\t\tmedia.type &&\n\t\t\t\tmedia.type !== IMAGE_BACKGROUND_TYPE )\n\t\t) {\n\t\t\tonUploadError(\n\t\t\t\t__( 'Only images can be used as a background image.' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sizeValue = style?.background?.backgroundSize;\n\t\tconst positionValue = style?.background?.backgroundPosition;\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundImage: {\n\t\t\t\t\turl: media.url,\n\t\t\t\t\tid: media.id,\n\t\t\t\t\tsource: 'file',\n\t\t\t\t\ttitle: media.title || undefined,\n\t\t\t\t},\n\t\t\t\tbackgroundPosition:\n\t\t\t\t\t! positionValue && ( 'auto' === sizeValue || ! sizeValue )\n\t\t\t\t\t\t? '50% 0'\n\t\t\t\t\t\t: positionValue,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst onFilesDrop = ( filesList ) => {\n\t\tmediaUpload( {\n\t\t\tallowedTypes: [ IMAGE_BACKGROUND_TYPE ],\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonSelectMedia( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t} );\n\t};\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tstyle: {\n\t\t\t\t...previousValue.style,\n\t\t\t\tbackground: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst hasValue = hasBackgroundImageValue( style );\n\n\tconst closeAndFocus = () => {\n\t\tconst [ toggleButton ] = focus.tabbable.find(\n\t\t\treplaceContainerRef.current\n\t\t);\n\t\t// Focus the toggle button and close the dropdown menu.\n\t\t// This ensures similar behaviour as to selecting an image, where the dropdown is\n\t\t// closed and focus is redirected to the dropdown toggle button.\n\t\ttoggleButton?.focus();\n\t\ttoggleButton?.click();\n\t};\n\n\tconst onRemove = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background', 'backgroundImage' ], 'none' )\n\t\t);\n\tconst canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"single-column\"\n\t\t\thasValue={ () => hasValue }\n\t\t\tlabel={ __( 'Background image' ) }\n\t\t\tonDeselect={ resetBackgroundImage }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-container\"\n\t\t\t\tref={ replaceContainerRef }\n\t\t\t>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tonSelect={ onSelectMedia }\n\t\t\t\t\tname={\n\t\t\t\t\t\t<InspectorImagePreview\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tfilename={ title }\n\t\t\t\t\t\t\turl={ getResolvedThemeFilePath(\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\tthemeFileURIs\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t>\n\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ hasValue && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\t\tresetBackgroundImage();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset ' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t<DropZone\n\t\t\t\t\tonFilesDrop={ onFilesDrop }\n\t\t\t\t\tlabel={ __( 'Drop to upload' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nfunction BackgroundSizeToolsPanelItem( {\n\tpanelId,\n\tisShownByDefault,\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tdefaultValues,\n\tthemeFileURIs,\n} ) {\n\tconst sizeValue =\n\t\tstyle?.background?.backgroundSize ||\n\t\tinheritedValue?.background?.backgroundSize;\n\tconst repeatValue =\n\t\tstyle?.background?.backgroundRepeat ||\n\t\tinheritedValue?.background?.backgroundRepeat;\n\tconst imageValue =\n\t\tstyle?.background?.backgroundImage?.url ||\n\t\tinheritedValue?.background?.backgroundImage?.url;\n\tconst positionValue =\n\t\tstyle?.background?.backgroundPosition ||\n\t\tinheritedValue?.background?.backgroundPosition;\n\n\t/*\n\t * An `undefined` value is replaced with any supplied\n\t * default control value for the toggle group control.\n\t * An empty string is treated as `auto` - this allows a user\n\t * to select \"Size\" and then enter a custom value, with an\n\t * empty value being treated as `auto`.\n\t */\n\tconst currentValueForToggle =\n\t\t( sizeValue !== undefined &&\n\t\t\tsizeValue !== 'cover' &&\n\t\t\tsizeValue !== 'contain' ) ||\n\t\tsizeValue === ''\n\t\t\t? 'auto'\n\t\t\t: sizeValue || defaultValues?.backgroundSize;\n\n\t/*\n\t * If the current value is `cover` and the repeat value is `undefined`, then\n\t * the toggle should be unchecked as the default state. Otherwise, the toggle\n\t * should reflect the current repeat value.\n\t */\n\tconst repeatCheckedValue = ! (\n\t\trepeatValue === 'no-repeat' ||\n\t\t( currentValueForToggle === 'cover' && repeatValue === undefined )\n\t);\n\n\tconst hasValue = hasBackgroundSizeValue( style );\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tstyle: {\n\t\t\t\t...previousValue.style,\n\t\t\t\tbackground: {\n\t\t\t\t\t...previousValue.style?.background,\n\t\t\t\t\tbackgroundRepeat: undefined,\n\t\t\t\t\tbackgroundSize: undefined,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}, [] );\n\n\tconst updateBackgroundSize = ( next ) => {\n\t\t// When switching to 'contain' toggle the repeat off.\n\t\tlet nextRepeat = repeatValue;\n\t\tlet nextPosition = positionValue;\n\n\t\tif ( next === 'contain' ) {\n\t\t\tnextRepeat = 'no-repeat';\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif ( next === 'cover' ) {\n\t\t\tnextRepeat = undefined;\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif (\n\t\t\t( currentValueForToggle === 'cover' ||\n\t\t\t\tcurrentValueForToggle === 'contain' ) &&\n\t\t\tnext === 'auto'\n\t\t) {\n\t\t\tnextRepeat = undefined;\n\t\t\t/*\n\t\t\t * A background image uploaded and set in the editor (an image with a record id),\n\t\t\t * receives a default background position of '50% 0',\n\t\t\t * when the toggle switches to \"Tile\". This is to increase the chance that\n\t\t\t * the image's focus point is visible.\n\t\t\t */\n\t\t\tif ( !! style?.background?.backgroundImage?.id ) {\n\t\t\t\tnextPosition = '50% 0';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Next will be null when the input is cleared,\n\t\t * in which case the value should be 'auto'.\n\t\t */\n\t\tif ( ! next && currentValueForToggle === 'auto' ) {\n\t\t\tnext = 'auto';\n\t\t}\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: nextPosition,\n\t\t\t\tbackgroundRepeat: nextRepeat,\n\t\t\t\tbackgroundSize: next,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst updateBackgroundPosition = ( next ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundPosition' ],\n\t\t\t\tcoordsToBackgroundPosition( next )\n\t\t\t)\n\t\t);\n\t};\n\n\tconst toggleIsRepeated = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundRepeat' ],\n\t\t\t\trepeatCheckedValue === true ? 'no-repeat' : 'repeat'\n\t\t\t)\n\t\t);\n\n\tconst resetBackgroundSize = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: undefined,\n\t\t\t\tbackgroundRepeat: undefined,\n\t\t\t\tbackgroundSize: undefined,\n\t\t\t} )\n\t\t);\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\tclassName=\"single-column\"\n\t\t\thasValue={ () => hasValue }\n\t\t\tlabel={ __( 'Size' ) }\n\t\t\tonDeselect={ resetBackgroundSize }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<FocalPointPicker\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\turl={ getResolvedThemeFilePath( imageValue, themeFileURIs ) }\n\t\t\t\tvalue={ backgroundPositionToCoords( positionValue ) }\n\t\t\t\tonChange={ updateBackgroundPosition }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\tvalue={ currentValueForToggle }\n\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\tisBlock\n\t\t\t\thelp={ backgroundSizeHelpText(\n\t\t\t\t\tsizeValue || defaultValues?.backgroundSize\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"cover\"\n\t\t\t\t\tvalue=\"cover\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Cover',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"contain\"\n\t\t\t\t\tvalue=\"contain\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Contain',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"tile\"\n\t\t\t\t\tvalue=\"auto\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Tile',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 } as=\"span\">\n\t\t\t\t{ currentValueForToggle !== undefined &&\n\t\t\t\tcurrentValueForToggle !== 'cover' &&\n\t\t\t\tcurrentValueForToggle !== 'contain' ? (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\taria-label={ __( 'Background image width' ) }\n\t\t\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\t\t\tvalue={ sizeValue }\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__unstableInputWidth=\"100px\"\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tplaceholder={ __( 'Auto' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ currentValueForToggle !== 'cover' && (\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Repeat' ) }\n\t\t\t\t\t\tchecked={ repeatCheckedValue }\n\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n\nfunction BackgroundToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n\theaderLabel,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanel }\n\t\t\tspacing={ 4 }\n\t\t\tlabel={ headerLabel }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t>\n\t\t\t{ children }\n\t\t</VStack>\n\t);\n}\n\nexport default function BackgroundPanel( {\n\tas: Wrapper = BackgroundToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tdefaultValues = {},\n\theaderLabel = __( 'Background image' ),\n\tthemeFileURIs,\n} ) {\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tbackground: {},\n\t\t};\n\t}, [] );\n\tconst shouldShowBackgroundSizeControls =\n\t\tsettings?.background?.backgroundSize;\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t\theaderLabel={ headerLabel }\n\t\t>\n\t\t\t<BackgroundImageToolsPanelItem\n\t\t\t\tonChange={ onChange }\n\t\t\t\tpanelId={ panelId }\n\t\t\t\tisShownByDefault={ defaultControls.backgroundImage }\n\t\t\t\tstyle={ value }\n\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\tthemeFileURIs={ themeFileURIs }\n\t\t\t/>\n\t\t\t{ shouldShowBackgroundSizeControls && (\n\t\t\t\t<BackgroundSizeToolsPanelItem\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t\tisShownByDefault={ defaultControls.backgroundSize }\n\t\t\t\t\tstyle={ value }\n\t\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\tthemeFileURIs={ themeFileURIs }\n\t\t\t\t/>\n\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aAAa,EAAGA;IAAe,CAC/B,CAAC,EACA0E,gCAAgC,iBACjCtH,IAAA,CAACuF,4BAA4B;MAC5B7C,QAAQ,EAAGA,QAAU;MACrBF,OAAO,EAAGA,OAAS;MACnBC,gBAAgB,EAAG4E,eAAe,CAAC/G,cAAgB;MACnDM,KAAK,EAAGO,KAAO;MACfwB,cAAc,EAAGA,cAAgB;MACjC6C,aAAa,EAAGA,aAAe;MAC/B5C,aAAa,EAAGA;IAAe,CAC/B,CACD;EAAA,CACO,CAAC;AAEZ","ignoreList":[]}
@@ -163,7 +163,7 @@ export function useSettingsForBlockElement(parentSettings, blockName, element) {
163
163
  updatedSettings.color.defaultDuotone = false;
164
164
  updatedSettings.color.customDuotone = false;
165
165
  }
166
- ['lineHeight', 'fontStyle', 'fontWeight', 'letterSpacing', 'textTransform', 'textDecoration', 'writingMode'].forEach(key => {
166
+ ['lineHeight', 'fontStyle', 'fontWeight', 'letterSpacing', 'textAlign', 'textTransform', 'textDecoration', 'writingMode'].forEach(key => {
167
167
  if (!supportedStyles.includes(key)) {
168
168
  updatedSettings.typography = {
169
169
  ...updatedSettings.typography,
@@ -1 +1 @@
1
- {"version":3,"names":["fastDeepEqual","useContext","useCallback","useMemo","useSelect","store","blocksStore","_x","getValueFromVariable","getPresetVariableFromValue","getValueFromObjectPath","setImmutably","GlobalStylesContext","unlock","EMPTY_CONFIG","settings","styles","VALID_SETTINGS","useGlobalStylesReset","user","config","setUserConfig","canReset","useGlobalSetting","propertyPath","blockName","source","configs","appendedBlockPath","appendedPropertyPath","contextualPath","globalPath","sourceKey","settingValue","configToUse","_getValueFromObjectPa","result","forEach","setting","_getValueFromObjectPa2","value","undefined","split","setSetting","newValue","currentConfig","useGlobalStyle","path","shouldDecodeEncode","merged","mergedConfig","base","baseConfig","userConfig","appendedPath","finalPath","setStyle","rawResult","useGlobalStyleLinks","_links","useSettingsForBlockElement","parentSettings","element","supportedStyles","supports","select","getSupportedStyles","getBlockType","updatedSettings","includes","typography","fontSizes","customFontSize","defaultFontSizes","fontFamilies","color","text","background","button","heading","link","caption","gradients","customGradient","defaultDuotone","customDuotone","key","textColumns","layout","spacing","sides","Array","isArray","length","dimensions","charAt","toUpperCase","slice","border","shadow","textAlign","useColorsPerOrigin","customColors","palette","custom","themeColors","theme","defaultColors","default","shouldDisplayDefaultColors","defaultPalette","push","name","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'background.backgroundImage',\n\t'background.backgroundRepeat',\n\t'background.backgroundSize',\n\t'background.backgroundPosition',\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.aspectRatio',\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.defaultSpacingSizes',\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.defaultFontSizes',\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.textAlign',\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\nexport function useGlobalStyleLinks() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn mergedConfig?._links;\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\tdefaultFontSizes: 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\t[ 'aspectRatio', 'minHeight' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.dimensions = {\n\t\t\t\t\t...updatedSettings.dimensions,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\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\t// Text alignment is only available for blocks.\n\t\tif ( element ) {\n\t\t\tupdatedSettings.typography.textAlign = false;\n\t\t}\n\n\t\treturn updatedSettings;\n\t}, [ parentSettings, supportedStyles, supports, element ] );\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":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,UAAU,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACrE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD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BAA6B,IAC7BD,gBAAgB,IAChBA,gBAAgB,CAACxB,MAAM,EACtB;MACDzD,MAAM,CAAC2E,IAAI,CAAE;QACZC,IAAI,EAAEzG,EAAE,CACP,SAAS,EACT,8CACD,CAAC;QACD2E,SAAS,EAAEmC;MACZ,CAAE,CAAC;IACJ;IACA,IAAKF,eAAe,IAAIA,eAAe,CAACtB,MAAM,EAAG;MAChDzD,MAAM,CAAC2E,IAAI,CAAE;QACZC,IAAI,EAAEzG,EAAE,CACP,QAAQ,EACR,gDACD,CAAC;QACD2E,SAAS,EAAEiC;MACZ,CAAE,CAAC;IACJ;IACA,OAAO/E,MAAM;EACd,CAAC,EAAE,CACF+E,eAAe,EACfC,cAAc,EACdC,gBAAgB,EAChBC,6BAA6B,CAC5B,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["fastDeepEqual","useContext","useCallback","useMemo","useSelect","store","blocksStore","_x","getValueFromVariable","getPresetVariableFromValue","getValueFromObjectPath","setImmutably","GlobalStylesContext","unlock","EMPTY_CONFIG","settings","styles","VALID_SETTINGS","useGlobalStylesReset","user","config","setUserConfig","canReset","useGlobalSetting","propertyPath","blockName","source","configs","appendedBlockPath","appendedPropertyPath","contextualPath","globalPath","sourceKey","settingValue","configToUse","_getValueFromObjectPa","result","forEach","setting","_getValueFromObjectPa2","value","undefined","split","setSetting","newValue","currentConfig","useGlobalStyle","path","shouldDecodeEncode","merged","mergedConfig","base","baseConfig","userConfig","appendedPath","finalPath","setStyle","rawResult","useGlobalStyleLinks","_links","useSettingsForBlockElement","parentSettings","element","supportedStyles","supports","select","getSupportedStyles","getBlockType","updatedSettings","includes","typography","fontSizes","customFontSize","defaultFontSizes","fontFamilies","color","text","background","button","heading","link","caption","gradients","customGradient","defaultDuotone","customDuotone","key","textColumns","layout","spacing","sides","Array","isArray","length","dimensions","charAt","toUpperCase","slice","border","shadow","textAlign","useColorsPerOrigin","customColors","palette","custom","themeColors","theme","defaultColors","default","shouldDisplayDefaultColors","defaultPalette","push","name","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'background.backgroundImage',\n\t'background.backgroundRepeat',\n\t'background.backgroundSize',\n\t'background.backgroundPosition',\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.aspectRatio',\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.defaultSpacingSizes',\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.defaultFontSizes',\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.textAlign',\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\nexport function useGlobalStyleLinks() {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn mergedConfig?._links;\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\tdefaultFontSizes: 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'textAlign',\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\t[ 'aspectRatio', 'minHeight' ].forEach( ( key ) => {\n\t\t\tif ( ! supportedStyles.includes( key ) ) {\n\t\t\t\tupdatedSettings.dimensions = {\n\t\t\t\t\t...updatedSettings.dimensions,\n\t\t\t\t\t[ key ]: false,\n\t\t\t\t};\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\t// Text alignment is only available for blocks.\n\t\tif ( element ) {\n\t\t\tupdatedSettings.typography.textAlign = false;\n\t\t}\n\n\t\treturn updatedSettings;\n\t}, [ parentSettings, supportedStyles, supports, element ] );\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":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,UAAU,EAAEC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACrE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,oBAAoB;AACzE,SAASC,mBAAmB,QAAQ,WAAW;AAC/C,SAASC,MA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C;IACJ;IACA,IAAKF,eAAe,IAAIA,eAAe,CAACtB,MAAM,EAAG;MAChDzD,MAAM,CAAC2E,IAAI,CAAE;QACZC,IAAI,EAAEzG,EAAE,CACP,QAAQ,EACR,gDACD,CAAC;QACD2E,SAAS,EAAEiC;MACZ,CAAE,CAAC;IACJ;IACA,OAAO/E,MAAM;EACd,CAAC,EAAE,CACF+E,eAAe,EACfC,cAAc,EACdC,gBAAgB,EAChBC,6BAA6B,CAC5B,CAAC;AACJ","ignoreList":[]}
@@ -154,8 +154,8 @@ export function BlockTypesTab({
154
154
  return /*#__PURE__*/_jsx(InserterListbox, {
155
155
  children: /*#__PURE__*/_jsxs("div", {
156
156
  ref: ref,
157
- children: [!!itemsForCurrentRoot.length && /*#__PURE__*/_jsxs(_Fragment, {
158
- children: [/*#__PURE__*/_jsx(BlockTypesTabPanel, {
157
+ children: [!!itemsForCurrentRoot.length && /*#__PURE__*/_jsx(_Fragment, {
158
+ children: /*#__PURE__*/_jsx(BlockTypesTabPanel, {
159
159
  items: itemsForCurrentRoot,
160
160
  categories: categories,
161
161
  collections: collections,
@@ -163,7 +163,7 @@ export function BlockTypesTab({
163
163
  onHover: onHover,
164
164
  showMostUsedBlocks: showMostUsedBlocks,
165
165
  className: "block-editor-inserter__insertable-blocks-at-selection"
166
- }), /*#__PURE__*/_jsx("hr", {})]
166
+ })
167
167
  }), /*#__PURE__*/_jsx(BlockTypesTabPanel, {
168
168
  items: itemsRemaining,
169
169
  categories: categories,
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","useMemo","useEffect","forwardRef","useAsyncList","BlockTypesList","InserterPanel","useBlockTypesState","InserterListbox","orderBy","InserterNoResults","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","children","title","onSelect","label","map","categoryItems","slug","icon","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","itemsForCurrentRoot","itemsRemaining","push"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect, forwardRef } from '@wordpress/element';\nimport { useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport InserterNoResults from './no-results';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function BlockTypesTabPanel( {\n\titems,\n\tcollections,\n\tcategories,\n\tonSelectItem,\n\tonHover,\n\tshowMostUsedBlocks,\n\tclassName,\n} ) {\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ showMostUsedBlocks &&\n\t\t\t\t// Only show the most used blocks if the total amount of block\n\t\t\t\t// is larger than 1 row, otherwise it is not so useful.\n\t\t\t\titems.length > 3 &&\n\t\t\t\t!! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t{ currentlyRenderedCategories.map( ( category ) => {\n\t\t\t\tconst categoryItems = items.filter(\n\t\t\t\t\t( item ) => item.category === category.slug\n\t\t\t\t);\n\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t);\n\t\t\t} ) }\n\n\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t<InserterPanel\n\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t/>\n\t\t\t\t</InserterPanel>\n\t\t\t) }\n\n\t\t\t{ currentlyRenderedCollections.map(\n\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport function BlockTypesTab(\n\t{ rootClientId, onInsert, onHover, showMostUsedBlocks },\n\tref\n) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tif ( ! items.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst itemsForCurrentRoot = [];\n\tconst itemsRemaining = [];\n\n\tfor ( const item of items ) {\n\t\t// Skip reusable blocks, they moved to the patterns tab.\n\t\tif ( item.category === 'reusable' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( rootClientId && item.rootClientId === rootClientId ) {\n\t\t\titemsForCurrentRoot.push( item );\n\t\t} else {\n\t\t\titemsRemaining.push( item );\n\t\t}\n\t}\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div ref={ ref }>\n\t\t\t\t{ !! itemsForCurrentRoot.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\t\t\titems={ itemsForCurrentRoot }\n\t\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\t\tcollections={ collections }\n\t\t\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__insertable-blocks-at-selection\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\titems={ itemsRemaining }\n\t\t\t\t\tcategories={ categories }\n\t\t\t\t\tcollections={ collections }\n\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tclassName=\"block-editor-inserter__all-blocks\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterListb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AC;IAC5B;EACD;EAEA,oBACCN,IAAA,CAACJ,eAAe;IAAAwC,QAAA,eACflC,KAAA;MAAK+C,GAAG,EAAGA,GAAK;MAAAb,QAAA,GACb,CAAC,CAAEc,mBAAmB,CAACpB,MAAM,iBAC9B5B,KAAA,CAAAE,SAAA;QAAAgC,QAAA,gBACCpC,IAAA,CAACW,kBAAkB;UAClBC,KAAK,EAAGsC,mBAAqB;UAC7BpC,UAAU,EAAGA,UAAY;UACzBD,WAAW,EAAGA,WAAa;UAC3BE,YAAY,EAAGA,YAAc;UAC7BC,OAAO,EAAGA,OAAS;UACnBC,kBAAkB,EAAGA,kBAAoB;UACzCC,SAAS,EAAC;QAAuD,CACjE,CAAC,eACFlB,IAAA,SAAK,CAAC;MAAA,CACL,CACF,eACDA,IAAA,CAACW,kBAAkB;QAClBC,KAAK,EAAGuC,cAAgB;QACxBrC,UAAU,EAAGA,UAAY;QACzBD,WAAW,EAAGA,WAAa;QAC3BE,YAAY,EAAGA,YAAc;QAC7BC,OAAO,EAAGA,OAAS;QACnBC,kBAAkB,EAAGA,kBAAoB;QACzCC,SAAS,EAAC;MAAmC,CAC7C,CAAC;IAAA,CACE;EAAC,CACU,CAAC;AAEpB;AAEA,eAAe3B,UAAU,CAAEuD,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","useMemo","useEffect","forwardRef","useAsyncList","BlockTypesList","InserterPanel","useBlockTypesState","InserterListbox","orderBy","InserterNoResults","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getBlockNamespace","item","name","split","MAX_SUGGESTED_ITEMS","EMPTY_ARRAY","BlockTypesTabPanel","items","collections","categories","onSelectItem","onHover","showMostUsedBlocks","className","suggestedItems","slice","uncategorizedItems","filter","category","itemsPerCollection","result","Object","keys","forEach","namespace","length","currentlyRenderedCategories","didRenderAllCategories","collectionEntries","entries","currentlyRenderedCollections","children","title","onSelect","label","map","categoryItems","slug","icon","collection","collectionItems","BlockTypesTab","rootClientId","onInsert","ref","itemsForCurrentRoot","itemsRemaining","push"],"sources":["@wordpress/block-editor/src/components/inserter/block-types-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useMemo, useEffect, forwardRef } from '@wordpress/element';\nimport { useAsyncList } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesList from '../block-types-list';\nimport InserterPanel from './panel';\nimport useBlockTypesState from './hooks/use-block-types-state';\nimport InserterListbox from '../inserter-listbox';\nimport { orderBy } from '../../utils/sorting';\nimport InserterNoResults from './no-results';\n\nconst getBlockNamespace = ( item ) => item.name.split( '/' )[ 0 ];\n\nconst MAX_SUGGESTED_ITEMS = 6;\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation and rerendering the component.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function BlockTypesTabPanel( {\n\titems,\n\tcollections,\n\tcategories,\n\tonSelectItem,\n\tonHover,\n\tshowMostUsedBlocks,\n\tclassName,\n} ) {\n\tconst suggestedItems = useMemo( () => {\n\t\treturn orderBy( items, 'frecency', 'desc' ).slice(\n\t\t\t0,\n\t\t\tMAX_SUGGESTED_ITEMS\n\t\t);\n\t}, [ items ] );\n\n\tconst uncategorizedItems = useMemo( () => {\n\t\treturn items.filter( ( item ) => ! item.category );\n\t}, [ items ] );\n\n\tconst itemsPerCollection = useMemo( () => {\n\t\t// Create a new Object to avoid mutating collection.\n\t\tconst result = { ...collections };\n\t\tObject.keys( collections ).forEach( ( namespace ) => {\n\t\t\tresult[ namespace ] = items.filter(\n\t\t\t\t( item ) => getBlockNamespace( item ) === namespace\n\t\t\t);\n\t\t\tif ( result[ namespace ].length === 0 ) {\n\t\t\t\tdelete result[ namespace ];\n\t\t\t}\n\t\t} );\n\n\t\treturn result;\n\t}, [ items, collections ] );\n\n\t// Hide block preview on unmount.\n\tuseEffect( () => () => onHover( null ), [] );\n\n\t/**\n\t * The inserter contains a big number of blocks and opening it is a costful operation.\n\t * The rendering is the most costful part of it, in order to improve the responsiveness\n\t * of the \"opening\" action, these lazy lists allow us to render the inserter category per category,\n\t * once all the categories are rendered, we start rendering the collections and the uncategorized block types.\n\t */\n\tconst currentlyRenderedCategories = useAsyncList( categories );\n\tconst didRenderAllCategories =\n\t\tcategories.length === currentlyRenderedCategories.length;\n\n\t// Async List requires an array.\n\tconst collectionEntries = useMemo( () => {\n\t\treturn Object.entries( collections );\n\t}, [ collections ] );\n\tconst currentlyRenderedCollections = useAsyncList(\n\t\tdidRenderAllCategories ? collectionEntries : EMPTY_ARRAY\n\t);\n\n\treturn (\n\t\t<div className={ className }>\n\t\t\t{ showMostUsedBlocks &&\n\t\t\t\t// Only show the most used blocks if the total amount of block\n\t\t\t\t// is larger than 1 row, otherwise it is not so useful.\n\t\t\t\titems.length > 3 &&\n\t\t\t\t!! suggestedItems.length && (\n\t\t\t\t\t<InserterPanel title={ _x( 'Most used', 'blocks' ) }>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ suggestedItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ _x( 'Most used', 'blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t) }\n\n\t\t\t{ currentlyRenderedCategories.map( ( category ) => {\n\t\t\t\tconst categoryItems = items.filter(\n\t\t\t\t\t( item ) => item.category === category.slug\n\t\t\t\t);\n\t\t\t\tif ( ! categoryItems || ! categoryItems.length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\ticon={ category.icon }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\titems={ categoryItems }\n\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tlabel={ category.title }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InserterPanel>\n\t\t\t\t);\n\t\t\t} ) }\n\n\t\t\t{ didRenderAllCategories && uncategorizedItems.length > 0 && (\n\t\t\t\t<InserterPanel\n\t\t\t\t\tclassName=\"block-editor-inserter__uncategorized-blocks-panel\"\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\titems={ uncategorizedItems }\n\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tlabel={ __( 'Uncategorized' ) }\n\t\t\t\t\t/>\n\t\t\t\t</InserterPanel>\n\t\t\t) }\n\n\t\t\t{ currentlyRenderedCollections.map(\n\t\t\t\t( [ namespace, collection ] ) => {\n\t\t\t\t\tconst collectionItems = itemsPerCollection[ namespace ];\n\t\t\t\t\tif ( ! collectionItems || ! collectionItems.length ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<InserterPanel\n\t\t\t\t\t\t\tkey={ namespace }\n\t\t\t\t\t\t\ttitle={ collection.title }\n\t\t\t\t\t\t\ticon={ collection.icon }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockTypesList\n\t\t\t\t\t\t\t\titems={ collectionItems }\n\t\t\t\t\t\t\t\tonSelect={ onSelectItem }\n\t\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\t\tlabel={ collection.title }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</InserterPanel>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport function BlockTypesTab(\n\t{ rootClientId, onInsert, onHover, showMostUsedBlocks },\n\tref\n) {\n\tconst [ items, categories, collections, onSelectItem ] = useBlockTypesState(\n\t\trootClientId,\n\t\tonInsert\n\t);\n\n\tif ( ! items.length ) {\n\t\treturn <InserterNoResults />;\n\t}\n\n\tconst itemsForCurrentRoot = [];\n\tconst itemsRemaining = [];\n\n\tfor ( const item of items ) {\n\t\t// Skip reusable blocks, they moved to the patterns tab.\n\t\tif ( item.category === 'reusable' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( rootClientId && item.rootClientId === rootClientId ) {\n\t\t\titemsForCurrentRoot.push( item );\n\t\t} else {\n\t\t\titemsRemaining.push( item );\n\t\t}\n\t}\n\n\treturn (\n\t\t<InserterListbox>\n\t\t\t<div ref={ ref }>\n\t\t\t\t{ !! itemsForCurrentRoot.length && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\t\t\titems={ itemsForCurrentRoot }\n\t\t\t\t\t\t\tcategories={ categories }\n\t\t\t\t\t\t\tcollections={ collections }\n\t\t\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t\t\tclassName=\"block-editor-inserter__insertable-blocks-at-selection\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockTypesTabPanel\n\t\t\t\t\titems={ itemsRemaining }\n\t\t\t\t\tcategories={ categories }\n\t\t\t\t\tcollections={ collections }\n\t\t\t\t\tonSelectItem={ onSelectItem }\n\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tclassName=\"block-editor-inserter__all-blocks\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</InserterListbox>\n\t);\n}\n\nexport default forwardRef( BlockTypesTab );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,OAAO,EAAEC,SAAS,EAAEC,U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AM,iBAC9B9B,IAAA,CAAAI,SAAA;QAAAgC,QAAA,eACCpC,IAAA,CAACW,kBAAkB;UAClBC,KAAK,EAAGsC,mBAAqB;UAC7BpC,UAAU,EAAGA,UAAY;UACzBD,WAAW,EAAGA,WAAa;UAC3BE,YAAY,EAAGA,YAAc;UAC7BC,OAAO,EAAGA,OAAS;UACnBC,kBAAkB,EAAGA,kBAAoB;UACzCC,SAAS,EAAC;QAAuD,CACjE;MAAC,CACD,CACF,eACDlB,IAAA,CAACW,kBAAkB;QAClBC,KAAK,EAAGuC,cAAgB;QACxBrC,UAAU,EAAGA,UAAY;QACzBD,WAAW,EAAGA,WAAa;QAC3BE,YAAY,EAAGA,YAAc;QAC7BC,OAAO,EAAGA,OAAS;QACnBC,kBAAkB,EAAGA,kBAAoB;QACzCC,SAAS,EAAC;MAAmC,CAC7C,CAAC;IAAA,CACE;EAAC,CACU,CAAC;AAEpB;AAEA,eAAe3B,UAAU,CAAEuD,aAAc,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { createBlock, createBlocksFromInnerBlocksTemplate, store as blocksStore, parse } from '@wordpress/blocks';
5
5
  import { useSelect } from '@wordpress/data';
6
- import { useCallback } from '@wordpress/element';
6
+ import { useCallback, useMemo } from '@wordpress/element';
7
7
 
8
8
  /**
9
9
  * Internal dependencies
@@ -20,9 +20,10 @@ import { withRootClientIdOptionKey } from '../../../store/utils';
20
20
  * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler)
21
21
  */
22
22
  const useBlockTypesState = (rootClientId, onInsert, isQuick) => {
23
- const [items] = useSelect(select => [select(blockEditorStore).getInserterItems(rootClientId, {
23
+ const options = useMemo(() => ({
24
24
  [withRootClientIdOptionKey]: !isQuick
25
- })], [rootClientId, isQuick]);
25
+ }), [isQuick]);
26
+ const [items] = useSelect(select => [select(blockEditorStore).getInserterItems(rootClientId, options)], [rootClientId, options]);
26
27
  const [categories, collections] = useSelect(select => {
27
28
  const {
28
29
  getCategories,
@@ -1 +1 @@
1
- {"version":3,"names":["createBlock","createBlocksFromInnerBlocksTemplate","store","blocksStore","parse","useSelect","useCallback","blockEditorStore","withRootClientIdOptionKey","useBlockTypesState","rootClientId","onInsert","isQuick","items","select","getInserterItems","categories","collections","getCategories","getCollections","onSelectItem","name","initialAttributes","innerBlocks","syncStatus","content","_rootClientId","shouldFocusBlock","insertedBlock","__unstableSkipMigrationLogs","undefined"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-block-types-state.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n\tparse,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { withRootClientIdOptionKey } from '../../../store/utils';\n\n/**\n * Retrieves the block types inserter state.\n *\n * @param {string=} rootClientId Insertion's root client ID.\n * @param {Function} onInsert function called when inserter a list of blocks.\n * @param {boolean} isQuick\n * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler)\n */\nconst useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {\n\tconst [ items ] = useSelect(\n\t\t( select ) => [\n\t\t\tselect( blockEditorStore ).getInserterItems( rootClientId, {\n\t\t\t\t[ withRootClientIdOptionKey ]: ! isQuick,\n\t\t\t} ),\n\t\t],\n\t\t[ rootClientId, isQuick ]\n\t);\n\n\tconst [ categories, collections ] = useSelect( ( select ) => {\n\t\tconst { getCategories, getCollections } = select( blocksStore );\n\t\treturn [ getCategories(), getCollections() ];\n\t}, [] );\n\n\tconst onSelectItem = useCallback(\n\t\t(\n\t\t\t{\n\t\t\t\tname,\n\t\t\t\tinitialAttributes,\n\t\t\t\tinnerBlocks,\n\t\t\t\tsyncStatus,\n\t\t\t\tcontent,\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t},\n\t\t\tshouldFocusBlock\n\t\t) => {\n\t\t\tconst insertedBlock =\n\t\t\t\tsyncStatus === 'unsynced'\n\t\t\t\t\t? parse( content, {\n\t\t\t\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t\t\t } )\n\t\t\t\t\t: createBlock(\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tinitialAttributes,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate( innerBlocks )\n\t\t\t\t\t );\n\n\t\t\tonInsert(\n\t\t\t\tinsertedBlock,\n\t\t\t\tundefined,\n\t\t\t\tshouldFocusBlock,\n\t\t\t\t_rootClientId\n\t\t\t);\n\t\t},\n\t\t[ onInsert ]\n\t);\n\n\treturn [ items, categories, collections, onSelectItem ];\n};\n\nexport default useBlockTypesState;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,mCAAmC,EACnCC,KAAK,IAAIC,WAAW,EACpBC,KAAK,QACC,mBAAmB;AAC1B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,yBAAyB,QAAQ,sBAAsB;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CAAEC,YAAY,EAAEC,QAAQ,EAAEC,OAAO,KAAM;EACjE,MAAM,CAAEC,KAAK,CAAE,GAAGR,SAAS,CACxBS,MAAM,IAAM,CACbA,MAAM,CAAEP,gBAAiB,CAAC,CAACQ,gBAAgB,CAAEL,YAAY,EAAE;IAC1D,CAAEF,yBAAyB,GAAI,CAAEI;EAClC,CAAE,CAAC,CACH,EACD,CAAEF,YAAY,EAAEE,OAAO,CACxB,CAAC;EAED,MAAM,CAAEI,UAAU,EAAEC,WAAW,CAAE,GAAGZ,SAAS,CAAIS,MAAM,IAAM;IAC5D,MAAM;MAAEI,aAAa;MAAEC;IAAe,CAAC,GAAGL,MAAM,CAAEX,WAAY,CAAC;IAC/D,OAAO,CAAEe,aAAa,CAAC,CAAC,EAAEC,cAAc,CAAC,CAAC,CAAE;EAC7C,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,YAAY,GAAGd,WAAW,CAC/B,CACC;IACCe,IAAI;IACJC,iBAAiB;IACjBC,WAAW;IACXC,UAAU;IACVC,OAAO;IACPf,YAAY,EAAEgB;EACf,CAAC,EACDC,gBAAgB,KACZ;IACJ,MAAMC,aAAa,GAClBJ,UAAU,KAAK,UAAU,GACtBpB,KAAK,CAAEqB,OAAO,EAAE;MAChBI,2BAA2B,EAAE;IAC7B,CAAE,CAAC,GACH7B,WAAW,CACXqB,IAAI,EACJC,iBAAiB,EACjBrB,mCAAmC,CAAEsB,WAAY,CACjD,CAAC;IAELZ,QAAQ,CACPiB,aAAa,EACbE,SAAS,EACTH,gBAAgB,EAChBD,aACD,CAAC;EACF,CAAC,EACD,CAAEf,QAAQ,CACX,CAAC;EAED,OAAO,CAAEE,KAAK,EAAEG,UAAU,EAAEC,WAAW,EAAEG,YAAY,CAAE;AACxD,CAAC;AAED,eAAeX,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["createBlock","createBlocksFromInnerBlocksTemplate","store","blocksStore","parse","useSelect","useCallback","useMemo","blockEditorStore","withRootClientIdOptionKey","useBlockTypesState","rootClientId","onInsert","isQuick","options","items","select","getInserterItems","categories","collections","getCategories","getCollections","onSelectItem","name","initialAttributes","innerBlocks","syncStatus","content","_rootClientId","shouldFocusBlock","insertedBlock","__unstableSkipMigrationLogs","undefined"],"sources":["@wordpress/block-editor/src/components/inserter/hooks/use-block-types-state.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n\tparse,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { withRootClientIdOptionKey } from '../../../store/utils';\n\n/**\n * Retrieves the block types inserter state.\n *\n * @param {string=} rootClientId Insertion's root client ID.\n * @param {Function} onInsert function called when inserter a list of blocks.\n * @param {boolean} isQuick\n * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler)\n */\nconst useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {\n\tconst options = useMemo(\n\t\t() => ( { [ withRootClientIdOptionKey ]: ! isQuick } ),\n\t\t[ isQuick ]\n\t);\n\tconst [ items ] = useSelect(\n\t\t( select ) => [\n\t\t\tselect( blockEditorStore ).getInserterItems(\n\t\t\t\trootClientId,\n\t\t\t\toptions\n\t\t\t),\n\t\t],\n\t\t[ rootClientId, options ]\n\t);\n\n\tconst [ categories, collections ] = useSelect( ( select ) => {\n\t\tconst { getCategories, getCollections } = select( blocksStore );\n\t\treturn [ getCategories(), getCollections() ];\n\t}, [] );\n\n\tconst onSelectItem = useCallback(\n\t\t(\n\t\t\t{\n\t\t\t\tname,\n\t\t\t\tinitialAttributes,\n\t\t\t\tinnerBlocks,\n\t\t\t\tsyncStatus,\n\t\t\t\tcontent,\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t},\n\t\t\tshouldFocusBlock\n\t\t) => {\n\t\t\tconst insertedBlock =\n\t\t\t\tsyncStatus === 'unsynced'\n\t\t\t\t\t? parse( content, {\n\t\t\t\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t\t\t } )\n\t\t\t\t\t: createBlock(\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tinitialAttributes,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate( innerBlocks )\n\t\t\t\t\t );\n\n\t\t\tonInsert(\n\t\t\t\tinsertedBlock,\n\t\t\t\tundefined,\n\t\t\t\tshouldFocusBlock,\n\t\t\t\t_rootClientId\n\t\t\t);\n\t\t},\n\t\t[ onInsert ]\n\t);\n\n\treturn [ items, categories, collections,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