@wordpress/block-editor 9.4.0 → 9.7.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 (483) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -8
  3. package/build/components/block-list/block-invalid-warning.native.js +54 -6
  4. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  5. package/build/components/block-list/block.js +14 -4
  6. package/build/components/block-list/block.js.map +1 -1
  7. package/build/components/block-list/block.native.js +2 -1
  8. package/build/components/block-list/block.native.js.map +1 -1
  9. package/build/components/block-list/index.native.js +5 -4
  10. package/build/components/block-list/index.native.js.map +1 -1
  11. package/build/components/block-list/layout.js +20 -5
  12. package/build/components/block-list/layout.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-block-class-names.js +5 -2
  14. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  15. package/build/components/block-lock/modal.js +37 -7
  16. package/build/components/block-lock/modal.js.map +1 -1
  17. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  18. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  19. package/build/components/block-mover/mover-description.js +95 -32
  20. package/build/components/block-mover/mover-description.js.map +1 -1
  21. package/build/components/block-pattern-setup/index.js +5 -17
  22. package/build/components/block-pattern-setup/index.js.map +1 -1
  23. package/build/components/block-popover/inbetween.js +2 -2
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-popover/index.js +1 -1
  26. package/build/components/block-popover/index.js.map +1 -1
  27. package/build/components/block-settings-menu/block-mode-toggle.js +1 -1
  28. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  29. package/build/components/block-settings-menu/block-settings-dropdown.js +4 -1
  30. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  31. package/build/components/block-settings-menu-controls/index.js +1 -1
  32. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  33. package/build/components/block-styles/index.js +3 -6
  34. package/build/components/block-styles/index.js.map +1 -1
  35. package/build/components/block-styles/preview.native.js.map +1 -1
  36. package/build/components/block-switcher/index.js +7 -1
  37. package/build/components/block-switcher/index.js.map +1 -1
  38. package/build/components/block-title/index.js +8 -2
  39. package/build/components/block-title/index.js.map +1 -1
  40. package/build/components/block-title/use-block-display-title.js +12 -5
  41. package/build/components/block-title/use-block-display-title.js.map +1 -1
  42. package/build/components/block-tools/block-contextual-toolbar.js +1 -1
  43. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  44. package/build/components/block-tools/block-selection-button.js +1 -7
  45. package/build/components/block-tools/block-selection-button.js.map +1 -1
  46. package/build/components/block-tools/index.js +4 -1
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-types-list/index.js +1 -1
  49. package/build/components/block-types-list/index.js.map +1 -1
  50. package/build/components/block-types-list/index.native.js +65 -23
  51. package/build/components/block-types-list/index.native.js.map +1 -1
  52. package/build/components/border-radius-control/index.js +5 -1
  53. package/build/components/border-radius-control/index.js.map +1 -1
  54. package/build/components/colors/utils.js +6 -2
  55. package/build/components/colors/utils.js.map +1 -1
  56. package/build/components/colors/with-colors.js +1 -1
  57. package/build/components/colors/with-colors.js.map +1 -1
  58. package/build/components/colors-gradients/control.js +49 -39
  59. package/build/components/colors-gradients/control.js.map +1 -1
  60. package/build/components/colors-gradients/dropdown.js +9 -3
  61. package/build/components/colors-gradients/dropdown.js.map +1 -1
  62. package/build/components/date-format-picker/index.js +1 -1
  63. package/build/components/date-format-picker/index.js.map +1 -1
  64. package/build/components/font-appearance-control/index.js +10 -4
  65. package/build/components/font-appearance-control/index.js.map +1 -1
  66. package/build/components/iframe/index.js +19 -6
  67. package/build/components/iframe/index.js.map +1 -1
  68. package/build/components/image-editor/cropper.js +4 -3
  69. package/build/components/image-editor/cropper.js.map +1 -1
  70. package/build/components/image-editor/index.js +3 -1
  71. package/build/components/image-editor/index.js.map +1 -1
  72. package/build/components/image-size-control/index.js +3 -1
  73. package/build/components/image-size-control/index.js.map +1 -1
  74. package/build/components/index.js +13 -6
  75. package/build/components/index.js.map +1 -1
  76. package/build/components/index.native.js +11 -4
  77. package/build/components/index.native.js.map +1 -1
  78. package/build/components/inserter/block-types-tab.native.js +30 -16
  79. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  80. package/build/components/inserter/index.native.js +8 -3
  81. package/build/components/inserter/index.native.js.map +1 -1
  82. package/build/components/inserter/preview-panel.js +8 -8
  83. package/build/components/inserter/preview-panel.js.map +1 -1
  84. package/build/components/inserter/reusable-blocks-tab.native.js +5 -1
  85. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  86. package/build/components/inserter/search-results.native.js +5 -2
  87. package/build/components/inserter/search-results.native.js.map +1 -1
  88. package/build/components/inserter/utils.native.js +21 -0
  89. package/build/components/inserter/utils.native.js.map +1 -1
  90. package/build/components/inserter-list-item/index.js +7 -20
  91. package/build/components/inserter-list-item/index.js.map +1 -1
  92. package/build/components/letter-spacing-control/index.js +6 -3
  93. package/build/components/letter-spacing-control/index.js.map +1 -1
  94. package/build/components/line-height-control/index.js +6 -3
  95. package/build/components/line-height-control/index.js.map +1 -1
  96. package/build/components/link-control/index.js +1 -1
  97. package/build/components/link-control/index.js.map +1 -1
  98. package/build/components/link-control/is-url-like.js +1 -7
  99. package/build/components/link-control/is-url-like.js.map +1 -1
  100. package/build/components/link-control/use-search-handler.js +1 -7
  101. package/build/components/link-control/use-search-handler.js.map +1 -1
  102. package/build/components/list-view/block-select-button.js +15 -7
  103. package/build/components/list-view/block-select-button.js.map +1 -1
  104. package/build/components/list-view/branch.js +1 -7
  105. package/build/components/list-view/branch.js.map +1 -1
  106. package/build/components/list-view/drop-indicator.js +1 -1
  107. package/build/components/list-view/drop-indicator.js.map +1 -1
  108. package/build/components/list-view/expander.js +3 -1
  109. package/build/components/list-view/expander.js.map +1 -1
  110. package/build/components/media-placeholder/index.js +13 -2
  111. package/build/components/media-placeholder/index.js.map +1 -1
  112. package/build/components/media-replace-flow/index.js +3 -6
  113. package/build/components/media-replace-flow/index.js.map +1 -1
  114. package/build/components/media-upload/index.native.js +8 -3
  115. package/build/components/media-upload/index.native.js.map +1 -1
  116. package/build/components/observe-typing/index.js +22 -8
  117. package/build/components/observe-typing/index.js.map +1 -1
  118. package/build/components/preview-options/index.js +2 -2
  119. package/build/components/preview-options/index.js.map +1 -1
  120. package/build/components/{use-no-recursive-renders → recursion-provider}/index.js +40 -18
  121. package/build/components/recursion-provider/index.js.map +1 -0
  122. package/build/components/rich-text/format-toolbar-container.js +61 -12
  123. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  124. package/build/components/rich-text/index.js +8 -2
  125. package/build/components/rich-text/index.js.map +1 -1
  126. package/build/components/rich-text/index.native.js +3 -1
  127. package/build/components/rich-text/index.native.js.map +1 -1
  128. package/build/components/rich-text/use-before-input-rules.js +110 -0
  129. package/build/components/rich-text/use-before-input-rules.js.map +1 -0
  130. package/build/components/rich-text/use-format-types.js +36 -16
  131. package/build/components/rich-text/use-format-types.js.map +1 -1
  132. package/build/components/text-decoration-control/index.js +3 -1
  133. package/build/components/text-decoration-control/index.js.map +1 -1
  134. package/build/components/text-transform-control/index.js +3 -1
  135. package/build/components/text-transform-control/index.js.map +1 -1
  136. package/build/components/url-popover/image-url-input-ui.js +4 -1
  137. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  138. package/build/components/url-popover/index.js +2 -1
  139. package/build/components/url-popover/index.js.map +1 -1
  140. package/build/components/writing-flow/use-arrow-nav.js +38 -27
  141. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  142. package/build/components/writing-flow/use-drag-selection.js +9 -2
  143. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  144. package/build/components/writing-flow/use-multi-selection.js +3 -47
  145. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  146. package/build/components/writing-flow/use-select-all.js +3 -1
  147. package/build/components/writing-flow/use-select-all.js.map +1 -1
  148. package/build/components/writing-flow/use-selection-observer.js +1 -3
  149. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  150. package/build/components/writing-flow/use-tab-nav.js +1 -1
  151. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  152. package/build/hooks/color.js +2 -4
  153. package/build/hooks/color.js.map +1 -1
  154. package/build/hooks/index.js +8 -0
  155. package/build/hooks/index.js.map +1 -1
  156. package/build/hooks/layout.js +61 -15
  157. package/build/hooks/layout.js.map +1 -1
  158. package/build/hooks/style.js +41 -31
  159. package/build/hooks/style.js.map +1 -1
  160. package/build/hooks/utils.js +5 -3
  161. package/build/hooks/utils.js.map +1 -1
  162. package/build/index.js +7 -0
  163. package/build/index.js.map +1 -1
  164. package/build/layouts/flex.js +40 -36
  165. package/build/layouts/flex.js.map +1 -1
  166. package/build/layouts/flow.js +35 -37
  167. package/build/layouts/flow.js.map +1 -1
  168. package/build/layouts/utils.js +35 -3
  169. package/build/layouts/utils.js.map +1 -1
  170. package/build/store/actions.js +15 -18
  171. package/build/store/actions.js.map +1 -1
  172. package/build/store/index.js +0 -4
  173. package/build/store/index.js.map +1 -1
  174. package/build/store/reducer.js +5 -3
  175. package/build/store/reducer.js.map +1 -1
  176. package/build/store/selectors.js +3 -3
  177. package/build/store/selectors.js.map +1 -1
  178. package/build/utils/block-variation-transforms.js +15 -9
  179. package/build/utils/block-variation-transforms.js.map +1 -1
  180. package/build/utils/pasting.js +9 -1
  181. package/build/utils/pasting.js.map +1 -1
  182. package/build-module/components/block-list/block-invalid-warning.native.js +50 -6
  183. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  184. package/build-module/components/block-list/block.js +15 -5
  185. package/build-module/components/block-list/block.js.map +1 -1
  186. package/build-module/components/block-list/block.native.js +2 -1
  187. package/build-module/components/block-list/block.native.js.map +1 -1
  188. package/build-module/components/block-list/index.native.js +4 -2
  189. package/build-module/components/block-list/index.native.js.map +1 -1
  190. package/build-module/components/block-list/layout.js +19 -4
  191. package/build-module/components/block-list/layout.js.map +1 -1
  192. package/build-module/components/block-list/use-block-props/use-block-class-names.js +5 -2
  193. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  194. package/build-module/components/block-lock/modal.js +39 -8
  195. package/build-module/components/block-lock/modal.js.map +1 -1
  196. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  197. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  198. package/build-module/components/block-mover/mover-description.js +97 -33
  199. package/build-module/components/block-mover/mover-description.js.map +1 -1
  200. package/build-module/components/block-pattern-setup/index.js +6 -18
  201. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  202. package/build-module/components/block-popover/inbetween.js +2 -2
  203. package/build-module/components/block-popover/inbetween.js.map +1 -1
  204. package/build-module/components/block-popover/index.js +1 -1
  205. package/build-module/components/block-popover/index.js.map +1 -1
  206. package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
  207. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  208. package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -1
  209. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  210. package/build-module/components/block-settings-menu-controls/index.js +2 -2
  211. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  212. package/build-module/components/block-styles/index.js +4 -7
  213. package/build-module/components/block-styles/index.js.map +1 -1
  214. package/build-module/components/block-styles/preview.native.js.map +1 -1
  215. package/build-module/components/block-switcher/index.js +7 -1
  216. package/build-module/components/block-switcher/index.js.map +1 -1
  217. package/build-module/components/block-title/index.js +8 -2
  218. package/build-module/components/block-title/index.js.map +1 -1
  219. package/build-module/components/block-title/use-block-display-title.js +12 -5
  220. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  221. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  222. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  223. package/build-module/components/block-tools/block-selection-button.js +1 -7
  224. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  225. package/build-module/components/block-tools/index.js +4 -1
  226. package/build-module/components/block-tools/index.js.map +1 -1
  227. package/build-module/components/block-types-list/index.js +1 -1
  228. package/build-module/components/block-types-list/index.js.map +1 -1
  229. package/build-module/components/block-types-list/index.native.js +67 -25
  230. package/build-module/components/block-types-list/index.native.js.map +1 -1
  231. package/build-module/components/border-radius-control/index.js +6 -2
  232. package/build-module/components/border-radius-control/index.js.map +1 -1
  233. package/build-module/components/colors/utils.js +7 -3
  234. package/build-module/components/colors/utils.js.map +1 -1
  235. package/build-module/components/colors/with-colors.js +2 -2
  236. package/build-module/components/colors/with-colors.js.map +1 -1
  237. package/build-module/components/colors-gradients/control.js +50 -40
  238. package/build-module/components/colors-gradients/control.js.map +1 -1
  239. package/build-module/components/colors-gradients/dropdown.js +10 -4
  240. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  241. package/build-module/components/date-format-picker/index.js +1 -1
  242. package/build-module/components/date-format-picker/index.js.map +1 -1
  243. package/build-module/components/font-appearance-control/index.js +7 -4
  244. package/build-module/components/font-appearance-control/index.js.map +1 -1
  245. package/build-module/components/iframe/index.js +19 -6
  246. package/build-module/components/iframe/index.js.map +1 -1
  247. package/build-module/components/image-editor/cropper.js +4 -3
  248. package/build-module/components/image-editor/cropper.js.map +1 -1
  249. package/build-module/components/image-editor/index.js +3 -1
  250. package/build-module/components/image-editor/index.js.map +1 -1
  251. package/build-module/components/image-size-control/index.js +3 -1
  252. package/build-module/components/image-size-control/index.js.map +1 -1
  253. package/build-module/components/index.js +1 -1
  254. package/build-module/components/index.js.map +1 -1
  255. package/build-module/components/index.native.js +1 -1
  256. package/build-module/components/index.native.js.map +1 -1
  257. package/build-module/components/inserter/block-types-tab.native.js +31 -15
  258. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  259. package/build-module/components/inserter/index.native.js +9 -2
  260. package/build-module/components/inserter/index.native.js.map +1 -1
  261. package/build-module/components/inserter/preview-panel.js +9 -9
  262. package/build-module/components/inserter/preview-panel.js.map +1 -1
  263. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -2
  264. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  265. package/build-module/components/inserter/search-results.native.js +6 -3
  266. package/build-module/components/inserter/search-results.native.js.map +1 -1
  267. package/build-module/components/inserter/utils.native.js +19 -0
  268. package/build-module/components/inserter/utils.native.js.map +1 -1
  269. package/build-module/components/inserter-list-item/index.js +5 -18
  270. package/build-module/components/inserter-list-item/index.js.map +1 -1
  271. package/build-module/components/letter-spacing-control/index.js +5 -3
  272. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  273. package/build-module/components/line-height-control/index.js +5 -3
  274. package/build-module/components/line-height-control/index.js.map +1 -1
  275. package/build-module/components/link-control/index.js +1 -1
  276. package/build-module/components/link-control/index.js.map +1 -1
  277. package/build-module/components/link-control/is-url-like.js +1 -6
  278. package/build-module/components/link-control/is-url-like.js.map +1 -1
  279. package/build-module/components/link-control/use-search-handler.js +1 -6
  280. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  281. package/build-module/components/list-view/block-select-button.js +16 -8
  282. package/build-module/components/list-view/block-select-button.js.map +1 -1
  283. package/build-module/components/list-view/branch.js +1 -6
  284. package/build-module/components/list-view/branch.js.map +1 -1
  285. package/build-module/components/list-view/drop-indicator.js +1 -1
  286. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  287. package/build-module/components/list-view/expander.js +3 -2
  288. package/build-module/components/list-view/expander.js.map +1 -1
  289. package/build-module/components/media-placeholder/index.js +13 -2
  290. package/build-module/components/media-placeholder/index.js.map +1 -1
  291. package/build-module/components/media-replace-flow/index.js +4 -7
  292. package/build-module/components/media-replace-flow/index.js.map +1 -1
  293. package/build-module/components/media-upload/index.native.js +9 -2
  294. package/build-module/components/media-upload/index.native.js.map +1 -1
  295. package/build-module/components/observe-typing/index.js +22 -8
  296. package/build-module/components/observe-typing/index.js.map +1 -1
  297. package/build-module/components/preview-options/index.js +2 -2
  298. package/build-module/components/preview-options/index.js.map +1 -1
  299. package/build-module/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -19
  300. package/build-module/components/recursion-provider/index.js.map +1 -0
  301. package/build-module/components/rich-text/format-toolbar-container.js +58 -12
  302. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  303. package/build-module/components/rich-text/index.js +7 -2
  304. package/build-module/components/rich-text/index.js.map +1 -1
  305. package/build-module/components/rich-text/index.native.js +3 -1
  306. package/build-module/components/rich-text/index.native.js.map +1 -1
  307. package/build-module/components/rich-text/use-before-input-rules.js +96 -0
  308. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -0
  309. package/build-module/components/rich-text/use-format-types.js +37 -18
  310. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  311. package/build-module/components/text-decoration-control/index.js +4 -2
  312. package/build-module/components/text-decoration-control/index.js.map +1 -1
  313. package/build-module/components/text-transform-control/index.js +4 -2
  314. package/build-module/components/text-transform-control/index.js.map +1 -1
  315. package/build-module/components/url-popover/image-url-input-ui.js +4 -1
  316. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  317. package/build-module/components/url-popover/index.js +2 -1
  318. package/build-module/components/url-popover/index.js.map +1 -1
  319. package/build-module/components/writing-flow/use-arrow-nav.js +40 -29
  320. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  321. package/build-module/components/writing-flow/use-drag-selection.js +9 -2
  322. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  323. package/build-module/components/writing-flow/use-multi-selection.js +3 -45
  324. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  325. package/build-module/components/writing-flow/use-select-all.js +3 -1
  326. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  327. package/build-module/components/writing-flow/use-selection-observer.js +1 -3
  328. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  329. package/build-module/components/writing-flow/use-tab-nav.js +1 -1
  330. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  331. package/build-module/hooks/color.js +2 -3
  332. package/build-module/hooks/color.js.map +1 -1
  333. package/build-module/hooks/index.js +1 -0
  334. package/build-module/hooks/index.js.map +1 -1
  335. package/build-module/hooks/layout.js +62 -16
  336. package/build-module/hooks/layout.js.map +1 -1
  337. package/build-module/hooks/style.js +44 -35
  338. package/build-module/hooks/style.js.map +1 -1
  339. package/build-module/hooks/utils.js +5 -2
  340. package/build-module/hooks/utils.js.map +1 -1
  341. package/build-module/index.js +1 -1
  342. package/build-module/index.js.map +1 -1
  343. package/build-module/layouts/flex.js +41 -33
  344. package/build-module/layouts/flex.js.map +1 -1
  345. package/build-module/layouts/flow.js +35 -38
  346. package/build-module/layouts/flow.js.map +1 -1
  347. package/build-module/layouts/utils.js +33 -3
  348. package/build-module/layouts/utils.js.map +1 -1
  349. package/build-module/store/actions.js +9 -10
  350. package/build-module/store/actions.js.map +1 -1
  351. package/build-module/store/index.js +0 -4
  352. package/build-module/store/index.js.map +1 -1
  353. package/build-module/store/reducer.js +5 -2
  354. package/build-module/store/reducer.js.map +1 -1
  355. package/build-module/store/selectors.js +4 -4
  356. package/build-module/store/selectors.js.map +1 -1
  357. package/build-module/utils/block-variation-transforms.js +14 -7
  358. package/build-module/utils/block-variation-transforms.js.map +1 -1
  359. package/build-module/utils/pasting.js +9 -1
  360. package/build-module/utils/pasting.js.map +1 -1
  361. package/build-style/style-rtl.css +72 -14
  362. package/build-style/style.css +72 -14
  363. package/package.json +28 -28
  364. package/src/components/block-list/block-invalid-warning.native.js +42 -7
  365. package/src/components/block-list/block.js +15 -4
  366. package/src/components/block-list/block.native.js +1 -0
  367. package/src/components/block-list/index.native.js +2 -2
  368. package/src/components/block-list/layout.js +15 -3
  369. package/src/components/block-list/style.scss +1 -1
  370. package/src/components/block-list/use-block-props/use-block-class-names.js +5 -1
  371. package/src/components/block-lock/modal.js +47 -9
  372. package/src/components/block-lock/style.scss +10 -0
  373. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  374. package/src/components/block-mover/mover-description.js +131 -48
  375. package/src/components/block-mover/test/mover-description.js +55 -3
  376. package/src/components/block-pattern-setup/index.js +3 -15
  377. package/src/components/block-pattern-setup/style.scss +4 -2
  378. package/src/components/block-popover/inbetween.js +2 -1
  379. package/src/components/block-popover/index.js +1 -1
  380. package/src/components/block-popover/style.scss +25 -2
  381. package/src/components/block-settings-menu/block-mode-toggle.js +1 -0
  382. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
  383. package/src/components/block-settings-menu-controls/index.js +2 -2
  384. package/src/components/block-styles/index.js +4 -7
  385. package/src/components/block-styles/preview.native.js +1 -0
  386. package/src/components/block-styles/style.scss +10 -0
  387. package/src/components/block-switcher/index.js +7 -1
  388. package/src/components/block-title/index.js +3 -2
  389. package/src/components/block-title/use-block-display-title.js +11 -5
  390. package/src/components/block-tools/block-contextual-toolbar.js +3 -1
  391. package/src/components/block-tools/block-selection-button.js +0 -5
  392. package/src/components/block-tools/index.js +4 -1
  393. package/src/components/block-types-list/index.js +1 -1
  394. package/src/components/block-types-list/index.native.js +76 -24
  395. package/src/components/block-types-list/style.native.scss +18 -0
  396. package/src/components/border-radius-control/index.js +6 -1
  397. package/src/components/color-palette/test/__snapshots__/control.js.snap +91 -79
  398. package/src/components/colors/test/__snapshots__/with-colors.js.snap +1 -1
  399. package/src/components/colors/test/with-colors.js +1 -1
  400. package/src/components/colors/utils.js +5 -2
  401. package/src/components/colors/with-colors.js +2 -2
  402. package/src/components/colors-gradients/control.js +82 -65
  403. package/src/components/colors-gradients/dropdown.js +14 -3
  404. package/src/components/colors-gradients/style.scss +34 -9
  405. package/src/components/colors-gradients/test/control.js +16 -23
  406. package/src/components/date-format-picker/index.js +1 -0
  407. package/src/components/font-appearance-control/index.js +3 -0
  408. package/src/components/iframe/index.js +25 -6
  409. package/src/components/image-editor/cropper.js +9 -3
  410. package/src/components/image-editor/index.js +2 -0
  411. package/src/components/image-size-control/README.md +7 -0
  412. package/src/components/image-size-control/index.js +2 -0
  413. package/src/components/index.js +4 -1
  414. package/src/components/index.native.js +4 -1
  415. package/src/components/inserter/block-types-tab.native.js +42 -21
  416. package/src/components/inserter/index.native.js +7 -2
  417. package/src/components/inserter/preview-panel.js +6 -14
  418. package/src/components/inserter/reusable-blocks-tab.native.js +4 -2
  419. package/src/components/inserter/search-results.native.js +4 -2
  420. package/src/components/inserter/style.scss +1 -1
  421. package/src/components/inserter/test/block-types-tab.native.js +2 -0
  422. package/src/components/inserter/test/utils.native.js +37 -0
  423. package/src/components/inserter/utils.native.js +11 -0
  424. package/src/components/inserter-list-item/index.js +5 -18
  425. package/src/components/letter-spacing-control/index.js +2 -0
  426. package/src/components/line-height-control/index.js +2 -0
  427. package/src/components/link-control/index.js +1 -0
  428. package/src/components/link-control/is-url-like.js +1 -6
  429. package/src/components/link-control/test/index.js +6 -4
  430. package/src/components/link-control/use-search-handler.js +1 -6
  431. package/src/components/list-view/block-select-button.js +29 -14
  432. package/src/components/list-view/branch.js +1 -6
  433. package/src/components/list-view/drop-indicator.js +1 -1
  434. package/src/components/list-view/expander.js +4 -2
  435. package/src/components/list-view/style.scss +18 -4
  436. package/src/components/media-placeholder/index.js +19 -0
  437. package/src/components/media-replace-flow/index.js +3 -6
  438. package/src/components/media-replace-flow/test/index.js +14 -4
  439. package/src/components/media-upload/index.native.js +7 -3
  440. package/src/components/observe-typing/index.js +17 -14
  441. package/src/components/preview-options/index.js +2 -2
  442. package/src/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -28
  443. package/src/components/{use-no-recursive-renders/test/use-no-recursive-renders.js → recursion-provider/test/index.js} +5 -6
  444. package/src/components/rich-text/README.md +13 -1
  445. package/src/components/rich-text/format-toolbar-container.js +63 -14
  446. package/src/components/rich-text/index.js +3 -0
  447. package/src/components/rich-text/index.native.js +2 -0
  448. package/src/components/rich-text/use-before-input-rules.js +91 -0
  449. package/src/components/rich-text/use-format-types.js +38 -17
  450. package/src/components/text-decoration-control/index.js +4 -2
  451. package/src/components/text-transform-control/index.js +4 -2
  452. package/src/components/url-popover/image-url-input-ui.js +3 -0
  453. package/src/components/url-popover/index.js +1 -0
  454. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -0
  455. package/src/components/writing-flow/use-arrow-nav.js +36 -34
  456. package/src/components/writing-flow/use-drag-selection.js +7 -1
  457. package/src/components/writing-flow/use-multi-selection.js +1 -48
  458. package/src/components/writing-flow/use-select-all.js +2 -1
  459. package/src/components/writing-flow/use-selection-observer.js +2 -3
  460. package/src/components/writing-flow/use-tab-nav.js +1 -1
  461. package/src/hooks/color.js +10 -3
  462. package/src/hooks/index.js +1 -0
  463. package/src/hooks/layout.js +66 -23
  464. package/src/hooks/style.js +46 -39
  465. package/src/hooks/utils.js +7 -3
  466. package/src/index.js +1 -0
  467. package/src/layouts/flex.js +47 -41
  468. package/src/layouts/flow.js +35 -34
  469. package/src/layouts/test/flex.js +21 -0
  470. package/src/layouts/test/flow.js +21 -0
  471. package/src/layouts/test/utils.js +138 -0
  472. package/src/layouts/utils.js +44 -3
  473. package/src/store/actions.js +10 -11
  474. package/src/store/index.js +0 -4
  475. package/src/store/reducer.js +3 -2
  476. package/src/store/selectors.js +3 -4
  477. package/src/utils/block-variation-transforms.js +13 -6
  478. package/src/utils/pasting.js +10 -1
  479. package/src/utils/test/block-variation-transforms.js +24 -0
  480. package/src/utils/test/pasting.js +10 -0
  481. package/tsconfig.json +2 -1
  482. package/build/components/use-no-recursive-renders/index.js.map +0 -1
  483. package/build-module/components/use-no-recursive-renders/index.js.map +0 -1
@@ -12,7 +12,7 @@ import { has, kebabCase } from 'lodash';
12
12
 
13
13
  import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
14
14
  import { addFilter } from '@wordpress/hooks';
15
- import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
15
+ import { getBlockDefaultClassName, getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
16
16
  import { useSelect } from '@wordpress/data';
17
17
  import { Button, ButtonGroup, ToggleControl, PanelBody } from '@wordpress/components';
18
18
  import { __ } from '@wordpress/i18n';
@@ -36,29 +36,44 @@ const layoutBlockSupportKey = '__experimentalLayout';
36
36
  * have the style engine generate a more extensive list of utility classnames which
37
37
  * will then replace this method.
38
38
  *
39
- * @param { Array } attributes Array of block attributes.
39
+ * @param { Object } layout Layout object.
40
+ * @param { Object } layoutDefinitions An object containing layout definitions, stored in theme.json.
40
41
  *
41
42
  * @return { Array } Array of CSS classname strings.
42
43
  */
43
44
 
44
- function getLayoutClasses(attributes) {
45
- var _attributes$layout, _attributes$layout2, _attributes$layout3;
45
+ function useLayoutClasses(layout, layoutDefinitions) {
46
+ var _layoutDefinitions;
46
47
 
48
+ const rootPaddingAlignment = useSelect(select => {
49
+ var _getSettings$__experi;
50
+
51
+ const {
52
+ getSettings
53
+ } = select(blockEditorStore);
54
+ return (_getSettings$__experi = getSettings().__experimentalFeatures) === null || _getSettings$__experi === void 0 ? void 0 : _getSettings$__experi.useRootPaddingAwareAlignments;
55
+ }, []);
47
56
  const layoutClassnames = [];
48
57
 
49
- if (!attributes.layout) {
50
- return layoutClassnames;
58
+ if (layoutDefinitions !== null && layoutDefinitions !== void 0 && (_layoutDefinitions = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) !== null && _layoutDefinitions !== void 0 && _layoutDefinitions.className) {
59
+ var _layoutDefinitions2;
60
+
61
+ layoutClassnames.push(layoutDefinitions === null || layoutDefinitions === void 0 ? void 0 : (_layoutDefinitions2 = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) === null || _layoutDefinitions2 === void 0 ? void 0 : _layoutDefinitions2.className);
62
+ }
63
+
64
+ if ((layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize) && rootPaddingAlignment) {
65
+ layoutClassnames.push('has-global-padding');
51
66
  }
52
67
 
53
- if (attributes !== null && attributes !== void 0 && (_attributes$layout = attributes.layout) !== null && _attributes$layout !== void 0 && _attributes$layout.orientation) {
54
- layoutClassnames.push(`is-${kebabCase(attributes.layout.orientation)}`);
68
+ if (layout !== null && layout !== void 0 && layout.orientation) {
69
+ layoutClassnames.push(`is-${kebabCase(layout.orientation)}`);
55
70
  }
56
71
 
57
- if (attributes !== null && attributes !== void 0 && (_attributes$layout2 = attributes.layout) !== null && _attributes$layout2 !== void 0 && _attributes$layout2.justifyContent) {
58
- layoutClassnames.push(`is-content-justification-${kebabCase(attributes.layout.justifyContent)}`);
72
+ if (layout !== null && layout !== void 0 && layout.justifyContent) {
73
+ layoutClassnames.push(`is-content-justification-${kebabCase(layout.justifyContent)}`);
59
74
  }
60
75
 
61
- if (attributes !== null && attributes !== void 0 && (_attributes$layout3 = attributes.layout) !== null && _attributes$layout3 !== void 0 && _attributes$layout3.flexWrap && attributes.layout.flexWrap === 'nowrap') {
76
+ if (layout !== null && layout !== void 0 && layout.flexWrap && layout.flexWrap === 'nowrap') {
62
77
  layoutClassnames.push('is-nowrap');
63
78
  }
64
79
 
@@ -223,7 +238,14 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
223
238
  name,
224
239
  attributes
225
240
  } = props;
226
- const shouldRenderLayoutStyles = hasBlockSupport(name, layoutBlockSupportKey);
241
+ const hasLayoutBlockSupport = hasBlockSupport(name, layoutBlockSupportKey);
242
+ const disableLayoutStyles = useSelect(select => {
243
+ const {
244
+ getSettings
245
+ } = select(blockEditorStore);
246
+ return !!getSettings().disableLayoutStyles;
247
+ });
248
+ const shouldRenderLayoutStyles = hasLayoutBlockSupport && !disableLayoutStyles;
227
249
  const id = useInstanceId(BlockListBlock);
228
250
  const defaultThemeLayout = useSetting('layout') || {};
229
251
  const element = useContext(BlockList.__unstableElementContext);
@@ -234,13 +256,37 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
234
256
  default: defaultBlockLayout
235
257
  } = getBlockSupport(name, layoutBlockSupportKey) || {};
236
258
  const usedLayout = layout !== null && layout !== void 0 && layout.inherit ? defaultThemeLayout : layout || defaultBlockLayout || {};
237
- const layoutClasses = shouldRenderLayoutStyles ? getLayoutClasses(attributes) : null;
259
+ const layoutClasses = hasLayoutBlockSupport ? useLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
260
+ const selector = `.${getBlockDefaultClassName(name)}.wp-container-${id}`;
261
+ const blockGapSupport = useSetting('spacing.blockGap');
262
+ const hasBlockGapSupport = blockGapSupport !== null; // Get CSS string for the current layout type.
263
+ // The CSS and `style` element is only output if it is not empty.
264
+
265
+ let css;
266
+
267
+ if (shouldRenderLayoutStyles) {
268
+ var _fullLayoutType$getLa;
269
+
270
+ const fullLayoutType = getLayoutType((usedLayout === null || usedLayout === void 0 ? void 0 : usedLayout.type) || 'default');
271
+ css = fullLayoutType === null || fullLayoutType === void 0 ? void 0 : (_fullLayoutType$getLa = fullLayoutType.getLayoutStyle) === null || _fullLayoutType$getLa === void 0 ? void 0 : _fullLayoutType$getLa.call(fullLayoutType, {
272
+ blockName: name,
273
+ selector,
274
+ layout: usedLayout,
275
+ layoutDefinitions: defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions,
276
+ style: attributes === null || attributes === void 0 ? void 0 : attributes.style,
277
+ hasBlockGapSupport
278
+ });
279
+ } // Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
280
+
281
+
238
282
  const className = classnames(props === null || props === void 0 ? void 0 : props.className, {
239
- [`wp-container-${id}`]: shouldRenderLayoutStyles
283
+ [`wp-container-${id}`]: shouldRenderLayoutStyles && !!css // Only attach a container class if there is generated CSS to be attached.
284
+
240
285
  }, layoutClasses);
241
- return createElement(Fragment, null, shouldRenderLayoutStyles && element && createPortal(createElement(LayoutStyle, {
286
+ return createElement(Fragment, null, shouldRenderLayoutStyles && element && !!css && createPortal(createElement(LayoutStyle, {
242
287
  blockName: name,
243
- selector: `.wp-container-${id}`,
288
+ selector: selector,
289
+ css: css,
244
290
  layout: usedLayout,
245
291
  style: attributes === null || attributes === void 0 ? void 0 : attributes.style
246
292
  }), element), createElement(BlockListBlock, _extends({}, props, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/layout.js"],"names":["classnames","has","kebabCase","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","__","useContext","createPortal","store","blockEditorStore","InspectorControls","useSetting","LayoutStyle","BlockList","getLayoutType","getLayoutTypes","layoutBlockSupportKey","getLayoutClasses","attributes","layoutClassnames","layout","orientation","push","justifyContent","flexWrap","LayoutPanel","setAttributes","name","blockName","defaultThemeLayout","themeSupportsLayout","select","getSettings","supportsLayout","layoutBlockSupport","allowSwitching","allowEditing","allowInheriting","default","defaultBlockLayout","showInheritToggle","type","inherit","usedLayout","layoutType","onChangeType","newType","onChangeLayout","newLayout","LayoutTypeSwitcher","onChange","map","label","addAttribute","settings","withInspectorControls","BlockEdit","props","supportLayout","withLayoutStyles","BlockListBlock","shouldRenderLayoutStyles","id","element","__unstableElementContext","layoutClasses","className","style"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,GAAT,EAAcC,SAAd,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,WAFD,EAGCC,aAHD,EAICC,SAJD,QAKO,uBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AACA,SAASC,iBAAT,QAAkC,eAAlC;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,WAAT,QAA4B,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EAOXJ,OAPW,CAHd,EAYC,cAAC,cAAD,eAAqBN,KAArB;AAA6B,IAAA,SAAS,EAAGS;AAAzC,KAZD,CADD;AAgBA,CA3CwD,CAAnD;AA8CPrE,SAAS,CACR,0BADQ,EAER,0BAFQ,EAGRwD,YAHQ,CAAT;AAKAxD,SAAS,CACR,uBADQ,EAER,uCAFQ,EAGR8D,gBAHQ,CAAT;AAKA9D,SAAS,CACR,kBADQ,EAER,4CAFQ,EAGR0D,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { has, kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useContext, createPortal } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport useSetting from '../components/use-setting';\nimport { LayoutStyle } from '../components/block-list/layout';\nimport BlockList from '../components/block-list';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\n\nconst layoutBlockSupportKey = '__experimentalLayout';\n\n/**\n * Generates the utility classnames for the given blocks layout attributes.\n * This method was primarily added to reintroduce classnames that were removed\n * in the 5.9 release (https://github.com/WordPress/gutenberg/issues/38719), rather\n * than providing an extensive list of all possible layout classes. The plan is to\n * have the style engine generate a more extensive list of utility classnames which\n * will then replace this method.\n *\n * @param { Array } attributes Array of block attributes.\n *\n * @return { Array } Array of CSS classname strings.\n */\nfunction getLayoutClasses( attributes ) {\n\tconst layoutClassnames = [];\n\n\tif ( ! attributes.layout ) {\n\t\treturn layoutClassnames;\n\t}\n\n\tif ( attributes?.layout?.orientation ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-${ kebabCase( attributes.layout.orientation ) }`\n\t\t);\n\t}\n\n\tif ( attributes?.layout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tattributes.layout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif (\n\t\tattributes?.layout?.flexWrap &&\n\t\tattributes.layout.flexWrap === 'nowrap'\n\t) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst { layout } = attributes;\n\tconst defaultThemeLayout = useSetting( 'layout' );\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().supportsLayout;\n\t}, [] );\n\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = layoutBlockSupport;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and that the default / flow layout type is in use, as this is the only one that supports inheritance.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type || layout?.type === 'default' || layout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, type = 'default' } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow`\n\t * layout and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif ( type === 'default' && ! themeSupportsLayout ) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use full width' ) }\n\t\t\t\t\t\t\t\tchecked={ ! inherit }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: { inherit: ! inherit },\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t\t\t\t{ !! inherit\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use theme content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container.'\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( has( settings.attributes, [ 'layout', 'type' ] ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, layoutBlockSupportKey ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst supportLayout = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\n\t\treturn [\n\t\t\tsupportLayout && <LayoutPanel key=\"layout\" { ...props } />,\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst shouldRenderLayoutStyles = hasBlockSupport(\n\t\t\tname,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst defaultThemeLayout = useSetting( 'layout' ) || {};\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst { layout } = attributes;\n\t\tconst { default: defaultBlockLayout } =\n\t\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\t\tconst usedLayout = layout?.inherit\n\t\t\t? defaultThemeLayout\n\t\t\t: layout || defaultBlockLayout || {};\n\t\tconst layoutClasses = shouldRenderLayoutStyles\n\t\t\t? getLayoutClasses( attributes )\n\t\t\t: null;\n\t\tconst className = classnames(\n\t\t\tprops?.className,\n\t\t\t{\n\t\t\t\t[ `wp-container-${ id }` ]: shouldRenderLayoutStyles,\n\t\t\t},\n\t\t\tlayoutClasses\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tblockName={ name }\n\t\t\t\t\t\t\tselector={ `.wp-container-${ id }` }\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tstyle={ attributes?.style }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/layout.js"],"names":["classnames","has","kebabCase","createHigherOrderComponent","useInstanceId","addFilter","getBlockDefaultClassName","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","__","useContext","createPortal","store","blockEditorStore","InspectorControls","useSetting","LayoutStyle","BlockList","getLayoutType","getLayoutTypes","layoutBlockSupportKey","useLayoutClasses","layout","layoutDefinitions","rootPaddingAlignment","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","layoutClassnames","type","className","push","inherit","contentSize","orientation","justifyContent","flexWrap","LayoutPanel","setAttributes","attributes","name","blockName","defaultThemeLayout","themeSupportsLayout","supportsLayout","layoutBlockSupport","allowSwitching","allowEditing","allowInheriting","default","defaultBlockLayout","showInheritToggle","usedLayout","layoutType","onChangeType","newType","onChangeLayout","newLayout","LayoutTypeSwitcher","onChange","map","label","addAttribute","settings","withInspectorControls","BlockEdit","props","supportLayout","withLayoutStyles","BlockListBlock","hasLayoutBlockSupport","disableLayoutStyles","shouldRenderLayoutStyles","id","element","__unstableElementContext","layoutClasses","definitions","selector","blockGapSupport","hasBlockGapSupport","css","fullLayoutType","getLayoutStyle","style"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,GAAT,EAAcC,SAAd,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,wBADD,EAECC,eAFD,EAGCC,eAHD,QAIO,mBAJP;AAKA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,WAFD,EAGCC,aAHD,EAICC,SAJD,QAKO,uBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC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**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockDefaultClassName,\n\tgetBlockSupport,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useContext, createPortal } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport useSetting from '../components/use-setting';\nimport { LayoutStyle } from '../components/block-list/layout';\nimport BlockList from '../components/block-list';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\n\nconst layoutBlockSupportKey = '__experimentalLayout';\n\n/**\n * Generates the utility classnames for the given blocks layout attributes.\n * This method was primarily added to reintroduce classnames that were removed\n * in the 5.9 release (https://github.com/WordPress/gutenberg/issues/38719), rather\n * than providing an extensive list of all possible layout classes. The plan is to\n * have the style engine generate a more extensive list of utility classnames which\n * will then replace this method.\n *\n * @param { Object } layout Layout object.\n * @param { Object } layoutDefinitions An object containing layout definitions, stored in theme.json.\n *\n * @return { Array } Array of CSS classname strings.\n */\nfunction useLayoutClasses( layout, layoutDefinitions ) {\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst layoutClassnames = [];\n\n\tif ( layoutDefinitions?.[ layout?.type || 'default' ]?.className ) {\n\t\tlayoutClassnames.push(\n\t\t\tlayoutDefinitions?.[ layout?.type || 'default' ]?.className\n\t\t);\n\t}\n\n\tif ( ( layout?.inherit || layout?.contentSize ) && rootPaddingAlignment ) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( layout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( layout.orientation ) }` );\n\t}\n\n\tif ( layout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase( layout.justifyContent ) }`\n\t\t);\n\t}\n\n\tif ( layout?.flexWrap && layout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst { layout } = attributes;\n\tconst defaultThemeLayout = useSetting( 'layout' );\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().supportsLayout;\n\t}, [] );\n\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = layoutBlockSupport;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and that the default / flow layout type is in use, as this is the only one that supports inheritance.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type || layout?.type === 'default' || layout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst { inherit = false, type = 'default' } = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow`\n\t * layout and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif ( type === 'default' && ! themeSupportsLayout ) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use full width' ) }\n\t\t\t\t\t\t\t\tchecked={ ! inherit }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\tinherit: ! inherit,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t\t\t\t{ !! inherit\n\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use theme content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container.'\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( has( settings.attributes, [ 'layout', 'type' ] ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, layoutBlockSupportKey ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst supportLayout = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\n\t\treturn [\n\t\t\tsupportLayout && <LayoutPanel key=\"layout\" { ...props } />,\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasLayoutBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderLayoutStyles =\n\t\t\thasLayoutBlockSupport && ! disableLayoutStyles;\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst defaultThemeLayout = useSetting( 'layout' ) || {};\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst { layout } = attributes;\n\t\tconst { default: defaultBlockLayout } =\n\t\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\t\tconst usedLayout = layout?.inherit\n\t\t\t? defaultThemeLayout\n\t\t\t: layout || defaultBlockLayout || {};\n\t\tconst layoutClasses = hasLayoutBlockSupport\n\t\t\t? useLayoutClasses( usedLayout, defaultThemeLayout?.definitions )\n\t\t\t: null;\n\t\tconst selector = `.${ getBlockDefaultClassName(\n\t\t\tname\n\t\t) }.wp-container-${ id }`;\n\t\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\t\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t\t// Get CSS string for the current layout type.\n\t\t// The CSS and `style` element is only output if it is not empty.\n\t\tlet css;\n\t\tif ( shouldRenderLayoutStyles ) {\n\t\t\tconst fullLayoutType = getLayoutType(\n\t\t\t\tusedLayout?.type || 'default'\n\t\t\t);\n\t\t\tcss = fullLayoutType?.getLayoutStyle?.( {\n\t\t\t\tblockName: name,\n\t\t\t\tselector,\n\t\t\t\tlayout: usedLayout,\n\t\t\t\tlayoutDefinitions: defaultThemeLayout?.definitions,\n\t\t\t\tstyle: attributes?.style,\n\t\t\t\thasBlockGapSupport,\n\t\t\t} );\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\t\tconst className = classnames(\n\t\t\tprops?.className,\n\t\t\t{\n\t\t\t\t[ `wp-container-${ id }` ]: shouldRenderLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t},\n\t\t\tlayoutClasses\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tblockName={ name }\n\t\t\t\t\t\t\tselector={ selector }\n\t\t\t\t\t\t\tcss={ css }\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tstyle={ attributes?.style }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
@@ -4,17 +4,17 @@ import { createElement, Fragment } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- import { get, has, isEmpty, kebabCase, omit } from 'lodash';
7
+ import { get, has, omit } from 'lodash';
8
8
  import classnames from 'classnames';
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
12
12
 
13
- import { useContext, createPortal } from '@wordpress/element';
13
+ import { useContext, useMemo, createPortal } from '@wordpress/element';
14
14
  import { addFilter } from '@wordpress/hooks';
15
15
  import { getBlockSupport, hasBlockSupport, __EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY, __EXPERIMENTAL_ELEMENTS as ELEMENTS } from '@wordpress/blocks';
16
16
  import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
17
- import { getCSSRules } from '@wordpress/style-engine';
17
+ import { getCSSRules, generate as generateStyles } from '@wordpress/style-engine';
18
18
  /**
19
19
  * Internal dependencies
20
20
  */
@@ -58,6 +58,10 @@ export function getInlineStyles() {
58
58
  const ignoredStyles = ['spacing.blockGap'];
59
59
  const output = {};
60
60
  Object.keys(STYLE_PROPERTY).forEach(propKey => {
61
+ if (STYLE_PROPERTY[propKey].rootOnly) {
62
+ return;
63
+ }
64
+
61
65
  const path = STYLE_PROPERTY[propKey].value;
62
66
  const subPaths = STYLE_PROPERTY[propKey].properties; // Ignore styles on elements because they are handled on the server.
63
67
 
@@ -90,26 +94,6 @@ export function getInlineStyles() {
90
94
  });
91
95
  return output;
92
96
  }
93
-
94
- function compileElementsStyles(selector) {
95
- let elements = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
96
- return Object.entries(elements).map(_ref => {
97
- let [element, styles] = _ref;
98
- const elementStyles = getInlineStyles(styles);
99
-
100
- if (!isEmpty(elementStyles)) {
101
- // The .editor-styles-wrapper selector is required on elements styles. As it is
102
- // added to all other editor styles, not providing it causes reset and global
103
- // styles to override element styles because of higher specificity.
104
- return [`.editor-styles-wrapper .${selector} ${ELEMENTS[element]}{`, ...Object.entries(elementStyles).map(_ref2 => {
105
- let [cssProperty, value] = _ref2;
106
- return `\t${kebabCase(cssProperty)}: ${value};`;
107
- }), '}'].join('\n');
108
- }
109
-
110
- return '';
111
- }).join('\n');
112
- }
113
97
  /**
114
98
  * Filters registered block settings, extending attributes to include `style` attribute.
115
99
  *
@@ -118,7 +102,6 @@ function compileElementsStyles(selector) {
118
102
  * @return {Object} Filtered block settings.
119
103
  */
120
104
 
121
-
122
105
  function addAttribute(settings) {
123
106
  if (!hasStyleSupport(settings)) {
124
107
  return settings;
@@ -202,8 +185,8 @@ export function addSaveProps(props, blockType, attributes) {
202
185
  let {
203
186
  style
204
187
  } = attributes;
205
- Object.entries(skipPaths).forEach(_ref3 => {
206
- let [indicator, path] = _ref3;
188
+ Object.entries(skipPaths).forEach(_ref => {
189
+ let [indicator, path] = _ref;
207
190
  const skipSerialization = getBlockSupport(blockType, indicator);
208
191
 
209
192
  if (skipSerialization === true) {
@@ -271,23 +254,49 @@ export const withBlockControls = createHigherOrderComponent(BlockEdit => props =
271
254
  */
272
255
 
273
256
  const withElementsStyles = createHigherOrderComponent(BlockListBlock => props => {
274
- var _props$attributes$sty, _props$attributes$sty2;
257
+ var _props$attributes$sty2, _props$attributes$sty3;
275
258
 
276
259
  const blockElementsContainerIdentifier = `wp-elements-${useInstanceId(BlockListBlock)}`;
277
- const skipLinkColorSerialization = shouldSkipSerialization(props.name, COLOR_SUPPORT_KEY, 'link'); // The Elements API only supports link colors for now,
278
- // hence the specific omission of `link` in the elements styles.
279
- // This might need to be refactored or removed if the Elements API
280
- // changes or `link` supports styles beyond `color`.
260
+ const skipLinkColorSerialization = shouldSkipSerialization(props.name, COLOR_SUPPORT_KEY, 'link');
261
+ const styles = useMemo(() => {
262
+ var _props$attributes$sty;
263
+
264
+ const rawElementsStyles = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements;
265
+ const elementCssRules = [];
266
+
267
+ if (rawElementsStyles && Object.keys(rawElementsStyles).length > 0) {
268
+ var _rawElementsStyles$li;
269
+
270
+ // Remove values based on whether serialization has been skipped for a specific style.
271
+ const filteredElementsStyles = { ...rawElementsStyles,
272
+ link: { ...rawElementsStyles.link,
273
+ color: !skipLinkColorSerialization ? (_rawElementsStyles$li = rawElementsStyles.link) === null || _rawElementsStyles$li === void 0 ? void 0 : _rawElementsStyles$li.color : undefined
274
+ }
275
+ };
276
+
277
+ for (const [elementName, elementStyles] of Object.entries(filteredElementsStyles)) {
278
+ const cssRule = generateStyles(elementStyles, {
279
+ // The .editor-styles-wrapper selector is required on elements styles. As it is
280
+ // added to all other editor styles, not providing it causes reset and global
281
+ // styles to override element styles because of higher specificity.
282
+ selector: `.editor-styles-wrapper .${blockElementsContainerIdentifier} ${ELEMENTS[elementName]}`
283
+ });
284
+
285
+ if (!!cssRule) {
286
+ elementCssRules.push(cssRule);
287
+ }
288
+ }
289
+ }
281
290
 
282
- const elements = skipLinkColorSerialization ? omit((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements, ['link']) : (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements;
283
- const styles = compileElementsStyles(blockElementsContainerIdentifier, elements);
291
+ return elementCssRules.length > 0 ? elementCssRules : undefined;
292
+ }, [(_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements]);
284
293
  const element = useContext(BlockList.__unstableElementContext);
285
- return createElement(Fragment, null, elements && element && createPortal(createElement("style", {
294
+ return createElement(Fragment, null, styles && element && createPortal(createElement("style", {
286
295
  dangerouslySetInnerHTML: {
287
296
  __html: styles
288
297
  }
289
298
  }), element), createElement(BlockListBlock, _extends({}, props, {
290
- className: elements ? classnames(props.className, blockElementsContainerIdentifier) : props.className
299
+ className: (_props$attributes$sty3 = props.attributes.style) !== null && _props$attributes$sty3 !== void 0 && _props$attributes$sty3.elements ? classnames(props.className, blockElementsContainerIdentifier) : props.className
291
300
  })));
292
301
  });
293
302
  addFilter('blocks.registerBlockType', 'core/style/addAttribute', addAttribute);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["get","has","isEmpty","kebabCase","omit","classnames","useContext","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","getCSSRules","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","shouldSkipSerialization","styleSupportKeys","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","forEach","propKey","path","value","subPaths","properties","styleValue","useEngine","entries","entry","name","subPath","includes","extraRules","rule","compileElementsStyles","selector","elements","map","element","elementStyles","cssProperty","addAttribute","settings","attributes","style","assign","type","skipSerializationPathsEdit","skipSerializationPathsSave","renamedFeatures","gradients","addSaveProps","props","skipPaths","indicator","skipSerialization","Array","isArray","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","skipLinkColorSerialization","__unstableElementContext","__html","className"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,GAAd,EAAmBC,OAAnB,EAA4BC,SAA5B,EAAuCC,IAAvC,QAAmD,QAAnD;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,oBAAzC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,eADD,EAECC,eAFD,EAGCC,6BAA6B,IAAIC,cAHlC,EAICC,uBAAuB,IAAIC,QAJ5B,QAKO,mBALP;AAMA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,WAAT,QAA4B,yBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,SAASC,kBAAT,EAA6BC,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AHQ,CAAT;AAMAlE,SAAS,CACR,kCADQ,EAER,yBAFQ,EAGR4E,YAHQ,CAAT;AAMA5E,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRqF,YAHQ,CAAT;AAMArF,SAAS,CACR,kBADQ,EAER,gCAFQ,EAGRwF,iBAHQ,CAAT;AAMAxF,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGR2F,kBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport { get, has, isEmpty, kebabCase, omit } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, 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 { getCSSRules } 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\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\nfunction compileElementsStyles( selector, elements = {} ) {\n\treturn Object.entries( elements )\n\t\t.map( ( [ element, styles ] ) => {\n\t\t\tconst elementStyles = getInlineStyles( styles );\n\t\t\tif ( ! isEmpty( elementStyles ) ) {\n\t\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t\t// styles to override element styles because of higher specificity.\n\t\t\t\treturn [\n\t\t\t\t\t`.editor-styles-wrapper .${ selector } ${ ELEMENTS[ element ] }{`,\n\t\t\t\t\t...Object.entries( elementStyles ).map(\n\t\t\t\t\t\t( [ cssProperty, value ] ) =>\n\t\t\t\t\t\t\t`\\t${ kebabCase( cssProperty ) }: ${ value };`\n\t\t\t\t\t),\n\t\t\t\t\t'}',\n\t\t\t\t].join( '\\n' );\n\t\t\t}\n\t\t\treturn '';\n\t\t} )\n\t\t.join( '\\n' );\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\t// The Elements API only supports link colors for now,\n\t\t// hence the specific omission of `link` in the elements styles.\n\t\t// This might need to be refactored or removed if the Elements API\n\t\t// changes or `link` supports styles beyond `color`.\n\t\tconst elements = skipLinkColorSerialization\n\t\t\t? omit( props.attributes.style?.elements, [ 'link' ] )\n\t\t\t: props.attributes.style?.elements;\n\n\t\tconst styles = compileElementsStyles(\n\t\t\tblockElementsContainerIdentifier,\n\t\t\telements\n\t\t);\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ elements &&\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\telements\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":["get","has","omit","classnames","useContext","useMemo","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","getCSSRules","generate","generateStyles","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","shouldSkipSerialization","styleSupportKeys","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","forEach","propKey","rootOnly","path","value","subPaths","properties","styleValue","useEngine","entries","entry","name","subPath","includes","extraRules","rule","addAttribute","settings","attributes","style","assign","type","skipSerializationPathsEdit","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","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IAAhB,CAAsBF,OAAtB;AACA;AACD;AACD;;AACD,WAAOP,eAAe,CAACxD,MAAhB,GAAyB,CAAzB,GAA6BwD,eAA7B,GAA+CI,SAAtD;AACA,GAjCqB,EAiCnB,2BAAExB,KAAK,CAACT,UAAN,CAAiBC,KAAnB,2DAAE,uBAAwB2B,QAA1B,CAjCmB,CAAtB;AAmCA,QAAMW,OAAO,GAAG1G,UAAU,CAAEe,SAAS,CAAC4F,wBAAZ,CAA1B;AAEA,SACC,8BACG/D,MAAM,IACP8D,OADC,IAEDxG,YAAY,CACX;AACC,IAAA,uBAAuB,EAAG;AACzB0G,MAAAA,MAAM,EAAEhE;AADiB;AAD3B,IADW,EAMX8D,OANW,CAHd,EAYC,cAAC,cAAD,eACM9B,KADN;AAEC,IAAA,SAAS,EACR,0BAAAA,KAAK,CAACT,UAAN,CAAiBC,KAAjB,0EAAwB2B,QAAxB,GACGhG,UAAU,CACV6E,KAAK,CAACiC,SADI,EAEVjB,gCAFU,CADb,GAKGhB,KAAK,CAACiC;AARX,KAZD,CADD;AA0BA,CA3EmD,CAArD;AA8EA1G,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGR8D,YAHQ,CAAT;AAMA9D,SAAS,CACR,kCADQ,EAER,yBAFQ,EAGRwE,YAHQ,CAAT;AAMAxE,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRiF,YAHQ,CAAT;AAMAjF,SAAS,CACR,kBADQ,EAER,gCAFQ,EAGRoF,iBAHQ,CAAT;AAMApF,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGRuF,kBAHQ,CAAT","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,12 +1,14 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { pickBy, isEmpty, isObject, identity, mapValues, forEach, get, setWith, clone, every } from 'lodash';
4
+ import { pickBy, isEmpty, mapValues, forEach, get, setWith, clone, every } from 'lodash';
5
5
  /**
6
6
  * WordPress dependencies
7
7
  */
8
8
 
9
9
  import { getBlockSupport } from '@wordpress/blocks';
10
+
11
+ const identity = x => x;
10
12
  /**
11
13
  * Removed falsy values from nested object.
12
14
  *
@@ -14,8 +16,9 @@ import { getBlockSupport } from '@wordpress/blocks';
14
16
  * @return {*} Object cleaned from falsy values
15
17
  */
16
18
 
19
+
17
20
  export const cleanEmptyObject = object => {
18
- if (!isObject(object) || Array.isArray(object)) {
21
+ if (object === null || typeof object !== 'object' || Array.isArray(object)) {
19
22
  return object;
20
23
  }
21
24
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/utils.js"],"names":["pickBy","isEmpty","isObject","identity","mapValues","forEach","get","setWith","clone","every","getBlockSupport","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","undefined","immutableSet","path","value","transformStyles","activeSupports","migrationPaths","result","source","index","results","isActive","length","innerBlocks","referenceBlockAttributes","attributes","returnBlock","support","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,OAFD,EAGCC,QAHD,EAICC,QAJD,EAKCC,SALD,EAMCC,OAND,EAOCC,GAPD,EAQCC,OARD,EASCC,KATD,EAUCC,KAVD,QAWO,QAXP;AAaA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,gBAAgB,GAAKC,MAAF,IAAc;AAC7C,MAAK,CAAEV,QAAQ,CAAEU,MAAF,CAAV,IAAwBC,KAAK,CAACC,OAAN,CAAeF,MAAf,CAA7B,EAAuD;AACtD,WAAOA,MAAP;AACA;;AACD,QAAMG,oBAAoB,GAAG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kB,CAAEM,QAAF,EAAYM,OAAZ,KAAyB;AACjD,QAAKN,QAAL,EAAgB;AACfL,MAAAA,cAAc,CAAEW,OAAF,CAAd,CAA0B5B,OAA1B,CAAqCa,IAAF,IAAY;AAC9C,cAAMgB,UAAU,GAAG5B,GAAG,CAAEwB,wBAAF,EAA4BZ,IAA5B,CAAtB;;AACA,YAAKgB,UAAL,EAAkB;AACjBF,UAAAA,WAAW,GAAG,EACb,GAAGA,WADU;AAEbD,YAAAA,UAAU,EAAEd,YAAY,CACvBe,WAAW,CAACD,UADW,EAEvBb,IAFuB,EAGvBgB,UAHuB;AAFX,WAAd;AAQA;AACD,OAZD;AAaA;AACD,GAhBM,CAAP;AAiBA,SAAOF,WAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,uBAAT,CAAkCC,SAAlC,EAA6CC,UAA7C,EAAyDC,OAAzD,EAAmE;AACzE,QAAML,OAAO,GAAGvB,eAAe,CAAE0B,SAAF,EAAaC,UAAb,CAA/B;AACA,QAAME,iBAAiB,GAAGN,OAAH,aAAGA,OAAH,uBAAGA,OAAO,CAAEO,+BAAnC;;AAEA,MAAK3B,KAAK,CAACC,OAAN,CAAeyB,iBAAf,CAAL,EAA0C;AACzC,WAAOA,iBAAiB,CAACE,QAAlB,CAA4BH,OAA5B,CAAP;AACA;;AAED,SAAOC,iBAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tpickBy,\n\tisEmpty,\n\tisObject,\n\tidentity,\n\tmapValues,\n\tforEach,\n\tget,\n\tsetWith,\n\tclone,\n\tevery,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif ( ! isObject( object ) || Array.isArray( object ) ) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = pickBy(\n\t\tmapValues( object, cleanEmptyObject ),\n\t\tidentity\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nexport function immutableSet( object, path, value ) {\n\treturn setWith( object ? clone( object ) : {}, path, value, clone );\n}\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif ( every( activeSupports, ( isActive ) => ! isActive ) ) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tforEach( activeSupports, ( isActive, support ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = get( referenceBlockAttributes, path );\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: immutableSet(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/utils.js"],"names":["pickBy","isEmpty","mapValues","forEach","get","setWith","clone","every","getBlockSupport","identity","x","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","undefined","immutableSet","path","value","transformStyles","activeSupports","migrationPaths","result","source","index","results","isActive","length","innerBlocks","referenceBlockAttributes","attributes","returnBlock","support","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,OAFD,EAGCC,SAHD,EAICC,OAJD,EAKCC,GALD,EAMCC,OAND,EAOCC,KAPD,EAQCC,KARD,QASO,QATP;AAWA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;;AAEA,MAAMC,QAAQ,GAAKC,CAAF,IAASA,CAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMC,gBAAgB,GAAKC,MAAF,IAAc;AAC7C,MACCA,MAAM,KAAK,IAAX,IACA,OAAOA,MAAP,KAAkB,QADlB,IAEAC,KAAK,CAACC,OAAN,CAAeF,MAAf,CAHD,EAIE;AACD,WAAOA,MAAP;AACA;;AACD,QAAMG,oBAAoB,GAAGf,MAAM,CAClCE,SAAS,CAAEU,MAAF,EAAUD,gBAAV,CADyB,EAElCF,QAFkC,CAAnC;AAIA,SAAOR,OAAO,CAAEc,oBAAF,CAAP,GAAkCC,SAAlC,GAA8CD,o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9C,cAAMgB,UAAU,GAAG9B,GAAG,CAAE0B,wBAAF,EAA4BZ,IAA5B,CAAtB;;AACA,YAAKgB,UAAL,EAAkB;AACjBF,UAAAA,WAAW,GAAG,EACb,GAAGA,WADU;AAEbD,YAAAA,UAAU,EAAEd,YAAY,CACvBe,WAAW,CAACD,UADW,EAEvBb,IAFuB,EAGvBgB,UAHuB;AAFX,WAAd;AAQA;AACD,OAZD;AAaA;AACD,GAhBM,CAAP;AAiBA,SAAOF,WAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,uBAAT,CAAkCC,SAAlC,EAA6CC,UAA7C,EAAyDC,OAAzD,EAAmE;AACzE,QAAML,OAAO,GAAGzB,eAAe,CAAE4B,SAAF,EAAaC,UAAb,CAA/B;AACA,QAAME,iBAAiB,GAAGN,OAAH,aAAGA,OAAH,uBAAGA,OAAO,CAAEO,+BAAnC;;AAEA,MAAK3B,KAAK,CAACC,OAAN,CAAeyB,iBAAf,CAAL,EAA0C;AACzC,WAAOA,iBAAiB,CAACE,QAAlB,CAA4BH,OAA5B,CAAP;AACA;;AAED,SAAOC,iBAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tpickBy,\n\tisEmpty,\n\tmapValues,\n\tforEach,\n\tget,\n\tsetWith,\n\tclone,\n\tevery,\n} from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\n\nconst identity = ( x ) => x;\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\tconst cleanedNestedObjects = pickBy(\n\t\tmapValues( object, cleanEmptyObject ),\n\t\tidentity\n\t);\n\treturn isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;\n};\n\nexport function immutableSet( object, path, value ) {\n\treturn setWith( object ? clone( object ) : {}, path, value, clone );\n}\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif ( every( activeSupports, ( isActive ) => ! isActive ) ) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tforEach( activeSupports, ( isActive, support ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = get( referenceBlockAttributes, path );\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: immutableSet(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import './hooks';
5
- export { getBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles, useBorderProps as __experimentalUseBorderProps, getColorClassesAndStyles as __experimentalGetColorClassesAndStyles, useColorProps as __experimentalUseColorProps, useCustomSides as __experimentalUseCustomSides, getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles, useCachedTruthy } from './hooks';
5
+ export { getBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles, useBorderProps as __experimentalUseBorderProps, getColorClassesAndStyles as __experimentalGetColorClassesAndStyles, useColorProps as __experimentalUseColorProps, useCustomSides as __experimentalUseCustomSides, getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles, getGapCSSValue as __experimentalGetGapCSSValue, useCachedTruthy } from './hooks';
6
6
  export * from './components';
7
7
  export * from './elements';
8
8
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/index.js"],"names":["getBorderClassesAndStyles","__experimentalGetBorderClassesAndStyles","useBorderProps","__experimentalUseBorderProps","getColorClassesAndStyles","__experimentalGetColorClassesAndStyles","useColorProps","__experimentalUseColorProps","useCustomSides","__experimentalUseCustomSides","getSpacingClassesAndStyles","__experimentalGetSpacingClassesAndStyles","useCachedTruthy","storeConfig","store","SETTINGS_DEFAULTS"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,SAAP;AACA,SACCA,yBAAyB,IAAIC,uCAD9B,EAECC,cAAc,IAAIC,4BAFnB,EAGCC,wBAAwB,IAAIC,sCAH7B,EAICC,aAAa,IAAIC,2BAJlB,EAKCC,cAAc,IAAIC,4BALnB,EAMCC,0BAA0B,IAAIC,wCAN/B,EAOCC,eAPD,QAQO,SARP;AASA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,SAASC,WAAT,EAAsBC,KAAtB,QAAmC,SAAnC;AACA,SAASC,iBAAT,QAAkC,kBAAlC","sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\nexport {\n\tgetBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,\n\tuseBorderProps as __experimentalUseBorderProps,\n\tgetColorClassesAndStyles as __experimentalGetColorClassesAndStyles,\n\tuseColorProps as __experimentalUseColorProps,\n\tuseCustomSides as __experimentalUseCustomSides,\n\tgetSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,\n\tuseCachedTruthy,\n} from './hooks';\nexport * from './components';\nexport * from './elements';\nexport * from './utils';\nexport { storeConfig, store } from './store';\nexport { SETTINGS_DEFAULTS } from './store/defaults';\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/index.js"],"names":["getBorderClassesAndStyles","__experimentalGetBorderClassesAndStyles","useBorderProps","__experimentalUseBorderProps","getColorClassesAndStyles","__experimentalGetColorClassesAndStyles","useColorProps","__experimentalUseColorProps","useCustomSides","__experimentalUseCustomSides","getSpacingClassesAndStyles","__experimentalGetSpacingClassesAndStyles","getGapCSSValue","__experimentalGetGapCSSValue","useCachedTruthy","storeConfig","store","SETTINGS_DEFAULTS"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,SAAP;AACA,SACCA,yBAAyB,IAAIC,uCAD9B,EAECC,cAAc,IAAIC,4BAFnB,EAGCC,wBAAwB,IAAIC,sCAH7B,EAICC,aAAa,IAAIC,2BAJlB,EAKCC,cAAc,IAAIC,4BALnB,EAMCC,0BAA0B,IAAIC,wCAN/B,EAOCC,cAAc,IAAIC,4BAPnB,EAQCC,eARD,QASO,SATP;AAUA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,SAASC,WAAT,EAAsBC,KAAtB,QAAmC,SAAnC;AACA,SAASC,iBAAT,QAAkC,kBAAlC","sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\nexport {\n\tgetBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,\n\tuseBorderProps as __experimentalUseBorderProps,\n\tgetColorClassesAndStyles as __experimentalGetColorClassesAndStyles,\n\tuseColorProps as __experimentalUseColorProps,\n\tuseCustomSides as __experimentalUseCustomSides,\n\tgetSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,\n\tgetGapCSSValue as __experimentalGetGapCSSValue,\n\tuseCachedTruthy,\n} from './hooks';\nexport * from './components';\nexport * from './elements';\nexport * from './utils';\nexport { storeConfig, store } from './store';\nexport { SETTINGS_DEFAULTS } from './store/defaults';\n"]}