@wordpress/block-editor 12.17.0 → 12.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +32 -0
  3. package/build/components/block-draggable/index.js +11 -3
  4. package/build/components/block-draggable/index.js.map +1 -1
  5. package/build/components/block-edit/context.js +3 -1
  6. package/build/components/block-edit/context.js.map +1 -1
  7. package/build/components/block-edit/index.js +4 -2
  8. package/build/components/block-edit/index.js.map +1 -1
  9. package/build/components/block-editing-mode/index.js +6 -3
  10. package/build/components/block-editing-mode/index.js.map +1 -1
  11. package/build/components/block-inspector/index.js +5 -2
  12. package/build/components/block-inspector/index.js.map +1 -1
  13. package/build/components/block-list/block.js +4 -3
  14. package/build/components/block-list/block.js.map +1 -1
  15. package/build/components/block-list/block.native.js +9 -5
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-list/index.js +30 -4
  18. package/build/components/block-list/index.js.map +1 -1
  19. package/build/components/block-list/private-block-context.js +1 -1
  20. package/build/components/block-list/private-block-context.js.map +1 -1
  21. package/build/components/block-list/use-in-between-inserter.js +1 -1
  22. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  23. package/build/components/block-lock/toolbar.js +8 -2
  24. package/build/components/block-lock/toolbar.js.map +1 -1
  25. package/build/components/block-popover/inbetween.js +15 -3
  26. package/build/components/block-popover/inbetween.js.map +1 -1
  27. package/build/components/block-preview/auto.js +1 -1
  28. package/build/components/block-preview/auto.js.map +1 -1
  29. package/build/components/block-removal-warning-modal/index.js +3 -2
  30. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-switcher/block-transformations-menu.js +12 -1
  34. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  35. package/build/components/block-switcher/index.js +119 -90
  36. package/build/components/block-switcher/index.js.map +1 -1
  37. package/build/components/block-tools/insertion-point.js +10 -3
  38. package/build/components/block-tools/insertion-point.js.map +1 -1
  39. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  40. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  41. package/build/components/font-sizes/fluid-utils.js +7 -1
  42. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  43. package/build/components/global-styles/border-panel.js +5 -14
  44. package/build/components/global-styles/border-panel.js.map +1 -1
  45. package/build/components/global-styles/dimensions-panel.js +30 -5
  46. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build/components/global-styles/effects-panel.js +7 -1
  48. package/build/components/global-styles/effects-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +11 -8
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +31 -14
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/use-global-styles-output.js +6 -0
  54. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build/components/iframe/get-compatibility-styles.js +99 -0
  56. package/build/components/iframe/get-compatibility-styles.js.map +1 -0
  57. package/build/components/iframe/index.js +2 -3
  58. package/build/components/iframe/index.js.map +1 -1
  59. package/build/components/index.js +16 -2
  60. package/build/components/index.js.map +1 -1
  61. package/build/components/index.native.js +16 -2
  62. package/build/components/index.native.js.map +1 -1
  63. package/build/components/inspector-controls/groups.js +2 -0
  64. package/build/components/inspector-controls/groups.js.map +1 -1
  65. package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
  66. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  67. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  68. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  69. package/build/components/link-control/link-preview.js +30 -26
  70. package/build/components/link-control/link-preview.js.map +1 -1
  71. package/build/components/link-control/search-input.js +1 -9
  72. package/build/components/link-control/search-input.js.map +1 -1
  73. package/build/components/list-view/block-contents.js +3 -1
  74. package/build/components/list-view/block-contents.js.map +1 -1
  75. package/build/components/list-view/block.js +10 -1
  76. package/build/components/list-view/block.js.map +1 -1
  77. package/build/components/list-view/branch.js +29 -8
  78. package/build/components/list-view/branch.js.map +1 -1
  79. package/build/components/list-view/drop-indicator.js +100 -32
  80. package/build/components/list-view/drop-indicator.js.map +1 -1
  81. package/build/components/list-view/index.js +52 -4
  82. package/build/components/list-view/index.js.map +1 -1
  83. package/build/components/list-view/leaf.js +2 -2
  84. package/build/components/list-view/leaf.js.map +1 -1
  85. package/build/components/list-view/use-list-view-block-indexes.js +30 -0
  86. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
  87. package/build/components/list-view/use-list-view-drop-zone.js +56 -5
  88. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  89. package/build/components/list-view/utils.js +92 -0
  90. package/build/components/list-view/utils.js.map +1 -1
  91. package/build/components/provider/index.js +1 -1
  92. package/build/components/provider/index.js.map +1 -1
  93. package/build/components/recursion-provider/index.js +21 -0
  94. package/build/components/recursion-provider/index.js.map +1 -1
  95. package/build/components/rich-text/index.js +30 -6
  96. package/build/components/rich-text/index.js.map +1 -1
  97. package/build/components/rich-text/native/index.native.js +9 -9
  98. package/build/components/rich-text/native/index.native.js.map +1 -1
  99. package/build/components/use-block-drop-zone/index.js +30 -7
  100. package/build/components/use-block-drop-zone/index.js.map +1 -1
  101. package/build/components/use-on-block-drop/index.js +50 -8
  102. package/build/components/use-on-block-drop/index.js.map +1 -1
  103. package/build/hooks/block-hooks.js +5 -14
  104. package/build/hooks/block-hooks.js.map +1 -1
  105. package/build/hooks/content-lock-ui.js +17 -42
  106. package/build/hooks/content-lock-ui.js.map +1 -1
  107. package/build/hooks/dimensions.js +71 -1
  108. package/build/hooks/dimensions.js.map +1 -1
  109. package/build/hooks/effects.js +66 -0
  110. package/build/hooks/effects.js.map +1 -0
  111. package/build/hooks/index.js +17 -4
  112. package/build/hooks/index.js.map +1 -1
  113. package/build/hooks/index.native.js +13 -0
  114. package/build/hooks/index.native.js.map +1 -1
  115. package/build/hooks/style.js +9 -2
  116. package/build/hooks/style.js.map +1 -1
  117. package/build/hooks/supports.js +2 -1
  118. package/build/hooks/supports.js.map +1 -1
  119. package/build/hooks/typography.native.js +2 -2
  120. package/build/hooks/typography.native.js.map +1 -1
  121. package/build/hooks/use-bindings-attributes.js +115 -0
  122. package/build/hooks/use-bindings-attributes.js.map +1 -0
  123. package/build/hooks/use-shadow-props.js +46 -0
  124. package/build/hooks/use-shadow-props.js.map +1 -0
  125. package/build/hooks/utils.js +12 -7
  126. package/build/hooks/utils.js.map +1 -1
  127. package/build/index.js +14 -0
  128. package/build/index.js.map +1 -1
  129. package/build/store/actions.js +10 -6
  130. package/build/store/actions.js.map +1 -1
  131. package/build/store/index.js +2 -0
  132. package/build/store/index.js.map +1 -1
  133. package/build/store/private-actions.js +37 -0
  134. package/build/store/private-actions.js.map +1 -1
  135. package/build/store/private-selectors.js +60 -9
  136. package/build/store/private-selectors.js.map +1 -1
  137. package/build/store/reducer.js +44 -3
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/resolvers.js +27 -0
  140. package/build/store/resolvers.js.map +1 -0
  141. package/build/store/selectors.js +94 -56
  142. package/build/store/selectors.js.map +1 -1
  143. package/build/store/utils.js +5 -26
  144. package/build/store/utils.js.map +1 -1
  145. package/build/utils/index.js +0 -16
  146. package/build/utils/index.js.map +1 -1
  147. package/build/utils/math.js +13 -0
  148. package/build/utils/math.js.map +1 -1
  149. package/build/utils/object.js +17 -0
  150. package/build/utils/object.js.map +1 -1
  151. package/build/utils/transform-styles/index.js +37 -27
  152. package/build/utils/transform-styles/index.js.map +1 -1
  153. package/build-module/components/block-draggable/index.js +11 -3
  154. package/build-module/components/block-draggable/index.js.map +1 -1
  155. package/build-module/components/block-edit/context.js +1 -0
  156. package/build-module/components/block-edit/context.js.map +1 -1
  157. package/build-module/components/block-edit/index.js +5 -3
  158. package/build-module/components/block-edit/index.js.map +1 -1
  159. package/build-module/components/block-editing-mode/index.js +7 -4
  160. package/build-module/components/block-editing-mode/index.js.map +1 -1
  161. package/build-module/components/block-inspector/index.js +5 -2
  162. package/build-module/components/block-inspector/index.js.map +1 -1
  163. package/build-module/components/block-list/block.js +6 -5
  164. package/build-module/components/block-list/block.js.map +1 -1
  165. package/build-module/components/block-list/block.native.js +11 -7
  166. package/build-module/components/block-list/block.native.js.map +1 -1
  167. package/build-module/components/block-list/index.js +31 -5
  168. package/build-module/components/block-list/index.js.map +1 -1
  169. package/build-module/components/block-list/private-block-context.js +1 -1
  170. package/build-module/components/block-list/private-block-context.js.map +1 -1
  171. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  172. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  173. package/build-module/components/block-lock/toolbar.js +8 -2
  174. package/build-module/components/block-lock/toolbar.js.map +1 -1
  175. package/build-module/components/block-popover/inbetween.js +15 -3
  176. package/build-module/components/block-popover/inbetween.js.map +1 -1
  177. package/build-module/components/block-preview/auto.js +3 -3
  178. package/build-module/components/block-preview/auto.js.map +1 -1
  179. package/build-module/components/block-removal-warning-modal/index.js +3 -2
  180. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  181. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
  182. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  183. package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
  184. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  185. package/build-module/components/block-switcher/index.js +116 -86
  186. package/build-module/components/block-switcher/index.js.map +1 -1
  187. package/build-module/components/block-tools/insertion-point.js +10 -3
  188. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  189. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  190. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  191. package/build-module/components/font-sizes/fluid-utils.js +7 -1
  192. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  193. package/build-module/components/global-styles/border-panel.js +5 -14
  194. package/build-module/components/global-styles/border-panel.js.map +1 -1
  195. package/build-module/components/global-styles/dimensions-panel.js +30 -5
  196. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  197. package/build-module/components/global-styles/effects-panel.js +7 -1
  198. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  199. package/build-module/components/global-styles/hooks.js +11 -8
  200. package/build-module/components/global-styles/hooks.js.map +1 -1
  201. package/build-module/components/global-styles/typography-panel.js +32 -15
  202. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  203. package/build-module/components/global-styles/use-global-styles-output.js +6 -0
  204. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  205. package/build-module/components/iframe/get-compatibility-styles.js +93 -0
  206. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
  207. package/build-module/components/iframe/index.js +2 -3
  208. package/build-module/components/iframe/index.js.map +1 -1
  209. package/build-module/components/index.js +1 -1
  210. package/build-module/components/index.js.map +1 -1
  211. package/build-module/components/index.native.js +1 -1
  212. package/build-module/components/index.native.js.map +1 -1
  213. package/build-module/components/inspector-controls/groups.js +2 -0
  214. package/build-module/components/inspector-controls/groups.js.map +1 -1
  215. package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
  216. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  217. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  218. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  219. package/build-module/components/link-control/link-preview.js +32 -28
  220. package/build-module/components/link-control/link-preview.js.map +1 -1
  221. package/build-module/components/link-control/search-input.js +1 -8
  222. package/build-module/components/link-control/search-input.js.map +1 -1
  223. package/build-module/components/list-view/block-contents.js +3 -1
  224. package/build-module/components/list-view/block-contents.js.map +1 -1
  225. package/build-module/components/list-view/block.js +10 -1
  226. package/build-module/components/list-view/block.js.map +1 -1
  227. package/build-module/components/list-view/branch.js +30 -9
  228. package/build-module/components/list-view/branch.js.map +1 -1
  229. package/build-module/components/list-view/drop-indicator.js +99 -32
  230. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  231. package/build-module/components/list-view/index.js +54 -6
  232. package/build-module/components/list-view/index.js.map +1 -1
  233. package/build-module/components/list-view/leaf.js +2 -2
  234. package/build-module/components/list-view/leaf.js.map +1 -1
  235. package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
  236. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
  237. package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
  238. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  239. package/build-module/components/list-view/utils.js +91 -0
  240. package/build-module/components/list-view/utils.js.map +1 -1
  241. package/build-module/components/provider/index.js +1 -1
  242. package/build-module/components/provider/index.js.map +1 -1
  243. package/build-module/components/recursion-provider/index.js +17 -0
  244. package/build-module/components/recursion-provider/index.js.map +1 -1
  245. package/build-module/components/rich-text/index.js +30 -6
  246. package/build-module/components/rich-text/index.js.map +1 -1
  247. package/build-module/components/rich-text/native/index.native.js +9 -9
  248. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  249. package/build-module/components/use-block-drop-zone/index.js +31 -8
  250. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  251. package/build-module/components/use-on-block-drop/index.js +51 -9
  252. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  253. package/build-module/hooks/block-hooks.js +5 -14
  254. package/build-module/hooks/block-hooks.js.map +1 -1
  255. package/build-module/hooks/content-lock-ui.js +19 -43
  256. package/build-module/hooks/content-lock-ui.js.map +1 -1
  257. package/build-module/hooks/dimensions.js +70 -2
  258. package/build-module/hooks/dimensions.js.map +1 -1
  259. package/build-module/hooks/effects.js +51 -0
  260. package/build-module/hooks/effects.js.map +1 -0
  261. package/build-module/hooks/index.js +5 -3
  262. package/build-module/hooks/index.js.map +1 -1
  263. package/build-module/hooks/index.native.js +1 -0
  264. package/build-module/hooks/index.native.js.map +1 -1
  265. package/build-module/hooks/style.js +9 -2
  266. package/build-module/hooks/style.js.map +1 -1
  267. package/build-module/hooks/supports.js +2 -1
  268. package/build-module/hooks/supports.js.map +1 -1
  269. package/build-module/hooks/typography.native.js +2 -2
  270. package/build-module/hooks/typography.native.js.map +1 -1
  271. package/build-module/hooks/use-bindings-attributes.js +112 -0
  272. package/build-module/hooks/use-bindings-attributes.js.map +1 -0
  273. package/build-module/hooks/use-shadow-props.js +39 -0
  274. package/build-module/hooks/use-shadow-props.js.map +1 -0
  275. package/build-module/hooks/utils.js +14 -9
  276. package/build-module/hooks/utils.js.map +1 -1
  277. package/build-module/index.js +1 -1
  278. package/build-module/index.js.map +1 -1
  279. package/build-module/store/actions.js +10 -6
  280. package/build-module/store/actions.js.map +1 -1
  281. package/build-module/store/index.js +2 -0
  282. package/build-module/store/index.js.map +1 -1
  283. package/build-module/store/private-actions.js +35 -0
  284. package/build-module/store/private-actions.js.map +1 -1
  285. package/build-module/store/private-selectors.js +53 -8
  286. package/build-module/store/private-selectors.js.map +1 -1
  287. package/build-module/store/reducer.js +43 -3
  288. package/build-module/store/reducer.js.map +1 -1
  289. package/build-module/store/resolvers.js +20 -0
  290. package/build-module/store/resolvers.js.map +1 -0
  291. package/build-module/store/selectors.js +89 -52
  292. package/build-module/store/selectors.js.map +1 -1
  293. package/build-module/store/utils.js +3 -23
  294. package/build-module/store/utils.js.map +1 -1
  295. package/build-module/utils/index.js +0 -1
  296. package/build-module/utils/index.js.map +1 -1
  297. package/build-module/utils/math.js +12 -0
  298. package/build-module/utils/math.js.map +1 -1
  299. package/build-module/utils/object.js +16 -0
  300. package/build-module/utils/object.js.map +1 -1
  301. package/build-module/utils/transform-styles/index.js +36 -27
  302. package/build-module/utils/transform-styles/index.js.map +1 -1
  303. package/build-style/content-rtl.css +33 -16
  304. package/build-style/content.css +33 -16
  305. package/build-style/default-editor-styles-rtl.css +1 -1
  306. package/build-style/default-editor-styles.css +1 -1
  307. package/build-style/style-rtl.css +169 -114
  308. package/build-style/style.css +169 -114
  309. package/package.json +31 -31
  310. package/src/components/block-canvas/style.scss +8 -1
  311. package/src/components/block-draggable/index.js +16 -5
  312. package/src/components/block-edit/context.js +1 -0
  313. package/src/components/block-edit/index.js +4 -0
  314. package/src/components/block-editing-mode/index.js +12 -7
  315. package/src/components/block-inspector/index.js +5 -2
  316. package/src/components/block-list/block.js +5 -4
  317. package/src/components/block-list/block.native.js +13 -3
  318. package/src/components/block-list/content.scss +34 -5
  319. package/src/components/block-list/index.js +52 -16
  320. package/src/components/block-list/private-block-context.js +1 -1
  321. package/src/components/block-list/use-in-between-inserter.js +1 -2
  322. package/src/components/block-lock/toolbar.js +10 -2
  323. package/src/components/block-popover/inbetween.js +22 -2
  324. package/src/components/block-preview/auto.js +3 -3
  325. package/src/components/block-removal-warning-modal/index.js +3 -2
  326. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
  327. package/src/components/block-switcher/block-transformations-menu.js +18 -1
  328. package/src/components/block-switcher/index.js +133 -111
  329. package/src/components/block-switcher/style.scss +6 -4
  330. package/src/components/block-switcher/test/index.js +113 -230
  331. package/src/components/block-toolbar/style.scss +22 -18
  332. package/src/components/block-tools/insertion-point.js +15 -2
  333. package/src/components/block-tools/style.scss +8 -7
  334. package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
  335. package/src/components/font-sizes/fluid-utils.js +8 -2
  336. package/src/components/font-sizes/test/fluid-utils.js +9 -0
  337. package/src/components/global-styles/border-panel.js +7 -17
  338. package/src/components/global-styles/dimensions-panel.js +50 -1
  339. package/src/components/global-styles/effects-panel.js +16 -1
  340. package/src/components/global-styles/hooks.js +11 -6
  341. package/src/components/global-styles/typography-panel.js +45 -13
  342. package/src/components/global-styles/use-global-styles-output.js +6 -0
  343. package/src/components/iframe/get-compatibility-styles.js +120 -0
  344. package/src/components/iframe/index.js +2 -3
  345. package/src/components/index.js +4 -2
  346. package/src/components/index.native.js +4 -2
  347. package/src/components/inspector-controls/groups.js +2 -0
  348. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  349. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
  350. package/src/components/link-control/link-preview.js +31 -55
  351. package/src/components/link-control/search-input.js +1 -9
  352. package/src/components/link-control/style.scss +31 -85
  353. package/src/components/link-control/test/index.js +2 -1
  354. package/src/components/list-view/block-contents.js +5 -1
  355. package/src/components/list-view/block.js +9 -0
  356. package/src/components/list-view/branch.js +30 -10
  357. package/src/components/list-view/drop-indicator.js +139 -46
  358. package/src/components/list-view/index.js +74 -3
  359. package/src/components/list-view/leaf.js +2 -2
  360. package/src/components/list-view/style.scss +102 -13
  361. package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
  362. package/src/components/list-view/test/utils.js +218 -1
  363. package/src/components/list-view/use-list-view-block-indexes.js +29 -0
  364. package/src/components/list-view/use-list-view-drop-zone.js +78 -6
  365. package/src/components/list-view/utils.js +116 -0
  366. package/src/components/provider/index.js +3 -1
  367. package/src/components/recursion-provider/README.md +2 -2
  368. package/src/components/recursion-provider/index.js +17 -0
  369. package/src/components/rich-text/index.js +48 -10
  370. package/src/components/rich-text/native/index.native.js +10 -10
  371. package/src/components/use-block-drop-zone/index.js +60 -19
  372. package/src/components/use-block-drop-zone/test/index.js +32 -61
  373. package/src/components/use-on-block-drop/index.js +92 -11
  374. package/src/hooks/block-hooks.js +5 -17
  375. package/src/hooks/content-lock-ui.js +15 -55
  376. package/src/hooks/dimensions.js +74 -3
  377. package/src/hooks/effects.js +57 -0
  378. package/src/hooks/index.js +4 -2
  379. package/src/hooks/index.native.js +1 -0
  380. package/src/hooks/style.js +12 -0
  381. package/src/hooks/supports.js +2 -0
  382. package/src/hooks/test/effects.js +39 -0
  383. package/src/hooks/typography.native.js +2 -2
  384. package/src/hooks/use-bindings-attributes.js +148 -0
  385. package/src/hooks/use-shadow-props.js +37 -0
  386. package/src/hooks/utils.js +30 -10
  387. package/src/index.js +2 -0
  388. package/src/store/actions.js +9 -4
  389. package/src/store/index.js +2 -0
  390. package/src/store/private-actions.js +32 -0
  391. package/src/store/private-selectors.js +78 -21
  392. package/src/store/reducer.js +49 -2
  393. package/src/store/resolvers.js +17 -0
  394. package/src/store/selectors.js +169 -161
  395. package/src/store/test/registry-selectors.js +431 -0
  396. package/src/store/test/selectors.js +14 -400
  397. package/src/store/utils.js +10 -33
  398. package/src/style.scss +0 -1
  399. package/src/utils/index.js +0 -1
  400. package/src/utils/math.js +12 -0
  401. package/src/utils/object.js +16 -0
  402. package/src/utils/transform-styles/index.js +52 -37
  403. package/tsconfig.tsbuildinfo +1 -1
  404. package/build/components/iframe/use-compatibility-styles.js +0 -100
  405. package/build/components/iframe/use-compatibility-styles.js.map +0 -1
  406. package/build/hooks/custom-fields.js +0 -106
  407. package/build/hooks/custom-fields.js.map +0 -1
  408. package/build/utils/block-variation-transforms.js +0 -42
  409. package/build/utils/block-variation-transforms.js.map +0 -1
  410. package/build-module/components/iframe/use-compatibility-styles.js +0 -94
  411. package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
  412. package/build-module/hooks/custom-fields.js +0 -99
  413. package/build-module/hooks/custom-fields.js.map +0 -1
  414. package/build-module/utils/block-variation-transforms.js +0 -35
  415. package/build-module/utils/block-variation-transforms.js.map +0 -1
  416. package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
  417. package/src/components/contrast-checker/style.scss +0 -3
  418. package/src/components/iframe/use-compatibility-styles.js +0 -122
  419. package/src/hooks/custom-fields.js +0 -115
  420. package/src/utils/block-variation-transforms.js +0 -38
  421. package/src/utils/test/block-variation-transforms.js +0 -94
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,kBAAkB,GAAG,sBAAsB;AACjD,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,6BAA6B,GAAG,iBAAiB;AACvD,MAAMC,uBAAuB,GAAG,qCAAqC;AACrE,MAAMC,qBAAqB,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,oCAAoC;AACnE;AACA;AACA;AACA,MAAMC,uBAAuB,GAAG,qCAAqC;AACrE;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,wBAAwB;AACzD;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,yCAAyC;AAC7E;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,sCAAsC;AACvE;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,wCAAwC;;AAE3E;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,wCAAwC;AAC3E,MAAMC,kBAAkB,GAAG,QAAQ;AACnC,MAAMC,uBAAuB,GAAG,CAC/BT,uBAAuB,EACvBD,qBAAqB,EACrBE,sBAAsB,EACtB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U,IAC1CF,gBAAgB,CAACwC,IAAI,CAAIC,GAAG,IAAM,IAAAtC,uBAAe,EAAED,UAAU,EAAEuC,GAAI,CAAE,CAAC;AAACrC,OAAA,CAAAmC,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_blocks","require","_element","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,GAAG,OAAO;AACjC,MAAMC,sBAAsB,GAAG,WAAW;AAC1C,MAAMC,kBAAkB,GAAG,sBAAsB;AACjD,MAAMC,iBAAiB,GAAG,OAAO;AACjC,MAAMC,6BAA6B,GAAG,iBAAiB;AACvD,MAAMC,uBAAuB,GAAG,qCAAqC;AACrE,MAAMC,qBAAqB,GAAG,qBAAqB;AACnD,MAAMC,uBAAuB,GAAG,uBAAuB;AACvD;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,oCAAoC;AACnE;AACA;AACA;AACA,MA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IAAAI,uBAAe,EAAEJ,UAAU,EAAEf,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AALAiB,OAAA,CAAAgC,kBAAA,GAAAA,kBAAA;AAMO,MAAMC,gBAAgB,GAAKnC,UAAU,IAC3C,IAAAC,uBAAe,EAAED,UAAU,EAAEN,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AALAQ,OAAA,CAAAiC,gBAAA,GAAAA,gBAAA;AAMO,MAAMC,gBAAgB,GAAKpC,UAAU,IAC3C,IAAAI,uBAAe,EAAEJ,UAAU,EAAEN,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AALAQ,OAAA,CAAAkC,gBAAA,GAAAA,gBAAA;AAMO,MAAMC,eAAe,GAAKrC,UAAU,IAC1CF,gBAAgB,CAACwC,IAAI,CAAIC,GAAG,IAAM,IAAAtC,uBAAe,EAAED,UAAU,EAAEuC,GAAI,CAAE,CAAC;AAACrC,OAAA,CAAAmC,eAAA,GAAAA,eAAA"}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.TypographyPanel = exports.TYPOGRAPHY_SUPPORT_KEYS = exports.TYPOGRAPHY_SUPPORT_KEY = void 0;
8
8
  var _react = require("react");
9
9
  var _data = require("@wordpress/data");
10
- var _compose = require("@wordpress/compose");
10
+ var _element = require("@wordpress/element");
11
11
  var _components = require("@wordpress/components");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _inspectorControls = _interopRequireDefault(require("../components/inspector-controls"));
@@ -71,6 +71,6 @@ function TypographyPanelPure({
71
71
  // We don't want block controls to re-render when typing inside a block. `pure`
72
72
  // will prevent re-renders unless props change, so only pass the needed props
73
73
  // and not the whole attributes object.
74
- const TypographyPanel = (0, _compose.pure)(TypographyPanelPure);
74
+ const TypographyPanel = (0, _element.memo)(TypographyPanelPure);
75
75
  exports.TypographyPanel = TypographyPanel;
76
76
  //# sourceMappingURL=typography.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_components","_i18n","_inspectorControls","_interopRequireDefault","_typographyPanel","_store","_lineHeight","_fontSize","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","TypographyPanelPure","clientId","setAttributes","settings","selector","select","style","fontFamily","fontSize","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","props","attributes","_react","createElement","default","PanelBody","title","__","FontSizeEdit","LineHeightEdit","TypographyPanel","pure"],"sources":["@wordpress/block-editor/src/hooks/typography.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { pure } from '@wordpress/compose';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport { useHasTypographyPanel } from '../components/global-styles/typography-panel';\n\nimport { store as blockEditorStore } from '../store';\n\nimport { LINE_HEIGHT_SUPPORT_KEY, LineHeightEdit } from './line-height';\nimport { FONT_SIZE_SUPPORT_KEY, FontSizeEdit } from './font-size';\n\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n];\n\nfunction TypographyPanelPure( { clientId, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst props = {\n\t\tattributes: {\n\t\t\tfontSize,\n\t\t\tstyle,\n\t\t},\n\t\tsetAttributes,\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Typography' ) }>\n\t\t\t\t<FontSizeEdit { ...props } />\n\t\t\t\t<LineHeightEdit { ...props } />\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\n// We don't want block controls to re-render when typing inside a block. `pure`\n// will prevent re-renders unless props change, so only pass the needed props\n// and not the whole attributes object.\nexport const TypographyPanel = pure( TypographyPanelPure );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAEA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAjBA;AACA;AACA;;AAMA;AACA;AACA;;AASO,MAAMU,sBAAsB,GAAG,YAAY;AAACC,OAAA,CAAAD,sBAAA,GAAAA,sBAAA;AAC5C,MAAME,uBAAuB,GAAG,CACtCC,mCAAuB,EACvBC,+BAAqB,CACrB;AAACH,OAAA,CAAAC,uBAAA,GAAAA,uBAAA;AAEF,SAASG,mBAAmBA,CAAE;EAAEC,QAAQ;EAAEC,aAAa;EAAEC;AAAS,CAAC,EAAG;EACrE,SAASC,QAAQA,CAAEC,MAAM,EAAG;IAC3B,MAAM;MAAEC,KAAK;MAAEC,UAAU;MAAEC;IAAS,CAAC,GACpCH,MAAM,CAAEI,YAAiB,CAAC,CAACC,kBAAkB,CAAET,QAAS,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO;MAAEK,KAAK;MAAEC,UAAU;MAAEC;IAAS,CAAC;EACvC;EACA,MAAM;IAAEF,KAAK;IAAEE;EAAS,CAAC,GAAG,IAAAG,eAAS,EAAEP,QAAQ,EAAE,CAAEH,QAAQ,CAAG,CAAC;EAC/D,MAAMW,SAAS,GAAG,IAAAC,sCAAqB,EAAEV,QAAS,CAAC;EAEnD,IAAK,CAAES,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAME,KAAK,GAAG;IACbC,UAAU,EAAE;MACXP,QAAQ;MACRF;IACD,CAAC;IACDJ;EACD,CAAC;EAED,OACC,IAAAc,MAAA,CAAAC,aAAA,EAAC5B,kBAAA,CAAA6B,OAAiB,QACjB,IAAAF,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAAgC,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa;EAAG,GACtC,IAAAL,MAAA,CAAAC,aAAA,EAACvB,SAAA,CAAA4B,YAAY;IAAA,GAAMR;EAAK,CAAI,CAAC,EAC7B,IAAAE,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA8B,cAAc;IAAA,GAAMT;EAAK,CAAI,CACpB,CACO,CAAC;AAEtB;;AAEA;AACA;AACA;AACO,MAAMU,eAAe,GAAG,IAAAC,aAAI,EAAEzB,mBAAoB,CAAC;AAACJ,OAAA,CAAA4B,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_data","require","_element","_components","_i18n","_inspectorControls","_interopRequireDefault","_typographyPanel","_store","_lineHeight","_fontSize","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","TypographyPanelPure","clientId","setAttributes","settings","selector","select","style","fontFamily","fontSize","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","props","attributes","_react","createElement","default","PanelBody","title","__","FontSizeEdit","LineHeightEdit","TypographyPanel","memo"],"sources":["@wordpress/block-editor/src/hooks/typography.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { memo } from '@wordpress/element';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport { useHasTypographyPanel } from '../components/global-styles/typography-panel';\n\nimport { store as blockEditorStore } from '../store';\n\nimport { LINE_HEIGHT_SUPPORT_KEY, LineHeightEdit } from './line-height';\nimport { FONT_SIZE_SUPPORT_KEY, FontSizeEdit } from './font-size';\n\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n];\n\nfunction TypographyPanelPure( { clientId, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst props = {\n\t\tattributes: {\n\t\t\tfontSize,\n\t\t\tstyle,\n\t\t},\n\t\tsetAttributes,\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Typography' ) }>\n\t\t\t\t<FontSizeEdit { ...props } />\n\t\t\t\t<LineHeightEdit { ...props } />\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\n// We don't want block controls to re-render when typing inside a block. `pure`\n// will prevent re-renders unless props change, so only pass the needed props\n// and not the whole attributes object.\nexport const TypographyPanel = memo( TypographyPanelPure );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,O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7B,IAAAE,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA8B,cAAc;IAAA,GAAMT;EAAK,CAAI,CACpB,CACO,CAAC;AAEtB;;AAEA;AACA;AACA;AACO,MAAMU,eAAe,GAAG,IAAAC,aAAI,EAAEzB,mBAAoB,CAAC;AAACJ,OAAA,CAAA4B,eAAA,GAAAA,eAAA"}
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ var _react = require("react");
4
+ var _blocks = require("@wordpress/blocks");
5
+ var _compose = require("@wordpress/compose");
6
+ var _data = require("@wordpress/data");
7
+ var _hooks = require("@wordpress/hooks");
8
+ var _store = require("../store");
9
+ var _context = require("../components/block-edit/context");
10
+ var _lockUnlock = require("../lock-unlock");
11
+ /**
12
+ * WordPress dependencies
13
+ */
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+
19
+ /** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */
20
+ /** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */
21
+
22
+ /**
23
+ * Given a binding of block attributes, returns a higher order component that
24
+ * overrides its `attributes` and `setAttributes` props to sync any changes needed.
25
+ *
26
+ * @return {WPHigherOrderComponent} Higher-order component.
27
+ */
28
+
29
+ const BLOCK_BINDINGS_ALLOWED_BLOCKS = {
30
+ 'core/paragraph': ['content'],
31
+ 'core/heading': ['content'],
32
+ 'core/image': ['url', 'title', 'alt'],
33
+ 'core/button': ['url', 'text', 'linkTarget']
34
+ };
35
+ const createEditFunctionWithBindingsAttribute = () => (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
36
+ const {
37
+ clientId,
38
+ name: blockName
39
+ } = (0, _context.useBlockEditContext)();
40
+ const {
41
+ getBlockBindingsSource
42
+ } = (0, _lockUnlock.unlock)((0, _data.useSelect)(_store.store));
43
+ const {
44
+ getBlockAttributes,
45
+ updateBlockAttributes
46
+ } = (0, _data.useSelect)(_store.store);
47
+ const updatedAttributes = getBlockAttributes(clientId);
48
+ if (updatedAttributes?.metadata?.bindings) {
49
+ Object.entries(updatedAttributes.metadata.bindings).forEach(([attributeName, settings]) => {
50
+ const source = getBlockBindingsSource(settings.source.name);
51
+ if (source) {
52
+ // Second argument (`updateMetaValue`) will be used to update the value in the future.
53
+ const {
54
+ placeholder,
55
+ useValue: [metaValue = null] = []
56
+ } = source.useSource(props, settings.source.attributes);
57
+ if (placeholder && !metaValue) {
58
+ // If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.
59
+ // Adding this workaround until attributes and metadata fields types are improved and include `url`.
60
+ const htmlAttribute = (0, _blocks.getBlockType)(blockName).attributes[attributeName].attribute;
61
+ if (htmlAttribute === 'src' || htmlAttribute === 'href') {
62
+ updatedAttributes[attributeName] = null;
63
+ } else {
64
+ updatedAttributes[attributeName] = placeholder;
65
+ }
66
+ }
67
+ if (metaValue) {
68
+ updatedAttributes[attributeName] = metaValue;
69
+ }
70
+ }
71
+ });
72
+ }
73
+ const registry = (0, _data.useRegistry)();
74
+ return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
75
+ key: "edit",
76
+ attributes: updatedAttributes,
77
+ setAttributes: (newAttributes, blockId) => registry.batch(() => updateBlockAttributes(blockId, newAttributes)),
78
+ ...props
79
+ }));
80
+ }, 'useBoundAttributes');
81
+
82
+ /**
83
+ * Filters a registered block's settings to enhance a block's `edit` component
84
+ * to upgrade bound attributes.
85
+ *
86
+ * @param {WPBlockSettings} settings Registered block settings.
87
+ *
88
+ * @return {WPBlockSettings} Filtered block settings.
89
+ */
90
+ function shimAttributeSource(settings) {
91
+ if (!(settings.name in BLOCK_BINDINGS_ALLOWED_BLOCKS)) {
92
+ return settings;
93
+ }
94
+ settings.edit = createEditFunctionWithBindingsAttribute()(settings.edit);
95
+ return settings;
96
+ }
97
+ (0, _hooks.addFilter)('blocks.registerBlockType', 'core/editor/custom-sources-backwards-compatibility/shim-attribute-source', shimAttributeSource);
98
+
99
+ // Add the context to all blocks.
100
+ (0, _hooks.addFilter)('blocks.registerBlockType', 'core/block-bindings-ui', (settings, name) => {
101
+ if (!(name in BLOCK_BINDINGS_ALLOWED_BLOCKS)) {
102
+ return settings;
103
+ }
104
+ const contextItems = ['postId', 'postType', 'queryId'];
105
+ const usesContextArray = settings.usesContext;
106
+ const oldUsesContextArray = new Set(usesContextArray);
107
+ contextItems.forEach(item => {
108
+ if (!oldUsesContextArray.has(item)) {
109
+ usesContextArray.push(item);
110
+ }
111
+ });
112
+ settings.usesContext = usesContextArray;
113
+ return settings;
114
+ });
115
+ //# sourceMappingURL=use-bindings-attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_blocks","require","_compose","_data","_hooks","_store","_context","_lockUnlock","BLOCK_BINDINGS_ALLOWED_BLOCKS","createEditFunctionWithBindingsAttribute","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","useBlockEditContext","getBlockBindingsSource","unlock","useSelect","blockEditorStore","getBlockAttributes","updateBlockAttributes","updatedAttributes","metadata","bindings","Object","entries","forEach","attributeName","settings","source","placeholder","useValue","metaValue","useSource","attributes","htmlAttribute","getBlockType","attribute","registry","useRegistry","_react","createElement","Fragment","key","setAttributes","newAttributes","blockId","batch","shimAttributeSource","edit","addFilter","contextItems","usesContextArray","usesContext","oldUsesContextArray","Set","item","has","push"],"sources":["@wordpress/block-editor/src/hooks/use-bindings-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit/context';\nimport { unlock } from '../lock-unlock';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Given a binding of block attributes, returns a higher order component that\n * overrides its `attributes` and `setAttributes` props to sync any changes needed.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\n\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget' ],\n};\n\nconst createEditFunctionWithBindingsAttribute = () =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) => ( props ) => {\n\t\t\tconst { clientId, name: blockName } = useBlockEditContext();\n\t\t\tconst { getBlockBindingsSource } = unlock(\n\t\t\t\tuseSelect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getBlockAttributes, updateBlockAttributes } =\n\t\t\t\tuseSelect( blockEditorStore );\n\n\t\t\tconst updatedAttributes = getBlockAttributes( clientId );\n\t\t\tif ( updatedAttributes?.metadata?.bindings ) {\n\t\t\t\tObject.entries( updatedAttributes.metadata.bindings ).forEach(\n\t\t\t\t\t( [ attributeName, settings ] ) => {\n\t\t\t\t\t\tconst source = getBlockBindingsSource(\n\t\t\t\t\t\t\tsettings.source.name\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( source ) {\n\t\t\t\t\t\t\t// Second argument (`updateMetaValue`) will be used to update the value in the future.\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tplaceholder,\n\t\t\t\t\t\t\t\tuseValue: [ metaValue = null ] = [],\n\t\t\t\t\t\t\t} = source.useSource(\n\t\t\t\t\t\t\t\tprops,\n\t\t\t\t\t\t\t\tsettings.source.attributes\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( placeholder && ! metaValue ) {\n\t\t\t\t\t\t\t\t// If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.\n\t\t\t\t\t\t\t\t// Adding this workaround until attributes and metadata fields types are improved and include `url`.\n\t\t\t\t\t\t\t\tconst htmlAttribute =\n\t\t\t\t\t\t\t\t\tgetBlockType( blockName ).attributes[\n\t\t\t\t\t\t\t\t\t\tattributeName\n\t\t\t\t\t\t\t\t\t].attribute;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\thtmlAttribute === 'src' ||\n\t\t\t\t\t\t\t\t\thtmlAttribute === 'href'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] = null;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] =\n\t\t\t\t\t\t\t\t\t\tplaceholder;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( metaValue ) {\n\t\t\t\t\t\t\t\tupdatedAttributes[ attributeName ] = metaValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst registry = useRegistry();\n\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t\tattributes={ updatedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( newAttributes, blockId ) =>\n\t\t\t\t\t\t\tregistry.batch( () =>\n\t\t\t\t\t\t\t\tupdateBlockAttributes( blockId, newAttributes )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t},\n\t\t'useBoundAttributes'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade bound attributes.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\tif ( ! ( settings.name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {\n\t\treturn settings;\n\t}\n\tsettings.edit = createEditFunctionWithBindingsAttribute()( settings.edit );\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// Add the context to all blocks.\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/block-bindings-ui',\n\t( settings, name ) => {\n\t\tif ( ! ( name in BLOCK_BINDINGS_ALLOWED_BLOCKS ) ) {\n\t\t\treturn settings;\n\t\t}\n\t\tconst contextItems = [ 'postId', 'postType', 'queryId' ];\n\t\tconst usesContextArray = settings.usesContext;\n\t\tconst oldUsesContextArray = new Set( usesContextArray );\n\t\tcontextItems.forEach( ( item ) => {\n\t\t\tif ( ! oldUsesContextArray.has( item ) ) {\n\t\t\t\tusesContextArray.push( item );\n\t\t\t}\n\t\t} );\n\t\tsettings.usesContext = usesContextArray;\n\t\treturn settings;\n\t}\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMO,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EACvC,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY;AAC7C,CAAC;AAED,MAAMC,uCAAuC,GAAGA,CAAA,KAC/C,IAAAC,mCAA0B,EACvBC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC,IAAI,EAAEC;EAAU,CAAC,GAAG,IAAAC,4BAAmB,EAAC,CAA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,IAAK,CAAC;IAC9B;EACD,CAAE,CAAC;EACH5B,QAAQ,CAACyB,WAAW,GAAGD,gBAAgB;EACvC,OAAOxB,QAAQ;AAChB,CACD,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getShadowClassesAndStyles = getShadowClassesAndStyles;
7
+ exports.useShadowProps = useShadowProps;
8
+ var _style = require("./style");
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+
13
+ // This utility is intended to assist where the serialization of the shadow
14
+ // block support is being skipped for a block but the shadow related CSS classes
15
+ // & styles still need to be generated so they can be applied to inner elements.
16
+
17
+ /**
18
+ * Provides the CSS class names and inline styles for a block's shadow support
19
+ * attributes.
20
+ *
21
+ * @param {Object} attributes Block attributes.
22
+ * @return {Object} Shadow block support derived CSS classes & styles.
23
+ */
24
+ function getShadowClassesAndStyles(attributes) {
25
+ const shadow = attributes.style?.shadow || '';
26
+ return {
27
+ className: undefined,
28
+ style: (0, _style.getInlineStyles)({
29
+ shadow
30
+ })
31
+ };
32
+ }
33
+
34
+ /**
35
+ * Derives the shadow related props for a block from its shadow block support
36
+ * attributes.
37
+ *
38
+ * @param {Object} attributes Block attributes.
39
+ *
40
+ * @return {Object} ClassName & style props from shadow block support.
41
+ */
42
+ function useShadowProps(attributes) {
43
+ const shadowProps = getShadowClassesAndStyles(attributes);
44
+ return shadowProps;
45
+ }
46
+ //# sourceMappingURL=use-shadow-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_style","require","getShadowClassesAndStyles","attributes","shadow","style","className","undefined","getInlineStyles","useShadowProps","shadowProps"],"sources":["@wordpress/block-editor/src/hooks/use-shadow-props.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\n\n// This utility is intended to assist where the serialization of the shadow\n// block support is being skipped for a block but the shadow related CSS classes\n// & styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's shadow support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @return {Object} Shadow block support derived CSS classes & styles.\n */\nexport function getShadowClassesAndStyles( attributes ) {\n\tconst shadow = attributes.style?.shadow || '';\n\n\treturn {\n\t\tclassName: undefined,\n\t\tstyle: getInlineStyles( { shadow } ),\n\t};\n}\n\n/**\n * Derives the shadow related props for a block from its shadow block support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} ClassName & style props from shadow block support.\n */\nexport function useShadowProps( attributes ) {\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\treturn shadowProps;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CAAEC,UAAU,EAAG;EACvD,MAAMC,MAAM,GAAGD,UAAU,CAACE,KAAK,EAAED,MAAM,IAAI,EAAE;EAE7C,OAAO;IACNE,SAAS,EAAEC,SAAS;IACpBF,KAAK,EAAE,IAAAG,sBAAe,EAAE;MAAEJ;IAAO,CAAE;EACpC,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,cAAcA,CAAEN,UAAU,EAAG;EAC5C,MAAMO,WAAW,GAAGR,yBAAyB,CAAEC,UAAW,CAAC;EAC3D,OAAOO,WAAW;AACnB"}
@@ -149,7 +149,7 @@ function useStyleOverride({
149
149
  * @return {Object} Settings object.
150
150
  */
151
151
  function useBlockSettings(name, parentLayout) {
152
- const [backgroundImage, backgroundSize, fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, writingMode, textTransform, letterSpacing, padding, margin, blockGap, spacingSizes, units, minHeight, layout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled] = (0, _components.useSettings)('background.backgroundImage', 'background.backgroundSize', 'typography.fontFamilies', 'typography.fontSizes', 'typography.customFontSize', 'typography.fontStyle', 'typography.fontWeight', 'typography.lineHeight', 'typography.textColumns', 'typography.textDecoration', 'typography.writingMode', 'typography.textTransform', 'typography.letterSpacing', 'spacing.padding', 'spacing.margin', 'spacing.blockGap', 'spacing.spacingSizes', 'spacing.units', 'dimensions.minHeight', 'layout', 'border.color', 'border.radius', 'border.style', 'border.width', 'color.custom', 'color.palette.custom', 'color.customDuotone', 'color.palette.theme', 'color.palette.default', 'color.defaultPalette', 'color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default', 'color.defaultGradients', 'color.customGradient', 'color.background', 'color.link', 'color.text', 'color.heading', 'color.button');
152
+ const [backgroundImage, backgroundSize, fontFamilies, userFontSizes, themeFontSizes, defaultFontSizes, defaultFontSizesEnabled, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, writingMode, textTransform, letterSpacing, padding, margin, blockGap, spacingSizes, units, aspectRatio, minHeight, layout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow] = (0, _components.useSettings)('background.backgroundImage', 'background.backgroundSize', 'typography.fontFamilies', 'typography.fontSizes.custom', 'typography.fontSizes.theme', 'typography.fontSizes.default', 'typography.defaultFontSizes', 'typography.customFontSize', 'typography.fontStyle', 'typography.fontWeight', 'typography.lineHeight', 'typography.textColumns', 'typography.textDecoration', 'typography.writingMode', 'typography.textTransform', 'typography.letterSpacing', 'spacing.padding', 'spacing.margin', 'spacing.blockGap', 'spacing.spacingSizes', 'spacing.units', 'dimensions.aspectRatio', 'dimensions.minHeight', 'layout', 'border.color', 'border.radius', 'border.style', 'border.width', 'color.custom', 'color.palette.custom', 'color.customDuotone', 'color.palette.theme', 'color.palette.default', 'color.defaultPalette', 'color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default', 'color.defaultGradients', 'color.customGradient', 'color.background', 'color.link', 'color.text', 'color.heading', 'color.button', 'shadow');
153
153
  const rawSettings = (0, _element.useMemo)(() => {
154
154
  return {
155
155
  background: {
@@ -189,9 +189,12 @@ function useBlockSettings(name, parentLayout) {
189
189
  custom: fontFamilies
190
190
  },
191
191
  fontSizes: {
192
- custom: fontSizes
192
+ custom: userFontSizes,
193
+ theme: themeFontSizes,
194
+ default: defaultFontSizes
193
195
  },
194
196
  customFontSize,
197
+ defaultFontSizes: defaultFontSizesEnabled,
195
198
  fontStyle,
196
199
  fontWeight,
197
200
  lineHeight,
@@ -217,22 +220,24 @@ function useBlockSettings(name, parentLayout) {
217
220
  width: borderWidth
218
221
  },
219
222
  dimensions: {
223
+ aspectRatio,
220
224
  minHeight
221
225
  },
222
226
  layout,
223
- parentLayout
227
+ parentLayout,
228
+ shadow
224
229
  };
225
- }, [backgroundImage, backgroundSize, fontFamilies, fontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, writingMode, padding, margin, blockGap, spacingSizes, units, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled]);
230
+ }, [backgroundImage, backgroundSize, fontFamilies, userFontSizes, themeFontSizes, defaultFontSizes, defaultFontSizesEnabled, customFontSize, fontStyle, fontWeight, lineHeight, textColumns, textDecoration, textTransform, letterSpacing, writingMode, padding, margin, blockGap, spacingSizes, units, aspectRatio, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow]);
226
231
  return (0, _hooks2.useSettingsForBlockElement)(rawSettings, name);
227
232
  }
228
233
  function createBlockEditFilter(features) {
229
234
  // We don't want block controls to re-render when typing inside a block.
230
- // `pure` will prevent re-renders unless props change, so only pass the
235
+ // `memo` will prevent re-renders unless props change, so only pass the
231
236
  // needed props and not the whole attributes object.
232
237
  features = features.map(settings => {
233
238
  return {
234
239
  ...settings,
235
- Edit: (0, _compose.pure)(settings.edit)
240
+ Edit: (0, _element.memo)(settings.edit)
236
241
  };
237
242
  });
238
243
  const withBlockEditHooks = (0, _compose.createHigherOrderComponent)(OriginalBlockEdit => props => {
@@ -304,7 +309,7 @@ function BlockProps({
304
309
  });
305
310
  return null;
306
311
  }
307
- const BlockPropsPure = (0, _compose.pure)(BlockProps);
312
+ const BlockPropsPure = (0, _element.memo)(BlockProps);
308
313
  function createBlockListBlockFilter(features) {
309
314
  const withBlockListBlockHooks = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
310
315
  const [allWrapperProps, setAllWrapperProps] = (0, _element.useState)(Array(features.length).fill(undefined));
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_classnames","_interopRequireDefault","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","useStyleOverride","id","css","assets","__unstableType","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","fallbackId","useId","useEffect","_id","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","spacing","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","pure","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","_react","createElement","isSelected","clientId","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","keys","Boolean","reduce","acc","className","classnames","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { createHigherOrderComponent, pure } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\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\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\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 (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\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\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\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: setImmutably(\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} blockNameOrType 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(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, 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\nexport function useStyleOverride( { id, css, assets, __unstableType } = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) return;\n\t\tconst _id = id || fallbackId;\n\t\tsetStyleOverride( _id, {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t} );\n\t\treturn () => {\n\t\t\tdeleteStyleOverride( _id );\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies',\n\t\t'typography.fontSizes',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.spacingSizes',\n\t\t'spacing.units',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `pure` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: pure( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = pure( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAzBA;AACA;AACA;;AAOA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMa,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EACtB;IACD,OAAOA,MAAM;EACd;EAEA,MAAMG,oBAAoB,GAAGC,MAAM,CAAC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CAACqC,SAAS;IACvB;IAEA,OAAOrC,KAAK;EACb,CACD,CAAC;AACF"}
1
+ {"version":3,"names":["_blocks","require","_element","_data","_compose","_hooks","_context","_components","_hooks2","_object","_store","_lockUnlock","_classnames","_interopRequireDefault","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","exports","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","getValueFromObjectPath","setImmutably","shouldSkipSerialization","blockNameOrType","featureSet","feature","getBlockSupport","skipSerialization","__experimentalSkipSerialization","includes","useStyleOverride","id","css","assets","__unstableType","setStyleOverride","deleteStyleOverride","unlock","useDispatch","blockEditorStore","fallbackId","useId","useEffect","_id","useBlockSettings","name","parentLayout","backgroundImage","backgroundSize","fontFamilies","userFontSizes","themeFontSizes","defaultFontSizes","defaultFontSizesEnabled","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","aspectRatio","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","shadow","useSettings","rawSettings","useMemo","background","color","palette","custom","theme","default","gradients","duotone","customGradient","link","heading","button","text","typography","fontSizes","spacing","border","radius","style","width","dimensions","useSettingsForBlockElement","createBlockEditFilter","features","settings","Edit","memo","edit","withBlockEditHooks","createHigherOrderComponent","OriginalBlockEdit","props","context","useBlockEditContext","i","hasSupport","attributeKeys","shareWithChildBlocks","shouldDisplayControls","mayDisplayControlsKey","mayDisplayParentControlsKey","neededProps","_react","createElement","isSelected","clientId","setAttributes","__unstableParentLayout","addFilter","BlockProps","useBlockProps","setAllWrapperProps","wrapperProps","setWrapperProps","next","prev","nextAll","BlockPropsPure","createBlockListBlockFilter","withBlockListBlockHooks","BlockListBlock","allWrapperProps","useState","fill","keys","Boolean","reduce","acc","className","classnames","createBlockSaveFilter","extraPropsFromHooks","accu","addSaveProps","neededAttributes","hasOwnProperty"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseBlockEditContext,\n\tmayDisplayControlsKey,\n\tmayDisplayParentControlsKey,\n} from '../components/block-edit/context';\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\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\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\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 (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\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\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\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: setImmutably(\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} blockNameOrType 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(\n\tblockNameOrType,\n\tfeatureSet,\n\tfeature\n) {\n\tconst support = getBlockSupport( blockNameOrType, 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\nexport function useStyleOverride( { id, css, assets, __unstableType } = {} ) {\n\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst fallbackId = useId();\n\tuseEffect( () => {\n\t\t// Unmount if there is CSS and assets are empty.\n\t\tif ( ! css && ! assets ) return;\n\t\tconst _id = id || fallbackId;\n\t\tsetStyleOverride( _id, {\n\t\t\tid,\n\t\t\tcss,\n\t\t\tassets,\n\t\t\t__unstableType,\n\t\t} );\n\t\treturn () => {\n\t\t\tdeleteStyleOverride( _id );\n\t\t};\n\t}, [\n\t\tid,\n\t\tcss,\n\t\tassets,\n\t\t__unstableType,\n\t\tfallbackId,\n\t\tsetStyleOverride,\n\t\tdeleteStyleOverride,\n\t] );\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tfontFamilies,\n\t\tuserFontSizes,\n\t\tthemeFontSizes,\n\t\tdefaultFontSizes,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] = useSettings(\n\t\t'background.backgroundImage',\n\t\t'background.backgroundSize',\n\t\t'typography.fontFamilies',\n\t\t'typography.fontSizes.custom',\n\t\t'typography.fontSizes.theme',\n\t\t'typography.fontSizes.default',\n\t\t'typography.defaultFontSizes',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.spacingSizes',\n\t\t'spacing.units',\n\t\t'dimensions.aspectRatio',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button',\n\t\t'shadow'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tbackground: {\n\t\t\t\tbackgroundImage,\n\t\t\t\tbackgroundSize,\n\t\t\t},\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: userFontSizes,\n\t\t\t\t\ttheme: themeFontSizes,\n\t\t\t\t\tdefault: defaultFontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tdefaultFontSizes: defaultFontSizesEnabled,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\taspectRatio,\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t\tshadow,\n\t\t};\n\t}, [\n\t\tbackgroundImage,\n\t\tbackgroundSize,\n\t\tfontFamilies,\n\t\tuserFontSizes,\n\t\tthemeFontSizes,\n\t\tdefaultFontSizes,\n\t\tdefaultFontSizesEnabled,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\taspectRatio,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t\tshadow,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n\nexport function createBlockEditFilter( features ) {\n\t// We don't want block controls to re-render when typing inside a block.\n\t// `memo` will prevent re-renders unless props change, so only pass the\n\t// needed props and not the whole attributes object.\n\tfeatures = features.map( ( settings ) => {\n\t\treturn { ...settings, Edit: memo( settings.edit ) };\n\t} );\n\tconst withBlockEditHooks = createHigherOrderComponent(\n\t\t( OriginalBlockEdit ) => ( props ) => {\n\t\t\tconst context = useBlockEditContext();\n\t\t\t// CAUTION: code added before this line will be executed for all\n\t\t\t// blocks, not just those that support the feature! Code added\n\t\t\t// above this line should be carefully evaluated for its impact on\n\t\t\t// performance.\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tEdit,\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tshareWithChildBlocks,\n\t\t\t\t\t} = feature;\n\t\t\t\t\tconst shouldDisplayControls =\n\t\t\t\t\t\tcontext[ mayDisplayControlsKey ] ||\n\t\t\t\t\t\t( context[ mayDisplayParentControlsKey ] &&\n\t\t\t\t\t\t\tshareWithChildBlocks );\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! shouldDisplayControls ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Edit\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\tisSelected={ props.isSelected }\n\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\tsetAttributes={ props.setAttributes }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tprops.__unstableParentLayout\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<OriginalBlockEdit key=\"edit\" { ...props } />,\n\t\t\t];\n\t\t},\n\t\t'withBlockEditHooks'\n\t);\n\taddFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );\n}\n\nfunction BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {\n\tconst wrapperProps = useBlockProps( props );\n\tconst setWrapperProps = ( next ) =>\n\t\tsetAllWrapperProps( ( prev ) => {\n\t\t\tconst nextAll = [ ...prev ];\n\t\t\tnextAll[ index ] = next;\n\t\t\treturn nextAll;\n\t\t} );\n\t// Setting state after every render is fine because this component is\n\t// pure and will only re-render when needed props change.\n\tuseEffect( () => {\n\t\t// We could shallow compare the props, but since this component only\n\t\t// changes when needed attributes change, the benefit is probably small.\n\t\tsetWrapperProps( wrapperProps );\n\t\treturn () => {\n\t\t\tsetWrapperProps( undefined );\n\t\t};\n\t} );\n\treturn null;\n}\n\nconst BlockPropsPure = memo( BlockProps );\n\nexport function createBlockListBlockFilter( features ) {\n\tconst withBlockListBlockHooks = createHigherOrderComponent(\n\t\t( BlockListBlock ) => ( props ) => {\n\t\t\tconst [ allWrapperProps, setAllWrapperProps ] = useState(\n\t\t\t\tArray( features.length ).fill( undefined )\n\t\t\t);\n\t\t\treturn [\n\t\t\t\t...features.map( ( feature, i ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\thasSupport,\n\t\t\t\t\t\tattributeKeys = [],\n\t\t\t\t\t\tuseBlockProps,\n\t\t\t\t\t} = feature;\n\n\t\t\t\t\tconst neededProps = {};\n\t\t\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\t\t\tif ( props.attributes[ key ] ) {\n\t\t\t\t\t\t\tneededProps[ key ] = props.attributes[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t\t\t// set.\n\t\t\t\t\t\t! Object.keys( neededProps ).length ||\n\t\t\t\t\t\t! hasSupport( props.name )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<BlockPropsPure\n\t\t\t\t\t\t\t// We can use the index because the array length\n\t\t\t\t\t\t\t// is fixed per page load right now.\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tindex={ i }\n\t\t\t\t\t\t\tuseBlockProps={ useBlockProps }\n\t\t\t\t\t\t\t// This component is pure, so we must pass a stable\n\t\t\t\t\t\t\t// function reference.\n\t\t\t\t\t\t\tsetAllWrapperProps={ setAllWrapperProps }\n\t\t\t\t\t\t\tname={ props.name }\n\t\t\t\t\t\t\t// This component is pure, so only pass needed\n\t\t\t\t\t\t\t// props!!!\n\t\t\t\t\t\t\t{ ...neededProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t\t\t<BlockListBlock\n\t\t\t\t\tkey=\"edit\"\n\t\t\t\t\t{ ...props }\n\t\t\t\t\twrapperProps={ allWrapperProps\n\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t.reduce( ( acc, wrapperProps ) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t\t\t...wrapperProps,\n\t\t\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t\t\tacc.className,\n\t\t\t\t\t\t\t\t\twrapperProps.className\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t...acc.style,\n\t\t\t\t\t\t\t\t\t...wrapperProps.style,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}, props.wrapperProps || {} ) }\n\t\t\t\t/>,\n\t\t\t];\n\t\t},\n\t\t'withBlockListBlockHooks'\n\t);\n\taddFilter(\n\t\t'editor.BlockListBlock',\n\t\t'core/editor/hooks',\n\t\twithBlockListBlockHooks\n\t);\n}\n\nexport function createBlockSaveFilter( features ) {\n\tfunction extraPropsFromHooks( props, name, attributes ) {\n\t\treturn features.reduce( ( accu, feature ) => {\n\t\t\tconst { hasSupport, attributeKeys = [], addSaveProps } = feature;\n\n\t\t\tconst neededAttributes = {};\n\t\t\tfor ( const key of attributeKeys ) {\n\t\t\t\tif ( attributes[ key ] ) {\n\t\t\t\t\tneededAttributes[ key ] = attributes[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// Skip rendering if none of the needed attributes are\n\t\t\t\t// set.\n\t\t\t\t! Object.keys( neededAttributes ).length ||\n\t\t\t\t! hasSupport( name )\n\t\t\t) {\n\t\t\t\treturn accu;\n\t\t\t}\n\n\t\t\treturn addSaveProps( accu, name, neededAttributes );\n\t\t}, props );\n\t}\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\textraPropsFromHooks,\n\t\t0\n\t);\n\taddFilter(\n\t\t'blocks.getSaveContent.extraProps',\n\t\t'core/editor/hooks',\n\t\t( props ) => {\n\t\t\t// Previously we had a filter deleting the className if it was an empty\n\t\t\t// string. That filter is no longer running, so now we need to delete it\n\t\t\t// here.\n\t\t\tif ( props.hasOwnProperty( 'className' ) && ! props.className ) {\n\t\t\t\tdelete props.className;\n\t\t\t}\n\n\t\t\treturn props;\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,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A,CAAExC,KAAK,EAAErF,IAAI,EAAE/B,UAAU,EAAG;IACvD,OAAO4G,QAAQ,CAAC2C,MAAM,CAAE,CAAEM,IAAI,EAAElJ,OAAO,KAAM;MAC5C,MAAM;QAAE6G,UAAU;QAAEC,aAAa,GAAG,EAAE;QAAEqC;MAAa,CAAC,GAAGnJ,OAAO;MAEhE,MAAMoJ,gBAAgB,GAAG,CAAC,CAAC;MAC3B,KAAM,MAAMlL,GAAG,IAAI4I,aAAa,EAAG;QAClC,IAAKzH,UAAU,CAAEnB,GAAG,CAAE,EAAG;UACxBkL,gBAAgB,CAAElL,GAAG,CAAE,GAAGmB,UAAU,CAAEnB,GAAG,CAAE;QAC5C;MACD;MAEA;MACC;MACA;MACA,CAAEH,MAAM,CAAC2K,IAAI,CAAEU,gBAAiB,CAAC,CAAC9K,MAAM,IACxC,CAAEuI,UAAU,CAAEzF,IAAK,CAAC,EACnB;QACD,OAAO8H,IAAI;MACZ;MAEA,OAAOC,YAAY,CAAED,IAAI,EAAE9H,IAAI,EAAEgI,gBAAiB,CAAC;IACpD,CAAC,EAAE3C,KAAM,CAAC;EACX;EACA,IAAAiB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACnBuB,mBAAmB,EACnB,CACD,CAAC;EACD,IAAAvB,gBAAS,EACR,kCAAkC,EAClC,mBAAmB,EACjBjB,KAAK,IAAM;IACZ;IACA;IACA;IACA,IAAKA,KAAK,CAAC4C,cAAc,CAAE,WAAY,CAAC,IAAI,CAAE5C,KAAK,CAACqC,SAAS,EAAG;MAC/D,OAAOrC,KAAK,CAACqC,SAAS;IACvB;IAEA,OAAOrC,KAAK;EACb,CACD,CAAC;AACF"}
package/build/index.js CHANGED
@@ -12,6 +12,8 @@ var _exportNames = {
12
12
  __experimentalUseCustomSides: true,
13
13
  __experimentalGetSpacingClassesAndStyles: true,
14
14
  __experimentalGetGapCSSValue: true,
15
+ __experimentalGetShadowClassesAndStyles: true,
16
+ __experimentalUseShadowProps: true,
15
17
  useCachedTruthy: true,
16
18
  storeConfig: true,
17
19
  store: true,
@@ -42,6 +44,12 @@ Object.defineProperty(exports, "__experimentalGetGapCSSValue", {
42
44
  return _hooks.getGapCSSValue;
43
45
  }
44
46
  });
47
+ Object.defineProperty(exports, "__experimentalGetShadowClassesAndStyles", {
48
+ enumerable: true,
49
+ get: function () {
50
+ return _hooks.getShadowClassesAndStyles;
51
+ }
52
+ });
45
53
  Object.defineProperty(exports, "__experimentalGetSpacingClassesAndStyles", {
46
54
  enumerable: true,
47
55
  get: function () {
@@ -66,6 +74,12 @@ Object.defineProperty(exports, "__experimentalUseCustomSides", {
66
74
  return _hooks.useCustomSides;
67
75
  }
68
76
  });
77
+ Object.defineProperty(exports, "__experimentalUseShadowProps", {
78
+ enumerable: true,
79
+ get: function () {
80
+ return _hooks.useShadowProps;
81
+ }
82
+ });
69
83
  Object.defineProperty(exports, "getTypographyClassesAndStyles", {
70
84
  enumerable: true,
71
85
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_elements","_utils","_store","_defaults","_privateApis"],"sources":["@wordpress/block-editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\nexport {\n\tgetBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,\n\tuseBorderProps as __experimentalUseBorderProps,\n\tgetColorClassesAndStyles as __experimentalGetColorClassesAndStyles,\n\tgetTypographyClassesAndStyles,\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';\nexport { privateApis } from './private-apis';\n"],"mappings":";;;;;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AAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,MAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,MAAA,GAAAhB,OAAA;AACA,IAAAiB,SAAA,GAAAjB,OAAA;AACA,IAAAkB,YAAA,GAAAlB,OAAA"}
1
+ {"version":3,"names":["_hooks","require","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_elements","_utils","_store","_defaults","_privateApis"],"sources":["@wordpress/block-editor/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './hooks';\nexport {\n\tgetBorderClassesAndStyles as __experimentalGetBorderClassesAndStyles,\n\tuseBorderProps as __experimentalUseBorderProps,\n\tgetColorClassesAndStyles as __experimentalGetColorClassesAndStyles,\n\tgetTypographyClassesAndStyles,\n\tuseColorProps as __experimentalUseColorProps,\n\tuseCustomSides as __experimentalUseCustomSides,\n\tgetSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,\n\tgetGapCSSValue as __experimentalGetGapCSSValue,\n\tgetShadowClassesAndStyles as __experimentalGetShadowClassesAndStyles,\n\tuseShadowProps as __experimentalUseShadowProps,\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';\nexport { privateApis } from './private-apis';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAcA,IAAAC,WAA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