@wordpress/edit-site 5.3.3 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/new-template.js +1 -20
  3. package/build/components/add-new-template/new-template.js.map +1 -1
  4. package/build/components/app/index.js.map +1 -1
  5. package/build/components/block-editor/editor-canvas.js +1 -0
  6. package/build/components/block-editor/editor-canvas.js.map +1 -1
  7. package/build/components/editor/index.js +3 -1
  8. package/build/components/editor/index.js.map +1 -1
  9. package/build/components/global-styles/border-panel.js +4 -4
  10. package/build/components/global-styles/border-panel.js.map +1 -1
  11. package/build/components/global-styles/color-palette-panel.js +5 -2
  12. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  13. package/build/components/global-styles/color-utils.js +1 -1
  14. package/build/components/global-styles/color-utils.js.map +1 -1
  15. package/build/components/global-styles/context-menu.js +16 -3
  16. package/build/components/global-styles/context-menu.js.map +1 -1
  17. package/build/components/global-styles/custom-css.js +1 -1
  18. package/build/components/global-styles/custom-css.js.map +1 -1
  19. package/build/components/global-styles/dimensions-panel.js +8 -7
  20. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  21. package/build/components/global-styles/gradients-palette-panel.js +8 -3
  22. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  23. package/build/components/global-styles/header.js +3 -1
  24. package/build/components/global-styles/header.js.map +1 -1
  25. package/build/components/global-styles/hooks.js +14 -51
  26. package/build/components/global-styles/hooks.js.map +1 -1
  27. package/build/components/global-styles/palette.js +3 -1
  28. package/build/components/global-styles/palette.js.map +1 -1
  29. package/build/components/global-styles/screen-background-color.js +3 -2
  30. package/build/components/global-styles/screen-background-color.js.map +1 -1
  31. package/build/components/global-styles/screen-block-list.js +14 -3
  32. package/build/components/global-styles/screen-block-list.js.map +1 -1
  33. package/build/components/global-styles/screen-button-color.js +7 -5
  34. package/build/components/global-styles/screen-button-color.js.map +1 -1
  35. package/build/components/global-styles/screen-colors.js +8 -6
  36. package/build/components/global-styles/screen-colors.js.map +1 -1
  37. package/build/components/global-styles/screen-heading-color.js +8 -6
  38. package/build/components/global-styles/screen-heading-color.js.map +1 -1
  39. package/build/components/global-styles/screen-link-color.js +3 -2
  40. package/build/components/global-styles/screen-link-color.js.map +1 -1
  41. package/build/components/global-styles/screen-text-color.js +3 -2
  42. package/build/components/global-styles/screen-text-color.js.map +1 -1
  43. package/build/components/global-styles/screen-typography.js +3 -1
  44. package/build/components/global-styles/screen-typography.js.map +1 -1
  45. package/build/components/global-styles/shadow-panel.js +2 -3
  46. package/build/components/global-styles/shadow-panel.js.map +1 -1
  47. package/build/components/global-styles/subtitle.js +3 -2
  48. package/build/components/global-styles/subtitle.js.map +1 -1
  49. package/build/components/global-styles/typography-panel.js +23 -300
  50. package/build/components/global-styles/typography-panel.js.map +1 -1
  51. package/build/components/navigation-inspector/index.js +0 -29
  52. package/build/components/navigation-inspector/index.js.map +1 -1
  53. package/build/components/navigation-inspector/navigation-menu.js +4 -2
  54. package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
  55. package/build/components/sidebar/index.js +1 -20
  56. package/build/components/sidebar/index.js.map +1 -1
  57. package/build/components/sidebar-edit-mode/index.js +1 -1
  58. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  59. package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
  60. package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  61. package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
  62. package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  63. package/build/components/start-template-options/index.js +175 -0
  64. package/build/components/start-template-options/index.js.map +1 -0
  65. package/build/hooks/push-changes-to-global-styles/index.js +5 -4
  66. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  67. package/build-module/components/add-new-template/new-template.js +1 -18
  68. package/build-module/components/add-new-template/new-template.js.map +1 -1
  69. package/build-module/components/app/index.js.map +1 -1
  70. package/build-module/components/block-editor/editor-canvas.js +1 -0
  71. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  72. package/build-module/components/editor/index.js +2 -1
  73. package/build-module/components/editor/index.js.map +1 -1
  74. package/build-module/components/global-styles/border-panel.js +5 -5
  75. package/build-module/components/global-styles/border-panel.js.map +1 -1
  76. package/build-module/components/global-styles/color-palette-panel.js +5 -2
  77. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  78. package/build-module/components/global-styles/color-utils.js +2 -2
  79. package/build-module/components/global-styles/color-utils.js.map +1 -1
  80. package/build-module/components/global-styles/context-menu.js +13 -2
  81. package/build-module/components/global-styles/context-menu.js.map +1 -1
  82. package/build-module/components/global-styles/custom-css.js +1 -1
  83. package/build-module/components/global-styles/custom-css.js.map +1 -1
  84. package/build-module/components/global-styles/dimensions-panel.js +9 -8
  85. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  86. package/build-module/components/global-styles/gradients-palette-panel.js +8 -3
  87. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  88. package/build-module/components/global-styles/header.js +3 -1
  89. package/build-module/components/global-styles/header.js.map +1 -1
  90. package/build-module/components/global-styles/hooks.js +12 -49
  91. package/build-module/components/global-styles/hooks.js.map +1 -1
  92. package/build-module/components/global-styles/palette.js +3 -1
  93. package/build-module/components/global-styles/palette.js.map +1 -1
  94. package/build-module/components/global-styles/screen-background-color.js +4 -3
  95. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  96. package/build-module/components/global-styles/screen-block-list.js +12 -3
  97. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  98. package/build-module/components/global-styles/screen-button-color.js +8 -6
  99. package/build-module/components/global-styles/screen-button-color.js.map +1 -1
  100. package/build-module/components/global-styles/screen-colors.js +9 -7
  101. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  102. package/build-module/components/global-styles/screen-heading-color.js +9 -7
  103. package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
  104. package/build-module/components/global-styles/screen-link-color.js +4 -3
  105. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  106. package/build-module/components/global-styles/screen-text-color.js +4 -3
  107. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  108. package/build-module/components/global-styles/screen-typography.js +3 -1
  109. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  110. package/build-module/components/global-styles/shadow-panel.js +3 -4
  111. package/build-module/components/global-styles/shadow-panel.js.map +1 -1
  112. package/build-module/components/global-styles/subtitle.js +3 -2
  113. package/build-module/components/global-styles/subtitle.js.map +1 -1
  114. package/build-module/components/global-styles/typography-panel.js +27 -300
  115. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  116. package/build-module/components/navigation-inspector/index.js +0 -27
  117. package/build-module/components/navigation-inspector/index.js.map +1 -1
  118. package/build-module/components/navigation-inspector/navigation-menu.js +4 -2
  119. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
  120. package/build-module/components/sidebar/index.js +1 -18
  121. package/build-module/components/sidebar/index.js.map +1 -1
  122. package/build-module/components/sidebar-edit-mode/index.js +1 -1
  123. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  124. package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
  125. package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
  126. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
  127. package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
  128. package/build-module/components/start-template-options/index.js +156 -0
  129. package/build-module/components/start-template-options/index.js.map +1 -0
  130. package/build-module/hooks/push-changes-to-global-styles/index.js +6 -5
  131. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  132. package/build-style/style-rtl.css +73 -4
  133. package/build-style/style.css +73 -4
  134. package/package.json +31 -31
  135. package/src/components/add-new-template/new-template.js +1 -16
  136. package/src/components/app/index.js +0 -1
  137. package/src/components/block-editor/editor-canvas.js +1 -0
  138. package/src/components/editor/index.js +2 -0
  139. package/src/components/global-styles/border-panel.js +5 -5
  140. package/src/components/global-styles/color-palette-panel.js +3 -0
  141. package/src/components/global-styles/color-utils.js +2 -3
  142. package/src/components/global-styles/context-menu.js +17 -2
  143. package/src/components/global-styles/custom-css.js +1 -1
  144. package/src/components/global-styles/dimensions-panel.js +12 -8
  145. package/src/components/global-styles/gradients-palette-panel.js +4 -1
  146. package/src/components/global-styles/header.js +7 -1
  147. package/src/components/global-styles/hooks.js +17 -90
  148. package/src/components/global-styles/palette.js +1 -1
  149. package/src/components/global-styles/screen-background-color.js +3 -2
  150. package/src/components/global-styles/screen-block-list.js +19 -3
  151. package/src/components/global-styles/screen-button-color.js +8 -6
  152. package/src/components/global-styles/screen-colors.js +7 -7
  153. package/src/components/global-styles/screen-heading-color.js +9 -7
  154. package/src/components/global-styles/screen-link-color.js +3 -2
  155. package/src/components/global-styles/screen-text-color.js +3 -2
  156. package/src/components/global-styles/screen-typography.js +1 -1
  157. package/src/components/global-styles/shadow-panel.js +6 -3
  158. package/src/components/global-styles/style.scss +5 -0
  159. package/src/components/global-styles/subtitle.js +5 -2
  160. package/src/components/global-styles/typography-panel.js +30 -394
  161. package/src/components/navigation-inspector/index.js +0 -32
  162. package/src/components/navigation-inspector/navigation-menu.js +8 -2
  163. package/src/components/sidebar/index.js +4 -17
  164. package/src/components/sidebar-edit-mode/index.js +1 -1
  165. package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
  166. package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
  167. package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
  168. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
  169. package/src/components/start-template-options/index.js +171 -0
  170. package/src/components/start-template-options/style.scss +76 -0
  171. package/src/hooks/push-changes-to-global-styles/index.js +26 -21
  172. package/src/style.scss +1 -0
@@ -52,37 +52,37 @@ function useHasDimensionsPanel(name) {
52
52
  }
53
53
 
54
54
  function useHasContentSize(name) {
55
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
55
+ const supports = (0, _hooks.useSupportedStyles)(name);
56
56
  const [settings] = useGlobalSetting('layout.contentSize', name);
57
57
  return settings && supports.includes('contentSize');
58
58
  }
59
59
 
60
60
  function useHasWideSize(name) {
61
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
61
+ const supports = (0, _hooks.useSupportedStyles)(name);
62
62
  const [settings] = useGlobalSetting('layout.wideSize', name);
63
63
  return settings && supports.includes('wideSize');
64
64
  }
65
65
 
66
66
  function useHasPadding(name) {
67
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
67
+ const supports = (0, _hooks.useSupportedStyles)(name);
68
68
  const [settings] = useGlobalSetting('spacing.padding', name);
69
69
  return settings && supports.includes('padding');
70
70
  }
71
71
 
72
72
  function useHasMargin(name) {
73
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
73
+ const supports = (0, _hooks.useSupportedStyles)(name);
74
74
  const [settings] = useGlobalSetting('spacing.margin', name);
75
75
  return settings && supports.includes('margin');
76
76
  }
77
77
 
78
78
  function useHasGap(name) {
79
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
79
+ const supports = (0, _hooks.useSupportedStyles)(name);
80
80
  const [settings] = useGlobalSetting('spacing.blockGap', name);
81
81
  return settings && supports.includes('blockGap');
82
82
  }
83
83
 
84
84
  function useHasMinHeight(name) {
85
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
85
+ const supports = (0, _hooks.useSupportedStyles)(name);
86
86
  const [settings] = useGlobalSetting('dimensions.minHeight', name);
87
87
  return settings && supports.includes('minHeight');
88
88
  }
@@ -387,7 +387,8 @@ function DimensionsPanel(_ref3) {
387
387
 
388
388
  return (0, _element.createElement)(_components.__experimentalToolsPanel, {
389
389
  label: (0, _i18n.__)('Dimensions'),
390
- resetAll: resetAll
390
+ resetAll: resetAll,
391
+ headingLevel: 3
391
392
  }, (showContentSizeControl || showWideSizeControl) && (0, _element.createElement)("span", {
392
393
  className: "span-columns"
393
394
  }, (0, _i18n.__)('Set the width of the main content area.')), showContentSizeControl && (0, _element.createElement)(_components.__experimentalToolsPanelItem, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/dimensions-panel.js"],"names":["useGlobalSetting","useGlobalStyle","blockEditorPrivateApis","AXIAL_SIDES","useHasDimensionsPanel","name","hasContentSize","useHasContentSize","hasWideSize","useHasWideSize","hasPadding","useHasPadding","hasMargin","useHasMargin","hasGap","useHasGap","hasMinHeight","useHasMinHeight","supports","settings","includes","useHasSpacingPresets","custom","theme","default","defaultPresets","presets","length","filterValuesBySides","values","sides","filteredValues","forEach","side","top","bottom","left","right","splitStyleValue","value","splitGapValue","useContentSizeProps","contentSizeValue","setContentSizeValue","userSetContentSizeValue","hasUserSetContentSizeValue","resetContentSizeValue","useWideSizeProps","wideSizeValue","setWideSizeValue","userSetWideSizeValue","hasUserSetWideSizeValue","resetWideSizeValue","usePaddingProps","variation","prefix","rawPadding","setRawPadding","paddingValues","paddingSides","isAxialPadding","some","setPaddingValues","newPaddingValues","padding","resetPaddingValue","userSetPaddingValue","hasPaddingValue","useMarginProps","rawMargin","setRawMargin","marginValues","marginSides","isAxialMargin","setMarginValues","newMarginValues","margin","resetMarginValue","hasMarginValue","Object","keys","useBlockGapProps","gapValue","setGapValue","gapValues","gapSides","isAxialGap","resetGapValue","undefined","userSetGapValue","hasGapValue","setGapValues","nextBoxGapValue","hasOwnProperty","useMinHeightProps","minHeightValue","setMinHeightValue","resetMinHeightValue","hasMinHeightValue","DimensionsPanel","showContentSizeControl","showWideSizeControl","showPaddingControl","showMarginControl","showGapControl","showMinHeightControl","showSpacingPresetsControl","units","availableUnits","resetAll","nextContentSize","positionCenter","nextWideSize","stretchWide"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AASA;;AAMA;;AAKA;;AACA;;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,gBAAF;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c,CAAE,KAAF,CAJjC,CAI6C;AAJ7C;AAKC,IAAA,MAAM,EAAGD,SALV;AAMC,IAAA,UAAU,EAAG,KANd;AAOC,IAAA,WAAW,EAAGE;AAPf,IAhCF,CA7HF,EAyKGmB,oBAAoB,IACrB,4BAAC,wCAAD;AACC,IAAA,QAAQ,EAAGP,iBADZ;AAEC,IAAA,KAAK,EAAG,cAAI,aAAJ,CAFT;AAGC,IAAA,UAAU,EAAGD,mBAHd;AAIC,IAAA,gBAAgB,EAAG;AAJpB,KAMC,4BAAC,0BAAD;AACC,IAAA,KAAK,EAAG,cAAI,aAAJ,CADT;AAEC,IAAA,KAAK,EAAGF,cAFT;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAND,CA1KF,CADD;AA0LA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalBoxControl as BoxControl,\n\t__experimentalHStack as HStack,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalView as View,\n} from '@wordpress/components';\nimport {\n\t__experimentalUseCustomSides as useCustomSides,\n\tHeightControl,\n\t__experimentalSpacingSizesControl as SpacingSizesControl,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Icon, positionCenter, stretchWide } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { getSupportedGlobalStylesPanels } from './hooks';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst AXIAL_SIDES = [ 'horizontal', 'vertical' ];\n\nexport function useHasDimensionsPanel( name ) {\n\tconst hasContentSize = useHasContentSize( name );\n\tconst hasWideSize = useHasWideSize( name );\n\tconst hasPadding = useHasPadding( name );\n\tconst hasMargin = useHasMargin( name );\n\tconst hasGap = useHasGap( name );\n\tconst hasMinHeight = useHasMinHeight( name );\n\n\treturn (\n\t\thasContentSize ||\n\t\thasWideSize ||\n\t\thasPadding ||\n\t\thasMargin ||\n\t\thasGap ||\n\t\thasMinHeight\n\t);\n}\n\nfunction useHasContentSize( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'layout.contentSize', name );\n\n\treturn settings && supports.includes( 'contentSize' );\n}\n\nfunction useHasWideSize( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'layout.wideSize', name );\n\n\treturn settings && supports.includes( 'wideSize' );\n}\n\nfunction useHasPadding( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.padding', name );\n\n\treturn settings && supports.includes( 'padding' );\n}\n\nfunction useHasMargin( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.margin', name );\n\n\treturn settings && supports.includes( 'margin' );\n}\n\nfunction useHasGap( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.blockGap', name );\n\n\treturn settings && supports.includes( 'blockGap' );\n}\n\nfunction useHasMinHeight( name ) {\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ settings ] = useGlobalSetting( 'dimensions.minHeight', name );\n\n\treturn settings && supports.includes( 'minHeight' );\n}\n\nfunction useHasSpacingPresets() {\n\tconst [ settings ] = useGlobalSetting( 'spacing.spacingSizes' );\n\tconst { custom, theme, default: defaultPresets } = settings || {};\n\tconst presets = custom ?? theme ?? defaultPresets ?? [];\n\n\treturn settings && presets.length > 0;\n}\n\nfunction filterValuesBySides( values, sides ) {\n\tif ( ! sides ) {\n\t\t// If no custom side configuration all sides are opted into by default.\n\t\treturn values;\n\t}\n\n\t// Only include sides opted into within filtered values.\n\tconst filteredValues = {};\n\tsides.forEach( ( side ) => {\n\t\tif ( side === 'vertical' ) {\n\t\t\tfilteredValues.top = values.top;\n\t\t\tfilteredValues.bottom = values.bottom;\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tfilteredValues.left = values.left;\n\t\t\tfilteredValues.right = values.right;\n\t\t}\n\t\tfilteredValues[ side ] = values[ side ];\n\t} );\n\n\treturn filteredValues;\n}\n\nfunction splitStyleValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( value && typeof value === 'string' ) {\n\t\t// Convert to value for individual sides for BoxControl.\n\t\treturn {\n\t\t\ttop: value,\n\t\t\tright: value,\n\t\t\tbottom: value,\n\t\t\tleft: value,\n\t\t};\n\t}\n\n\treturn value;\n}\n\nfunction splitGapValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( value && typeof value === 'string' ) {\n\t\t// If the value is a string, treat it as a single side (top) for the spacing controls.\n\t\treturn {\n\t\t\ttop: value,\n\t\t};\n\t}\n\n\tif ( value ) {\n\t\treturn {\n\t\t\t...value,\n\t\t\tright: value?.left,\n\t\t\tbottom: value?.top,\n\t\t};\n\t}\n\n\treturn value;\n}\n\n// Props for managing `layout.contentSize`.\nfunction useContentSizeProps( name ) {\n\tconst [ contentSizeValue, setContentSizeValue ] = useGlobalSetting(\n\t\t'layout.contentSize',\n\t\tname\n\t);\n\tconst [ userSetContentSizeValue ] = useGlobalSetting(\n\t\t'layout.contentSize',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasUserSetContentSizeValue = () => !! userSetContentSizeValue;\n\tconst resetContentSizeValue = () => setContentSizeValue( '' );\n\treturn {\n\t\tcontentSizeValue,\n\t\tsetContentSizeValue,\n\t\thasUserSetContentSizeValue,\n\t\tresetContentSizeValue,\n\t};\n}\n\n// Props for managing `layout.wideSize`.\nfunction useWideSizeProps( name ) {\n\tconst [ wideSizeValue, setWideSizeValue ] = useGlobalSetting(\n\t\t'layout.wideSize',\n\t\tname\n\t);\n\tconst [ userSetWideSizeValue ] = useGlobalSetting(\n\t\t'layout.wideSize',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasUserSetWideSizeValue = () => !! userSetWideSizeValue;\n\tconst resetWideSizeValue = () => setWideSizeValue( '' );\n\treturn {\n\t\twideSizeValue,\n\t\tsetWideSizeValue,\n\t\thasUserSetWideSizeValue,\n\t\tresetWideSizeValue,\n\t};\n}\n\n// Props for managing `spacing.padding`.\nfunction usePaddingProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ rawPadding, setRawPadding ] = useGlobalStyle(\n\t\tprefix + 'spacing.padding',\n\t\tname\n\t);\n\tconst paddingValues = splitStyleValue( rawPadding );\n\tconst paddingSides = useCustomSides( name, 'padding' );\n\tconst isAxialPadding =\n\t\tpaddingSides &&\n\t\tpaddingSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\n\tconst setPaddingValues = ( newPaddingValues ) => {\n\t\tconst padding = filterValuesBySides( newPaddingValues, paddingSides );\n\t\tsetRawPadding( padding );\n\t};\n\tconst resetPaddingValue = () => setPaddingValues( {} );\n\tconst [ userSetPaddingValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.padding',\n\t\tname,\n\t\t'user'\n\t);\n\t// The `hasPaddingValue` check does not need a parsed value, as `userSetPaddingValue` will be `undefined` if not set.\n\tconst hasPaddingValue = () => !! userSetPaddingValue;\n\n\treturn {\n\t\tpaddingValues,\n\t\tpaddingSides,\n\t\tisAxialPadding,\n\t\tsetPaddingValues,\n\t\tresetPaddingValue,\n\t\thasPaddingValue,\n\t};\n}\n\n// Props for managing `spacing.margin`.\nfunction useMarginProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ rawMargin, setRawMargin ] = useGlobalStyle(\n\t\tprefix + 'spacing.margin',\n\t\tname\n\t);\n\tconst marginValues = splitStyleValue( rawMargin );\n\tconst marginSides = useCustomSides( name, 'margin' );\n\tconst isAxialMargin =\n\t\tmarginSides &&\n\t\tmarginSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\n\tconst setMarginValues = ( newMarginValues ) => {\n\t\tconst margin = filterValuesBySides( newMarginValues, marginSides );\n\t\tsetRawMargin( margin );\n\t};\n\tconst resetMarginValue = () => setMarginValues( {} );\n\tconst hasMarginValue = () =>\n\t\t!! marginValues && Object.keys( marginValues ).length;\n\n\treturn {\n\t\tmarginValues,\n\t\tmarginSides,\n\t\tisAxialMargin,\n\t\tsetMarginValues,\n\t\tresetMarginValue,\n\t\thasMarginValue,\n\t};\n}\n\n// Props for managing `spacing.blockGap`.\nfunction useBlockGapProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ gapValue, setGapValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.blockGap',\n\t\tname\n\t);\n\tconst gapValues = splitGapValue( gapValue );\n\tconst gapSides = useCustomSides( name, 'blockGap' );\n\tconst isAxialGap =\n\t\tgapSides && gapSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst resetGapValue = () => setGapValue( undefined );\n\tconst [ userSetGapValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.blockGap',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasGapValue = () => !! userSetGapValue;\n\tconst setGapValues = ( nextBoxGapValue ) => {\n\t\tif ( ! nextBoxGapValue ) {\n\t\t\tsetGapValue( null );\n\t\t}\n\t\t// If axial gap is not enabled, treat the 'top' value as the shorthand gap value.\n\t\tif ( ! isAxialGap && nextBoxGapValue?.hasOwnProperty( 'top' ) ) {\n\t\t\tsetGapValue( nextBoxGapValue.top );\n\t\t} else {\n\t\t\tsetGapValue( {\n\t\t\t\ttop: nextBoxGapValue?.top,\n\t\t\t\tleft: nextBoxGapValue?.left,\n\t\t\t} );\n\t\t}\n\t};\n\treturn {\n\t\tgapValue,\n\t\tgapValues,\n\t\tgapSides,\n\t\tisAxialGap,\n\t\tsetGapValue,\n\t\tsetGapValues,\n\t\tresetGapValue,\n\t\thasGapValue,\n\t};\n}\n\n// Props for managing `dimensions.minHeight`.\nfunction useMinHeightProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ minHeightValue, setMinHeightValue ] = useGlobalStyle(\n\t\tprefix + 'dimensions.minHeight',\n\t\tname\n\t);\n\tconst resetMinHeightValue = () => setMinHeightValue( undefined );\n\tconst hasMinHeightValue = () => !! minHeightValue;\n\treturn {\n\t\tminHeightValue,\n\t\tsetMinHeightValue,\n\t\tresetMinHeightValue,\n\t\thasMinHeightValue,\n\t};\n}\n\nexport default function DimensionsPanel( { name, variation = '' } ) {\n\tconst showContentSizeControl = useHasContentSize( name );\n\tconst showWideSizeControl = useHasWideSize( name );\n\tconst showPaddingControl = useHasPadding( name );\n\tconst showMarginControl = useHasMargin( name );\n\tconst showGapControl = useHasGap( name );\n\tconst showMinHeightControl = useHasMinHeight( name );\n\tconst showSpacingPresetsControl = useHasSpacingPresets();\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useGlobalSetting( 'spacing.units', name )[ 0 ] || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\t// Props for managing `layout.contentSize`.\n\tconst {\n\t\tcontentSizeValue,\n\t\tsetContentSizeValue,\n\t\thasUserSetContentSizeValue,\n\t\tresetContentSizeValue,\n\t} = useContentSizeProps( name );\n\n\t// Props for managing `layout.wideSize`.\n\tconst {\n\t\twideSizeValue,\n\t\tsetWideSizeValue,\n\t\thasUserSetWideSizeValue,\n\t\tresetWideSizeValue,\n\t} = useWideSizeProps( name );\n\n\t// Props for managing `spacing.padding`.\n\tconst {\n\t\tpaddingValues,\n\t\tpaddingSides,\n\t\tisAxialPadding,\n\t\tsetPaddingValues,\n\t\tresetPaddingValue,\n\t\thasPaddingValue,\n\t} = usePaddingProps( name, variation );\n\n\t// Props for managing `spacing.margin`.\n\tconst {\n\t\tmarginValues,\n\t\tmarginSides,\n\t\tisAxialMargin,\n\t\tsetMarginValues,\n\t\tresetMarginValue,\n\t\thasMarginValue,\n\t} = useMarginProps( name, variation );\n\n\t// Props for managing `spacing.blockGap`.\n\tconst {\n\t\tgapValue,\n\t\tgapValues,\n\t\tgapSides,\n\t\tisAxialGap,\n\t\tsetGapValue,\n\t\tsetGapValues,\n\t\tresetGapValue,\n\t\thasGapValue,\n\t} = useBlockGapProps( name, variation );\n\n\t// Props for managing `dimensions.minHeight`.\n\tconst {\n\t\tminHeightValue,\n\t\tsetMinHeightValue,\n\t\tresetMinHeightValue,\n\t\thasMinHeightValue,\n\t} = useMinHeightProps( name, variation );\n\n\tconst resetAll = () => {\n\t\tresetPaddingValue();\n\t\tresetMarginValue();\n\t\tresetGapValue();\n\t\tresetContentSizeValue();\n\t\tresetWideSizeValue();\n\t};\n\n\treturn (\n\t\t<ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n\t\t\t{ ( showContentSizeControl || showWideSizeControl ) && (\n\t\t\t\t<span className=\"span-columns\">\n\t\t\t\t\t{ __( 'Set the width of the main content area.' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showContentSizeControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Content size' ) }\n\t\t\t\t\thasValue={ hasUserSetContentSizeValue }\n\t\t\t\t\tonDeselect={ resetContentSizeValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"flex-end\" justify=\"flex-start\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSizeValue || '' }\n\t\t\t\t\t\t\tonChange={ ( nextContentSize ) => {\n\t\t\t\t\t\t\t\tsetContentSizeValue( nextContentSize );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</HStack>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWideSizeControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Wide size' ) }\n\t\t\t\t\thasValue={ hasUserSetWideSizeValue }\n\t\t\t\t\tonDeselect={ resetWideSizeValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"flex-end\" justify=\"flex-start\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSizeValue || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWideSize ) => {\n\t\t\t\t\t\t\t\tsetWideSizeValue( nextWideSize );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</HStack>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showPaddingControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasPaddingValue }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\tonDeselect={ resetPaddingValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMarginControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasMarginValue }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\tonDeselect={ resetMarginValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showGapControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasGapValue }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\tonDeselect={ resetGapValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl &&\n\t\t\t\t\t\t( isAxialGap ? (\n\t\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tsides={ gapSides }\n\t\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValue }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tvalue={ gapValue }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\tsides={ isAxialGap ? gapSides : [ 'top' ] } // Use 'top' as the shorthand property in non-axial configurations.\n\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMinHeightControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasMinHeightValue }\n\t\t\t\t\tlabel={ __( 'Min. height' ) }\n\t\t\t\t\tonDeselect={ resetMinHeightValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HeightControl\n\t\t\t\t\t\tlabel={ __( 'Min. height' ) }\n\t\t\t\t\t\tvalue={ minHeightValue }\n\t\t\t\t\t\tonChange={ setMinHeightValue }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</ToolsPanel>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/dimensions-panel.js"],"names":["useGlobalSetting","useGlobalStyle","blockEditorPrivateApis","AXIAL_SIDES","useHasDimensionsPanel","name","hasContentSize","useHasContentSize","hasWideSize","useHasWideSize","hasPadding","useHasPadding","hasMargin","useHasMargin","hasGap","useHasGap","hasMinHeight","useHasMinHeight","supports","settings","includes","useHasSpacingPresets","custom","theme","default","defaultPresets","presets","length","filterValuesBySides","values","sides","filteredValues","forEach","side","top","bottom","left","right","splitStyleValue","value","splitGapValue","useContentSizeProps","contentSizeValue","setContentSizeValue","userSetContentSizeValue","hasUserSetContentSizeValue","resetContentSizeValue","useWideSizeProps","wideSizeValue","setWideSizeValue","userSetWideSizeValue","hasUserSetWideSizeValue","resetWideSizeValue","usePaddingProps","variation","prefix","rawPadding","setRawPadding","paddingValues","paddingSides","isAxialPadding","some","setPaddingValues","newPaddingValues","padding","resetPaddingValue","userSetPaddingValue","hasPaddingValue","useMarginProps","rawMargin","setRawMargin","marginValues","marginSides","isAxialMargin","setMarginValues","newMarginValues","margin","resetMarginValue","hasMarginValue","Object","keys","useBlockGapProps","gapValue","setGapValue","gapValues","gapSides","isAxialGap","resetGapValue","undefined","userSetGapValue","hasGapValue","setGapValues","nextBoxGapValue","hasOwnProperty","useMinHeightProps","minHeightValue","setMinHeightValue","resetMinHeightValue","hasMinHeightValue","DimensionsPanel","showContentSizeControl","showWideSizeControl","showPaddingControl","showMarginControl","showGapControl","showMinHeightControl","showSpacingPresetsControl","units","availableUnits","resetAll","nextContentSize","positionCenter","nextWideSize","stretchWide"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AASA;;AAMA;;AAKA;;AACA;;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,IAAuC,yBAAQC,wBAAR,CAA7C;AAEA,MAAMC,WAAW,GAAG,CAAE,YAAF,EAAgB,UAAhB,CAApB;;AAEO,SAASC,qBAAT,CAAgCC,IAAhC,EAAuC;AAC7C,QAAMC,cAAc,GAAGC,iBAAiB,CAAEF,IAAF,CAAxC;AACA,QAAMG,WAAW,GAAGC,cAAc,CAAEJ,IAAF,CAAlC;AACA,QAAMK,UAAU,GAAGC,aAAa,CAAEN,IAAF,CAAhC;AACA,QAAMO,SAAS,GAAGC,YAAY,CAAER,IAAF,CAA9B;AACA,Q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AA,KAAK,EAAG,cAAI,aAAJ,CADT;AAEC,IAAA,KAAK,EAAGF,cAFT;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAND,CA9KF,CADD;AA8LA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalBoxControl as BoxControl,\n\t__experimentalHStack as HStack,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalView as View,\n} from '@wordpress/components';\nimport {\n\t__experimentalUseCustomSides as useCustomSides,\n\tHeightControl,\n\t__experimentalSpacingSizesControl as SpacingSizesControl,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Icon, positionCenter, stretchWide } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from './hooks';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst AXIAL_SIDES = [ 'horizontal', 'vertical' ];\n\nexport function useHasDimensionsPanel( name ) {\n\tconst hasContentSize = useHasContentSize( name );\n\tconst hasWideSize = useHasWideSize( name );\n\tconst hasPadding = useHasPadding( name );\n\tconst hasMargin = useHasMargin( name );\n\tconst hasGap = useHasGap( name );\n\tconst hasMinHeight = useHasMinHeight( name );\n\n\treturn (\n\t\thasContentSize ||\n\t\thasWideSize ||\n\t\thasPadding ||\n\t\thasMargin ||\n\t\thasGap ||\n\t\thasMinHeight\n\t);\n}\n\nfunction useHasContentSize( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'layout.contentSize', name );\n\n\treturn settings && supports.includes( 'contentSize' );\n}\n\nfunction useHasWideSize( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'layout.wideSize', name );\n\n\treturn settings && supports.includes( 'wideSize' );\n}\n\nfunction useHasPadding( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.padding', name );\n\n\treturn settings && supports.includes( 'padding' );\n}\n\nfunction useHasMargin( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.margin', name );\n\n\treturn settings && supports.includes( 'margin' );\n}\n\nfunction useHasGap( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'spacing.blockGap', name );\n\n\treturn settings && supports.includes( 'blockGap' );\n}\n\nfunction useHasMinHeight( name ) {\n\tconst supports = useSupportedStyles( name );\n\tconst [ settings ] = useGlobalSetting( 'dimensions.minHeight', name );\n\n\treturn settings && supports.includes( 'minHeight' );\n}\n\nfunction useHasSpacingPresets() {\n\tconst [ settings ] = useGlobalSetting( 'spacing.spacingSizes' );\n\tconst { custom, theme, default: defaultPresets } = settings || {};\n\tconst presets = custom ?? theme ?? defaultPresets ?? [];\n\n\treturn settings && presets.length > 0;\n}\n\nfunction filterValuesBySides( values, sides ) {\n\tif ( ! sides ) {\n\t\t// If no custom side configuration all sides are opted into by default.\n\t\treturn values;\n\t}\n\n\t// Only include sides opted into within filtered values.\n\tconst filteredValues = {};\n\tsides.forEach( ( side ) => {\n\t\tif ( side === 'vertical' ) {\n\t\t\tfilteredValues.top = values.top;\n\t\t\tfilteredValues.bottom = values.bottom;\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tfilteredValues.left = values.left;\n\t\t\tfilteredValues.right = values.right;\n\t\t}\n\t\tfilteredValues[ side ] = values[ side ];\n\t} );\n\n\treturn filteredValues;\n}\n\nfunction splitStyleValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( value && typeof value === 'string' ) {\n\t\t// Convert to value for individual sides for BoxControl.\n\t\treturn {\n\t\t\ttop: value,\n\t\t\tright: value,\n\t\t\tbottom: value,\n\t\t\tleft: value,\n\t\t};\n\t}\n\n\treturn value;\n}\n\nfunction splitGapValue( value ) {\n\t// Check for shorthand value (a string value).\n\tif ( value && typeof value === 'string' ) {\n\t\t// If the value is a string, treat it as a single side (top) for the spacing controls.\n\t\treturn {\n\t\t\ttop: value,\n\t\t};\n\t}\n\n\tif ( value ) {\n\t\treturn {\n\t\t\t...value,\n\t\t\tright: value?.left,\n\t\t\tbottom: value?.top,\n\t\t};\n\t}\n\n\treturn value;\n}\n\n// Props for managing `layout.contentSize`.\nfunction useContentSizeProps( name ) {\n\tconst [ contentSizeValue, setContentSizeValue ] = useGlobalSetting(\n\t\t'layout.contentSize',\n\t\tname\n\t);\n\tconst [ userSetContentSizeValue ] = useGlobalSetting(\n\t\t'layout.contentSize',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasUserSetContentSizeValue = () => !! userSetContentSizeValue;\n\tconst resetContentSizeValue = () => setContentSizeValue( '' );\n\treturn {\n\t\tcontentSizeValue,\n\t\tsetContentSizeValue,\n\t\thasUserSetContentSizeValue,\n\t\tresetContentSizeValue,\n\t};\n}\n\n// Props for managing `layout.wideSize`.\nfunction useWideSizeProps( name ) {\n\tconst [ wideSizeValue, setWideSizeValue ] = useGlobalSetting(\n\t\t'layout.wideSize',\n\t\tname\n\t);\n\tconst [ userSetWideSizeValue ] = useGlobalSetting(\n\t\t'layout.wideSize',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasUserSetWideSizeValue = () => !! userSetWideSizeValue;\n\tconst resetWideSizeValue = () => setWideSizeValue( '' );\n\treturn {\n\t\twideSizeValue,\n\t\tsetWideSizeValue,\n\t\thasUserSetWideSizeValue,\n\t\tresetWideSizeValue,\n\t};\n}\n\n// Props for managing `spacing.padding`.\nfunction usePaddingProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ rawPadding, setRawPadding ] = useGlobalStyle(\n\t\tprefix + 'spacing.padding',\n\t\tname\n\t);\n\tconst paddingValues = splitStyleValue( rawPadding );\n\tconst paddingSides = useCustomSides( name, 'padding' );\n\tconst isAxialPadding =\n\t\tpaddingSides &&\n\t\tpaddingSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\n\tconst setPaddingValues = ( newPaddingValues ) => {\n\t\tconst padding = filterValuesBySides( newPaddingValues, paddingSides );\n\t\tsetRawPadding( padding );\n\t};\n\tconst resetPaddingValue = () => setPaddingValues( {} );\n\tconst [ userSetPaddingValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.padding',\n\t\tname,\n\t\t'user'\n\t);\n\t// The `hasPaddingValue` check does not need a parsed value, as `userSetPaddingValue` will be `undefined` if not set.\n\tconst hasPaddingValue = () => !! userSetPaddingValue;\n\n\treturn {\n\t\tpaddingValues,\n\t\tpaddingSides,\n\t\tisAxialPadding,\n\t\tsetPaddingValues,\n\t\tresetPaddingValue,\n\t\thasPaddingValue,\n\t};\n}\n\n// Props for managing `spacing.margin`.\nfunction useMarginProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ rawMargin, setRawMargin ] = useGlobalStyle(\n\t\tprefix + 'spacing.margin',\n\t\tname\n\t);\n\tconst marginValues = splitStyleValue( rawMargin );\n\tconst marginSides = useCustomSides( name, 'margin' );\n\tconst isAxialMargin =\n\t\tmarginSides &&\n\t\tmarginSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\n\tconst setMarginValues = ( newMarginValues ) => {\n\t\tconst margin = filterValuesBySides( newMarginValues, marginSides );\n\t\tsetRawMargin( margin );\n\t};\n\tconst resetMarginValue = () => setMarginValues( {} );\n\tconst hasMarginValue = () =>\n\t\t!! marginValues && Object.keys( marginValues ).length;\n\n\treturn {\n\t\tmarginValues,\n\t\tmarginSides,\n\t\tisAxialMargin,\n\t\tsetMarginValues,\n\t\tresetMarginValue,\n\t\thasMarginValue,\n\t};\n}\n\n// Props for managing `spacing.blockGap`.\nfunction useBlockGapProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ gapValue, setGapValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.blockGap',\n\t\tname\n\t);\n\tconst gapValues = splitGapValue( gapValue );\n\tconst gapSides = useCustomSides( name, 'blockGap' );\n\tconst isAxialGap =\n\t\tgapSides && gapSides.some( ( side ) => AXIAL_SIDES.includes( side ) );\n\tconst resetGapValue = () => setGapValue( undefined );\n\tconst [ userSetGapValue ] = useGlobalStyle(\n\t\tprefix + 'spacing.blockGap',\n\t\tname,\n\t\t'user'\n\t);\n\tconst hasGapValue = () => !! userSetGapValue;\n\tconst setGapValues = ( nextBoxGapValue ) => {\n\t\tif ( ! nextBoxGapValue ) {\n\t\t\tsetGapValue( null );\n\t\t}\n\t\t// If axial gap is not enabled, treat the 'top' value as the shorthand gap value.\n\t\tif ( ! isAxialGap && nextBoxGapValue?.hasOwnProperty( 'top' ) ) {\n\t\t\tsetGapValue( nextBoxGapValue.top );\n\t\t} else {\n\t\t\tsetGapValue( {\n\t\t\t\ttop: nextBoxGapValue?.top,\n\t\t\t\tleft: nextBoxGapValue?.left,\n\t\t\t} );\n\t\t}\n\t};\n\treturn {\n\t\tgapValue,\n\t\tgapValues,\n\t\tgapSides,\n\t\tisAxialGap,\n\t\tsetGapValue,\n\t\tsetGapValues,\n\t\tresetGapValue,\n\t\thasGapValue,\n\t};\n}\n\n// Props for managing `dimensions.minHeight`.\nfunction useMinHeightProps( name, variation = '' ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst [ minHeightValue, setMinHeightValue ] = useGlobalStyle(\n\t\tprefix + 'dimensions.minHeight',\n\t\tname\n\t);\n\tconst resetMinHeightValue = () => setMinHeightValue( undefined );\n\tconst hasMinHeightValue = () => !! minHeightValue;\n\treturn {\n\t\tminHeightValue,\n\t\tsetMinHeightValue,\n\t\tresetMinHeightValue,\n\t\thasMinHeightValue,\n\t};\n}\n\nexport default function DimensionsPanel( { name, variation = '' } ) {\n\tconst showContentSizeControl = useHasContentSize( name );\n\tconst showWideSizeControl = useHasWideSize( name );\n\tconst showPaddingControl = useHasPadding( name );\n\tconst showMarginControl = useHasMargin( name );\n\tconst showGapControl = useHasGap( name );\n\tconst showMinHeightControl = useHasMinHeight( name );\n\tconst showSpacingPresetsControl = useHasSpacingPresets();\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useGlobalSetting( 'spacing.units', name )[ 0 ] || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vw',\n\t\t],\n\t} );\n\n\t// Props for managing `layout.contentSize`.\n\tconst {\n\t\tcontentSizeValue,\n\t\tsetContentSizeValue,\n\t\thasUserSetContentSizeValue,\n\t\tresetContentSizeValue,\n\t} = useContentSizeProps( name );\n\n\t// Props for managing `layout.wideSize`.\n\tconst {\n\t\twideSizeValue,\n\t\tsetWideSizeValue,\n\t\thasUserSetWideSizeValue,\n\t\tresetWideSizeValue,\n\t} = useWideSizeProps( name );\n\n\t// Props for managing `spacing.padding`.\n\tconst {\n\t\tpaddingValues,\n\t\tpaddingSides,\n\t\tisAxialPadding,\n\t\tsetPaddingValues,\n\t\tresetPaddingValue,\n\t\thasPaddingValue,\n\t} = usePaddingProps( name, variation );\n\n\t// Props for managing `spacing.margin`.\n\tconst {\n\t\tmarginValues,\n\t\tmarginSides,\n\t\tisAxialMargin,\n\t\tsetMarginValues,\n\t\tresetMarginValue,\n\t\thasMarginValue,\n\t} = useMarginProps( name, variation );\n\n\t// Props for managing `spacing.blockGap`.\n\tconst {\n\t\tgapValue,\n\t\tgapValues,\n\t\tgapSides,\n\t\tisAxialGap,\n\t\tsetGapValue,\n\t\tsetGapValues,\n\t\tresetGapValue,\n\t\thasGapValue,\n\t} = useBlockGapProps( name, variation );\n\n\t// Props for managing `dimensions.minHeight`.\n\tconst {\n\t\tminHeightValue,\n\t\tsetMinHeightValue,\n\t\tresetMinHeightValue,\n\t\thasMinHeightValue,\n\t} = useMinHeightProps( name, variation );\n\n\tconst resetAll = () => {\n\t\tresetPaddingValue();\n\t\tresetMarginValue();\n\t\tresetGapValue();\n\t\tresetContentSizeValue();\n\t\tresetWideSizeValue();\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\theadingLevel={ 3 }\n\t\t>\n\t\t\t{ ( showContentSizeControl || showWideSizeControl ) && (\n\t\t\t\t<span className=\"span-columns\">\n\t\t\t\t\t{ __( 'Set the width of the main content area.' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showContentSizeControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Content size' ) }\n\t\t\t\t\thasValue={ hasUserSetContentSizeValue }\n\t\t\t\t\tonDeselect={ resetContentSizeValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"flex-end\" justify=\"flex-start\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSizeValue || '' }\n\t\t\t\t\t\t\tonChange={ ( nextContentSize ) => {\n\t\t\t\t\t\t\t\tsetContentSizeValue( nextContentSize );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</HStack>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showWideSizeControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Wide size' ) }\n\t\t\t\t\thasValue={ hasUserSetWideSizeValue }\n\t\t\t\t\tonDeselect={ resetWideSizeValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"flex-end\" justify=\"flex-start\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSizeValue || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWideSize ) => {\n\t\t\t\t\t\t\t\tsetWideSizeValue( nextWideSize );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View>\n\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</HStack>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showPaddingControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasPaddingValue }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\tonDeselect={ resetPaddingValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ paddingValues }\n\t\t\t\t\t\t\tonChange={ setPaddingValues }\n\t\t\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\t\t\tsides={ paddingSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialPadding }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMarginControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasMarginValue }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\tonDeselect={ resetMarginValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl && (\n\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tvalues={ marginValues }\n\t\t\t\t\t\t\tonChange={ setMarginValues }\n\t\t\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\t\t\tsides={ marginSides }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialMargin }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showGapControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasGapValue }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\tonDeselect={ resetGapValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'tools-panel-item-spacing': showSpacingPresetsControl,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ ! showSpacingPresetsControl &&\n\t\t\t\t\t\t( isAxialGap ? (\n\t\t\t\t\t\t\t<BoxControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tsides={ gapSides }\n\t\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tonChange={ setGapValue }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t\tvalue={ gapValue }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t{ showSpacingPresetsControl && (\n\t\t\t\t\t\t<SpacingSizesControl\n\t\t\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tonChange={ setGapValues }\n\t\t\t\t\t\t\tsides={ isAxialGap ? gapSides : [ 'top' ] } // Use 'top' as the shorthand property in non-axial configurations.\n\t\t\t\t\t\t\tvalues={ gapValues }\n\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\tsplitOnAxis={ isAxialGap }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showMinHeightControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasMinHeightValue }\n\t\t\t\t\tlabel={ __( 'Min. height' ) }\n\t\t\t\t\tonDeselect={ resetMinHeightValue }\n\t\t\t\t\tisShownByDefault={ true }\n\t\t\t\t>\n\t\t\t\t\t<HeightControl\n\t\t\t\t\t\tlabel={ __( 'Min. height' ) }\n\t\t\t\t\t\tvalue={ minHeightValue }\n\t\t\t\t\t\tonChange={ setMinHeightValue }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</ToolsPanel>\n\t);\n}\n"]}
@@ -55,20 +55,25 @@ function GradientPalettePanel(_ref) {
55
55
  canOnlyChangeValues: true,
56
56
  gradients: themeGradients,
57
57
  onChange: setThemeGradients,
58
- paletteLabel: (0, _i18n.__)('Theme')
58
+ paletteLabel: (0, _i18n.__)('Theme'),
59
+ paletteLabelHeadingLevel: 3
59
60
  }), !!defaultGradients && !!defaultGradients.length && !!defaultPaletteEnabled && (0, _element.createElement)(_components.__experimentalPaletteEdit, {
60
61
  canReset: defaultGradients !== baseDefaultGradients,
61
62
  canOnlyChangeValues: true,
62
63
  gradients: defaultGradients,
63
64
  onChange: setDefaultGradients,
64
- paletteLabel: (0, _i18n.__)('Default')
65
+ paletteLabel: (0, _i18n.__)('Default'),
66
+ paletteLabelLevel: 3
65
67
  }), (0, _element.createElement)(_components.__experimentalPaletteEdit, {
66
68
  gradients: customGradients,
67
69
  onChange: setCustomGradients,
68
70
  paletteLabel: (0, _i18n.__)('Custom'),
71
+ paletteLabelLevel: 3,
69
72
  emptyMessage: (0, _i18n.__)('Custom gradients are empty! Add some gradients to create your own palette.'),
70
73
  slugPrefix: "custom-"
71
- }), !!duotonePalette && !!duotonePalette.length && (0, _element.createElement)("div", null, (0, _element.createElement)(_subtitle.default, null, (0, _i18n.__)('Duotone')), (0, _element.createElement)(_components.__experimentalSpacer, {
74
+ }), !!duotonePalette && !!duotonePalette.length && (0, _element.createElement)("div", null, (0, _element.createElement)(_subtitle.default, {
75
+ level: 3
76
+ }, (0, _i18n.__)('Duotone')), (0, _element.createElement)(_components.__experimentalSpacer, {
72
77
  margin: 3
73
78
  }), (0, _element.createElement)(_components.DuotonePicker, {
74
79
  duotonePalette: duotonePalette,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/gradients-palette-panel.js"],"names":["useGlobalSetting","blockEditorPrivateApis","noop","GradientPalettePanel","name","themeGradients","setThemeGradients","baseThemeGradients","defaultGradients","setDefaultGradients","baseDefaultGradients","customGradients","setCustomGradients","defaultPaletteEnabled","customDuotone","defaultDuotone","themeDuotone","defaultDuotoneEnabled","duotonePalette","length"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEe,SAASC,oBAAT,OAA0C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACxD,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwCN,gBAAgB,CAC7D,uBAD6D,EAE7DI,IAF6D,CAA9D;AAIA,QAAM,CAAEG,kBAAF,IAAyBP,gBAAgB,CAC9C,uBAD8C,EAE9CI,IAF8C,EAG9C,MAH8C,CAA/C;AAKA,QAAM,CAAEI,gBAAF,EAAoBC,mBAApB,IAA4CT,gBAAgB,CACjE,yBADiE,EAEjEI,IAFiE,CAAlE;AAIA,QAAM,CAAEM,oBAAF,IAA2B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jC;AAEC,IAAA,mBAAmB,MAFpB;AAGC,IAAA,SAAS,EAAGF,gBAHb;AAIC,IAAA,QAAQ,EAAGC,mBAJZ;AAKC,IAAA,YAAY,EAAG,cAAI,SAAJ;AALhB,IAhBH,EAwBC,4BAAC,qCAAD;AACC,IAAA,SAAS,EAAGE,eADb;AAEC,IAAA,QAAQ,EAAGC,kBAFZ;AAGC,IAAA,YAAY,EAAG,cAAI,QAAJ,CAHhB;AAIC,IAAA,YAAY,EAAG,cACd,4EADc,CAJhB;AAOC,IAAA,UAAU,EAAC;AAPZ,IAxBD,EAiCG,CAAC,CAAEM,cAAH,IAAqB,CAAC,CAAEA,cAAc,CAACC,MAAvC,IACD,yCACC,4BAAC,iBAAD,QAAY,cAAI,SAAJ,CAAZ,CADD,EAEC,4BAAC,gCAAD;AAAQ,IAAA,MAAM,EAAG;AAAjB,IAFD,EAGC,4BAAC,yBAAD;AACC,IAAA,cAAc,EAAGD,cADlB;AAEC,IAAA,oBAAoB,EAAG,IAFxB;AAGC,IAAA,mBAAmB,EAAG,IAHvB;AAIC,IAAA,SAAS,EAAG,KAJb;AAKC,IAAA,QAAQ,EAAGhB;AALZ,IAHD,CAlCF,CADD;AAiDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalSpacer as Spacer,\n\tDuotonePicker,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst noop = () => {};\n\nexport default function GradientPalettePanel( { name } ) {\n\tconst [ themeGradients, setThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ baseThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultGradients, setDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ baseDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customGradients, setCustomGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultGradients',\n\t\tname\n\t);\n\n\tconst [ customDuotone ] = useGlobalSetting( 'color.duotone.custom' ) || [];\n\tconst [ defaultDuotone ] =\n\t\tuseGlobalSetting( 'color.duotone.default' ) || [];\n\tconst [ themeDuotone ] = useGlobalSetting( 'color.duotone.theme' ) || [];\n\tconst [ defaultDuotoneEnabled ] = useGlobalSetting(\n\t\t'color.defaultDuotone'\n\t);\n\n\tconst duotonePalette = [\n\t\t...( customDuotone || [] ),\n\t\t...( themeDuotone || [] ),\n\t\t...( defaultDuotone && defaultDuotoneEnabled ? defaultDuotone : [] ),\n\t];\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-gradient-palette-panel\"\n\t\t\tspacing={ 10 }\n\t\t>\n\t\t\t{ !! themeGradients && !! themeGradients.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeGradients !== baseThemeGradients }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tgradients={ themeGradients }\n\t\t\t\t\tonChange={ setThemeGradients }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultGradients &&\n\t\t\t\t!! defaultGradients.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultGradients !== baseDefaultGradients }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tgradients={ defaultGradients }\n\t\t\t\t\t\tonChange={ setDefaultGradients }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tgradients={ customGradients }\n\t\t\t\tonChange={ setCustomGradients }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\temptyMessage={ __(\n\t\t\t\t\t'Custom gradients are empty! Add some gradients to create your own palette.'\n\t\t\t\t) }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t/>\n\t\t\t{ !! duotonePalette && !! duotonePalette.length && (\n\t\t\t\t<div>\n\t\t\t\t\t<Subtitle>{ __( 'Duotone' ) }</Subtitle>\n\t\t\t\t\t<Spacer margin={ 3 } />\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomDuotone={ true }\n\t\t\t\t\t\tdisableCustomColors={ true }\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tonChange={ noop }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/gradients-palette-panel.js"],"names":["useGlobalSetting","blockEditorPrivateApis","noop","GradientPalettePanel","name","themeGradients","setThemeGradients","baseThemeGradients","defaultGradients","setDefaultGradients","baseDefaultGradients","customGradients","setCustomGradients","defaultPaletteEnabled","customDuotone","defaultDuotone","themeDuotone","defaultDuotoneEnabled","duotonePalette","length"],"mappings":";;;;;;;;;;;AAGA;;AAMA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEe,SAASC,oBAAT,OAA0C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACxD,QAAM,CAAEC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Stack,\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalSpacer as Spacer,\n\tDuotonePicker,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst noop = () => {};\n\nexport default function GradientPalettePanel( { name } ) {\n\tconst [ themeGradients, setThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ baseThemeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultGradients, setDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ baseDefaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customGradients, setCustomGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultGradients',\n\t\tname\n\t);\n\n\tconst [ customDuotone ] = useGlobalSetting( 'color.duotone.custom' ) || [];\n\tconst [ defaultDuotone ] =\n\t\tuseGlobalSetting( 'color.duotone.default' ) || [];\n\tconst [ themeDuotone ] = useGlobalSetting( 'color.duotone.theme' ) || [];\n\tconst [ defaultDuotoneEnabled ] = useGlobalSetting(\n\t\t'color.defaultDuotone'\n\t);\n\n\tconst duotonePalette = [\n\t\t...( customDuotone || [] ),\n\t\t...( themeDuotone || [] ),\n\t\t...( defaultDuotone && defaultDuotoneEnabled ? defaultDuotone : [] ),\n\t];\n\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"edit-site-global-styles-gradient-palette-panel\"\n\t\t\tspacing={ 10 }\n\t\t>\n\t\t\t{ !! themeGradients && !! themeGradients.length && (\n\t\t\t\t<PaletteEdit\n\t\t\t\t\tcanReset={ themeGradients !== baseThemeGradients }\n\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\tgradients={ themeGradients }\n\t\t\t\t\tonChange={ setThemeGradients }\n\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ !! defaultGradients &&\n\t\t\t\t!! defaultGradients.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultGradients !== baseDefaultGradients }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tgradients={ defaultGradients }\n\t\t\t\t\t\tonChange={ setDefaultGradients }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tgradients={ customGradients }\n\t\t\t\tonChange={ setCustomGradients }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelLevel={ 3 }\n\t\t\t\temptyMessage={ __(\n\t\t\t\t\t'Custom gradients are empty! Add some gradients to create your own palette.'\n\t\t\t\t) }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t/>\n\t\t\t{ !! duotonePalette && !! duotonePalette.length && (\n\t\t\t\t<div>\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Duotone' ) }</Subtitle>\n\t\t\t\t\t<Spacer margin={ 3 } />\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomDuotone={ true }\n\t\t\t\t\t\tdisableCustomColors={ true }\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tonChange={ noop }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"]}
@@ -40,7 +40,9 @@ function ScreenHeader(_ref) {
40
40
  isSmall: true,
41
41
  "aria-label": (0, _i18n.__)('Navigate to the previous view')
42
42
  }), (0, _element.createElement)(_components.__experimentalSpacer, null, (0, _element.createElement)(_components.__experimentalHeading, {
43
- level: 5
43
+ className: "edit-site-global-styles-header",
44
+ level: 2,
45
+ size: 13
44
46
  }, title))))), description && (0, _element.createElement)("p", {
45
47
  className: "edit-site-global-styles-header__description"
46
48
  }, description));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"names":["ScreenHeader","title","description","minWidth","padding","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAQA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,YAAT,OAAgD;AAAA,MAAzB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAyB;AAC/C,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,8BAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,YAAY,EAAG,CAAvB;AAA2B,IAAA,QAAQ,EAAG,CAAtC;AAA0C,IAAA,QAAQ,EAAG;AAArD,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iDAAD;AACC,IAAA,KAAK,EACJ;AACA;AACA;AAAEC,MAAAA,QAAQ,EAAE,EAAZ;AAAgBC,MAAAA,OAAO,EAAE;AAAzB,KAJF;AAMC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBANjC;AAOC,IAAA,OAAO,MAPR;AAQC,kBAAa,cAAI,+BAAJ;AARd,IADD,EAWC,4BAAC,gCAAD,QACC,4BAAC,iCAAD;AAAS,IAAA,KAAK,EAAG;AAAjB,KAAuBL,KAAvB,CADD,CAXD,CADD,CADD,CADD,EAoBGC,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CArBF,CADD;AA4BA;;eAEcF,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nfunction ScreenHeader( { title, description } ) {\n\treturn (\n\t\t<VStack spacing={ 0 }>\n\t\t\t<View>\n\t\t\t\t<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>\n\t\t\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t// TODO: This style override is also used in ToolsPanelHeader.\n\t\t\t\t\t\t\t\t// It should be supported out-of-the-box by Button.\n\t\t\t\t\t\t\t\t{ minWidth: 24, padding: 0 }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\taria-label={ __( 'Navigate to the previous view' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer>\n\t\t\t\t\t\t\t<Heading level={ 5 }>{ title }</Heading>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</HStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/header.js"],"names":["ScreenHeader","title","description","minWidth","padding","chevronRight","chevronLeft"],"mappings":";;;;;;;;;AAGA;;AAQA;;AACA;;AAZA;AACA;AACA;AAYA,SAASA,YAAT,OAAgD;AAAA,MAAzB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAyB;AAC/C,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,8BAAD,QACC,4BAAC,gCAAD;AAAQ,IAAA,YAAY,EAAG,CAAvB;AAA2B,IAAA,QAAQ,EAAG,CAAtC;AAA0C,IAAA,QAAQ,EAAG;AAArD,KACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,iDAAD;AACC,IAAA,KAAK,EACJ;AACA;AACA;AAAEC,MAAAA,QAAQ,EAAE,EAAZ;AAAgBC,MAAAA,OAAO,EAAE;AAAzB,KAJF;AAMC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBANjC;AAOC,IAAA,OAAO,MAPR;AAQC,kBAAa,cAAI,+BAAJ;AARd,IADD,EAWC,4BAAC,gCAAD,QACC,4BAAC,iCAAD;AACC,IAAA,SAAS,EAAC,gCADX;AAEC,IAAA,KAAK,EAAG,CAFT;AAGC,IAAA,IAAI,EAAG;AAHR,KAKGL,KALH,CADD,CAXD,CADD,CADD,CADD,EA0BGC,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CA3BF,CADD;AAkCA;;eAEcF,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHeading as Heading,\n\t__experimentalView as View,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\n\nfunction ScreenHeader( { title, description } ) {\n\treturn (\n\t\t<VStack spacing={ 0 }>\n\t\t\t<View>\n\t\t\t\t<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>\n\t\t\t\t\t<HStack spacing={ 2 }>\n\t\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t// TODO: This style override is also used in ToolsPanelHeader.\n\t\t\t\t\t\t\t\t// It should be supported out-of-the-box by Button.\n\t\t\t\t\t\t\t\t{ minWidth: 24, padding: 0 }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\taria-label={ __( 'Navigate to the previous view' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Spacer>\n\t\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-header\"\n\t\t\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</HStack>\n\t\t\t\t</Spacer>\n\t\t\t</View>\n\t\t\t{ description && (\n\t\t\t\t<p className=\"edit-site-global-styles-header__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</p>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default ScreenHeader;\n"]}
@@ -5,12 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.getSupportedGlobalStylesPanels = getSupportedGlobalStylesPanels;
9
8
  exports.useColorRandomizer = useColorRandomizer;
10
9
  exports.useColorsPerOrigin = useColorsPerOrigin;
11
10
  exports.useGradientsPerOrigin = useGradientsPerOrigin;
12
-
13
- var _lodash = require("lodash");
11
+ exports.useSupportedStyles = useSupportedStyles;
14
12
 
15
13
  var _colord = require("colord");
16
14
 
@@ -26,6 +24,8 @@ var _blockEditor = require("@wordpress/block-editor");
26
24
 
27
25
  var _privateApis = require("../../private-apis");
28
26
 
27
+ var _data = require("@wordpress/data");
28
+
29
29
  /**
30
30
  * External dependencies
31
31
  */
@@ -42,54 +42,6 @@ const {
42
42
  } = (0, _privateApis.unlock)(_blockEditor.privateApis); // Enable colord's a11y plugin.
43
43
 
44
44
  (0, _colord.extend)([_a11y.default]);
45
- const ROOT_BLOCK_SUPPORTS = ['background', 'backgroundColor', 'color', 'linkColor', 'buttonColor', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'lineHeight', 'textDecoration', 'padding', 'contentSize', 'wideSize', 'blockGap'];
46
-
47
- function getSupportedGlobalStylesPanels(name) {
48
- var _blockType$supports, _blockType$supports$s, _blockType$supports2, _blockType$supports2$, _blockType$supports3, _blockType$supports3$, _blockType$supports3$2, _blockType$supports3$3, _blockType$supports4;
49
-
50
- if (!name) {
51
- return ROOT_BLOCK_SUPPORTS;
52
- }
53
-
54
- const blockType = (0, _blocks.getBlockType)(name);
55
-
56
- if (!blockType) {
57
- return [];
58
- }
59
-
60
- const supportKeys = []; // Check for blockGap support.
61
- // Block spacing support doesn't map directly to a single style property, so needs to be handled separately.
62
- // Also, only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.
63
-
64
- if (blockType !== null && blockType !== void 0 && (_blockType$supports = blockType.supports) !== null && _blockType$supports !== void 0 && (_blockType$supports$s = _blockType$supports.spacing) !== null && _blockType$supports$s !== void 0 && _blockType$supports$s.blockGap && (blockType === null || blockType === void 0 ? void 0 : (_blockType$supports2 = blockType.supports) === null || _blockType$supports2 === void 0 ? void 0 : (_blockType$supports2$ = _blockType$supports2.spacing) === null || _blockType$supports2$ === void 0 ? void 0 : _blockType$supports2$.__experimentalSkipSerialization) !== true && !(blockType !== null && blockType !== void 0 && (_blockType$supports3 = blockType.supports) !== null && _blockType$supports3 !== void 0 && (_blockType$supports3$ = _blockType$supports3.spacing) !== null && _blockType$supports3$ !== void 0 && (_blockType$supports3$2 = _blockType$supports3$.__experimentalSkipSerialization) !== null && _blockType$supports3$2 !== void 0 && (_blockType$supports3$3 = _blockType$supports3$2.some) !== null && _blockType$supports3$3 !== void 0 && _blockType$supports3$3.call(_blockType$supports3$2, spacingType => spacingType === 'blockGap'))) {
65
- supportKeys.push('blockGap');
66
- } // check for shadow support
67
-
68
-
69
- if (blockType !== null && blockType !== void 0 && (_blockType$supports4 = blockType.supports) !== null && _blockType$supports4 !== void 0 && _blockType$supports4.shadow) {
70
- supportKeys.push('shadow');
71
- }
72
-
73
- Object.keys(_blocks.__EXPERIMENTAL_STYLE_PROPERTY).forEach(styleName => {
74
- if (!_blocks.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) {
75
- return;
76
- } // Opting out means that, for certain support keys like background color,
77
- // blocks have to explicitly set the support value false. If the key is
78
- // unset, we still enable it.
79
-
80
-
81
- if (_blocks.__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) {
82
- if (_blocks.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && (0, _lodash.get)(blockType.supports, _blocks.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) !== false) {
83
- return supportKeys.push(styleName);
84
- }
85
- }
86
-
87
- if ((0, _lodash.get)(blockType.supports, _blocks.__EXPERIMENTAL_STYLE_PROPERTY[styleName].support, false)) {
88
- return supportKeys.push(styleName);
89
- }
90
- });
91
- return supportKeys;
92
- }
93
45
 
94
46
  function useColorsPerOrigin(name) {
95
47
  const [customColors] = useGlobalSetting('color.palette.custom', name);
@@ -179,4 +131,15 @@ function useColorRandomizer(name) {
179
131
 
180
132
  return window.__experimentalEnableColorRandomizer ? [randomizeColors] : [];
181
133
  }
134
+
135
+ function useSupportedStyles(name, element) {
136
+ const {
137
+ supportedPanels
138
+ } = (0, _data.useSelect)(select => {
139
+ return {
140
+ supportedPanels: (0, _privateApis.unlock)(select(_blocks.store)).getSupportedStyles(name, element)
141
+ };
142
+ }, [name, element]);
143
+ return supportedPanels;
144
+ }
182
145
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"names":["useGlobalSetting","blockEditorPrivateApis","a11yPlugin","ROOT_BLOCK_SUPPORTS","getSupportedGlobalStylesPanels","name","blockType","supportKeys","supports","spacing","blockGap","__experimentalSkipSerialization","some","spacingType","push","shadow","Object","keys","STYLE_PROPERTY","forEach","styleName","support","requiresOptOut","useColorsPerOrigin","customColors","themeColors","defaultColors","shouldDisplayDefaultColors","result","length","colors","useGradientsPerOrigin","customGradients","themeGradients","defaultGradients","shouldDisplayDefaultGradients","gradients","useColorRandomizer","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AArBA;AACA;AACA;;AAKA;AACA;AACA;;AASA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B,C,CAEA;;AACA,oBAAQ,CAAEC,aAAF,CAAR;AAEA,MAAMC,mBAAmB,GAAG,CAC3B,YAD2B,EAE3B,iBAF2B,EAG3B,OAH2B,EAI3B,WAJ2B,EAK3B,aAL2B,EAM3B,YAN2B,EAO3B,UAP2B,EAQ3B,WAR2B,EAS3B,YAT2B,EAU3B,YAV2B,EAW3B,gBAX2B,EAY3B,SAZ2B,EAa3B,aAb2B,EAc3B,UAd2B,EAe3B,UAf2B,CAA5B;;AAkBO,SAASC,8BAAT,CAAyCC,IAAzC,EAAgD;AAAA;;AACtD,MAAK,CAAEA,IAAP,EAAc;AACb,WAAOF,mBAAP;AACA;;AAED,QAAMG,SAAS,GAAG,0BAAcD,IAAd,CAAlB;;AAEA,MAAK,CAAEC,SAAP,EAAmB;AAClB,WAAO,EAAP;AACA;;AAED,QAAMC,WAAW,GAAG,EAApB,CAXsD,CAatD;AACA;AACA;;AACA,MACCD,SAAS,SAA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C,KAAL,CAAYD,IAAI,CAACE,MAAL,KAAgB,GAA5B,CAA5B;AACA;;AAEA,UAAMC,SAAS,GAAGnB,WAAW,CAACoB,GAAZ,CAAmBC,WAAF,IAAmB;AACrD,YAAM;AAAEC,QAAAA;AAAF,UAAYD,WAAlB;AACA,YAAME,QAAQ,GAAG,oBAAQD,KAAR,EACfE,MADe,CACPT,mBADO,EAEfU,KAFe,EAAjB;AAIA,aAAO,EACN,GAAGJ,WADG;AAENC,QAAAA,KAAK,EAAEC;AAFD,OAAP;AAIA,KAViB,CAAlB;AAYAV,IAAAA,cAAc,CAAEM,SAAF,CAAd;AACA;;AAED,SAAOO,MAAM,CAACC,mCAAP,GACJ,CAAEb,eAAF,CADI,GAEJ,EAFH;AAGA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tgetBlockType,\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n} from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nconst ROOT_BLOCK_SUPPORTS = [\n\t'background',\n\t'backgroundColor',\n\t'color',\n\t'linkColor',\n\t'buttonColor',\n\t'fontFamily',\n\t'fontSize',\n\t'fontStyle',\n\t'fontWeight',\n\t'lineHeight',\n\t'textDecoration',\n\t'padding',\n\t'contentSize',\n\t'wideSize',\n\t'blockGap',\n];\n\nexport function getSupportedGlobalStylesPanels( name ) {\n\tif ( ! name ) {\n\t\treturn ROOT_BLOCK_SUPPORTS;\n\t}\n\n\tconst blockType = getBlockType( name );\n\n\tif ( ! blockType ) {\n\t\treturn [];\n\t}\n\n\tconst supportKeys = [];\n\n\t// Check for blockGap support.\n\t// Block spacing support doesn't map directly to a single style property, so needs to be handled separately.\n\t// Also, only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.\n\tif (\n\t\tblockType?.supports?.spacing?.blockGap &&\n\t\tblockType?.supports?.spacing?.__experimentalSkipSerialization !==\n\t\t\ttrue &&\n\t\t! blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(\n\t\t\t( spacingType ) => spacingType === 'blockGap'\n\t\t)\n\t) {\n\t\tsupportKeys.push( 'blockGap' );\n\t}\n\n\t// check for shadow support\n\tif ( blockType?.supports?.shadow ) {\n\t\tsupportKeys.push( 'shadow' );\n\t}\n\n\tObject.keys( STYLE_PROPERTY ).forEach( ( styleName ) => {\n\t\tif ( ! STYLE_PROPERTY[ styleName ].support ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Opting out means that, for certain support keys like background color,\n\t\t// blocks have to explicitly set the support value false. If the key is\n\t\t// unset, we still enable it.\n\t\tif ( STYLE_PROPERTY[ styleName ].requiresOptOut ) {\n\t\t\tif (\n\t\t\t\tSTYLE_PROPERTY[ styleName ].support[ 0 ] in\n\t\t\t\t\tblockType.supports &&\n\t\t\t\tget(\n\t\t\t\t\tblockType.supports,\n\t\t\t\t\tSTYLE_PROPERTY[ styleName ].support\n\t\t\t\t) !== false\n\t\t\t) {\n\t\t\t\treturn supportKeys.push( styleName );\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tget(\n\t\t\t\tblockType.supports,\n\t\t\t\tSTYLE_PROPERTY[ styleName ].support,\n\t\t\t\tfalse\n\t\t\t)\n\t\t) {\n\t\t\treturn supportKeys.push( styleName );\n\t\t}\n\t} );\n\n\treturn supportKeys;\n}\n\nexport function useColorsPerOrigin( name ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom', name );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme', name );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default', name );\n\tconst [ shouldDisplayDefaultColors ] = useGlobalSetting(\n\t\t'color.defaultPalette'\n\t);\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}, [ customColors, themeColors, defaultColors ] );\n}\n\nexport function useGradientsPerOrigin( name ) {\n\tconst [ customGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\tconst [ themeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ defaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ shouldDisplayDefaultGradients ] = useGlobalSetting(\n\t\t'color.defaultGradients'\n\t);\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}, [ customGradients, themeGradients, defaultGradients ] );\n}\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/hooks.js"],"names":["useGlobalSetting","blockEditorPrivateApis","a11yPlugin","useColorsPerOrigin","name","customColors","themeColors","defaultColors","shouldDisplayDefaultColors","result","length","push","colors","useGradientsPerOrigin","customGradients","themeGradients","defaultGradients","shouldDisplayDefaultGradients","gradients","useColorRandomizer","setThemeColors","randomizeColors","randomRotationValue","Math","floor","random","newColors","map","colorObject","color","newColor","rotate","toHex","window","__experimentalEnableColorRandomizer","useSupportedStyles","element","supportedPanels","select","blocksStore","getSupportedStyles"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B,C,CAEA;;AACA,oBAAQ,CAAEC,aAAF,CAAR;;AAEO,SAASC,kBAAT,CAA6BC,IAA7B,EAAoC;AAC1C,QAAM,CAAEC,YAAF,IAAmBL,gBAAgB,CAAE,sBAAF,EAA0BI,IAA1B,CAAzC;AACA,QAAM,CAAEE,WAAF,IAAkBN,gBAAgB,CAAE,qBAAF,EAAyBI,IAAzB,CAAxC;AACA,QAAM,CAAEG,aAAF,IAAoBP,gBAAgB,CAAE,uBAAF,EAA2BI,IAA3B,CAA1C;AACA,QAAM,CAAEI,0BAAF,IAAiCR,gBAAgB,CACtD,sBADsD,CAAvD;AAIA,SAAO,sBAAS,MAAM;AACrB,UAAMS,MAAM,GAAG,EAAf;;AACA,QAAKH,WAAW,IAAIA,WAAW,CAACI,MAAhC,EAAyC;AACxCD,MAAAA,MAAM,CAACE,IAAP,CAAa;AACZP,QAAAA,IAAI,EAAE,cACL,OADK,EAEL,8CAFK,CADM;AAKZQ,QAAAA,MAAM,EAAEN;AALI,OAAb;AAOA;;AACD,QACCE,0BAA0B,IAC1BD,aADA,IAEAA,aAAa,CAACG,MAHf,EAIE;AACDD,MAAAA,MAAM,CAACE,IAAP,CAAa;AACZP,QAAAA,IAAI,EAAE,cACL,SADK,EAEL,8CAFK,CADM;AAKZQ,QAAAA,MAAM,EAAEL;AALI,OAAb;AAOA;;AACD,QAAKF,YAAY,IAAIA,YAAY,CAACK,MAAlC,EAA2C;AAC1CD,MAAAA,MAAM,CAACE,IAAP,CAAa;AACZP,QAAAA,IAAI,EAAE,c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BC,cAAnB,EAAmCC,gBAAnC,CAlCI,CAAP;AAmCA;;AAEM,SAASG,kBAAT,CAA6Bf,IAA7B,EAAoC;AAC1C,QAAM,CAAEE,WAAF,EAAec,cAAf,IAAkCpB,gBAAgB,CACvD,qBADuD,EAEvDI,IAFuD,CAAxD;;AAKA,WAASiB,eAAT,GAA2B;AAC1B;AACA,UAAMC,mBAAmB,GAAGC,IAAI,CAACC,KAAL,CAAYD,IAAI,CAACE,MAAL,KAAgB,GAA5B,CAA5B;AACA;;AAEA,UAAMC,SAAS,GAAGpB,WAAW,CAACqB,GAAZ,CAAmBC,WAAF,IAAmB;AACrD,YAAM;AAAEC,QAAAA;AAAF,UAAYD,WAAlB;AACA,YAAME,QAAQ,GAAG,oBAAQD,KAAR,EACfE,MADe,CACPT,mBADO,EAEfU,KAFe,EAAjB;AAIA,aAAO,EACN,GAAGJ,WADG;AAENC,QAAAA,KAAK,EAAEC;AAFD,OAAP;AAIA,KAViB,CAAlB;AAYAV,IAAAA,cAAc,CAAEM,SAAF,CAAd;AACA;;AAED,SAAOO,MAAM,CAACC,mCAAP,GACJ,CAAEb,eAAF,CADI,GAEJ,EAFH;AAGA;;AAEM,SAASc,kBAAT,CAA6B/B,IAA7B,EAAmCgC,OAAnC,EAA6C;AACnD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBACzBC,MAAF,IAAc;AACb,WAAO;AACND,MAAAA,eAAe,EAAE,yBAChBC,MAAM,CAAEC,aAAF,CADU,EAEfC,kBAFe,CAEKpC,IAFL,EAEWgC,OAFX;AADX,KAAP;AAKA,GAP0B,EAQ3B,CAAEhC,IAAF,EAAQgC,OAAR,CAR2B,CAA5B;AAWA,SAAOC,eAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { colord, extend } from 'colord';\nimport a11yPlugin from 'colord/plugins/a11y';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport { useSelect } from '@wordpress/data';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\n// Enable colord's a11y plugin.\nextend( [ a11yPlugin ] );\n\nexport function useColorsPerOrigin( name ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom', name );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme', name );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default', name );\n\tconst [ shouldDisplayDefaultColors ] = useGlobalSetting(\n\t\t'color.defaultPalette'\n\t);\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}, [ customColors, themeColors, defaultColors ] );\n}\n\nexport function useGradientsPerOrigin( name ) {\n\tconst [ customGradients ] = useGlobalSetting(\n\t\t'color.gradients.custom',\n\t\tname\n\t);\n\tconst [ themeGradients ] = useGlobalSetting(\n\t\t'color.gradients.theme',\n\t\tname\n\t);\n\tconst [ defaultGradients ] = useGlobalSetting(\n\t\t'color.gradients.default',\n\t\tname\n\t);\n\tconst [ shouldDisplayDefaultGradients ] = useGlobalSetting(\n\t\t'color.defaultGradients'\n\t);\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}, [ customGradients, themeGradients, defaultGradients ] );\n}\n\nexport function useColorRandomizer( name ) {\n\tconst [ themeColors, setThemeColors ] = useGlobalSetting(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\n\tfunction randomizeColors() {\n\t\t/* eslint-disable no-restricted-syntax */\n\t\tconst randomRotationValue = Math.floor( Math.random() * 225 );\n\t\t/* eslint-enable no-restricted-syntax */\n\n\t\tconst newColors = themeColors.map( ( colorObject ) => {\n\t\t\tconst { color } = colorObject;\n\t\t\tconst newColor = colord( color )\n\t\t\t\t.rotate( randomRotationValue )\n\t\t\t\t.toHex();\n\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\tcolor: newColor,\n\t\t\t};\n\t\t} );\n\n\t\tsetThemeColors( newColors );\n\t}\n\n\treturn window.__experimentalEnableColorRandomizer\n\t\t? [ randomizeColors ]\n\t\t: [];\n}\n\nexport function useSupportedStyles( name, element ) {\n\tconst { supportedPanels } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tsupportedPanels: unlock(\n\t\t\t\t\tselect( blocksStore )\n\t\t\t\t).getSupportedStyles( name, element ),\n\t\t\t};\n\t\t},\n\t\t[ name, element ]\n\t);\n\n\treturn supportedPanels;\n}\n"]}
@@ -54,7 +54,9 @@ function Palette(_ref) {
54
54
  (0, _i18n._n)('%d color', '%d colors', colors.length), colors.length) : (0, _i18n.__)('Add custom colors');
55
55
  return (0, _element.createElement)(_components.__experimentalVStack, {
56
56
  spacing: 3
57
- }, (0, _element.createElement)(_subtitle.default, null, (0, _i18n.__)('Palette')), (0, _element.createElement)(_components.__experimentalItemGroup, {
57
+ }, (0, _element.createElement)(_subtitle.default, {
58
+ level: 3
59
+ }, (0, _i18n.__)('Palette')), (0, _element.createElement)(_components.__experimentalItemGroup, {
58
60
  isBordered: true,
59
61
  isSeparated: true
60
62
  }, (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["useGlobalSetting","blockEditorPrivateApis","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","slice","map","index","color","shuffle"],"mappings":";;;;;;;;;AAcA;;AAXA;;AASA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAeA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B;AAEA,MAAMC,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmBL,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AAQ,IAAA,SAAS,EAAG,KAApB;AAA4B,IAAA,MAAM,EAAG,CAAC;AAAtC,KACGJ,MAAM,CACNK,KADA,CACO,CADP,EACU,CADV,EAEAC,GAFA,CAEK,QAAaC,KAAb;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACL,4BAAC,8BAAD;AACC,MAAA,GAAG,EAAI,GAAGA,KAAO,IAAID,KAAO;AAD7B,OAGC,4BAAC,0BAAD;AAAgB,MAAA,UAAU,EAAGC;AAA7B,MAHD,CADK;AAAA,GAFL,CADH,CALD,EAgBC,4BAAC,oBAAD,QAAYL,iBAAZ,CAhBD,CAJD,CADD,CAFD,EA2BGJ,oBAAoB,IACrB,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,IAAI,EAAGU,cAFR;AAGC,IAAA,OAAO,EAAGV;AAHX,KAKG,cAAI,kBAAJ,CALH,CA5BF,CADD;AAuCA;;eAEcN,O","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ randomizeThemeColors && (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/palette.js"],"names":["useGlobalSetting","blockEditorPrivateApis","EMPTY_COLORS","Palette","name","customColors","themeColors","defaultColors","defaultPaletteEnabled","randomizeThemeColors","colors","screenPath","encodeURIComponent","paletteButtonText","length","slice","map","index","color","shuffle"],"mappings":";;;;;;;;;AAcA;;AAXA;;AASA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAeA;AACA;AACA;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAuB,yBAAQC,wBAAR,CAA7B;AAEA,MAAMC,YAAY,GAAG,EAArB;;AAEA,SAASC,OAAT,OAA6B;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC5B,QAAM,CAAEC,YAAF,IAAmBL,gBAAgB,CAAE,sBAAF,CAAzC;AACA,QAAM,CAAEM,WAAF,IAAkBN,gBAAgB,CAAE,qBAAF,CAAxC;AACA,QAAM,CAAEO,aAAF,IAAoBP,gBAAgB,CAAE,uBAAF,CAA1C;AAEA,QAAM,CAAEQ,qBAAF,IAA4BR,gBAAgB,CACjD,sBADiD,EAEjDI,IAFiD,CAAlD;AAKA,QAAM,CAAEK,oBAAF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EAAI,GAAGA,KAAO,IAAID,KAAO;AAD7B,OAGC,4BAAC,0BAAD;AAAgB,MAAA,UAAU,EAAGC;AAA7B,MAHD,CADK;AAAA,GAFL,CADH,CALD,EAgBC,4BAAC,oBAAD,QAAYL,iBAAZ,CAhBD,CAJD,CADD,CAFD,EA2BGJ,oBAAoB,IACrB,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,IAAI,EAAGU,cAFR;AAGC,IAAA,OAAO,EAAGV;AAHX,KAKG,cAAI,kBAAJ,CALH,CA5BF,CADD;AAuCA;;eAEcN,O","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tFlexItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalVStack as VStack,\n\tColorIndicator,\n\tButton,\n} from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Subtitle from './subtitle';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useColorRandomizer } from './hooks';\nimport ColorIndicatorWrapper from './color-indicator-wrapper';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\n\nconst EMPTY_COLORS = [];\n\nfunction Palette( { name } ) {\n\tconst [ customColors ] = useGlobalSetting( 'color.palette.custom' );\n\tconst [ themeColors ] = useGlobalSetting( 'color.palette.theme' );\n\tconst [ defaultColors ] = useGlobalSetting( 'color.palette.default' );\n\n\tconst [ defaultPaletteEnabled ] = useGlobalSetting(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer();\n\n\tconst colors = useMemo(\n\t\t() => [\n\t\t\t...( customColors || EMPTY_COLORS ),\n\t\t\t...( themeColors || EMPTY_COLORS ),\n\t\t\t...( defaultColors && defaultPaletteEnabled\n\t\t\t\t? defaultColors\n\t\t\t\t: EMPTY_COLORS ),\n\t\t],\n\t\t[ customColors, themeColors, defaultColors, defaultPaletteEnabled ]\n\t);\n\n\tconst screenPath = ! name\n\t\t? '/colors/palette'\n\t\t: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';\n\tconst paletteButtonText =\n\t\tcolors.length > 0\n\t\t\t? sprintf(\n\t\t\t\t\t// Translators: %d: Number of palette colors.\n\t\t\t\t\t_n( '%d color', '%d colors', colors.length ),\n\t\t\t\t\tcolors.length\n\t\t\t )\n\t\t\t: __( 'Add custom colors' );\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\tpath={ screenPath }\n\t\t\t\t\taria-label={ __( 'Color palettes' ) }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tdirection={\n\t\t\t\t\t\t\tcolors.length === 0 ? 'row-reverse' : 'row'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t\t\t\t\t{ colors\n\t\t\t\t\t\t\t\t.slice( 0, 5 )\n\t\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t\t<ColorIndicatorWrapper\n\t\t\t\t\t\t\t\t\t\tkey={ `${ color }-${ index }` }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ColorIndicator colorValue={ color } />\n\t\t\t\t\t\t\t\t\t</ColorIndicatorWrapper>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ZStack>\n\t\t\t\t\t\t<FlexItem>{ paletteButtonText }</FlexItem>\n\t\t\t\t\t</HStack>\n\t\t\t\t</NavigationButtonAsItem>\n\t\t\t</ItemGroup>\n\t\t\t{ randomizeThemeColors && (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport default Palette;\n"]}
@@ -45,7 +45,7 @@ function ScreenBackgroundColor(_ref) {
45
45
  variation = ''
46
46
  } = _ref;
47
47
  const prefix = variation ? `variations.${variation}.` : '';
48
- const supports = (0, _hooks.getSupportedGlobalStylesPanels)(name);
48
+ const supports = (0, _hooks.useSupportedStyles)(name);
49
49
  const [areCustomSolidsEnabled] = useGlobalSetting('color.custom', name);
50
50
  const [areCustomGradientsEnabled] = useGlobalSetting('color.customGradient', name);
51
51
  const colorsPerOrigin = (0, _hooks.useColorsPerOrigin)(name);
@@ -104,7 +104,8 @@ function ScreenBackgroundColor(_ref) {
104
104
  disableCustomGradients: !areCustomGradientsEnabled,
105
105
  showTitle: false,
106
106
  enableAlpha: true,
107
- __experimentalIsRenderedInSidebar: true
107
+ __experimentalIsRenderedInSidebar: true,
108
+ headingLevel: 3
108
109
  }, controlProps)));
109
110
  }
110
111
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["useGlobalSetting","useGlobalStyle","blockEditorPrivateApis","ScreenBackgroundColor","name","variation","prefix","supports","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","backgroundSettings","colorValue","onColorChange","clearable","gradientSettings","gradientValue","onGradientChange","controlProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAQA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA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WAAW,MAbZ;AAcC,IAAA,iCAAiC;AAdlC,KAeMqB,YAfN,EAPD,CADD;AA2BA;;eAEc3B,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalColorGradientControl as ColorGradientControl,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseColorsPerOrigin,\n\tuseGradientsPerOrigin,\n} from './hooks';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenBackgroundColor( { name, variation = '' } ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );\n\tconst [ areCustomGradientsEnabled ] = useGlobalSetting(\n\t\t'color.customGradient',\n\t\tname\n\t);\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\tconst gradientsPerOrigin = useGradientsPerOrigin( name );\n\n\tconst [ isBackgroundEnabled ] = useGlobalSetting(\n\t\t'color.background',\n\t\tname\n\t);\n\n\tconst hasBackgroundColor =\n\t\tsupports.includes( 'backgroundColor' ) &&\n\t\tisBackgroundEnabled &&\n\t\t( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );\n\tconst hasGradientColor =\n\t\tsupports.includes( 'background' ) &&\n\t\t( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );\n\tconst [ backgroundColor, setBackgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ userBackgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname,\n\t\t'user'\n\t);\n\tconst [ gradient, setGradient ] = useGlobalStyle(\n\t\tprefix + 'color.gradient',\n\t\tname\n\t);\n\tconst [ userGradient ] = useGlobalStyle(\n\t\tprefix + 'color.gradient',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasBackgroundColor && ! hasGradientColor ) {\n\t\treturn null;\n\t}\n\n\tlet backgroundSettings = {};\n\tif ( hasBackgroundColor ) {\n\t\tbackgroundSettings = {\n\t\t\tcolorValue: backgroundColor,\n\t\t\tonColorChange: setBackgroundColor,\n\t\t};\n\t\tif ( backgroundColor ) {\n\t\t\tbackgroundSettings.clearable =\n\t\t\t\tbackgroundColor === userBackgroundColor;\n\t\t}\n\t}\n\n\tlet gradientSettings = {};\n\tif ( hasGradientColor ) {\n\t\tgradientSettings = {\n\t\t\tgradientValue: gradient,\n\t\t\tonGradientChange: setGradient,\n\t\t};\n\t\tif ( gradient ) {\n\t\t\tgradientSettings.clearable = gradient === userGradient;\n\t\t}\n\t}\n\n\tconst controlProps = {\n\t\t...backgroundSettings,\n\t\t...gradientSettings,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set a background color or gradient for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-screen-background-color__control',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-no-tabs':\n\t\t\t\t\t\t\t! hasBackgroundColor || ! hasGradientColor,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tgradients={ gradientsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\tdisableCustomGradients={ ! areCustomGradientsEnabled }\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t{ ...controlProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBackgroundColor;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["useGlobalSetting","useGlobalStyle","blockEditorPrivateApis","ScreenBackgroundColor","name","variation","prefix","supports","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","backgroundSettings","colorValue","onColorChange","clearable","gradientSettings","gradientValue","onGradientChange","controlProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAQA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,IAAuC,yBAAQC,wBAAR,CAA7C;;AAEA,SAASC,qBAAT,OAA2D;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AAC1D,QAAMC,MAAM,GAAGD,SAAS,GAAI,cAAcA,SAAW,GAA7B,GAAkC,EAA1D;AACA,QAAME,QAAQ,GAAG,+BAAoBH,IAApB,CAAjB;AACA,QAAM,CAAEI,sBAAF,IAA6BR,gBAAgB,CAAE,cAAF,EAAkBI,IAAlB,CAAnD;AACA,QAAM,CAAEK,yBAAF,IAAgCT,gBAAgB,CACrD,sBADqD,EAErDI,IAFqD,CAAtD;AAIA,QAAMM,eAAe,GAAG,+BAAoBN,IAApB,CAAxB;AACA,QAAMO,kBAAkB,GAAG,kCAAuBP,IAAvB,CAA3B;AAEA,QAAM,CAAEQ,mBAAF,IAA0BZ,gBAAgB,CAC/C,kBAD+C,EAE/CI,IAF+C,CAAhD;AAKA,QAAMS,kBAAkB,GACvBN,QAAQ,CAACO,QAAT,CAAmB,iBAAnB,KACAF,mBADA,KAEEF,eAAe,CAACK,MAAhB,GAAyB,CAAzB,IAA8BP,sB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AEpB,OAAGI;AAFiB,GAArB;AAKA,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,WAAW,EAAG,cACb,wDADa;AAFf,IADD,EAOC,4BAAC,+CAAD;AACC,IAAA,SAAS,EAAG,yBACX,4CADW,EAEX;AACC,qBACC,CAAEd,kBAAF,IAAwB,CAAEG;AAF5B,KAFW,CADb;AAQC,IAAA,MAAM,EAAGN,eARV;AASC,IAAA,SAAS,EAAGC,kBATb;AAUC,IAAA,mBAAmB,EAAG,CAAEH,sBAVzB;AAWC,IAAA,sBAAsB,EAAG,CAAEC,yBAX5B;AAYC,IAAA,SAAS,EAAG,KAZb;AAaC,IAAA,WAAW,MAbZ;AAcC,IAAA,iCAAiC,MAdlC;AAeC,IAAA,YAAY,EAAG;AAfhB,KAgBMqB,YAhBN,EAPD,CADD;AA4BA;;eAEc3B,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalColorGradientControl as ColorGradientControl,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tuseSupportedStyles,\n\tuseColorsPerOrigin,\n\tuseGradientsPerOrigin,\n} from './hooks';\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalSetting, useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenBackgroundColor( { name, variation = '' } ) {\n\tconst prefix = variation ? `variations.${ variation }.` : '';\n\tconst supports = useSupportedStyles( name );\n\tconst [ areCustomSolidsEnabled ] = useGlobalSetting( 'color.custom', name );\n\tconst [ areCustomGradientsEnabled ] = useGlobalSetting(\n\t\t'color.customGradient',\n\t\tname\n\t);\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\tconst gradientsPerOrigin = useGradientsPerOrigin( name );\n\n\tconst [ isBackgroundEnabled ] = useGlobalSetting(\n\t\t'color.background',\n\t\tname\n\t);\n\n\tconst hasBackgroundColor =\n\t\tsupports.includes( 'backgroundColor' ) &&\n\t\tisBackgroundEnabled &&\n\t\t( colorsPerOrigin.length > 0 || areCustomSolidsEnabled );\n\tconst hasGradientColor =\n\t\tsupports.includes( 'background' ) &&\n\t\t( gradientsPerOrigin.length > 0 || areCustomGradientsEnabled );\n\tconst [ backgroundColor, setBackgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ userBackgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname,\n\t\t'user'\n\t);\n\tconst [ gradient, setGradient ] = useGlobalStyle(\n\t\tprefix + 'color.gradient',\n\t\tname\n\t);\n\tconst [ userGradient ] = useGlobalStyle(\n\t\tprefix + 'color.gradient',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasBackgroundColor && ! hasGradientColor ) {\n\t\treturn null;\n\t}\n\n\tlet backgroundSettings = {};\n\tif ( hasBackgroundColor ) {\n\t\tbackgroundSettings = {\n\t\t\tcolorValue: backgroundColor,\n\t\t\tonColorChange: setBackgroundColor,\n\t\t};\n\t\tif ( backgroundColor ) {\n\t\t\tbackgroundSettings.clearable =\n\t\t\t\tbackgroundColor === userBackgroundColor;\n\t\t}\n\t}\n\n\tlet gradientSettings = {};\n\tif ( hasGradientColor ) {\n\t\tgradientSettings = {\n\t\t\tgradientValue: gradient,\n\t\t\tonGradientChange: setGradient,\n\t\t};\n\t\tif ( gradient ) {\n\t\t\tgradientSettings.clearable = gradient === userGradient;\n\t\t}\n\t}\n\n\tconst controlProps = {\n\t\t...backgroundSettings,\n\t\t...gradientSettings,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set a background color or gradient for the whole site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-screen-background-color__control',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-no-tabs':\n\t\t\t\t\t\t\t! hasBackgroundColor || ! hasGradientColor,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tgradients={ gradientsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\tdisableCustomGradients={ ! areCustomGradientsEnabled }\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\theadingLevel={ 3 }\n\t\t\t\t{ ...controlProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBackgroundColor;\n"]}
@@ -29,14 +29,16 @@ var _colorUtils = require("./color-utils");
29
29
 
30
30
  var _dimensionsPanel = require("./dimensions-panel");
31
31
 
32
- var _typographyPanel = require("./typography-panel");
33
-
34
32
  var _variationsPanel = require("./variations-panel");
35
33
 
36
34
  var _header = _interopRequireDefault(require("./header"));
37
35
 
38
36
  var _navigationButton = require("./navigation-button");
39
37
 
38
+ var _privateApis = require("../../private-apis");
39
+
40
+ var _hooks = require("./hooks");
41
+
40
42
  /**
41
43
  * WordPress dependencies
42
44
  */
@@ -44,6 +46,12 @@ var _navigationButton = require("./navigation-button");
44
46
  /**
45
47
  * Internal dependencies
46
48
  */
49
+ const {
50
+ useHasTypographyPanel,
51
+ useGlobalSetting,
52
+ overrideSettingsWithSupports
53
+ } = (0, _privateApis.unlock)(_blockEditor.privateApis);
54
+
47
55
  function useSortedBlockTypes() {
48
56
  const blockItems = (0, _data.useSelect)(select => select(_blocks.store).getBlockTypes(), []); // Ensure core blocks are prioritized in the returned results,
49
57
  // because third party blocks can be registered earlier than
@@ -75,7 +83,10 @@ function BlockMenuItem(_ref) {
75
83
  let {
76
84
  block
77
85
  } = _ref;
78
- const hasTypographyPanel = (0, _typographyPanel.useHasTypographyPanel)(block.name);
86
+ const [rawSettings] = useGlobalSetting('', block.name);
87
+ const supports = (0, _hooks.useSupportedStyles)(block.name);
88
+ const settings = (0, _element.useMemo)(() => overrideSettingsWithSupports(rawSettings, supports), [rawSettings, supports]);
89
+ const hasTypographyPanel = useHasTypographyPanel(settings);
79
90
  const hasColorPanel = (0, _colorUtils.useHasColorPanel)(block.name);
80
91
  const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(block.name);
81
92
  const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(block.name);