@wordpress/block-editor 12.16.1-next.79a6196f.0 → 12.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/CHANGELOG.md +6 -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-popover/inbetween.js +15 -3
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-preview/auto.js +1 -1
  26. package/build/components/block-preview/auto.js.map +1 -1
  27. package/build/components/block-removal-warning-modal/index.js +3 -2
  28. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  29. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
  30. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  31. package/build/components/block-switcher/block-transformations-menu.js +12 -1
  32. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  33. package/build/components/block-switcher/index.js +119 -90
  34. package/build/components/block-switcher/index.js.map +1 -1
  35. package/build/components/block-tools/insertion-point.js +10 -3
  36. package/build/components/block-tools/insertion-point.js.map +1 -1
  37. package/build/components/font-sizes/fluid-utils.js +7 -1
  38. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  39. package/build/components/global-styles/border-panel.js +5 -14
  40. package/build/components/global-styles/border-panel.js.map +1 -1
  41. package/build/components/global-styles/effects-panel.js +7 -1
  42. package/build/components/global-styles/effects-panel.js.map +1 -1
  43. package/build/components/iframe/get-compatibility-styles.js +99 -0
  44. package/build/components/iframe/get-compatibility-styles.js.map +1 -0
  45. package/build/components/iframe/index.js +2 -3
  46. package/build/components/iframe/index.js.map +1 -1
  47. package/build/components/index.js +16 -2
  48. package/build/components/index.js.map +1 -1
  49. package/build/components/index.native.js +16 -2
  50. package/build/components/index.native.js.map +1 -1
  51. package/build/components/inspector-controls/groups.js +2 -0
  52. package/build/components/inspector-controls/groups.js.map +1 -1
  53. package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
  54. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  55. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  56. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  57. package/build/components/link-control/link-preview.js +30 -26
  58. package/build/components/link-control/link-preview.js.map +1 -1
  59. package/build/components/link-control/search-input.js +1 -9
  60. package/build/components/link-control/search-input.js.map +1 -1
  61. package/build/components/list-view/block-contents.js +3 -1
  62. package/build/components/list-view/block-contents.js.map +1 -1
  63. package/build/components/list-view/block.js +10 -1
  64. package/build/components/list-view/block.js.map +1 -1
  65. package/build/components/list-view/branch.js +29 -8
  66. package/build/components/list-view/branch.js.map +1 -1
  67. package/build/components/list-view/drop-indicator.js +100 -32
  68. package/build/components/list-view/drop-indicator.js.map +1 -1
  69. package/build/components/list-view/index.js +52 -4
  70. package/build/components/list-view/index.js.map +1 -1
  71. package/build/components/list-view/leaf.js +2 -2
  72. package/build/components/list-view/leaf.js.map +1 -1
  73. package/build/components/list-view/use-list-view-block-indexes.js +30 -0
  74. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
  75. package/build/components/list-view/use-list-view-drop-zone.js +56 -5
  76. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  77. package/build/components/list-view/utils.js +92 -0
  78. package/build/components/list-view/utils.js.map +1 -1
  79. package/build/components/provider/index.js +1 -1
  80. package/build/components/provider/index.js.map +1 -1
  81. package/build/components/recursion-provider/index.js +21 -0
  82. package/build/components/recursion-provider/index.js.map +1 -1
  83. package/build/components/rich-text/index.js +30 -6
  84. package/build/components/rich-text/index.js.map +1 -1
  85. package/build/components/rich-text/native/index.native.js +9 -9
  86. package/build/components/rich-text/native/index.native.js.map +1 -1
  87. package/build/components/use-block-drop-zone/index.js +30 -7
  88. package/build/components/use-block-drop-zone/index.js.map +1 -1
  89. package/build/components/use-on-block-drop/index.js +50 -8
  90. package/build/components/use-on-block-drop/index.js.map +1 -1
  91. package/build/hooks/block-hooks.js +5 -14
  92. package/build/hooks/block-hooks.js.map +1 -1
  93. package/build/hooks/content-lock-ui.js +17 -42
  94. package/build/hooks/content-lock-ui.js.map +1 -1
  95. package/build/hooks/effects.js +66 -0
  96. package/build/hooks/effects.js.map +1 -0
  97. package/build/hooks/index.js +14 -0
  98. package/build/hooks/index.js.map +1 -1
  99. package/build/hooks/index.native.js +13 -0
  100. package/build/hooks/index.native.js.map +1 -1
  101. package/build/hooks/style.js +6 -2
  102. package/build/hooks/style.js.map +1 -1
  103. package/build/hooks/supports.js +2 -1
  104. package/build/hooks/supports.js.map +1 -1
  105. package/build/hooks/typography.native.js +2 -2
  106. package/build/hooks/typography.native.js.map +1 -1
  107. package/build/hooks/use-bindings-attributes.js +115 -0
  108. package/build/hooks/use-bindings-attributes.js.map +1 -0
  109. package/build/hooks/use-shadow-props.js +46 -0
  110. package/build/hooks/use-shadow-props.js.map +1 -0
  111. package/build/hooks/utils.js +7 -6
  112. package/build/hooks/utils.js.map +1 -1
  113. package/build/index.js +14 -0
  114. package/build/index.js.map +1 -1
  115. package/build/store/actions.js +10 -6
  116. package/build/store/actions.js.map +1 -1
  117. package/build/store/index.js +2 -0
  118. package/build/store/index.js.map +1 -1
  119. package/build/store/private-actions.js +37 -0
  120. package/build/store/private-actions.js.map +1 -1
  121. package/build/store/private-selectors.js +60 -9
  122. package/build/store/private-selectors.js.map +1 -1
  123. package/build/store/reducer.js +44 -3
  124. package/build/store/reducer.js.map +1 -1
  125. package/build/store/resolvers.js +27 -0
  126. package/build/store/resolvers.js.map +1 -0
  127. package/build/store/selectors.js +94 -56
  128. package/build/store/selectors.js.map +1 -1
  129. package/build/store/utils.js +5 -26
  130. package/build/store/utils.js.map +1 -1
  131. package/build/utils/index.js +0 -16
  132. package/build/utils/index.js.map +1 -1
  133. package/build/utils/math.js +13 -0
  134. package/build/utils/math.js.map +1 -1
  135. package/build/utils/transform-styles/index.js +37 -27
  136. package/build/utils/transform-styles/index.js.map +1 -1
  137. package/build-module/components/block-draggable/index.js +11 -3
  138. package/build-module/components/block-draggable/index.js.map +1 -1
  139. package/build-module/components/block-edit/context.js +1 -0
  140. package/build-module/components/block-edit/context.js.map +1 -1
  141. package/build-module/components/block-edit/index.js +5 -3
  142. package/build-module/components/block-edit/index.js.map +1 -1
  143. package/build-module/components/block-editing-mode/index.js +7 -4
  144. package/build-module/components/block-editing-mode/index.js.map +1 -1
  145. package/build-module/components/block-inspector/index.js +5 -2
  146. package/build-module/components/block-inspector/index.js.map +1 -1
  147. package/build-module/components/block-list/block.js +6 -5
  148. package/build-module/components/block-list/block.js.map +1 -1
  149. package/build-module/components/block-list/block.native.js +11 -7
  150. package/build-module/components/block-list/block.native.js.map +1 -1
  151. package/build-module/components/block-list/index.js +31 -5
  152. package/build-module/components/block-list/index.js.map +1 -1
  153. package/build-module/components/block-list/private-block-context.js +1 -1
  154. package/build-module/components/block-list/private-block-context.js.map +1 -1
  155. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  156. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  157. package/build-module/components/block-popover/inbetween.js +15 -3
  158. package/build-module/components/block-popover/inbetween.js.map +1 -1
  159. package/build-module/components/block-preview/auto.js +3 -3
  160. package/build-module/components/block-preview/auto.js.map +1 -1
  161. package/build-module/components/block-removal-warning-modal/index.js +3 -2
  162. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  163. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
  164. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  165. package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
  166. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  167. package/build-module/components/block-switcher/index.js +116 -86
  168. package/build-module/components/block-switcher/index.js.map +1 -1
  169. package/build-module/components/block-tools/insertion-point.js +10 -3
  170. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  171. package/build-module/components/font-sizes/fluid-utils.js +7 -1
  172. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  173. package/build-module/components/global-styles/border-panel.js +5 -14
  174. package/build-module/components/global-styles/border-panel.js.map +1 -1
  175. package/build-module/components/global-styles/effects-panel.js +7 -1
  176. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  177. package/build-module/components/iframe/get-compatibility-styles.js +93 -0
  178. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
  179. package/build-module/components/iframe/index.js +2 -3
  180. package/build-module/components/iframe/index.js.map +1 -1
  181. package/build-module/components/index.js +1 -1
  182. package/build-module/components/index.js.map +1 -1
  183. package/build-module/components/index.native.js +1 -1
  184. package/build-module/components/index.native.js.map +1 -1
  185. package/build-module/components/inspector-controls/groups.js +2 -0
  186. package/build-module/components/inspector-controls/groups.js.map +1 -1
  187. package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
  188. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  189. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  190. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  191. package/build-module/components/link-control/link-preview.js +32 -28
  192. package/build-module/components/link-control/link-preview.js.map +1 -1
  193. package/build-module/components/link-control/search-input.js +1 -8
  194. package/build-module/components/link-control/search-input.js.map +1 -1
  195. package/build-module/components/list-view/block-contents.js +3 -1
  196. package/build-module/components/list-view/block-contents.js.map +1 -1
  197. package/build-module/components/list-view/block.js +10 -1
  198. package/build-module/components/list-view/block.js.map +1 -1
  199. package/build-module/components/list-view/branch.js +30 -9
  200. package/build-module/components/list-view/branch.js.map +1 -1
  201. package/build-module/components/list-view/drop-indicator.js +99 -32
  202. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  203. package/build-module/components/list-view/index.js +54 -6
  204. package/build-module/components/list-view/index.js.map +1 -1
  205. package/build-module/components/list-view/leaf.js +2 -2
  206. package/build-module/components/list-view/leaf.js.map +1 -1
  207. package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
  208. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
  209. package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
  210. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  211. package/build-module/components/list-view/utils.js +91 -0
  212. package/build-module/components/list-view/utils.js.map +1 -1
  213. package/build-module/components/provider/index.js +1 -1
  214. package/build-module/components/provider/index.js.map +1 -1
  215. package/build-module/components/recursion-provider/index.js +17 -0
  216. package/build-module/components/recursion-provider/index.js.map +1 -1
  217. package/build-module/components/rich-text/index.js +30 -6
  218. package/build-module/components/rich-text/index.js.map +1 -1
  219. package/build-module/components/rich-text/native/index.native.js +9 -9
  220. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  221. package/build-module/components/use-block-drop-zone/index.js +31 -8
  222. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  223. package/build-module/components/use-on-block-drop/index.js +51 -9
  224. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  225. package/build-module/hooks/block-hooks.js +5 -14
  226. package/build-module/hooks/block-hooks.js.map +1 -1
  227. package/build-module/hooks/content-lock-ui.js +19 -43
  228. package/build-module/hooks/content-lock-ui.js.map +1 -1
  229. package/build-module/hooks/effects.js +51 -0
  230. package/build-module/hooks/effects.js.map +1 -0
  231. package/build-module/hooks/index.js +2 -0
  232. package/build-module/hooks/index.js.map +1 -1
  233. package/build-module/hooks/index.native.js +1 -0
  234. package/build-module/hooks/index.native.js.map +1 -1
  235. package/build-module/hooks/style.js +6 -2
  236. package/build-module/hooks/style.js.map +1 -1
  237. package/build-module/hooks/supports.js +2 -1
  238. package/build-module/hooks/supports.js.map +1 -1
  239. package/build-module/hooks/typography.native.js +2 -2
  240. package/build-module/hooks/typography.native.js.map +1 -1
  241. package/build-module/hooks/use-bindings-attributes.js +112 -0
  242. package/build-module/hooks/use-bindings-attributes.js.map +1 -0
  243. package/build-module/hooks/use-shadow-props.js +39 -0
  244. package/build-module/hooks/use-shadow-props.js.map +1 -0
  245. package/build-module/hooks/utils.js +9 -8
  246. package/build-module/hooks/utils.js.map +1 -1
  247. package/build-module/index.js +1 -1
  248. package/build-module/index.js.map +1 -1
  249. package/build-module/store/actions.js +10 -6
  250. package/build-module/store/actions.js.map +1 -1
  251. package/build-module/store/index.js +2 -0
  252. package/build-module/store/index.js.map +1 -1
  253. package/build-module/store/private-actions.js +35 -0
  254. package/build-module/store/private-actions.js.map +1 -1
  255. package/build-module/store/private-selectors.js +53 -8
  256. package/build-module/store/private-selectors.js.map +1 -1
  257. package/build-module/store/reducer.js +43 -3
  258. package/build-module/store/reducer.js.map +1 -1
  259. package/build-module/store/resolvers.js +20 -0
  260. package/build-module/store/resolvers.js.map +1 -0
  261. package/build-module/store/selectors.js +89 -52
  262. package/build-module/store/selectors.js.map +1 -1
  263. package/build-module/store/utils.js +3 -23
  264. package/build-module/store/utils.js.map +1 -1
  265. package/build-module/utils/index.js +0 -1
  266. package/build-module/utils/index.js.map +1 -1
  267. package/build-module/utils/math.js +12 -0
  268. package/build-module/utils/math.js.map +1 -1
  269. package/build-module/utils/transform-styles/index.js +36 -27
  270. package/build-module/utils/transform-styles/index.js.map +1 -1
  271. package/build-style/content-rtl.css +33 -16
  272. package/build-style/content.css +33 -16
  273. package/build-style/default-editor-styles-rtl.css +1 -1
  274. package/build-style/default-editor-styles.css +1 -1
  275. package/build-style/style-rtl.css +169 -114
  276. package/build-style/style.css +169 -114
  277. package/package.json +31 -31
  278. package/src/components/block-canvas/style.scss +8 -1
  279. package/src/components/block-draggable/index.js +16 -5
  280. package/src/components/block-edit/context.js +1 -0
  281. package/src/components/block-edit/index.js +4 -0
  282. package/src/components/block-editing-mode/index.js +12 -7
  283. package/src/components/block-inspector/index.js +5 -2
  284. package/src/components/block-list/block.js +5 -4
  285. package/src/components/block-list/block.native.js +13 -3
  286. package/src/components/block-list/content.scss +34 -5
  287. package/src/components/block-list/index.js +52 -16
  288. package/src/components/block-list/private-block-context.js +1 -1
  289. package/src/components/block-list/use-in-between-inserter.js +1 -2
  290. package/src/components/block-popover/inbetween.js +22 -2
  291. package/src/components/block-preview/auto.js +3 -3
  292. package/src/components/block-removal-warning-modal/index.js +3 -2
  293. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
  294. package/src/components/block-switcher/block-transformations-menu.js +18 -1
  295. package/src/components/block-switcher/index.js +133 -111
  296. package/src/components/block-switcher/style.scss +6 -4
  297. package/src/components/block-switcher/test/index.js +113 -230
  298. package/src/components/block-toolbar/style.scss +22 -18
  299. package/src/components/block-tools/insertion-point.js +15 -2
  300. package/src/components/block-tools/style.scss +8 -7
  301. package/src/components/font-sizes/fluid-utils.js +8 -2
  302. package/src/components/font-sizes/test/fluid-utils.js +9 -0
  303. package/src/components/global-styles/border-panel.js +7 -17
  304. package/src/components/global-styles/effects-panel.js +16 -1
  305. package/src/components/iframe/get-compatibility-styles.js +120 -0
  306. package/src/components/iframe/index.js +2 -3
  307. package/src/components/index.js +4 -2
  308. package/src/components/index.native.js +4 -2
  309. package/src/components/inspector-controls/groups.js +2 -0
  310. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  311. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
  312. package/src/components/link-control/link-preview.js +31 -55
  313. package/src/components/link-control/search-input.js +1 -9
  314. package/src/components/link-control/style.scss +31 -85
  315. package/src/components/link-control/test/index.js +2 -1
  316. package/src/components/list-view/block-contents.js +5 -1
  317. package/src/components/list-view/block.js +9 -0
  318. package/src/components/list-view/branch.js +30 -10
  319. package/src/components/list-view/drop-indicator.js +139 -46
  320. package/src/components/list-view/index.js +74 -3
  321. package/src/components/list-view/leaf.js +2 -2
  322. package/src/components/list-view/style.scss +102 -13
  323. package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
  324. package/src/components/list-view/test/utils.js +218 -1
  325. package/src/components/list-view/use-list-view-block-indexes.js +29 -0
  326. package/src/components/list-view/use-list-view-drop-zone.js +78 -6
  327. package/src/components/list-view/utils.js +116 -0
  328. package/src/components/provider/index.js +3 -1
  329. package/src/components/recursion-provider/README.md +2 -2
  330. package/src/components/recursion-provider/index.js +17 -0
  331. package/src/components/rich-text/index.js +48 -10
  332. package/src/components/rich-text/native/index.native.js +10 -10
  333. package/src/components/use-block-drop-zone/index.js +60 -19
  334. package/src/components/use-block-drop-zone/test/index.js +32 -61
  335. package/src/components/use-on-block-drop/index.js +92 -11
  336. package/src/hooks/block-hooks.js +5 -17
  337. package/src/hooks/content-lock-ui.js +15 -55
  338. package/src/hooks/effects.js +57 -0
  339. package/src/hooks/index.js +2 -0
  340. package/src/hooks/index.native.js +1 -0
  341. package/src/hooks/style.js +8 -0
  342. package/src/hooks/supports.js +2 -0
  343. package/src/hooks/test/effects.js +39 -0
  344. package/src/hooks/typography.native.js +2 -2
  345. package/src/hooks/use-bindings-attributes.js +148 -0
  346. package/src/hooks/use-shadow-props.js +37 -0
  347. package/src/hooks/utils.js +10 -6
  348. package/src/index.js +2 -0
  349. package/src/store/actions.js +9 -4
  350. package/src/store/index.js +2 -0
  351. package/src/store/private-actions.js +32 -0
  352. package/src/store/private-selectors.js +78 -21
  353. package/src/store/reducer.js +49 -2
  354. package/src/store/resolvers.js +17 -0
  355. package/src/store/selectors.js +169 -161
  356. package/src/store/test/registry-selectors.js +431 -0
  357. package/src/store/test/selectors.js +14 -400
  358. package/src/store/utils.js +10 -33
  359. package/src/style.scss +0 -1
  360. package/src/utils/index.js +0 -1
  361. package/src/utils/math.js +12 -0
  362. package/src/utils/transform-styles/index.js +52 -37
  363. package/tsconfig.tsbuildinfo +1 -1
  364. package/build/components/iframe/use-compatibility-styles.js +0 -100
  365. package/build/components/iframe/use-compatibility-styles.js.map +0 -1
  366. package/build/utils/block-variation-transforms.js +0 -42
  367. package/build/utils/block-variation-transforms.js.map +0 -1
  368. package/build-module/components/iframe/use-compatibility-styles.js +0 -94
  369. package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
  370. package/build-module/utils/block-variation-transforms.js +0 -35
  371. package/build-module/utils/block-variation-transforms.js.map +0 -1
  372. package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
  373. package/src/components/contrast-checker/style.scss +0 -3
  374. package/src/components/iframe/use-compatibility-styles.js +0 -122
  375. package/src/utils/block-variation-transforms.js +0 -38
  376. package/src/utils/test/block-variation-transforms.js +0 -94
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EFFECTS_SUPPORT_KEYS = void 0;
7
+ exports.EffectsPanel = EffectsPanel;
8
+ exports.SHADOW_SUPPORT_KEY = void 0;
9
+ exports.hasEffectsSupport = hasEffectsSupport;
10
+ var _react = require("react");
11
+ var _blocks = require("@wordpress/blocks");
12
+ var _data = require("@wordpress/data");
13
+ var _effectsPanel = _interopRequireWildcard(require("../components/global-styles/effects-panel"));
14
+ var _components = require("../components");
15
+ var _store = require("../store");
16
+ var _utils = require("./utils");
17
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
+ /**
20
+ * WordPress dependencies
21
+ */
22
+
23
+ /**
24
+ * Internal dependencies
25
+ */
26
+
27
+ const SHADOW_SUPPORT_KEY = 'shadow';
28
+ exports.SHADOW_SUPPORT_KEY = SHADOW_SUPPORT_KEY;
29
+ const EFFECTS_SUPPORT_KEYS = [SHADOW_SUPPORT_KEY];
30
+ exports.EFFECTS_SUPPORT_KEYS = EFFECTS_SUPPORT_KEYS;
31
+ function hasEffectsSupport(blockName) {
32
+ return EFFECTS_SUPPORT_KEYS.some(key => (0, _blocks.hasBlockSupport)(blockName, key));
33
+ }
34
+ function EffectsInspectorControl({
35
+ children,
36
+ resetAllFilter
37
+ }) {
38
+ return (0, _react.createElement)(_components.InspectorControls, {
39
+ group: "effects",
40
+ resetAllFilter: resetAllFilter
41
+ }, children);
42
+ }
43
+ function EffectsPanel({
44
+ clientId,
45
+ setAttributes,
46
+ settings
47
+ }) {
48
+ const isEnabled = (0, _effectsPanel.useHasEffectsPanel)(settings);
49
+ const value = (0, _data.useSelect)(select => select(_store.store).getBlockAttributes(clientId)?.style, [clientId]);
50
+ const onChange = newStyle => {
51
+ setAttributes({
52
+ style: (0, _utils.cleanEmptyObject)(newStyle)
53
+ });
54
+ };
55
+ if (!isEnabled) {
56
+ return null;
57
+ }
58
+ return (0, _react.createElement)(_effectsPanel.default, {
59
+ as: EffectsInspectorControl,
60
+ panelId: clientId,
61
+ settings: settings,
62
+ value: value,
63
+ onChange: onChange
64
+ });
65
+ }
66
+ //# sourceMappingURL=effects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_blocks","require","_data","_effectsPanel","_interopRequireWildcard","_components","_store","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SHADOW_SUPPORT_KEY","exports","EFFECTS_SUPPORT_KEYS","hasEffectsSupport","blockName","some","hasBlockSupport","EffectsInspectorControl","children","resetAllFilter","_react","createElement","InspectorControls","group","EffectsPanel","clientId","setAttributes","settings","isEnabled","useHasEffectsPanel","value","useSelect","select","blockEditorStore","getBlockAttributes","style","onChange","newStyle","cleanEmptyObject","as","panelId"],"sources":["@wordpress/block-editor/src/hooks/effects.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport StylesEffectsPanel, {\n\tuseHasEffectsPanel,\n} from '../components/global-styles/effects-panel';\nimport { InspectorControls } from '../components';\nimport { store as blockEditorStore } from '../store';\nimport { cleanEmptyObject } from './utils';\n\nexport const SHADOW_SUPPORT_KEY = 'shadow';\nexport const EFFECTS_SUPPORT_KEYS = [ SHADOW_SUPPORT_KEY ];\n\nexport function hasEffectsSupport( blockName ) {\n\treturn EFFECTS_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n}\n\nfunction EffectsInspectorControl( { children, resetAllFilter } ) {\n\treturn (\n\t\t<InspectorControls group=\"effects\" resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\nexport function EffectsPanel( { clientId, setAttributes, settings } ) {\n\tconst isEnabled = useHasEffectsPanel( settings );\n\tconst value = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId )?.style,\n\t\t[ clientId ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( { style: cleanEmptyObject( newStyle ) } );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StylesEffectsPanel\n\t\t\tas={ EffectsInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MA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AMC,SAAS,GAAG,IAAAC,gCAAkB,EAAEF,QAAS,CAAC;EAChD,MAAMG,KAAK,GAAG,IAAAC,eAAS,EACpBC,MAAM,IACPA,MAAM,CAAEC,YAAiB,CAAC,CAACC,kBAAkB,CAAET,QAAS,CAAC,EAAEU,KAAK,EACjE,CAAEV,QAAQ,CACX,CAAC;EAED,MAAMW,QAAQ,GAAKC,QAAQ,IAAM;IAChCX,aAAa,CAAE;MAAES,KAAK,EAAE,IAAAG,uBAAgB,EAAED,QAAS;IAAE,CAAE,CAAC;EACzD,CAAC;EAED,IAAK,CAAET,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAR,MAAA,CAAAC,aAAA,EAACtC,aAAA,CAAAY,OAAkB;IAClB4C,EAAE,EAAGtB,uBAAyB;IAC9BuB,OAAO,EAAGf,QAAU;IACpBE,QAAQ,EAAGA,QAAU;IACrBG,KAAK,EAAGA,KAAO;IACfM,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ"}
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "getGapCSSValue", {
22
22
  return _gap.getGapCSSValue;
23
23
  }
24
24
  });
25
+ Object.defineProperty(exports, "getShadowClassesAndStyles", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _useShadowProps.getShadowClassesAndStyles;
29
+ }
30
+ });
25
31
  Object.defineProperty(exports, "getSpacingClassesAndStyles", {
26
32
  enumerable: true,
27
33
  get: function () {
@@ -70,6 +76,12 @@ Object.defineProperty(exports, "useLayoutStyles", {
70
76
  return _layout.useLayoutStyles;
71
77
  }
72
78
  });
79
+ Object.defineProperty(exports, "useShadowProps", {
80
+ enumerable: true,
81
+ get: function () {
82
+ return _useShadowProps.useShadowProps;
83
+ }
84
+ });
73
85
  var _utils = require("./utils");
74
86
  require("./compat");
75
87
  var _align = _interopRequireDefault(require("./align"));
@@ -92,8 +104,10 @@ var _contentLockUi = _interopRequireDefault(require("./content-lock-ui"));
92
104
  require("./metadata");
93
105
  var _blockHooks = _interopRequireDefault(require("./block-hooks"));
94
106
  var _blockRenaming = _interopRequireDefault(require("./block-renaming"));
107
+ require("./use-bindings-attributes");
95
108
  var _dimensions = require("./dimensions");
96
109
  var _useBorderProps = require("./use-border-props");
110
+ var _useShadowProps = require("./use-shadow-props");
97
111
  var _useColorProps = require("./use-color-props");
98
112
  var _useSpacingProps = require("./use-spacing-props");
99
113
  var _useTypographyProps = require("./use-typography-props");
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_ariaLabel","_customClassName","_style","_color","_duotone","_fontFamily","_fontSize","_border","_position","_layout","_interopRequireWildcard","_layoutChild","_contentLockUi","_blockHooks","_blockRenaming","_dimensions","_useBorderProps","_useColorProps","_useSpacingProps","_useTypographyProps","_gap","_useCachedTruthy","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createBlockEditFilter","align","anchor","customClassName","style","duotone","position","layout","contentLockUI","blockHooks","blockRenaming","filter","Boolean","createBlockListBlockFilter","color","fontFamily","fontSize","border","childLayout","createBlockSaveFilter","ariaLabel"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport border from './border';\nimport position from './position';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockRenaming from './block-renaming';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tblockRenaming,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\tstyle,\n\tcolor,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,QAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,SAAA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kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AA1EtD;AACA;AACA;;AA4BA,IAAAW,4BAAqB,EACpB,CACCC,cAAK,EACLC,eAAM,EACNC,wBAAe,EACfC,cAAK,EACLC,gBAAO,EACPC,iBAAQ,EACRC,eAAM,EACNC,sBAAa,EACbC,mBAAU,EACVC,sBAAa,CACb,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC;AACD,IAAAC,iCAA0B,EAAE,CAC3BZ,cAAK,EACLG,cAAK,EACLU,cAAK,EACLT,gBAAO,EACPU,mBAAU,EACVC,iBAAQ,EACRC,eAAM,EACNX,iBAAQ,EACRY,oBAAW,CACV,CAAC;AACH,IAAAC,4BAAqB,EAAE,CACtBlB,cAAK,EACLC,eAAM,EACNkB,kBAAS,EACTjB,wBAAe,EACfc,eAAM,EACNH,cAAK,EACLV,cAAK,EACLW,mBAAU,EACVC,iBAAQ,CACP,CAAC"}
1
+ {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_ariaLabel","_customClassName","_style","_color","_duotone","_fontFamily","_fontSize","_border","_position","_layout","_interopRequireWildcard","_layoutChild","_contentLockUi","_blockHooks","_blockRenaming","_dimensions","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useTypographyProps","_gap","_useCachedTruthy","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createBlockEditFilter","align","anchor","customClassName","style","duotone","position","layout","contentLockUI","blockHooks","blockRenaming","filter","Boolean","createBlockListBlockFilter","color","fontFamily","fontSize","border","childLayout","createBlockSaveFilter","ariaLabel"],"sources":["@wordpress/block-editor/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport './lock';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport border from './border';\nimport position from './position';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport contentLockUI from './content-lock-ui';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockRenaming from './block-renaming';\nimport './use-bindings-attributes';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tduotone,\n\t\tposition,\n\t\tlayout,\n\t\tcontentLockUI,\n\t\tblockHooks,\n\t\tblockRenaming,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\tstyle,\n\tcolor,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tborder,\n\tposition,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,QAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,SAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,OAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,SAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,OAAA,GAAAC,uBAAA,CAAAd,OAAA;AACA,IAAAe,YAAA,GAAAb,sBAAA,CAAAF,OAAA;AACA,IAAAgB,cAAA,GAAAd,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAiB,WAAA,GAAAf,sBAAA,CAAAF,OAAA;AACA,IAAAkB,cAAA,GAAAhB,sBAAA,CAAAF,OAAA;AACAA,OAAA;AAuCA,IAAAmB,WAAA,GAAAnB,OAAA;AAEA,IAAAoB,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GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AA5EtD;AACA;AACA;;AA6BA,IAAAW,4BAAqB,EACpB,CACCC,cAAK,EACLC,eAAM,EACNC,wBAAe,EACfC,cAAK,EACLC,gBAAO,EACPC,iBAAQ,EACRC,eAAM,EACNC,sBAAa,EACbC,mBAAU,EACVC,sBAAa,CACb,CAACC,MAAM,CAAEC,OAAQ,CACnB,CAAC;AACD,IAAAC,iCAA0B,EAAE,CAC3BZ,cAAK,EACLG,cAAK,EACLU,cAAK,EACLT,gBAAO,EACPU,mBAAU,EACVC,iBAAQ,EACRC,eAAM,EACNX,iBAAQ,EACRY,oBAAW,CACV,CAAC;AACH,IAAAC,4BAAqB,EAAE,CACtBlB,cAAK,EACLC,eAAM,EACNkB,kBAAS,EACTjB,wBAAe,EACfc,eAAM,EACNH,cAAK,EACLV,cAAK,EACLW,mBAAU,EACVC,iBAAQ,CACP,CAAC"}
@@ -16,6 +16,12 @@ Object.defineProperty(exports, "getColorClassesAndStyles", {
16
16
  return _useColorProps.getColorClassesAndStyles;
17
17
  }
18
18
  });
19
+ Object.defineProperty(exports, "getShadowClassesAndStyles", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _useShadowProps.getShadowClassesAndStyles;
23
+ }
24
+ });
19
25
  Object.defineProperty(exports, "getSpacingClassesAndStyles", {
20
26
  enumerable: true,
21
27
  get: function () {
@@ -46,6 +52,12 @@ Object.defineProperty(exports, "useEditorWrapperStyles", {
46
52
  return _useEditorWrapperStyles.useEditorWrapperStyles;
47
53
  }
48
54
  });
55
+ Object.defineProperty(exports, "useShadowProps", {
56
+ enumerable: true,
57
+ get: function () {
58
+ return _useShadowProps.useShadowProps;
59
+ }
60
+ });
49
61
  var _utils = require("./utils");
50
62
  require("./compat");
51
63
  var _align = _interopRequireDefault(require("./align"));
@@ -57,6 +69,7 @@ var _color = _interopRequireDefault(require("./color"));
57
69
  var _fontSize = _interopRequireDefault(require("./font-size"));
58
70
  require("./layout");
59
71
  var _useBorderProps = require("./use-border-props");
72
+ var _useShadowProps = require("./use-shadow-props");
60
73
  var _useColorProps = require("./use-color-props");
61
74
  var _useSpacingProps = require("./use-spacing-props");
62
75
  var _useCachedTruthy = require("./use-cached-truthy");
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_customClassName","_style","_color","_fontSize","_useBorderProps","_useColorProps","_useSpacingProps","_useCachedTruthy","_useEditorWrapperStyles","createBlockEditFilter","align","anchor","style","createBlockListBlockFilter","color","fontSize","createBlockSaveFilter","customClassName"],"sources":["@wordpress/block-editor/src/hooks/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport anchor from './anchor';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport color from './color';\nimport fontSize from './font-size';\nimport './layout';\n\ncreateBlockEditFilter( [ align, anchor, style ] );\ncreateBlockListBlockFilter( [ align, style, color, fontSize ] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tcustomClassName,\n\tcolor,\n\tstyle,\n\tfontSize,\n] );\n\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { useEditorWrapperStyles } from './use-editor-wrapper-styles';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,gBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAL,sBAAA,CAAAF,OAAA;AACAA,OAAA;AAaA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,uBAAA,GAAAZ,OAAA;AAjCA;AACA;AACA;;AAgBA,IAAAa,4BAAqB,EAAE,CAAEC,cAAK,EAAEC,eAAM,EAAEC,cAAK,CAAG,CAAC;AACjD,IAAAC,iCAA0B,EAAE,CAAEH,cAAK,EAAEE,cAAK,EAAEE,cAAK,EAAEC,iBAAQ,CAAG,CAAC;AAC/D,IAAAC,4BAAqB,EAAE,CACtBN,cAAK,EACLC,eAAM,EACNM,wBAAe,EACfH,cAAK,EACLF,cAAK,EACLG,iBAAQ,CACP,CAAC"}
1
+ {"version":3,"names":["_utils","require","_align","_interopRequireDefault","_anchor","_customClassName","_style","_color","_fontSize","_useBorderProps","_useShadowProps","_useColorProps","_useSpacingProps","_useCachedTruthy","_useEditorWrapperStyles","createBlockEditFilter","align","anchor","style","createBlockListBlockFilter","color","fontSize","createBlockSaveFilter","customClassName"],"sources":["@wordpress/block-editor/src/hooks/index.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport align from './align';\nimport anchor from './anchor';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport color from './color';\nimport fontSize from './font-size';\nimport './layout';\n\ncreateBlockEditFilter( [ align, anchor, style ] );\ncreateBlockListBlockFilter( [ align, style, color, fontSize ] );\ncreateBlockSaveFilter( [\n\talign,\n\tanchor,\n\tcustomClassName,\n\tcolor,\n\tstyle,\n\tfontSize,\n] );\n\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { useEditorWrapperStyles } from './use-editor-wrapper-styles';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKAA,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,gBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,SAAA,GAAAL,sBAAA,CAAAF,OAAA;AACAA,OAAA;AAaA,IAAAQ,eAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAb,OAAA;AAlCA;AACA;AACA;;AAgBA,IAAAc,4BAAqB,EAAE,CAAEC,cAAK,EAAEC,eAAM,EAAEC,cAAK,CAAG,CAAC;AACjD,IAAAC,iCAA0B,EAAE,CAAEH,cAAK,EAAEE,cAAK,EAAEE,cAAK,EAAEC,iBAAQ,CAAG,CAAC;AAC/D,IAAAC,4BAAqB,EAAE,CACtBN,cAAK,EACLC,eAAM,EACNM,wBAAe,EACfH,cAAK,EACLF,cAAK,EACLG,iBAAQ,CACP,CAAC"}
@@ -18,6 +18,7 @@ var _border = require("./border");
18
18
  var _color = require("./color");
19
19
  var _typography = require("./typography");
20
20
  var _dimensions = require("./dimensions");
21
+ var _effects = require("./effects");
21
22
  var _utils = require("./utils");
22
23
  var _utils2 = require("../components/global-styles/utils");
23
24
  var _blockEditingMode = require("../components/block-editing-mode");
@@ -29,7 +30,7 @@ var _blockEditingMode = require("../components/block-editing-mode");
29
30
  * Internal dependencies
30
31
  */
31
32
 
32
- const styleSupportKeys = [..._typography.TYPOGRAPHY_SUPPORT_KEYS, _border.BORDER_SUPPORT_KEY, _color.COLOR_SUPPORT_KEY, _dimensions.DIMENSIONS_SUPPORT_KEY, _background.BACKGROUND_SUPPORT_KEY, _dimensions.SPACING_SUPPORT_KEY];
33
+ const styleSupportKeys = [..._typography.TYPOGRAPHY_SUPPORT_KEYS, ..._effects.EFFECTS_SUPPORT_KEYS, _border.BORDER_SUPPORT_KEY, _color.COLOR_SUPPORT_KEY, _dimensions.DIMENSIONS_SUPPORT_KEY, _background.BACKGROUND_SUPPORT_KEY, _dimensions.SPACING_SUPPORT_KEY];
33
34
  const hasStyleSupport = nameOrType => styleSupportKeys.some(key => (0, _blocks.hasBlockSupport)(nameOrType, key));
34
35
 
35
36
  /**
@@ -84,7 +85,8 @@ const skipSerializationPathsEdit = {
84
85
  [`${_color.COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [_color.COLOR_SUPPORT_KEY],
85
86
  [`${_typography.TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [_typography.TYPOGRAPHY_SUPPORT_KEY],
86
87
  [`${_dimensions.DIMENSIONS_SUPPORT_KEY}.__experimentalSkipSerialization`]: [_dimensions.DIMENSIONS_SUPPORT_KEY],
87
- [`${_dimensions.SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: [_dimensions.SPACING_SUPPORT_KEY]
88
+ [`${_dimensions.SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: [_dimensions.SPACING_SUPPORT_KEY],
89
+ [`${_effects.SHADOW_SUPPORT_KEY}`]: [_effects.SHADOW_SUPPORT_KEY]
88
90
  };
89
91
 
90
92
  /**
@@ -300,6 +302,8 @@ function BlockStyleControls({
300
302
  ...passedProps
301
303
  }), (0, _react.createElement)(_dimensions.DimensionsPanel, {
302
304
  ...passedProps
305
+ }), (0, _react.createElement)(_effects.EffectsPanel, {
306
+ ...passedProps
303
307
  }));
304
308
  }
305
309
  var _default = {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","_react","createElement","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","edit","hasSupport","attributeKeys","useBlockProps","exports","default","elementTypes","elementType","pseudo","elements","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings,\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\tuseBlockProps\n\t) }`;\n\n\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t// added to all other editor styles, not providing it causes reset and global\n\t// styles to override element styles because of higher specificity.\n\tconst baseElementSelector = `.editor-styles-wrapper .${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AAnCA;AACA;AACA;;AAWA;AACA;AACA;;AAsBA,MAAMa,gBAAgB,GAAG,CACxB,GAAGC,mCAAuB,EAC1BC,0BAAkB,EAClBC,wBAAi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AAI,CAC/DA,+BAAmB;AAErB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMsB,0BAA0B,GAAG;EAClC,GAAGF,0BAA0B;EAC7B,CAAG,GAAGrB,kCAAwB,EAAC,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMwB,gCAAgC,GAAG;EACxC,CAAG,GAAGxB,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMyB,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAEV,KAAK,EAAEW,KAAK,EAAEC,iBAAiB,GAAG,KAAK,EAAG;EACpE,IAAK,CAAEZ,KAAK,EAAG;IACd,OAAOA,KAAK;EACb;EAEA,IAAIa,QAAQ,GAAGb,KAAK;EACpB,IAAK,CAAEY,iBAAiB,EAAG;IAC1BC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAAED,IAAI,CAACE,SAAS,CAAEhB,KAAM,CAAE,CAAC;EACjD;EAEA,IAAK,CAAEiB,KAAK,CAACC,OAAO,CAAEP,KAAM,CAAC,EAAG;IAC/BA,KAAK,GAA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EAEnC,OAAOiC,YAAY,CAClB;IAAEyD,SAAS,EAAEnB;EAAiC,CAAC,EAC/C1B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAA8E,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBrF,YACD,CAAC"}
1
+ {"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_effects","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","SHADOW_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","_react","createElement","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","EffectsPanel","_default","edit","hasSupport","attributeKeys","useBlockProps","exports","default","elementTypes","elementType","pseudo","elements","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tEFFECTS_SUPPORT_KEYS,\n\tSHADOW_SUPPORT_KEY,\n\tEffectsPanel,\n} from './effects';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\t...EFFECTS_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }` ]: [ SHADOW_SUPPORT_KEY ],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings,\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t\t<EffectsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\tuseBlockProps\n\t) }`;\n\n\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t// added to all other editor styles, not providing it causes reset and global\n\t// styles to override element styles because of higher specificity.\n\tconst baseElementSelector = `.editor-styles-wrapper .${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAA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iC,GAAI,CAAE,QAAQ,CAAE;EAC3E,CAAG,GAAGC,wBAAmB,kCAAiC,GAAI,CAC7DA,wBAAiB,CACjB;EACD,CAAG,GAAGwB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGvB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGE,+BAAqB,kCAAiC,GAAI,CAC/DA,+BAAmB,CACnB;EACD,CAAG,GAAGsB,2BAAoB,EAAC,GAAI,CAAEA,2BAAkB;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG;EAClC,GAAGH,0BAA0B;EAC7B,CAAG,GAAGrB,kCAAwB,EAAC,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMyB,gCAAgC,GAAG;EACxC,CAAG,GAAGzB,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAEX,KAAK,EAAEY,KAAK,EAAEC,iBAAiB,G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AAE,EAAE;cAC1CN,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAC/C,MAAM,GAAG,CAAC,GAC9B+C,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAE9B,IAAI,CAAG,CAAC;EAEtD,IAAA4C,uBAAgB,EAAE;IAAEC,GAAG,EAAE3F;EAAO,CAAE,CAAC;EAEnC,OAAOkC,YAAY,CAClB;IAAE0D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C3B,IAAI,EACJ;IAAErC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAgF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBvF,YACD,CAAC"}
@@ -56,8 +56,9 @@ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
56
56
  const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
57
57
  const LAYOUT_SUPPORT_KEY = 'layout';
58
58
  const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
59
+ const EFFECTS_SUPPORT_KEYS = ['shadow'];
59
60
  const SPACING_SUPPORT_KEY = 'spacing';
60
- const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
61
+ const styleSupportKeys = [...EFFECTS_SUPPORT_KEYS, ...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
61
62
 
62
63
  /**
63
64
  * Returns true if the block defines support for align.
@@ -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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C,kBAAA,GAAAA,kBAAA;AAMO,MAAMC,gBAAgB,GAAKnC,UAAU,IAC3C,IAAAC,uBAAe,EAAED,UAAU,EAAEL,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AALAO,OAAA,CAAAiC,gBAAA,GAAAA,gBAAA;AAMO,MAAMC,gBAAgB,GAAKpC,UAAU,IAC3C,IAAAI,uBAAe,EAAEJ,UAAU,EAAEL,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AALAO,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"}
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,QAA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oBAAA;AAMO,MAAMC,oBAAoB,GAAKhC,UAAU,IAC/C,IAAAI,uBAAe,EAAEJ,UAAU,EAAEhB,uBAAwB,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AALAkB,OAAA,CAAA8B,oBAAA,GAAAA,oBAAA;AAMO,MAAMC,kBAAkB,GAAKjC,UAAU,IAC7C,IAAAC,uBAAe,EAAED,UAAU,EAAEf,qBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AALAiB,OAAA,CAAA+B,kBAAA,GAAAA,kBAAA;AAMO,MAAMC,kBAAkB,GAAKlC,UAAU,IAC7C,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,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"}
@@ -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