@wordpress/block-editor 9.7.0 → 9.7.1-next.d6164808d3.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 (279) hide show
  1. package/build/components/block-alignment-control/use-available-alignments.js +1 -1
  2. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  3. package/build/components/block-edit-visually-button/index.js +46 -0
  4. package/build/components/block-edit-visually-button/index.js.map +1 -0
  5. package/build/components/block-popover/inbetween.js +4 -2
  6. package/build/components/block-popover/inbetween.js.map +1 -1
  7. package/build/components/block-settings-menu/index.js +2 -6
  8. package/build/components/block-settings-menu/index.js.map +1 -1
  9. package/build/components/block-switcher/index.js +10 -16
  10. package/build/components/block-switcher/index.js.map +1 -1
  11. package/build/components/block-toolbar/index.js +5 -1
  12. package/build/components/block-toolbar/index.js.map +1 -1
  13. package/build/components/border-radius-control/all-input-control.js +31 -3
  14. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  15. package/build/components/border-radius-control/index.js +20 -6
  16. package/build/components/border-radius-control/index.js.map +1 -1
  17. package/build/components/border-radius-control/input-controls.js +21 -6
  18. package/build/components/border-radius-control/input-controls.js.map +1 -1
  19. package/build/components/border-radius-control/utils.js +13 -16
  20. package/build/components/border-radius-control/utils.js.map +1 -1
  21. package/build/components/colors/with-colors.js +17 -4
  22. package/build/components/colors/with-colors.js.map +1 -1
  23. package/build/components/copy-handler/index.js +6 -0
  24. package/build/components/copy-handler/index.js.map +1 -1
  25. package/build/components/date-format-picker/index.js +2 -7
  26. package/build/components/date-format-picker/index.js.map +1 -1
  27. package/build/components/duotone/components.js +5 -5
  28. package/build/components/duotone/components.js.map +1 -1
  29. package/build/components/font-family/index.js +1 -1
  30. package/build/components/font-family/index.js.map +1 -1
  31. package/build/components/font-sizes/with-font-sizes.js +17 -4
  32. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  33. package/build/components/index.js +9 -0
  34. package/build/components/index.js.map +1 -1
  35. package/build/components/inserter/search-items.js +22 -4
  36. package/build/components/inserter/search-items.js.map +1 -1
  37. package/build/components/link-control/link-preview.js +0 -1
  38. package/build/components/link-control/link-preview.js.map +1 -1
  39. package/build/components/list-view/block-select-button.js +5 -2
  40. package/build/components/list-view/block-select-button.js.map +1 -1
  41. package/build/components/list-view/use-block-selection.js +1 -7
  42. package/build/components/list-view/use-block-selection.js.map +1 -1
  43. package/build/components/rich-text/use-enter.js +0 -4
  44. package/build/components/rich-text/use-enter.js.map +1 -1
  45. package/build/components/rich-text/use-format-types.js +8 -11
  46. package/build/components/rich-text/use-format-types.js.map +1 -1
  47. package/build/components/spacing-sizes-control/all-input-control.js +53 -0
  48. package/build/components/spacing-sizes-control/all-input-control.js.map +1 -0
  49. package/build/components/spacing-sizes-control/axial-input-controls.js +69 -0
  50. package/build/components/spacing-sizes-control/axial-input-controls.js.map +1 -0
  51. package/build/components/spacing-sizes-control/index.js +100 -0
  52. package/build/components/spacing-sizes-control/index.js.map +1 -0
  53. package/build/components/spacing-sizes-control/input-controls.js +52 -0
  54. package/build/components/spacing-sizes-control/input-controls.js.map +1 -0
  55. package/build/components/spacing-sizes-control/linked-button.js +38 -0
  56. package/build/components/spacing-sizes-control/linked-button.js.map +1 -0
  57. package/build/components/spacing-sizes-control/spacing-input-control.js +208 -0
  58. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -0
  59. package/build/components/spacing-sizes-control/utils.js +202 -0
  60. package/build/components/spacing-sizes-control/utils.js.map +1 -0
  61. package/build/components/url-input/index.js +1 -1
  62. package/build/components/url-input/index.js.map +1 -1
  63. package/build/components/writing-flow/use-multi-selection.js +4 -2
  64. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  65. package/build/components/writing-flow/use-selection-observer.js +10 -2
  66. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  67. package/build/hooks/border-radius.js +2 -7
  68. package/build/hooks/border-radius.js.map +1 -1
  69. package/build/hooks/border.js +2 -2
  70. package/build/hooks/border.js.map +1 -1
  71. package/build/hooks/color.js +4 -1
  72. package/build/hooks/color.js.map +1 -1
  73. package/build/hooks/dimensions.js +15 -0
  74. package/build/hooks/dimensions.js.map +1 -1
  75. package/build/hooks/duotone.js +4 -4
  76. package/build/hooks/duotone.js.map +1 -1
  77. package/build/hooks/gap.js +6 -4
  78. package/build/hooks/gap.js.map +1 -1
  79. package/build/hooks/generated-class-name.js +1 -7
  80. package/build/hooks/generated-class-name.js.map +1 -1
  81. package/build/hooks/layout.js +20 -12
  82. package/build/hooks/layout.js.map +1 -1
  83. package/build/hooks/margin.js +28 -12
  84. package/build/hooks/margin.js.map +1 -1
  85. package/build/hooks/padding.js +19 -8
  86. package/build/hooks/padding.js.map +1 -1
  87. package/build/hooks/style.js +4 -50
  88. package/build/hooks/style.js.map +1 -1
  89. package/build/layouts/constrained.js +215 -0
  90. package/build/layouts/constrained.js.map +1 -0
  91. package/build/layouts/flex.js +1 -1
  92. package/build/layouts/flex.js.map +1 -1
  93. package/build/layouts/flow.js +7 -169
  94. package/build/layouts/flow.js.map +1 -1
  95. package/build/layouts/index.js +3 -1
  96. package/build/layouts/index.js.map +1 -1
  97. package/build/layouts/utils.js +43 -0
  98. package/build/layouts/utils.js.map +1 -1
  99. package/build/store/actions.js +25 -3
  100. package/build/store/actions.js.map +1 -1
  101. package/build/store/selectors.js +4 -6
  102. package/build/store/selectors.js.map +1 -1
  103. package/build-module/components/block-alignment-control/use-available-alignments.js +1 -1
  104. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  105. package/build-module/components/block-edit-visually-button/index.js +35 -0
  106. package/build-module/components/block-edit-visually-button/index.js.map +1 -0
  107. package/build-module/components/block-popover/inbetween.js +4 -2
  108. package/build-module/components/block-popover/inbetween.js.map +1 -1
  109. package/build-module/components/block-settings-menu/index.js +3 -6
  110. package/build-module/components/block-settings-menu/index.js.map +1 -1
  111. package/build-module/components/block-switcher/index.js +10 -16
  112. package/build-module/components/block-switcher/index.js.map +1 -1
  113. package/build-module/components/block-toolbar/index.js +4 -1
  114. package/build-module/components/block-toolbar/index.js.map +1 -1
  115. package/build-module/components/border-radius-control/all-input-control.js +32 -4
  116. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  117. package/build-module/components/border-radius-control/index.js +20 -6
  118. package/build-module/components/border-radius-control/index.js.map +1 -1
  119. package/build-module/components/border-radius-control/input-controls.js +22 -7
  120. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  121. package/build-module/components/border-radius-control/utils.js +13 -16
  122. package/build-module/components/border-radius-control/utils.js.map +1 -1
  123. package/build-module/components/colors/with-colors.js +16 -3
  124. package/build-module/components/colors/with-colors.js.map +1 -1
  125. package/build-module/components/copy-handler/index.js +7 -1
  126. package/build-module/components/copy-handler/index.js.map +1 -1
  127. package/build-module/components/date-format-picker/index.js +2 -6
  128. package/build-module/components/date-format-picker/index.js.map +1 -1
  129. package/build-module/components/duotone/components.js +5 -5
  130. package/build-module/components/duotone/components.js.map +1 -1
  131. package/build-module/components/font-family/index.js +1 -1
  132. package/build-module/components/font-family/index.js.map +1 -1
  133. package/build-module/components/font-sizes/with-font-sizes.js +16 -3
  134. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  135. package/build-module/components/index.js +1 -0
  136. package/build-module/components/index.js.map +1 -1
  137. package/build-module/components/inserter/search-items.js +19 -5
  138. package/build-module/components/inserter/search-items.js.map +1 -1
  139. package/build-module/components/link-control/link-preview.js +0 -1
  140. package/build-module/components/link-control/link-preview.js.map +1 -1
  141. package/build-module/components/list-view/block-select-button.js +5 -2
  142. package/build-module/components/list-view/block-select-button.js.map +1 -1
  143. package/build-module/components/list-view/use-block-selection.js +1 -6
  144. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  145. package/build-module/components/rich-text/use-enter.js +0 -4
  146. package/build-module/components/rich-text/use-enter.js.map +1 -1
  147. package/build-module/components/rich-text/use-format-types.js +8 -10
  148. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  149. package/build-module/components/spacing-sizes-control/all-input-control.js +41 -0
  150. package/build-module/components/spacing-sizes-control/all-input-control.js.map +1 -0
  151. package/build-module/components/spacing-sizes-control/axial-input-controls.js +57 -0
  152. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +1 -0
  153. package/build-module/components/spacing-sizes-control/index.js +83 -0
  154. package/build-module/components/spacing-sizes-control/index.js.map +1 -0
  155. package/build-module/components/spacing-sizes-control/input-controls.js +41 -0
  156. package/build-module/components/spacing-sizes-control/input-controls.js.map +1 -0
  157. package/build-module/components/spacing-sizes-control/linked-button.js +28 -0
  158. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -0
  159. package/build-module/components/spacing-sizes-control/spacing-input-control.js +192 -0
  160. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -0
  161. package/build-module/components/spacing-sizes-control/utils.js +174 -0
  162. package/build-module/components/spacing-sizes-control/utils.js.map +1 -0
  163. package/build-module/components/url-input/index.js +1 -1
  164. package/build-module/components/url-input/index.js.map +1 -1
  165. package/build-module/components/writing-flow/use-multi-selection.js +4 -2
  166. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  167. package/build-module/components/writing-flow/use-selection-observer.js +10 -2
  168. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  169. package/build-module/hooks/border-radius.js +2 -7
  170. package/build-module/hooks/border-radius.js.map +1 -1
  171. package/build-module/hooks/border.js +2 -2
  172. package/build-module/hooks/border.js.map +1 -1
  173. package/build-module/hooks/color.js +4 -1
  174. package/build-module/hooks/color.js.map +1 -1
  175. package/build-module/hooks/dimensions.js +13 -0
  176. package/build-module/hooks/dimensions.js.map +1 -1
  177. package/build-module/hooks/duotone.js +4 -4
  178. package/build-module/hooks/duotone.js.map +1 -1
  179. package/build-module/hooks/gap.js +3 -2
  180. package/build-module/hooks/gap.js.map +1 -1
  181. package/build-module/hooks/generated-class-name.js +1 -6
  182. package/build-module/hooks/generated-class-name.js.map +1 -1
  183. package/build-module/hooks/layout.js +20 -12
  184. package/build-module/hooks/layout.js.map +1 -1
  185. package/build-module/hooks/margin.js +26 -12
  186. package/build-module/hooks/margin.js.map +1 -1
  187. package/build-module/hooks/padding.js +17 -8
  188. package/build-module/hooks/padding.js.map +1 -1
  189. package/build-module/hooks/style.js +7 -53
  190. package/build-module/hooks/style.js.map +1 -1
  191. package/build-module/layouts/constrained.js +197 -0
  192. package/build-module/layouts/constrained.js.map +1 -0
  193. package/build-module/layouts/flex.js +1 -1
  194. package/build-module/layouts/flex.js.map +1 -1
  195. package/build-module/layouts/flow.js +8 -163
  196. package/build-module/layouts/flow.js.map +1 -1
  197. package/build-module/layouts/index.js +2 -1
  198. package/build-module/layouts/index.js.map +1 -1
  199. package/build-module/layouts/utils.js +40 -0
  200. package/build-module/layouts/utils.js.map +1 -1
  201. package/build-module/store/actions.js +25 -3
  202. package/build-module/store/actions.js.map +1 -1
  203. package/build-module/store/selectors.js +5 -7
  204. package/build-module/store/selectors.js.map +1 -1
  205. package/build-style/style-rtl.css +115 -20
  206. package/build-style/style.css +115 -20
  207. package/package.json +30 -28
  208. package/src/components/block-alignment-control/use-available-alignments.js +1 -1
  209. package/src/components/block-edit-visually-button/index.js +39 -0
  210. package/src/components/block-popover/inbetween.js +4 -1
  211. package/src/components/block-settings-menu/index.js +11 -15
  212. package/src/components/block-switcher/index.js +9 -13
  213. package/src/components/block-switcher/test/index.js +1 -0
  214. package/src/components/block-toolbar/index.js +2 -0
  215. package/src/components/border-radius-control/all-input-control.js +41 -4
  216. package/src/components/border-radius-control/index.js +25 -5
  217. package/src/components/border-radius-control/input-controls.js +40 -13
  218. package/src/components/border-radius-control/test/utils.js +22 -60
  219. package/src/components/border-radius-control/utils.js +12 -16
  220. package/src/components/colors/with-colors.js +11 -1
  221. package/src/components/copy-handler/index.js +18 -0
  222. package/src/components/date-format-picker/index.js +12 -14
  223. package/src/components/date-format-picker/style.scss +0 -4
  224. package/src/components/duotone/components.js +5 -5
  225. package/src/components/duotone-control/style.scss +0 -4
  226. package/src/components/font-appearance-control/style.scss +0 -2
  227. package/src/components/font-family/index.js +1 -1
  228. package/src/components/font-sizes/with-font-sizes.js +11 -1
  229. package/src/components/index.js +1 -0
  230. package/src/components/inserter/search-items.js +17 -5
  231. package/src/components/link-control/link-preview.js +0 -1
  232. package/src/components/link-control/test/index.js +540 -893
  233. package/src/components/list-view/block-select-button.js +7 -2
  234. package/src/components/list-view/style.scss +11 -4
  235. package/src/components/list-view/use-block-selection.js +2 -8
  236. package/src/components/media-replace-flow/style.scss +1 -0
  237. package/src/components/rich-text/use-enter.js +0 -3
  238. package/src/components/rich-text/use-format-types.js +6 -6
  239. package/src/components/spacing-sizes-control/all-input-control.js +40 -0
  240. package/src/components/spacing-sizes-control/axial-input-controls.js +62 -0
  241. package/src/components/spacing-sizes-control/index.js +91 -0
  242. package/src/components/spacing-sizes-control/input-controls.js +46 -0
  243. package/src/components/spacing-sizes-control/linked-button.js +25 -0
  244. package/src/components/spacing-sizes-control/spacing-input-control.js +280 -0
  245. package/src/components/spacing-sizes-control/style.scss +122 -0
  246. package/src/components/spacing-sizes-control/test/utils.js +156 -0
  247. package/src/components/spacing-sizes-control/utils.js +195 -0
  248. package/src/components/url-input/index.js +1 -1
  249. package/src/components/url-input/style.scss +2 -2
  250. package/src/components/url-popover/style.scss +0 -3
  251. package/src/components/writing-flow/use-multi-selection.js +4 -1
  252. package/src/components/writing-flow/use-selection-observer.js +10 -2
  253. package/src/hooks/border-radius.js +2 -6
  254. package/src/hooks/border.js +2 -2
  255. package/src/hooks/color.js +13 -3
  256. package/src/hooks/dimensions.js +15 -0
  257. package/src/hooks/duotone.js +4 -4
  258. package/src/hooks/gap.js +7 -2
  259. package/src/hooks/generated-class-name.js +6 -9
  260. package/src/hooks/layout.js +45 -14
  261. package/src/hooks/margin.js +49 -17
  262. package/src/hooks/padding.js +41 -14
  263. package/src/hooks/style.js +5 -56
  264. package/src/hooks/test/gap.js +22 -0
  265. package/src/hooks/typography.scss +0 -1
  266. package/src/layouts/constrained.js +217 -0
  267. package/src/layouts/flex.js +1 -1
  268. package/src/layouts/flow.js +6 -173
  269. package/src/layouts/index.js +2 -1
  270. package/src/layouts/test/constrained.js +21 -0
  271. package/src/layouts/utils.js +34 -0
  272. package/src/store/actions.js +32 -4
  273. package/src/store/selectors.js +5 -4
  274. package/src/style.scss +1 -0
  275. package/build/components/block-settings-menu/block-edit-visually-button.js +0 -70
  276. package/build/components/block-settings-menu/block-edit-visually-button.js.map +0 -1
  277. package/build-module/components/block-settings-menu/block-edit-visually-button.js +0 -56
  278. package/build-module/components/block-settings-menu/block-edit-visually-button.js.map +0 -1
  279. package/src/components/block-settings-menu/block-edit-visually-button.js +0 -52
@@ -54,21 +54,6 @@ var _utils = require("./utils");
54
54
  const styleSupportKeys = [..._typography.TYPOGRAPHY_SUPPORT_KEYS, _border.BORDER_SUPPORT_KEY, _color.COLOR_SUPPORT_KEY, _dimensions.SPACING_SUPPORT_KEY];
55
55
 
56
56
  const hasStyleSupport = blockType => styleSupportKeys.some(key => (0, _blocks.hasBlockSupport)(blockType, key));
57
-
58
- const VARIABLE_REFERENCE_PREFIX = 'var:';
59
- const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
60
- const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
61
-
62
- function compileStyleValue(uncompiledValue) {
63
- var _uncompiledValue$star;
64
-
65
- if (uncompiledValue !== null && uncompiledValue !== void 0 && (_uncompiledValue$star = uncompiledValue.startsWith) !== null && _uncompiledValue$star !== void 0 && _uncompiledValue$star.call(uncompiledValue, VARIABLE_REFERENCE_PREFIX)) {
66
- const variable = uncompiledValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).join(VARIABLE_PATH_SEPARATOR_TOKEN_STYLE);
67
- return `var(--wp--${variable})`;
68
- }
69
-
70
- return uncompiledValue;
71
- }
72
57
  /**
73
58
  * Returns the inline styles to add depending on the style object
74
59
  *
@@ -80,41 +65,10 @@ function compileStyleValue(uncompiledValue) {
80
65
 
81
66
  function getInlineStyles() {
82
67
  let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
83
- const ignoredStyles = ['spacing.blockGap'];
84
- const output = {};
85
- Object.keys(_blocks.__EXPERIMENTAL_STYLE_PROPERTY).forEach(propKey => {
86
- if (_blocks.__EXPERIMENTAL_STYLE_PROPERTY[propKey].rootOnly) {
87
- return;
88
- }
89
-
90
- const path = _blocks.__EXPERIMENTAL_STYLE_PROPERTY[propKey].value;
91
- const subPaths = _blocks.__EXPERIMENTAL_STYLE_PROPERTY[propKey].properties; // Ignore styles on elements because they are handled on the server.
92
-
93
- if ((0, _lodash.has)(styles, path) && 'elements' !== (path === null || path === void 0 ? void 0 : path[0])) {
94
- // Checking if style value is a string allows for shorthand css
95
- // option and backwards compatibility for border radius support.
96
- const styleValue = (0, _lodash.get)(styles, path);
97
-
98
- if (!_blocks.__EXPERIMENTAL_STYLE_PROPERTY[propKey].useEngine) {
99
- if (!!subPaths && typeof styleValue !== 'string') {
100
- Object.entries(subPaths).forEach(entry => {
101
- const [name, subPath] = entry;
102
- const value = (0, _lodash.get)(styleValue, [subPath]);
103
-
104
- if (value) {
105
- output[name] = compileStyleValue(value);
106
- }
107
- });
108
- } else if (!ignoredStyles.includes(path.join('.'))) {
109
- output[propKey] = compileStyleValue((0, _lodash.get)(styles, path));
110
- }
111
- }
112
- }
113
- }); // The goal is to move everything to server side generated engine styles
68
+ const output = {}; // The goal is to move everything to server side generated engine styles
114
69
  // This is temporary as we absorb more and more styles into the engine.
115
70
 
116
- const extraRules = (0, _styleEngine.getCSSRules)(styles);
117
- extraRules.forEach(rule => {
71
+ (0, _styleEngine.getCSSRules)(styles).forEach(rule => {
118
72
  output[rule.key] = rule.value;
119
73
  });
120
74
  return output;
@@ -275,7 +229,7 @@ const withBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit =>
275
229
  return (0, _element.createElement)(_element.Fragment, null, shouldDisplayControls && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_color.ColorEdit, props), (0, _element.createElement)(_typography.TypographyPanel, props), (0, _element.createElement)(_border.BorderPanel, props), (0, _element.createElement)(_dimensions.DimensionsPanel, props)), (0, _element.createElement)(BlockEdit, props));
276
230
  }, 'withToolbarControls');
277
231
  /**
278
- * Override the default block element to include duotone styles.
232
+ * Override the default block element to include elements styles.
279
233
  *
280
234
  * @param {Function} BlockListBlock Original component
281
235
  * @return {Function} Wrapped component
@@ -304,7 +258,7 @@ const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
304
258
  };
305
259
 
306
260
  for (const [elementName, elementStyles] of Object.entries(filteredElementsStyles)) {
307
- const cssRule = (0, _styleEngine.generate)(elementStyles, {
261
+ const cssRule = (0, _styleEngine.compileCSS)(elementStyles, {
308
262
  // The .editor-styles-wrapper selector is required on elements styles. As it is
309
263
  // added to all other editor styles, not providing it causes reset and global
310
264
  // styles to override element styles because of higher specificity.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","blockType","some","key","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","compileStyleValue","uncompiledValue","startsWith","variable","slice","length","split","join","getInlineStyles","styles","ignoredStyles","output","Object","keys","STYLE_PROPERTY","forEach","propKey","rootOnly","path","value","subPaths","properties","styleValue","useEngine","entries","entry","name","subPath","includes","extraRules","rule","addAttribute","settings","attributes","style","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","renamedFeatures","gradients","addSaveProps","props","skipPaths","indicator","skipSerialization","Array","isArray","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","skipLinkColorSerialization","rawElementsStyles","elements","elementCssRules","filteredElementsStyles","link","color","undefined","elementName","elementStyles","cssRule","selector","ELEMENTS","push","element","BlockList","__unstableElementContext","__html","className"],"mappings":";;;;;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AACA;;AAMA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AApCA;AACA;AACA;;AAIA;AACA;AACA;;AAeA;AACA;AACA;AAaA,MAAMA,gBAAgB,GAAG,CACxB,GAAGC,mCADqB,EAExBC,0BAFwB,EAGxBC,wBAHwB,EAIxBC,+BAJwB,CAAzB;;AAOA,MAAMC,eAAe,GAAKC,SAAF,IACvBN,gBAAgB,CAACO,IAAjB,CAAyBC,GAAF,IAAW,6BAAiBF,SAAjB,EAA4BE,GAA5B,CAAlC,CADD;;AAGA,MAAMC,yBAAyB,GAAG,MAAlC;AACA,MAAMC,uCAAuC,GAAG,GAAhD;AACA,MAAMC,mCAAmC,GAAG,IAA5C;;AACA,SAASC,iBAAT,CAA4BC,eAA5B,EAA8C;AAAA;;AAC7C,MAAKA,eAAL,aAAKA,eAAL,wCAAKA,eAAe,CAAEC,UAAtB,kDAAK,2BAAAD,eAAe,EAAgBJ,yBAAhB,CAApB,EAAkE;AACjE,UAAMM,QAAQ,GAAGF,eAAe,CAC9BG,KADe,CACRP,yBAAyB,CAACQ,MADlB,EAEfC,KAFe,CAERR,uCAFQ,EAGfS,IAHe,CAGTR,mCAHS,CAAjB;AAIA,WAAQ,aAAaI,QAAU,GAA/B;AACA;;AACD,SAAOF,eAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,eAAT,GAAwC;AAAA,MAAdC,MAAc,uEAAL,EAAK;AAC9C,QAAMC,aAAa,GAAG,CAAE,kBAAF,CAAtB;AACA,QAAMC,MAAM,GAAG,EAAf;AACAC,EAAAA,MAAM,CAACC,IAA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A,CA3EyB,CAA3B;AA8EA,sBACC,0BADD,EAEC,yBAFD,EAGC/C,YAHD;AAMA,sBACC,kCADD,EAEC,yBAFD,EAGCW,YAHD;AAMA,sBACC,0BADD,EAEC,yBAFD,EAGCS,YAHD;AAMA,sBACC,kBADD,EAEC,gCAFD,EAGCG,iBAHD;AAMA,sBACC,uBADD,EAEC,kCAFD,EAGCG,kBAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { get, has, omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport {\n\tgetCSSRules,\n\tgenerate as generateStyles,\n} from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport { SPACING_SUPPORT_KEY, DimensionsPanel } from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\nimport { shouldSkipSerialization } from './utils';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\nconst VARIABLE_REFERENCE_PREFIX = 'var:';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\nfunction compileStyleValue( uncompiledValue ) {\n\tif ( uncompiledValue?.startsWith?.( VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst ignoredStyles = [ 'spacing.blockGap' ];\n\tconst output = {};\n\tObject.keys( STYLE_PROPERTY ).forEach( ( propKey ) => {\n\t\tif ( STYLE_PROPERTY[ propKey ].rootOnly ) {\n\t\t\treturn;\n\t\t}\n\t\tconst path = STYLE_PROPERTY[ propKey ].value;\n\t\tconst subPaths = STYLE_PROPERTY[ propKey ].properties;\n\t\t// Ignore styles on elements because they are handled on the server.\n\t\tif ( has( styles, path ) && 'elements' !== path?.[ 0 ] ) {\n\t\t\t// Checking if style value is a string allows for shorthand css\n\t\t\t// option and backwards compatibility for border radius support.\n\t\t\tconst styleValue = get( styles, path );\n\n\t\t\tif ( ! STYLE_PROPERTY[ propKey ].useEngine ) {\n\t\t\t\tif ( !! subPaths && typeof styleValue !== 'string' ) {\n\t\t\t\t\tObject.entries( subPaths ).forEach( ( entry ) => {\n\t\t\t\t\t\tconst [ name, subPath ] = entry;\n\t\t\t\t\t\tconst value = get( styleValue, [ subPath ] );\n\n\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\toutput[ name ] = compileStyleValue( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {\n\t\t\t\t\toutput[ propKey ] = compileStyleValue(\n\t\t\t\t\t\tget( styles, path )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( styles );\n\textraRules.forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\t'spacing',\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization = getBlockSupport( blockType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omit( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omit( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include duotone styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\n\t\tconst skipLinkColorSerialization = shouldSkipSerialization(\n\t\t\tprops.name,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t'link'\n\t\t);\n\n\t\tconst styles = useMemo( () => {\n\t\t\tconst rawElementsStyles = props.attributes.style?.elements;\n\t\t\tconst elementCssRules = [];\n\t\t\tif (\n\t\t\t\trawElementsStyles &&\n\t\t\t\tObject.keys( rawElementsStyles ).length > 0\n\t\t\t) {\n\t\t\t\t// Remove values based on whether serialization has been skipped for a specific style.\n\t\t\t\tconst filteredElementsStyles = {\n\t\t\t\t\t...rawElementsStyles,\n\t\t\t\t\tlink: {\n\t\t\t\t\t\t...rawElementsStyles.link,\n\t\t\t\t\t\tcolor: ! skipLinkColorSerialization\n\t\t\t\t\t\t\t? rawElementsStyles.link?.color\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tfor ( const [ elementName, elementStyles ] of Object.entries(\n\t\t\t\t\tfilteredElementsStyles\n\t\t\t\t) ) {\n\t\t\t\t\tconst cssRule = generateStyles( elementStyles, {\n\t\t\t\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t\t\t\t// styles to override element styles because of higher specificity.\n\t\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS[ elementName ] }`,\n\t\t\t\t\t} );\n\t\t\t\t\tif ( !! cssRule ) {\n\t\t\t\t\t\telementCssRules.push( cssRule );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn elementCssRules.length > 0 ? elementCssRules : undefined;\n\t\t}, [ props.attributes.style?.elements ] );\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ styles &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.attributes.style?.elements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","blockType","some","key","getInlineStyles","styles","output","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","renamedFeatures","gradients","addSaveProps","props","skipPaths","entries","indicator","path","skipSerialization","Array","isArray","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","skipLinkColorSerialization","name","rawElementsStyles","elements","elementCssRules","keys","length","filteredElementsStyles","link","color","undefined","elementName","elementStyles","cssRule","selector","ELEMENTS","push","element","BlockList","__unstableElementContext","__html","className"],"mappings":";;;;;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAhCA;AACA;AACA;;AAIA;AACA;AACA;;AAWA;AACA;AACA;AAaA,MAAMA,gBAAgB,GAAG,CACxB,GAAGC,mC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PsD,OADC,IAED,2BACC;AACC,IAAA,uBAAuB,EAAG;AACzBG,MAAAA,MAAM,EAAEzD;AADiB;AAD3B,IADD,EAMCsD,OAND,CAHF,EAYC,4BAAC,cAAD,6BACMpC,KADN;AAEC,IAAA,SAAS,EACR,0BAAAA,KAAK,CAACX,UAAN,CAAiBC,KAAjB,0EAAwBgC,QAAxB,GACG,yBACAtB,KAAK,CAACwC,SADN,EAEAtB,gCAFA,CADH,GAKGlB,KAAK,CAACwC;AARX,KAZD,CADD;AA0BA,CA3EyB,CAA3B;AA8EA,sBACC,0BADD,EAEC,yBAFD,EAGCrD,YAHD;AAMA,sBACC,kCADD,EAEC,yBAFD,EAGCY,YAHD;AAMA,sBACC,0BADD,EAEC,yBAFD,EAGCW,YAHD;AAMA,sBACC,kBADD,EAEC,gCAFD,EAGCG,iBAHD;AAMA,sBACC,uBADD,EAEC,kCAFD,EAGCG,kBAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport { SPACING_SUPPORT_KEY, DimensionsPanel } from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\nimport { shouldSkipSerialization } from './utils';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\t'spacing',\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization = getBlockSupport( blockType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omit( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omit( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include elements styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\n\t\tconst skipLinkColorSerialization = shouldSkipSerialization(\n\t\t\tprops.name,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t'link'\n\t\t);\n\n\t\tconst styles = useMemo( () => {\n\t\t\tconst rawElementsStyles = props.attributes.style?.elements;\n\t\t\tconst elementCssRules = [];\n\t\t\tif (\n\t\t\t\trawElementsStyles &&\n\t\t\t\tObject.keys( rawElementsStyles ).length > 0\n\t\t\t) {\n\t\t\t\t// Remove values based on whether serialization has been skipped for a specific style.\n\t\t\t\tconst filteredElementsStyles = {\n\t\t\t\t\t...rawElementsStyles,\n\t\t\t\t\tlink: {\n\t\t\t\t\t\t...rawElementsStyles.link,\n\t\t\t\t\t\tcolor: ! skipLinkColorSerialization\n\t\t\t\t\t\t\t? rawElementsStyles.link?.color\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tfor ( const [ elementName, elementStyles ] of Object.entries(\n\t\t\t\t\tfilteredElementsStyles\n\t\t\t\t) ) {\n\t\t\t\t\tconst cssRule = compileCSS( elementStyles, {\n\t\t\t\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t\t\t\t// styles to override element styles because of higher specificity.\n\t\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS[ elementName ] }`,\n\t\t\t\t\t} );\n\t\t\t\t\tif ( !! cssRule ) {\n\t\t\t\t\t\telementCssRules.push( cssRule );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn elementCssRules.length > 0 ? elementCssRules : undefined;\n\t\t}, [ props.attributes.style?.elements ] );\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ styles &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.attributes.style?.elements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _element = require("@wordpress/element");
11
+
12
+ var _components = require("@wordpress/components");
13
+
14
+ var _i18n = require("@wordpress/i18n");
15
+
16
+ var _icons = require("@wordpress/icons");
17
+
18
+ var _styleEngine = require("@wordpress/style-engine");
19
+
20
+ var _useSetting = _interopRequireDefault(require("../components/use-setting"));
21
+
22
+ var _utils = require("./utils");
23
+
24
+ var _gap = require("../hooks/gap");
25
+
26
+ var _utils2 = require("../hooks/utils");
27
+
28
+ /**
29
+ * WordPress dependencies
30
+ */
31
+
32
+ /**
33
+ * Internal dependencies
34
+ */
35
+ var _default = {
36
+ name: 'constrained',
37
+ label: (0, _i18n.__)('Constrained'),
38
+ inspectorControls: function DefaultLayoutInspectorControls(_ref) {
39
+ let {
40
+ layout,
41
+ onChange
42
+ } = _ref;
43
+ const {
44
+ wideSize,
45
+ contentSize
46
+ } = layout;
47
+ const units = (0, _components.__experimentalUseCustomUnits)({
48
+ availableUnits: (0, _useSetting.default)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
49
+ });
50
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
51
+ className: "block-editor-hooks__layout-controls"
52
+ }, (0, _element.createElement)("div", {
53
+ className: "block-editor-hooks__layout-controls-unit"
54
+ }, (0, _element.createElement)(_components.__experimentalUnitControl, {
55
+ label: (0, _i18n.__)('Content'),
56
+ labelPosition: "top",
57
+ __unstableInputWidth: "80px",
58
+ value: contentSize || wideSize || '',
59
+ onChange: nextWidth => {
60
+ nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
61
+ onChange({ ...layout,
62
+ contentSize: nextWidth
63
+ });
64
+ },
65
+ units: units
66
+ }), (0, _element.createElement)(_icons.Icon, {
67
+ icon: _icons.positionCenter
68
+ })), (0, _element.createElement)("div", {
69
+ className: "block-editor-hooks__layout-controls-unit"
70
+ }, (0, _element.createElement)(_components.__experimentalUnitControl, {
71
+ label: (0, _i18n.__)('Wide'),
72
+ labelPosition: "top",
73
+ __unstableInputWidth: "80px",
74
+ value: wideSize || contentSize || '',
75
+ onChange: nextWidth => {
76
+ nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
77
+ onChange({ ...layout,
78
+ wideSize: nextWidth
79
+ });
80
+ },
81
+ units: units
82
+ }), (0, _element.createElement)(_icons.Icon, {
83
+ icon: _icons.stretchWide
84
+ }))), (0, _element.createElement)("div", {
85
+ className: "block-editor-hooks__layout-controls-reset"
86
+ }, (0, _element.createElement)(_components.Button, {
87
+ variant: "secondary",
88
+ isSmall: true,
89
+ disabled: !contentSize && !wideSize,
90
+ onClick: () => onChange({
91
+ contentSize: undefined,
92
+ wideSize: undefined,
93
+ inherit: false
94
+ })
95
+ }, (0, _i18n.__)('Reset'))), (0, _element.createElement)("p", {
96
+ className: "block-editor-hooks__layout-controls-helptext"
97
+ }, (0, _i18n.__)('Customize the width for all elements that are assigned to the center or wide columns.')));
98
+ },
99
+ toolBarControls: function DefaultLayoutToolbarControls() {
100
+ return null;
101
+ },
102
+ getLayoutStyle: function getLayoutStyle(_ref2) {
103
+ var _style$spacing, _style$spacing2;
104
+
105
+ let {
106
+ selector,
107
+ layout = {},
108
+ style,
109
+ blockName,
110
+ hasBlockGapSupport,
111
+ layoutDefinitions
112
+ } = _ref2;
113
+ const {
114
+ contentSize,
115
+ wideSize
116
+ } = layout;
117
+ const blockGapStyleValue = (0, _gap.getGapBoxControlValueFromStyle)(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // If a block's block.json skips serialization for spacing or
118
+ // spacing.blockGap, don't apply the user-defined value to the styles.
119
+
120
+ const blockGapValue = blockGapStyleValue !== null && blockGapStyleValue !== void 0 && blockGapStyleValue.top && !(0, _utils2.shouldSkipSerialization)(blockName, 'spacing', 'blockGap') ? blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top : '';
121
+ let output = !!contentSize || !!wideSize ? `
122
+ ${(0, _utils.appendSelectors)(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')} {
123
+ max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
124
+ margin-left: auto !important;
125
+ margin-right: auto !important;
126
+ }
127
+ ${(0, _utils.appendSelectors)(selector, '> .alignwide')} {
128
+ max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize};
129
+ }
130
+ ${(0, _utils.appendSelectors)(selector, '> .alignfull')} {
131
+ max-width: none;
132
+ }
133
+ ` : ''; // If there is custom padding, add negative margins for alignfull blocks.
134
+
135
+ if (style !== null && style !== void 0 && (_style$spacing2 = style.spacing) !== null && _style$spacing2 !== void 0 && _style$spacing2.padding) {
136
+ // The style object might be storing a preset so we need to make sure we get a usable value.
137
+ const paddingValues = (0, _styleEngine.getCSSRules)(style);
138
+ paddingValues.forEach(rule => {
139
+ if (rule.key === 'paddingRight') {
140
+ output += `
141
+ ${(0, _utils.appendSelectors)(selector, '> .alignfull')} {
142
+ margin-right: calc(${rule.value} * -1);
143
+ }
144
+ `;
145
+ } else if (rule.key === 'paddingLeft') {
146
+ output += `
147
+ ${(0, _utils.appendSelectors)(selector, '> .alignfull')} {
148
+ margin-left: calc(${rule.value} * -1);
149
+ }
150
+ `;
151
+ }
152
+ });
153
+ } // Output blockGap styles based on rules contained in layout definitions in theme.json.
154
+
155
+
156
+ if (hasBlockGapSupport && blockGapValue) {
157
+ output += (0, _utils.getBlockGapCSS)(selector, layoutDefinitions, 'constrained', blockGapValue);
158
+ }
159
+
160
+ return output;
161
+ },
162
+
163
+ getOrientation() {
164
+ return 'vertical';
165
+ },
166
+
167
+ getAlignments(layout) {
168
+ const alignmentInfo = (0, _utils.getAlignmentsInfo)(layout);
169
+
170
+ if (layout.alignments !== undefined) {
171
+ if (!layout.alignments.includes('none')) {
172
+ layout.alignments.unshift('none');
173
+ }
174
+
175
+ return layout.alignments.map(alignment => ({
176
+ name: alignment,
177
+ info: alignmentInfo[alignment]
178
+ }));
179
+ }
180
+
181
+ const {
182
+ contentSize,
183
+ wideSize
184
+ } = layout;
185
+ const alignments = [{
186
+ name: 'left'
187
+ }, {
188
+ name: 'center'
189
+ }, {
190
+ name: 'right'
191
+ }];
192
+
193
+ if (contentSize) {
194
+ alignments.unshift({
195
+ name: 'full'
196
+ });
197
+ }
198
+
199
+ if (wideSize) {
200
+ alignments.unshift({
201
+ name: 'wide',
202
+ info: alignmentInfo.wide
203
+ });
204
+ }
205
+
206
+ alignments.unshift({
207
+ name: 'none',
208
+ info: alignmentInfo.none
209
+ });
210
+ return alignments;
211
+ }
212
+
213
+ };
214
+ exports.default = _default;
215
+ //# sourceMappingURL=constrained.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/layouts/constrained.js"],"names":["name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","wideSize","contentSize","units","availableUnits","nextWidth","parseFloat","positionCenter","stretchWide","undefined","inherit","toolBarControls","DefaultLayoutToolbarControls","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapStyleValue","spacing","blockGap","blockGapValue","top","output","padding","paddingValues","forEach","rule","key","value","getOrientation","getAlignments","alignmentInfo","alignments","includes","unshift","map","alignment","info","wide","none"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAUA;AACA;AACA;eAMe;AACdA,EAAAA,IAAI,EAAE,aADQ;AAEdC,EAAAA,KAAK,EAAE,cAAI,aAAJ,CAFO;AAGdC,EAAAA,iBAAiB,EAAE,SAASC,8BAAT,OAGf;AAAA,QAHwD;AAC3DC,MAAAA,MAD2D;AAE3DC,MAAAA;AAF2D,KAGxD;AACH,UAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA4BH,MAAlC;AACA,UAAMI,KAAK,GAAG,8CAAgB;AAC7BC,MAAAA,cAAc,EAAE,yBAAY,eAAZ,KAAiC,CAChD,GADgD,EAEhD,IAFgD,EAGhD,IAHgD,EAIhD,KAJgD,EAKhD,IALgD;AADpB,KAAhB,CAAd;AAUA,WACC,qDACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,qCAAD;AACC,MAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,MAAA,aAAa,EAAC,KAFf;AAGC,MAAA,oBAAoB,EAAC,MAHtB;AAIC,MAAA,KAAK,EAAGF,WAAW,IAAID,QAAf,IAA2B,EAJpC;AAKC,MAAA,QAAQ,EAAKI,SAAF,IAAiB;AAC3BA,QAAAA,SAAS,GACR,IAAIC,UAAU,CAAED,SAAF,CAAd,GACG,GADH,GAEGA,SAHJ;AAIAL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AAeD,MAAAA;AAAf,QAA4BF,MAAlC;AAEA,UAAMmC,UAAU,GAAG,CAClB;AAAEvC,MAAAA,IAAI,EAAE;AAAR,KADkB,EAElB;AAAEA,MAAAA,IAAI,EAAE;AAAR,KAFkB,EAGlB;AAAEA,MAAAA,IAAI,EAAE;AAAR,KAHkB,CAAnB;;AAMA,QAAKO,WAAL,EAAmB;AAClBgC,MAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEzC,QAAAA,IAAI,EAAE;AAAR,OAApB;AACA;;AAED,QAAKM,QAAL,EAAgB;AACfiC,MAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEzC,QAAAA,IAAI,EAAE,MAAR;AAAgB4C,QAAAA,IAAI,EAAEN,aAAa,CAACO;AAApC,OAApB;AACA;;AAEDN,IAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEzC,MAAAA,IAAI,EAAE,MAAR;AAAgB4C,MAAAA,IAAI,EAAEN,aAAa,CAACQ;AAApC,KAApB;AAEA,WAAOP,UAAP;AACA;;AAnMa,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, positionCenter, stretchWide } from '@wordpress/icons';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\nimport { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';\nimport { getGapBoxControlValueFromStyle } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\n\nexport default {\n\tname: 'constrained',\n\tlabel: __( 'Constrained' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t} ) {\n\t\tconst { wideSize, contentSize } = layout;\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t\t'%',\n\t\t\t\t'px',\n\t\t\t\t'em',\n\t\t\t\t'rem',\n\t\t\t\t'vw',\n\t\t\t],\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\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={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\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<Icon icon={ positionCenter } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\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={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\twideSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\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<Icon icon={ stretchWide } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls-reset\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tdisabled={ ! contentSize && ! wideSize }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcontentSize: undefined,\n\t\t\t\t\t\t\t\twideSize: undefined,\n\t\t\t\t\t\t\t\tinherit: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\n\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout = {},\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions,\n\t} ) {\n\t\tconst { contentSize, wideSize } = layout;\n\t\tconst blockGapStyleValue = getGapBoxControlValueFromStyle(\n\t\t\tstyle?.spacing?.blockGap\n\t\t);\n\t\t// If a block's block.json skips serialization for spacing or\n\t\t// spacing.blockGap, don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tblockGapStyleValue?.top &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? blockGapStyleValue?.top\n\t\t\t\t: '';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\t// If there is custom padding, add negative margins for alignfull blocks.\n\t\tif ( style?.spacing?.padding ) {\n\t\t\t// The style object might be storing a preset so we need to make sure we get a usable value.\n\t\t\tconst paddingValues = getCSSRules( style );\n\t\t\tpaddingValues.forEach( ( rule ) => {\n\t\t\t\tif ( rule.key === 'paddingRight' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-right: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t} else if ( rule.key === 'paddingLeft' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-left: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'constrained',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n"]}
@@ -113,7 +113,7 @@ var _default = {
113
113
  } = layout; // If a block's block.json skips serialization for spacing or spacing.blockGap,
114
114
  // don't apply the user-defined value to the styles.
115
115
 
116
- const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !(0, _utils2.shouldSkipSerialization)(blockName, 'spacing', 'blockGap') ? (0, _gap.getGapCSSValue)(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap) : undefined;
116
+ const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !(0, _utils2.shouldSkipSerialization)(blockName, 'spacing', 'blockGap') ? (0, _gap.getGapCSSValue)(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap, '0.5em') : undefined;
117
117
  const justifyContent = justifyContentMap[layout.justifyContent];
118
118
  const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
119
119
  const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/layouts/flex.js"],"names":["justifyContentMap","left","right","center","alignItemsMap","verticalAlignmentMap","top","bottom","flexWrapOptions","name","label","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","toolBarControls","FlexLayoutToolbarControls","allowSwitching","allowVerticalAlignment","orientation","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapValue","spacing","blockGap","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","join","getOrientation","getAlignments","FlexLayoutVerticalAlignmentControl","isToolbar","onVerticalAlignmentChange","value","verticalAlignmentOptions","map","icon","FlexLayoutJustifyContentControl","onJustificationChange","allowedControls","position","isAlternate","justificationOptions","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","FlexWrapControl","OrientationControl","arrowRight","arrowDown"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AAKA;;AACA;;AACA;;AAKA;;AAxBA;AACA;AACA;;AAYA;AACA;AACA;AAUA;AACA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,IAAI,EAAE,YADmB;AAEzBC,EAAAA,KAAK,EAAE,UAFkB;AAGzBC,EAAAA,MAAM,EAAE,QAHiB;AAIzB,mBAAiB;AAJQ,CAA1B,C,CAOA;;AACA,MAAMC,aAAa,GAAG;AACrBH,EAAAA,IAAI,EAAE,YADe;AAErBC,EAAAA,KAAK,EAAE,UAFc;AAGrBC,EAAAA,MAAM,EAAE;AAHa,CAAtB;AAMA,MAAME,oBAAoB,GAAG;AAC5BC,EAAAA,GAAG,EAAE,YADuB;A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K,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,IAAI,EAAGkD,iBAFR;AAGC,IAAA,SAAS,EAAG1C,WAAW,KAAK,YAH7B;AAIC,IAAA,OAAO,EAAG,MACTP,QAAQ,CAAE,EACT,GAAGD,MADM;AAETQ,MAAAA,WAAW,EAAE;AAFJ,KAAF;AALV,IAFD,EAaC,4BAAC,kBAAD;AACC,IAAA,KAAK,EAAG,cAAI,UAAJ,CADT;AAEC,IAAA,IAAI,EAAG2C,gBAFR;AAGC,IAAA,SAAS,EAAG3C,WAAW,KAAK,UAH7B;AAIC,IAAA,OAAO,EAAG,MACTP,QAAQ,CAAE,EACT,GAAGD,MADM;AAETQ,MAAAA,WAAW,EAAE;AAFJ,KAAF;AALV,IAbD,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport { Button, ToggleControl, Flex, FlexItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tif ( layoutBlockSupport?.allowSwitching ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { allowVerticalAlignment = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tisToolbar\n\t\t\t\t/>\n\t\t\t\t{ allowVerticalAlignment &&\n\t\t\t\t\tlayout?.orientation !== 'vertical' && (\n\t\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tisToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { verticalAlignment = verticalAlignmentMap.center } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<BlockVerticalAlignmentControl\n\t\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\t\tvalue={ verticalAlignment }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst verticalAlignmentOptions = [\n\t\t{\n\t\t\tvalue: 'flex-start',\n\t\t\tlabel: __( 'Align items top' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\tlabel: __( 'Align items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'flex-end',\n\t\t\tlabel: __( 'Align items bottom' ),\n\t\t},\n\t];\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-vertical-alignment-control\">\n\t\t\t<legend>{ __( 'Vertical alignment' ) }</legend>\n\t\t\t<div>\n\t\t\t\t{ verticalAlignmentOptions.map( ( value, icon, label ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisPressed={ verticalAlignment === value }\n\t\t\t\t\t\t\tonClick={ () => onVerticalAlignmentChange( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tposition: 'bottom right',\n\t\t\t\t\tisAlternate: true,\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-justification-controls\">\n\t\t\t<legend>{ __( 'Justification' ) }</legend>\n\t\t\t<div>\n\t\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisPressed={ justifyContent === value }\n\t\t\t\t\t\t\tonClick={ () => onJustificationChange( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-orientation-controls\">\n\t\t\t<legend>{ __( 'Orientation' ) }</legend>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tisPressed={ orientation === 'horizontal' }\n\t\t\t\tonClick={ () =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t...layout,\n\t\t\t\t\t\torientation: 'horizontal',\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Vertical' ) }\n\t\t\t\ticon={ arrowDown }\n\t\t\t\tisPressed={ orientation === 'vertical' }\n\t\t\t\tonClick={ () =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t...layout,\n\t\t\t\t\t\torientation: 'vertical',\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t/>\n\t\t</fieldset>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/layouts/flex.js"],"names":["justifyContentMap","left","right","center","alignItemsMap","verticalAlignmentMap","top","bottom","flexWrapOptions","name","label","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","toolBarControls","FlexLayoutToolbarControls","allowSwitching","allowVerticalAlignment","orientation","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapValue","spacing","blockGap","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","join","getOrientation","getAlignments","FlexLayoutVerticalAlignmentControl","isToolbar","onVerticalAlignmentChange","value","verticalAlignmentOptions","map","icon","FlexLayoutJustifyContentControl","onJustificationChange","allowedControls","position","isAlternate","justificationOptions","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","FlexWrapControl","OrientationControl","arrowRight","arrowDown"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AAKA;;AACA;;AACA;;AAKA;;AAxBA;AACA;AACA;;AAYA;AACA;AACA;AAUA;AACA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,IAAI,EAAE,YADmB;AAEzBC,EAAAA,KAAK,EAAE,UAFkB;AAGzBC,EAAAA,MAAM,EAAE,QAHiB;AAIzB,mBAAiB;AAJQ,CAA1B,C,CAOA;;AACA,MAAMC,aAAa,GAAG;AACrBH,EAAAA,IAAI,EAAE,YADe;AAErBC,EAAAA,KAAK,EAAE,UAFc;AAGrBC,EAAAA,MAAM,EAAE;AAHa,CAAtB;AAMA,MAAME,oBAAoB,GAAG;AAC5BC,EAAAA,GAAG,EAAE,YADuB;AAE5BH,EAAAA,MAAM,EAAE,QAFoB;AAG5BI,EAAAA,MAAM,EAAE;AAHoB,CAA7B;AAMA,MAAMC,eAAe,GAAG,CAAE,MAAF,EAAU,QAAV,CAAxB;eAEe;AACdC,EAAAA,IAAI,EAAE,MADQ;AAEdC,EAAAA,KAAK,EAAE,cAAI,MAAJ,CAFO;AAGdC,EAAAA,iBAAiB,EAAE,SAASC,2BAAT,OAIf;AAAA,QAJqD;AACxDC,MAAAA,MAAM,GAAG,EAD+C;AAExDC,MAAAA,QAFwD;AAGxDC,MAAAA,kBAAkB,G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,KAAK,UAH7B;AAIC,IAAA,OAAO,EAAG,MACTP,QAAQ,CAAE,EACT,GAAGD,MADM;AAETQ,MAAAA,WAAW,EAAE;AAFJ,KAAF;AALV,IAbD,CADD;AA2BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport { Button, ToggleControl, Flex, FlexItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tif ( layoutBlockSupport?.allowSwitching ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { allowVerticalAlignment = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tisToolbar\n\t\t\t\t/>\n\t\t\t\t{ allowVerticalAlignment &&\n\t\t\t\t\tlayout?.orientation !== 'vertical' && (\n\t\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tisToolbar\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { verticalAlignment = verticalAlignmentMap.center } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<BlockVerticalAlignmentControl\n\t\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\t\tvalue={ verticalAlignment }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst verticalAlignmentOptions = [\n\t\t{\n\t\t\tvalue: 'flex-start',\n\t\t\tlabel: __( 'Align items top' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\tlabel: __( 'Align items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'flex-end',\n\t\t\tlabel: __( 'Align items bottom' ),\n\t\t},\n\t];\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-vertical-alignment-control\">\n\t\t\t<legend>{ __( 'Vertical alignment' ) }</legend>\n\t\t\t<div>\n\t\t\t\t{ verticalAlignmentOptions.map( ( value, icon, label ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisPressed={ verticalAlignment === value }\n\t\t\t\t\t\t\tonClick={ () => onVerticalAlignmentChange( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tposition: 'bottom right',\n\t\t\t\t\tisAlternate: true,\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-justification-controls\">\n\t\t\t<legend>{ __( 'Justification' ) }</legend>\n\t\t\t<div>\n\t\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisPressed={ justifyContent === value }\n\t\t\t\t\t\t\tonClick={ () => onJustificationChange( value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__flex-layout-orientation-controls\">\n\t\t\t<legend>{ __( 'Orientation' ) }</legend>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tisPressed={ orientation === 'horizontal' }\n\t\t\t\tonClick={ () =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t...layout,\n\t\t\t\t\t\torientation: 'horizontal',\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tlabel={ __( 'Vertical' ) }\n\t\t\t\ticon={ arrowDown }\n\t\t\t\tisPressed={ orientation === 'vertical' }\n\t\t\t\tonClick={ () =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t...layout,\n\t\t\t\t\t\torientation: 'vertical',\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t/>\n\t\t</fieldset>\n\t);\n}\n"]}