@wordpress/block-editor 8.0.0 → 8.0.4

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 (1139) hide show
  1. package/build/components/alignment-control/ui.js +11 -9
  2. package/build/components/alignment-control/ui.js.map +1 -1
  3. package/build/components/autocomplete/index.js +5 -4
  4. package/build/components/autocomplete/index.js.map +1 -1
  5. package/build/components/block-actions/index.js +12 -8
  6. package/build/components/block-actions/index.js.map +1 -1
  7. package/build/components/block-alignment-control/ui.js +21 -17
  8. package/build/components/block-alignment-control/ui.js.map +1 -1
  9. package/build/components/block-alignment-control/use-available-alignments.js +9 -4
  10. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  11. package/build/components/block-alignment-matrix-control/index.js +6 -4
  12. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  13. package/build/components/block-breadcrumb/index.js +4 -3
  14. package/build/components/block-breadcrumb/index.js.map +1 -1
  15. package/build/components/block-caption/index.native.js +34 -29
  16. package/build/components/block-caption/index.native.js.map +1 -1
  17. package/build/components/block-card/index.js +8 -6
  18. package/build/components/block-card/index.js.map +1 -1
  19. package/build/components/block-compare/block-view.js +9 -8
  20. package/build/components/block-compare/block-view.js.map +1 -1
  21. package/build/components/block-compare/index.js +9 -7
  22. package/build/components/block-compare/index.js.map +1 -1
  23. package/build/components/block-content-overlay/index.js +7 -6
  24. package/build/components/block-content-overlay/index.js.map +1 -1
  25. package/build/components/block-context/index.js +5 -4
  26. package/build/components/block-context/index.js.map +1 -1
  27. package/build/components/block-controls/fill.js +7 -6
  28. package/build/components/block-controls/fill.js.map +1 -1
  29. package/build/components/block-controls/slot.js +5 -4
  30. package/build/components/block-controls/slot.js.map +1 -1
  31. package/build/components/block-controls/slot.native.js +5 -4
  32. package/build/components/block-controls/slot.native.js.map +1 -1
  33. package/build/components/block-draggable/draggable-chip.js +5 -4
  34. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  35. package/build/components/block-draggable/index.js +13 -11
  36. package/build/components/block-draggable/index.js.map +1 -1
  37. package/build/components/block-edit/context.js +1 -1
  38. package/build/components/block-full-height-alignment-control/index.js +7 -6
  39. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  40. package/build/components/block-icon/index.js +7 -5
  41. package/build/components/block-icon/index.js.map +1 -1
  42. package/build/components/block-icon/index.native.js +8 -6
  43. package/build/components/block-icon/index.native.js.map +1 -1
  44. package/build/components/block-inspector/index.js +20 -15
  45. package/build/components/block-inspector/index.js.map +1 -1
  46. package/build/components/block-list/block-html.js +4 -3
  47. package/build/components/block-list/block-html.js.map +1 -1
  48. package/build/components/block-list/block-invalid-warning.js +28 -20
  49. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  50. package/build/components/block-list/block-invalid-warning.native.js +5 -4
  51. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  52. package/build/components/block-list/block-list-item.native.js +6 -5
  53. package/build/components/block-list/block-list-item.native.js.map +1 -1
  54. package/build/components/block-list/block-selection-button.native.js +11 -9
  55. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  56. package/build/components/block-list/block.js +40 -33
  57. package/build/components/block-list/block.js.map +1 -1
  58. package/build/components/block-list/block.native.js +35 -29
  59. package/build/components/block-list/block.native.js.map +1 -1
  60. package/build/components/block-list/index.js +14 -12
  61. package/build/components/block-list/index.js.map +1 -1
  62. package/build/components/block-list/index.native.js +22 -17
  63. package/build/components/block-list/index.native.js.map +1 -1
  64. package/build/components/block-list/insertion-point.native.js +4 -3
  65. package/build/components/block-list/insertion-point.native.js.map +1 -1
  66. package/build/components/block-list/layout.js +8 -6
  67. package/build/components/block-list/layout.js.map +1 -1
  68. package/build/components/block-list/subdirectory-icon.js +13 -10
  69. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  70. package/build/components/block-list/use-block-props/index.js +5 -3
  71. package/build/components/block-list/use-block-props/index.js.map +1 -1
  72. package/build/components/block-list/use-block-props/index.native.js +2 -1
  73. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  74. package/build/components/block-list/use-block-props/use-block-refs.js +2 -2
  75. package/build/components/block-list/use-block-props/use-multi-selection.js +9 -6
  76. package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  77. package/build/components/block-list-appender/index.js +16 -13
  78. package/build/components/block-list-appender/index.js.map +1 -1
  79. package/build/components/block-list-appender/index.native.js +14 -11
  80. package/build/components/block-list-appender/index.native.js.map +1 -1
  81. package/build/components/block-media-update-progress/index.native.js +1 -1
  82. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  83. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  84. package/build/components/block-mobile-toolbar/index.js +4 -3
  85. package/build/components/block-mobile-toolbar/index.js.map +1 -1
  86. package/build/components/block-mobile-toolbar/index.native.js +33 -25
  87. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  88. package/build/components/block-mover/button.js +8 -7
  89. package/build/components/block-mover/button.js.map +1 -1
  90. package/build/components/block-mover/index.js +15 -13
  91. package/build/components/block-mover/index.js.map +1 -1
  92. package/build/components/block-mover/index.native.js +23 -20
  93. package/build/components/block-mover/index.native.js.map +1 -1
  94. package/build/components/block-mover/mover-description.native.js +10 -7
  95. package/build/components/block-mover/mover-description.native.js.map +1 -1
  96. package/build/components/block-navigation/dropdown.js +26 -21
  97. package/build/components/block-navigation/dropdown.js.map +1 -1
  98. package/build/components/block-pattern-setup/index.js +26 -22
  99. package/build/components/block-pattern-setup/index.js.map +1 -1
  100. package/build/components/block-pattern-setup/setup-toolbar.js +46 -39
  101. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  102. package/build/components/block-patterns-list/index.js +44 -39
  103. package/build/components/block-patterns-list/index.js.map +1 -1
  104. package/build/components/block-preview/auto.js +5 -4
  105. package/build/components/block-preview/auto.js.map +1 -1
  106. package/build/components/block-preview/index.js +8 -7
  107. package/build/components/block-preview/index.js.map +1 -1
  108. package/build/components/block-preview/live.js +4 -3
  109. package/build/components/block-preview/live.js.map +1 -1
  110. package/build/components/block-selection-clearer/index.js +1 -1
  111. package/build/components/block-settings/button.native.js +10 -7
  112. package/build/components/block-settings/button.native.js.map +1 -1
  113. package/build/components/block-settings/container.native.js +7 -6
  114. package/build/components/block-settings/container.native.js.map +1 -1
  115. package/build/components/block-settings/index.native.js +4 -2
  116. package/build/components/block-settings/index.native.js.map +1 -1
  117. package/build/components/block-settings-menu/block-convert-button.js +7 -5
  118. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  119. package/build/components/block-settings-menu/block-html-convert-button.js +14 -10
  120. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  121. package/build/components/block-settings-menu/block-mode-toggle.js +25 -19
  122. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  123. package/build/components/block-settings-menu/block-settings-dropdown.js +74 -66
  124. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  125. package/build/components/block-settings-menu/index.js +5 -4
  126. package/build/components/block-settings-menu/index.js.map +1 -1
  127. package/build/components/block-settings-menu-controls/index.js +8 -6
  128. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  129. package/build/components/block-styles/index.js +20 -17
  130. package/build/components/block-styles/index.js.map +1 -1
  131. package/build/components/block-styles/index.native.js +6 -4
  132. package/build/components/block-styles/index.native.js.map +1 -1
  133. package/build/components/block-styles/preview.native.js +7 -6
  134. package/build/components/block-styles/preview.native.js.map +1 -1
  135. package/build/components/block-switcher/block-styles-menu.js +5 -4
  136. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  137. package/build/components/block-switcher/block-transformations-menu.js +7 -6
  138. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  139. package/build/components/block-switcher/block-transformations-menu.native.js +9 -8
  140. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  141. package/build/components/block-switcher/index.js +42 -34
  142. package/build/components/block-switcher/index.js.map +1 -1
  143. package/build/components/block-switcher/pattern-transformations-menu.js +22 -18
  144. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  145. package/build/components/block-switcher/preview-block-popover.js +4 -3
  146. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  147. package/build/components/block-switcher/use-transformed-patterns.js +1 -1
  148. package/build/components/block-switcher/utils.js +2 -1
  149. package/build/components/block-switcher/utils.js.map +1 -1
  150. package/build/components/block-title/index.js +4 -3
  151. package/build/components/block-title/index.js.map +1 -1
  152. package/build/components/block-toolbar/index.js +4 -3
  153. package/build/components/block-toolbar/index.js.map +1 -1
  154. package/build/components/block-toolbar/utils.js +13 -11
  155. package/build/components/block-toolbar/utils.js.map +1 -1
  156. package/build/components/block-tools/back-compat.js +8 -5
  157. package/build/components/block-tools/back-compat.js.map +1 -1
  158. package/build/components/block-tools/block-contextual-toolbar.js +6 -5
  159. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  160. package/build/components/block-tools/block-popover.js +15 -13
  161. package/build/components/block-tools/block-popover.js.map +1 -1
  162. package/build/components/block-tools/block-selection-button.js +6 -5
  163. package/build/components/block-tools/block-selection-button.js.map +1 -1
  164. package/build/components/block-tools/index.js +6 -5
  165. package/build/components/block-tools/index.js.map +1 -1
  166. package/build/components/block-tools/insertion-point.js +12 -10
  167. package/build/components/block-tools/insertion-point.js.map +1 -1
  168. package/build/components/block-types-list/index.js +9 -8
  169. package/build/components/block-types-list/index.js.map +1 -1
  170. package/build/components/block-types-list/index.native.js +19 -15
  171. package/build/components/block-types-list/index.native.js.map +1 -1
  172. package/build/components/block-variation-picker/index.js +9 -8
  173. package/build/components/block-variation-picker/index.js.map +1 -1
  174. package/build/components/block-variation-picker/index.native.js +9 -7
  175. package/build/components/block-variation-picker/index.native.js.map +1 -1
  176. package/build/components/block-variation-transforms/index.js +22 -15
  177. package/build/components/block-variation-transforms/index.js.map +1 -1
  178. package/build/components/block-vertical-alignment-control/ui.js +9 -7
  179. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  180. package/build/components/border-radius-control/all-input-control.js +6 -5
  181. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  182. package/build/components/border-radius-control/index.js +5 -4
  183. package/build/components/border-radius-control/index.js.map +1 -1
  184. package/build/components/border-radius-control/input-controls.js +16 -11
  185. package/build/components/border-radius-control/input-controls.js.map +1 -1
  186. package/build/components/border-radius-control/linked-button.js +5 -4
  187. package/build/components/border-radius-control/linked-button.js.map +1 -1
  188. package/build/components/border-radius-control/utils.js +10 -5
  189. package/build/components/border-radius-control/utils.js.map +1 -1
  190. package/build/components/border-style-control/index.js +5 -4
  191. package/build/components/border-style-control/index.js.map +1 -1
  192. package/build/components/button-block-appender/index.js +15 -13
  193. package/build/components/button-block-appender/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.native.js +28 -24
  195. package/build/components/button-block-appender/index.native.js.map +1 -1
  196. package/build/components/caption/index.native.js +44 -41
  197. package/build/components/caption/index.native.js.map +1 -1
  198. package/build/components/color-palette/control.js +6 -5
  199. package/build/components/color-palette/control.js.map +1 -1
  200. package/build/components/color-style-selector/index.js +43 -34
  201. package/build/components/color-style-selector/index.js.map +1 -1
  202. package/build/components/colors/color-panel.js +21 -18
  203. package/build/components/colors/color-panel.js.map +1 -1
  204. package/build/components/colors/index.js +10 -8
  205. package/build/components/colors/index.js.map +1 -1
  206. package/build/components/colors/utils.js +7 -4
  207. package/build/components/colors/utils.js.map +1 -1
  208. package/build/components/colors/with-colors.js +17 -6
  209. package/build/components/colors/with-colors.js.map +1 -1
  210. package/build/components/colors-gradients/control.js +16 -15
  211. package/build/components/colors-gradients/control.js.map +1 -1
  212. package/build/components/colors-gradients/panel-color-gradient-settings.js +56 -49
  213. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  214. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  215. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  216. package/build/components/contrast-checker/index.js +18 -15
  217. package/build/components/contrast-checker/index.js.map +1 -1
  218. package/build/components/convert-to-group-buttons/index.js +9 -8
  219. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  220. package/build/components/copy-handler/index.js +6 -5
  221. package/build/components/copy-handler/index.js.map +1 -1
  222. package/build/components/default-block-appender/index.js +10 -8
  223. package/build/components/default-block-appender/index.js.map +1 -1
  224. package/build/components/default-block-appender/index.native.js +10 -8
  225. package/build/components/default-block-appender/index.native.js.map +1 -1
  226. package/build/components/default-style-picker/index.js +14 -10
  227. package/build/components/default-style-picker/index.js.map +1 -1
  228. package/build/components/duotone-control/index.js +15 -12
  229. package/build/components/duotone-control/index.js.map +1 -1
  230. package/build/components/editable-text/index.js +6 -5
  231. package/build/components/editable-text/index.js.map +1 -1
  232. package/build/components/editor-styles/index.js +4 -3
  233. package/build/components/editor-styles/index.js.map +1 -1
  234. package/build/components/floating-toolbar/index.native.js +8 -7
  235. package/build/components/floating-toolbar/index.native.js.map +1 -1
  236. package/build/components/font-appearance-control/index.js +26 -19
  237. package/build/components/font-appearance-control/index.js.map +1 -1
  238. package/build/components/font-family/index.js +12 -10
  239. package/build/components/font-family/index.js.map +1 -1
  240. package/build/components/font-sizes/index.js +6 -6
  241. package/build/components/font-sizes/index.native.js +6 -6
  242. package/build/components/font-sizes/utils.js +2 -2
  243. package/build/components/font-sizes/with-font-sizes.js +11 -5
  244. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  245. package/build/components/gradients/use-gradient.js +7 -6
  246. package/build/components/gradients/use-gradient.js.map +1 -1
  247. package/build/components/iframe/index.js +28 -22
  248. package/build/components/iframe/index.js.map +1 -1
  249. package/build/components/image-editor/aspect-ratio-dropdown.js +90 -82
  250. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  251. package/build/components/image-editor/constants.js +1 -1
  252. package/build/components/image-editor/context.js +11 -10
  253. package/build/components/image-editor/context.js.map +1 -1
  254. package/build/components/image-editor/cropper.js +9 -8
  255. package/build/components/image-editor/cropper.js.map +1 -1
  256. package/build/components/image-editor/index.js +10 -9
  257. package/build/components/image-editor/index.js.map +1 -1
  258. package/build/components/image-editor/use-save-image.js +12 -11
  259. package/build/components/image-editor/use-save-image.js.map +1 -1
  260. package/build/components/image-editor/use-transform-image.js +6 -5
  261. package/build/components/image-editor/use-transform-image.js.map +1 -1
  262. package/build/components/image-editor/zoom-dropdown.js +13 -10
  263. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  264. package/build/components/image-size-control/index.js +12 -11
  265. package/build/components/image-size-control/index.js.map +1 -1
  266. package/build/components/index.js +210 -208
  267. package/build/components/index.js.map +1 -1
  268. package/build/components/index.native.js +112 -110
  269. package/build/components/index.native.js.map +1 -1
  270. package/build/components/inner-blocks/button-block-appender.js +8 -7
  271. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  272. package/build/components/inner-blocks/default-block-appender.js +9 -7
  273. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  274. package/build/components/inner-blocks/index.js +4 -2
  275. package/build/components/inner-blocks/index.js.map +1 -1
  276. package/build/components/inner-blocks/index.native.js +4 -2
  277. package/build/components/inner-blocks/index.native.js.map +1 -1
  278. package/build/components/inserter/block-patterns-explorer/explorer.js +10 -8
  279. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/patterns-list.js +12 -9
  281. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  282. package/build/components/inserter/block-patterns-explorer/sidebar.js +24 -20
  283. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  284. package/build/components/inserter/block-patterns-tab.js +26 -20
  285. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  286. package/build/components/inserter/block-types-tab.js +9 -7
  287. package/build/components/inserter/block-types-tab.js.map +1 -1
  288. package/build/components/inserter/block-types-tab.native.js +9 -8
  289. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  290. package/build/components/inserter/hooks/use-block-type-impressions.native.js +5 -3
  291. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  292. package/build/components/inserter/hooks/use-block-types-state.js +6 -5
  293. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  294. package/build/components/inserter/hooks/use-insertion-point.js +11 -9
  295. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  296. package/build/components/inserter/index.js +36 -28
  297. package/build/components/inserter/index.js.map +1 -1
  298. package/build/components/inserter/index.native.js +46 -37
  299. package/build/components/inserter/index.native.js.map +1 -1
  300. package/build/components/inserter/library.js +12 -11
  301. package/build/components/inserter/library.js.map +1 -1
  302. package/build/components/inserter/menu.js +12 -11
  303. package/build/components/inserter/menu.js.map +1 -1
  304. package/build/components/inserter/menu.native.js +31 -27
  305. package/build/components/inserter/menu.native.js.map +1 -1
  306. package/build/components/inserter/panel.js +6 -5
  307. package/build/components/inserter/panel.js.map +1 -1
  308. package/build/components/inserter/pattern-panel.js +7 -6
  309. package/build/components/inserter/pattern-panel.js.map +1 -1
  310. package/build/components/inserter/preview-panel.js +4 -3
  311. package/build/components/inserter/preview-panel.js.map +1 -1
  312. package/build/components/inserter/quick-inserter.js +7 -6
  313. package/build/components/inserter/quick-inserter.js.map +1 -1
  314. package/build/components/inserter/reusable-blocks-tab.js +18 -13
  315. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  316. package/build/components/inserter/reusable-blocks-tab.native.js +6 -5
  317. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  318. package/build/components/inserter/search-items.js +23 -7
  319. package/build/components/inserter/search-items.js.map +1 -1
  320. package/build/components/inserter/search-results.js +15 -14
  321. package/build/components/inserter/search-results.js.map +1 -1
  322. package/build/components/inserter/search-results.native.js +11 -10
  323. package/build/components/inserter/search-results.native.js.map +1 -1
  324. package/build/components/inserter/tabs.js +7 -6
  325. package/build/components/inserter/tabs.js.map +1 -1
  326. package/build/components/inserter/tabs.native.js +55 -37
  327. package/build/components/inserter/tabs.native.js.map +1 -1
  328. package/build/components/inserter/utils.native.js +10 -8
  329. package/build/components/inserter/utils.native.js.map +1 -1
  330. package/build/components/inserter-draggable-blocks/index.js +12 -10
  331. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  332. package/build/components/inserter-list-item/index.js +79 -73
  333. package/build/components/inserter-list-item/index.js.map +1 -1
  334. package/build/components/inserter-listbox/index.js +8 -7
  335. package/build/components/inserter-listbox/index.js.map +1 -1
  336. package/build/components/inserter-listbox/item.js +7 -6
  337. package/build/components/inserter-listbox/item.js.map +1 -1
  338. package/build/components/inspector-controls/block-support-slot-container.js +5 -4
  339. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  340. package/build/components/inspector-controls/block-support-tools-panel.js +8 -6
  341. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  342. package/build/components/inspector-controls/fill.js +5 -4
  343. package/build/components/inspector-controls/fill.js.map +1 -1
  344. package/build/components/inspector-controls/fill.native.js +6 -5
  345. package/build/components/inspector-controls/fill.native.js.map +1 -1
  346. package/build/components/inspector-controls/slot.js +7 -6
  347. package/build/components/inspector-controls/slot.js.map +1 -1
  348. package/build/components/inspector-controls/slot.native.js +5 -4
  349. package/build/components/inspector-controls/slot.native.js.map +1 -1
  350. package/build/components/justify-content-control/ui.js +10 -8
  351. package/build/components/justify-content-control/ui.js.map +1 -1
  352. package/build/components/letter-spacing-control/index.js +6 -5
  353. package/build/components/letter-spacing-control/index.js.map +1 -1
  354. package/build/components/line-height-control/index.js +5 -4
  355. package/build/components/line-height-control/index.js.map +1 -1
  356. package/build/components/line-height-control/index.native.js +5 -4
  357. package/build/components/line-height-control/index.native.js.map +1 -1
  358. package/build/components/line-height-control/utils.js +1 -1
  359. package/build/components/link-control/index.js +25 -23
  360. package/build/components/link-control/index.js.map +1 -1
  361. package/build/components/link-control/link-preview.js +8 -7
  362. package/build/components/link-control/link-preview.js.map +1 -1
  363. package/build/components/link-control/search-create-button.js +9 -7
  364. package/build/components/link-control/search-create-button.js.map +1 -1
  365. package/build/components/link-control/search-input.js +21 -20
  366. package/build/components/link-control/search-input.js.map +1 -1
  367. package/build/components/link-control/search-item.js +10 -9
  368. package/build/components/link-control/search-item.js.map +1 -1
  369. package/build/components/link-control/search-results.js +15 -14
  370. package/build/components/link-control/search-results.js.map +1 -1
  371. package/build/components/link-control/settings-drawer.js +7 -5
  372. package/build/components/link-control/settings-drawer.js.map +1 -1
  373. package/build/components/link-control/use-search-handler.js +5 -4
  374. package/build/components/link-control/use-search-handler.js.map +1 -1
  375. package/build/components/link-control/viewer-slot.js +1 -1
  376. package/build/components/list-view/appender.js +27 -23
  377. package/build/components/list-view/appender.js.map +1 -1
  378. package/build/components/list-view/block-contents.js +32 -28
  379. package/build/components/list-view/block-contents.js.map +1 -1
  380. package/build/components/list-view/block-select-button.js +18 -17
  381. package/build/components/list-view/block-select-button.js.map +1 -1
  382. package/build/components/list-view/block.js +79 -66
  383. package/build/components/list-view/block.js.map +1 -1
  384. package/build/components/list-view/drop-indicator.js +5 -4
  385. package/build/components/list-view/drop-indicator.js.map +1 -1
  386. package/build/components/list-view/expander.js +4 -3
  387. package/build/components/list-view/expander.js.map +1 -1
  388. package/build/components/list-view/index.js +11 -10
  389. package/build/components/list-view/index.js.map +1 -1
  390. package/build/components/list-view/leaf.js +11 -10
  391. package/build/components/list-view/leaf.js.map +1 -1
  392. package/build/components/list-view/list-item.js +8 -7
  393. package/build/components/list-view/list-item.js.map +1 -1
  394. package/build/components/media-placeholder/index.js +86 -68
  395. package/build/components/media-placeholder/index.js.map +1 -1
  396. package/build/components/media-placeholder/index.native.js +5 -4
  397. package/build/components/media-placeholder/index.native.js.map +1 -1
  398. package/build/components/media-replace-flow/index.js +85 -72
  399. package/build/components/media-replace-flow/index.js.map +1 -1
  400. package/build/components/media-upload/check.js +5 -4
  401. package/build/components/media-upload/check.js.map +1 -1
  402. package/build/components/media-upload/index.native.js +1 -1
  403. package/build/components/media-upload-progress/index.native.js +1 -1
  404. package/build/components/multi-selection-inspector/index.js +4 -3
  405. package/build/components/multi-selection-inspector/index.js.map +1 -1
  406. package/build/components/navigable-toolbar/index.js +8 -7
  407. package/build/components/navigable-toolbar/index.js.map +1 -1
  408. package/build/components/observe-typing/index.js +5 -4
  409. package/build/components/observe-typing/index.js.map +1 -1
  410. package/build/components/panel-color-settings/index.js +16 -12
  411. package/build/components/panel-color-settings/index.js.map +1 -1
  412. package/build/components/plain-text/index.js +6 -4
  413. package/build/components/plain-text/index.js.map +1 -1
  414. package/build/components/preview-options/index.js +8 -7
  415. package/build/components/preview-options/index.js.map +1 -1
  416. package/build/components/provider/block-refs-provider.js +5 -4
  417. package/build/components/provider/block-refs-provider.js.map +1 -1
  418. package/build/components/provider/use-block-sync.js +8 -7
  419. package/build/components/provider/use-block-sync.js.map +1 -1
  420. package/build/components/provider/with-registry-provider.js +7 -5
  421. package/build/components/provider/with-registry-provider.js.map +1 -1
  422. package/build/components/responsive-block-control/label.js +6 -5
  423. package/build/components/responsive-block-control/label.js.map +1 -1
  424. package/build/components/rich-text/embed-handler-picker.native.js +7 -5
  425. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  426. package/build/components/rich-text/file-paste-handler.js +6 -3
  427. package/build/components/rich-text/file-paste-handler.js.map +1 -1
  428. package/build/components/rich-text/format-edit.js +8 -7
  429. package/build/components/rich-text/format-edit.js.map +1 -1
  430. package/build/components/rich-text/format-toolbar/index.js +18 -9
  431. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  432. package/build/components/rich-text/format-toolbar-container.js +6 -4
  433. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  434. package/build/components/rich-text/index.js +45 -41
  435. package/build/components/rich-text/index.js.map +1 -1
  436. package/build/components/rich-text/index.native.js +145 -122
  437. package/build/components/rich-text/index.native.js.map +1 -1
  438. package/build/components/rich-text/input-event.js +5 -4
  439. package/build/components/rich-text/input-event.js.map +1 -1
  440. package/build/components/rich-text/shortcut.js +6 -5
  441. package/build/components/rich-text/shortcut.js.map +1 -1
  442. package/build/components/rich-text/split-value.js +10 -8
  443. package/build/components/rich-text/split-value.js.map +1 -1
  444. package/build/components/rich-text/toolbar-button.js +7 -6
  445. package/build/components/rich-text/toolbar-button.js.map +1 -1
  446. package/build/components/rich-text/use-caret-in-format.js +4 -3
  447. package/build/components/rich-text/use-caret-in-format.js.map +1 -1
  448. package/build/components/rich-text/use-enter.js +6 -3
  449. package/build/components/rich-text/use-enter.js.map +1 -1
  450. package/build/components/rich-text/use-format-types.js +13 -10
  451. package/build/components/rich-text/use-format-types.js.map +1 -1
  452. package/build/components/rich-text/use-input-rules.js +15 -9
  453. package/build/components/rich-text/use-input-rules.js.map +1 -1
  454. package/build/components/rich-text/use-mark-persistent.js +5 -4
  455. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  456. package/build/components/rich-text/use-paste-handler.js +28 -4
  457. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  458. package/build/components/rich-text/utils.js +9 -7
  459. package/build/components/rich-text/utils.js.map +1 -1
  460. package/build/components/skip-to-selected-block/index.js +4 -3
  461. package/build/components/skip-to-selected-block/index.js.map +1 -1
  462. package/build/components/text-decoration-control/index.js +5 -4
  463. package/build/components/text-decoration-control/index.js.map +1 -1
  464. package/build/components/text-transform-control/index.js +5 -4
  465. package/build/components/text-transform-control/index.js.map +1 -1
  466. package/build/components/tool-selector/index.js +16 -13
  467. package/build/components/tool-selector/index.js.map +1 -1
  468. package/build/components/typewriter/index.js +10 -7
  469. package/build/components/typewriter/index.js.map +1 -1
  470. package/build/components/ungroup-button/index.native.js +12 -9
  471. package/build/components/ungroup-button/index.native.js.map +1 -1
  472. package/build/components/unit-control/index.js +5 -4
  473. package/build/components/unit-control/index.js.map +1 -1
  474. package/build/components/url-input/index.js +12 -9
  475. package/build/components/url-input/index.js.map +1 -1
  476. package/build/components/url-input/index.native.js +8 -6
  477. package/build/components/url-input/index.native.js.map +1 -1
  478. package/build/components/url-popover/image-url-input-ui.js +12 -11
  479. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  480. package/build/components/url-popover/index.js +9 -8
  481. package/build/components/url-popover/index.js.map +1 -1
  482. package/build/components/url-popover/link-editor.js +8 -7
  483. package/build/components/url-popover/link-editor.js.map +1 -1
  484. package/build/components/url-popover/link-viewer-url.js +6 -5
  485. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  486. package/build/components/url-popover/link-viewer.js +9 -8
  487. package/build/components/url-popover/link-viewer.js.map +1 -1
  488. package/build/components/use-block-drop-zone/index.js +9 -8
  489. package/build/components/use-block-drop-zone/index.js.map +1 -1
  490. package/build/components/use-moving-animation/index.js +17 -13
  491. package/build/components/use-moving-animation/index.js.map +1 -1
  492. package/build/components/use-no-recursive-renders/index.js +10 -6
  493. package/build/components/use-no-recursive-renders/index.js.map +1 -1
  494. package/build/components/use-on-block-drop/index.js +2 -2
  495. package/build/components/use-setting/index.js +1 -1
  496. package/build/components/use-setting/index.js.map +1 -1
  497. package/build/components/warning/index.js +7 -6
  498. package/build/components/warning/index.js.map +1 -1
  499. package/build/components/warning/index.native.js +10 -9
  500. package/build/components/warning/index.native.js.map +1 -1
  501. package/build/components/writing-flow/index.js +6 -5
  502. package/build/components/writing-flow/index.js.map +1 -1
  503. package/build/components/writing-flow/use-arrow-nav.js +2 -2
  504. package/build/hooks/align.js +12 -7
  505. package/build/hooks/align.js.map +1 -1
  506. package/build/hooks/border.js +4 -2
  507. package/build/hooks/border.js.map +1 -1
  508. package/build/hooks/color-panel.js +7 -6
  509. package/build/hooks/color-panel.js.map +1 -1
  510. package/build/hooks/color.js +4 -3
  511. package/build/hooks/color.js.map +1 -1
  512. package/build/hooks/dimensions.js +4 -2
  513. package/build/hooks/dimensions.js.map +1 -1
  514. package/build/hooks/duotone.js +13 -10
  515. package/build/hooks/duotone.js.map +1 -1
  516. package/build/hooks/font-appearance.js +17 -14
  517. package/build/hooks/font-appearance.js.map +1 -1
  518. package/build/hooks/font-family.js +29 -20
  519. package/build/hooks/font-family.js.map +1 -1
  520. package/build/hooks/font-size.js +10 -8
  521. package/build/hooks/font-size.js.map +1 -1
  522. package/build/hooks/gap.js +10 -8
  523. package/build/hooks/gap.js.map +1 -1
  524. package/build/hooks/index.js +14 -14
  525. package/build/hooks/index.native.js +10 -10
  526. package/build/hooks/layout.js +16 -13
  527. package/build/hooks/layout.js.map +1 -1
  528. package/build/hooks/letter-spacing.js +11 -9
  529. package/build/hooks/letter-spacing.js.map +1 -1
  530. package/build/hooks/line-height.js +11 -9
  531. package/build/hooks/line-height.js.map +1 -1
  532. package/build/hooks/margin.js +10 -8
  533. package/build/hooks/margin.js.map +1 -1
  534. package/build/hooks/padding.js +10 -8
  535. package/build/hooks/padding.js.map +1 -1
  536. package/build/hooks/style.js +9 -5
  537. package/build/hooks/style.js.map +1 -1
  538. package/build/hooks/text-decoration.js +11 -9
  539. package/build/hooks/text-decoration.js.map +1 -1
  540. package/build/hooks/text-transform.js +11 -9
  541. package/build/hooks/text-transform.js.map +1 -1
  542. package/build/hooks/typography.js +3 -2
  543. package/build/hooks/typography.js.map +1 -1
  544. package/build/hooks/typography.native.js +3 -2
  545. package/build/hooks/typography.native.js.map +1 -1
  546. package/build/hooks/use-border-props.js +5 -4
  547. package/build/hooks/use-border-props.js.map +1 -1
  548. package/build/index.js +18 -18
  549. package/build/layouts/flex.js +67 -39
  550. package/build/layouts/flex.js.map +1 -1
  551. package/build/layouts/flow.js +10 -8
  552. package/build/layouts/flow.js.map +1 -1
  553. package/build/layouts/index.js +2 -1
  554. package/build/layouts/index.js.map +1 -1
  555. package/build/layouts/utils.js +2 -1
  556. package/build/layouts/utils.js.map +1 -1
  557. package/build/store/actions.js +311 -232
  558. package/build/store/actions.js.map +1 -1
  559. package/build/store/array.js +2 -1
  560. package/build/store/array.js.map +1 -1
  561. package/build/store/index.js +5 -3
  562. package/build/store/index.js.map +1 -1
  563. package/build/store/reducer.js +124 -49
  564. package/build/store/reducer.js.map +1 -1
  565. package/build/store/selectors.js +219 -141
  566. package/build/store/selectors.js.map +1 -1
  567. package/build/utils/block-variation-transforms.js +4 -3
  568. package/build/utils/block-variation-transforms.js.map +1 -1
  569. package/build/utils/dom.js +1 -1
  570. package/build/utils/get-paste-event-data.js +10 -6
  571. package/build/utils/get-paste-event-data.js.map +1 -1
  572. package/build/utils/index.js +4 -4
  573. package/build/utils/math.js +2 -1
  574. package/build/utils/math.js.map +1 -1
  575. package/build/utils/parse-css-unit-to-px.js +6 -3
  576. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  577. package/build/utils/transform-styles/index.js +8 -6
  578. package/build/utils/transform-styles/index.js.map +1 -1
  579. package/build/utils/transform-styles/transforms/wrap.js +31 -28
  580. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  581. package/build-module/components/alignment-control/ui.js +11 -9
  582. package/build-module/components/alignment-control/ui.js.map +1 -1
  583. package/build-module/components/autocomplete/index.js +4 -3
  584. package/build-module/components/autocomplete/index.js.map +1 -1
  585. package/build-module/components/block-actions/index.js +12 -8
  586. package/build-module/components/block-actions/index.js.map +1 -1
  587. package/build-module/components/block-alignment-control/ui.js +21 -17
  588. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  589. package/build-module/components/block-alignment-control/use-available-alignments.js +9 -4
  590. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  591. package/build-module/components/block-alignment-matrix-control/index.js +6 -4
  592. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  593. package/build-module/components/block-breadcrumb/index.js +4 -3
  594. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  595. package/build-module/components/block-caption/index.native.js +34 -29
  596. package/build-module/components/block-caption/index.native.js.map +1 -1
  597. package/build-module/components/block-card/index.js +8 -6
  598. package/build-module/components/block-card/index.js.map +1 -1
  599. package/build-module/components/block-compare/block-view.js +9 -8
  600. package/build-module/components/block-compare/block-view.js.map +1 -1
  601. package/build-module/components/block-compare/index.js +9 -7
  602. package/build-module/components/block-compare/index.js.map +1 -1
  603. package/build-module/components/block-content-overlay/index.js +7 -6
  604. package/build-module/components/block-content-overlay/index.js.map +1 -1
  605. package/build-module/components/block-context/index.js +5 -4
  606. package/build-module/components/block-context/index.js.map +1 -1
  607. package/build-module/components/block-controls/fill.js +7 -6
  608. package/build-module/components/block-controls/fill.js.map +1 -1
  609. package/build-module/components/block-controls/slot.js +5 -4
  610. package/build-module/components/block-controls/slot.js.map +1 -1
  611. package/build-module/components/block-controls/slot.native.js +5 -4
  612. package/build-module/components/block-controls/slot.native.js.map +1 -1
  613. package/build-module/components/block-draggable/draggable-chip.js +5 -4
  614. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  615. package/build-module/components/block-draggable/index.js +13 -11
  616. package/build-module/components/block-draggable/index.js.map +1 -1
  617. package/build-module/components/block-full-height-alignment-control/index.js +7 -6
  618. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  619. package/build-module/components/block-icon/index.js +7 -5
  620. package/build-module/components/block-icon/index.js.map +1 -1
  621. package/build-module/components/block-icon/index.native.js +8 -6
  622. package/build-module/components/block-icon/index.native.js.map +1 -1
  623. package/build-module/components/block-inspector/index.js +16 -13
  624. package/build-module/components/block-inspector/index.js.map +1 -1
  625. package/build-module/components/block-list/block-html.js +4 -3
  626. package/build-module/components/block-list/block-html.js.map +1 -1
  627. package/build-module/components/block-list/block-invalid-warning.js +27 -19
  628. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  629. package/build-module/components/block-list/block-invalid-warning.native.js +5 -4
  630. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  631. package/build-module/components/block-list/block-list-item.native.js +6 -5
  632. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  633. package/build-module/components/block-list/block-selection-button.native.js +11 -9
  634. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  635. package/build-module/components/block-list/block.js +40 -33
  636. package/build-module/components/block-list/block.js.map +1 -1
  637. package/build-module/components/block-list/block.native.js +35 -29
  638. package/build-module/components/block-list/block.native.js.map +1 -1
  639. package/build-module/components/block-list/index.js +13 -11
  640. package/build-module/components/block-list/index.js.map +1 -1
  641. package/build-module/components/block-list/index.native.js +21 -16
  642. package/build-module/components/block-list/index.native.js.map +1 -1
  643. package/build-module/components/block-list/insertion-point.native.js +4 -3
  644. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  645. package/build-module/components/block-list/layout.js +5 -4
  646. package/build-module/components/block-list/layout.js.map +1 -1
  647. package/build-module/components/block-list/subdirectory-icon.js +13 -10
  648. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  649. package/build-module/components/block-list/use-block-props/index.js +5 -3
  650. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  651. package/build-module/components/block-list/use-block-props/index.native.js +2 -1
  652. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  653. package/build-module/components/block-list/use-block-props/use-multi-selection.js +9 -6
  654. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  655. package/build-module/components/block-list-appender/index.js +16 -13
  656. package/build-module/components/block-list-appender/index.js.map +1 -1
  657. package/build-module/components/block-list-appender/index.native.js +14 -11
  658. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  659. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  660. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  661. package/build-module/components/block-mobile-toolbar/index.js +4 -3
  662. package/build-module/components/block-mobile-toolbar/index.js.map +1 -1
  663. package/build-module/components/block-mobile-toolbar/index.native.js +33 -25
  664. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  665. package/build-module/components/block-mover/button.js +7 -6
  666. package/build-module/components/block-mover/button.js.map +1 -1
  667. package/build-module/components/block-mover/index.js +15 -13
  668. package/build-module/components/block-mover/index.js.map +1 -1
  669. package/build-module/components/block-mover/index.native.js +22 -19
  670. package/build-module/components/block-mover/index.native.js.map +1 -1
  671. package/build-module/components/block-mover/mover-description.native.js +10 -7
  672. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  673. package/build-module/components/block-navigation/dropdown.js +26 -21
  674. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  675. package/build-module/components/block-pattern-setup/index.js +26 -22
  676. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  677. package/build-module/components/block-pattern-setup/setup-toolbar.js +46 -39
  678. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  679. package/build-module/components/block-patterns-list/index.js +44 -39
  680. package/build-module/components/block-patterns-list/index.js.map +1 -1
  681. package/build-module/components/block-preview/auto.js +5 -4
  682. package/build-module/components/block-preview/auto.js.map +1 -1
  683. package/build-module/components/block-preview/index.js +8 -7
  684. package/build-module/components/block-preview/index.js.map +1 -1
  685. package/build-module/components/block-preview/live.js +4 -3
  686. package/build-module/components/block-preview/live.js.map +1 -1
  687. package/build-module/components/block-settings/button.native.js +10 -7
  688. package/build-module/components/block-settings/button.native.js.map +1 -1
  689. package/build-module/components/block-settings/container.native.js +7 -6
  690. package/build-module/components/block-settings/container.native.js.map +1 -1
  691. package/build-module/components/block-settings-menu/block-convert-button.js +7 -5
  692. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  693. package/build-module/components/block-settings-menu/block-html-convert-button.js +14 -10
  694. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  695. package/build-module/components/block-settings-menu/block-mode-toggle.js +25 -19
  696. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  697. package/build-module/components/block-settings-menu/block-settings-dropdown.js +74 -66
  698. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  699. package/build-module/components/block-settings-menu/index.js +5 -4
  700. package/build-module/components/block-settings-menu/index.js.map +1 -1
  701. package/build-module/components/block-settings-menu-controls/index.js +8 -6
  702. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  703. package/build-module/components/block-styles/index.js +20 -17
  704. package/build-module/components/block-styles/index.js.map +1 -1
  705. package/build-module/components/block-styles/index.native.js +6 -4
  706. package/build-module/components/block-styles/index.native.js.map +1 -1
  707. package/build-module/components/block-styles/preview.native.js +7 -6
  708. package/build-module/components/block-styles/preview.native.js.map +1 -1
  709. package/build-module/components/block-switcher/block-styles-menu.js +5 -4
  710. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  711. package/build-module/components/block-switcher/block-transformations-menu.js +7 -6
  712. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  713. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -8
  714. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  715. package/build-module/components/block-switcher/index.js +41 -33
  716. package/build-module/components/block-switcher/index.js.map +1 -1
  717. package/build-module/components/block-switcher/pattern-transformations-menu.js +22 -18
  718. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  719. package/build-module/components/block-switcher/preview-block-popover.js +4 -3
  720. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  721. package/build-module/components/block-switcher/utils.js +2 -1
  722. package/build-module/components/block-switcher/utils.js.map +1 -1
  723. package/build-module/components/block-title/index.js +4 -3
  724. package/build-module/components/block-title/index.js.map +1 -1
  725. package/build-module/components/block-toolbar/index.js +4 -3
  726. package/build-module/components/block-toolbar/index.js.map +1 -1
  727. package/build-module/components/block-toolbar/utils.js +13 -11
  728. package/build-module/components/block-toolbar/utils.js.map +1 -1
  729. package/build-module/components/block-tools/back-compat.js +4 -3
  730. package/build-module/components/block-tools/back-compat.js.map +1 -1
  731. package/build-module/components/block-tools/block-contextual-toolbar.js +6 -5
  732. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  733. package/build-module/components/block-tools/block-popover.js +15 -13
  734. package/build-module/components/block-tools/block-popover.js.map +1 -1
  735. package/build-module/components/block-tools/block-selection-button.js +6 -5
  736. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  737. package/build-module/components/block-tools/index.js +6 -5
  738. package/build-module/components/block-tools/index.js.map +1 -1
  739. package/build-module/components/block-tools/insertion-point.js +11 -9
  740. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  741. package/build-module/components/block-types-list/index.js +9 -8
  742. package/build-module/components/block-types-list/index.js.map +1 -1
  743. package/build-module/components/block-types-list/index.native.js +19 -15
  744. package/build-module/components/block-types-list/index.native.js.map +1 -1
  745. package/build-module/components/block-variation-picker/index.js +9 -8
  746. package/build-module/components/block-variation-picker/index.js.map +1 -1
  747. package/build-module/components/block-variation-picker/index.native.js +9 -7
  748. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  749. package/build-module/components/block-variation-transforms/index.js +22 -15
  750. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  751. package/build-module/components/block-vertical-alignment-control/ui.js +9 -7
  752. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  753. package/build-module/components/border-radius-control/all-input-control.js +6 -5
  754. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  755. package/build-module/components/border-radius-control/index.js +5 -4
  756. package/build-module/components/border-radius-control/index.js.map +1 -1
  757. package/build-module/components/border-radius-control/input-controls.js +16 -11
  758. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  759. package/build-module/components/border-radius-control/linked-button.js +5 -4
  760. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  761. package/build-module/components/border-radius-control/utils.js +8 -3
  762. package/build-module/components/border-radius-control/utils.js.map +1 -1
  763. package/build-module/components/border-style-control/index.js +5 -4
  764. package/build-module/components/border-style-control/index.js.map +1 -1
  765. package/build-module/components/button-block-appender/index.js +15 -13
  766. package/build-module/components/button-block-appender/index.js.map +1 -1
  767. package/build-module/components/button-block-appender/index.native.js +28 -24
  768. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  769. package/build-module/components/caption/index.native.js +44 -41
  770. package/build-module/components/caption/index.native.js.map +1 -1
  771. package/build-module/components/color-palette/control.js +6 -5
  772. package/build-module/components/color-palette/control.js.map +1 -1
  773. package/build-module/components/color-style-selector/index.js +43 -34
  774. package/build-module/components/color-style-selector/index.js.map +1 -1
  775. package/build-module/components/colors/color-panel.js +21 -18
  776. package/build-module/components/colors/color-panel.js.map +1 -1
  777. package/build-module/components/colors/utils.js +6 -3
  778. package/build-module/components/colors/utils.js.map +1 -1
  779. package/build-module/components/colors/with-colors.js +17 -6
  780. package/build-module/components/colors/with-colors.js.map +1 -1
  781. package/build-module/components/colors-gradients/control.js +16 -15
  782. package/build-module/components/colors-gradients/control.js.map +1 -1
  783. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +57 -50
  784. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  785. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  786. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  787. package/build-module/components/contrast-checker/index.js +18 -15
  788. package/build-module/components/contrast-checker/index.js.map +1 -1
  789. package/build-module/components/convert-to-group-buttons/index.js +9 -8
  790. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  791. package/build-module/components/copy-handler/index.js +4 -3
  792. package/build-module/components/copy-handler/index.js.map +1 -1
  793. package/build-module/components/default-block-appender/index.js +10 -8
  794. package/build-module/components/default-block-appender/index.js.map +1 -1
  795. package/build-module/components/default-block-appender/index.native.js +10 -8
  796. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  797. package/build-module/components/default-style-picker/index.js +14 -10
  798. package/build-module/components/default-style-picker/index.js.map +1 -1
  799. package/build-module/components/duotone-control/index.js +15 -12
  800. package/build-module/components/duotone-control/index.js.map +1 -1
  801. package/build-module/components/editable-text/index.js +6 -5
  802. package/build-module/components/editable-text/index.js.map +1 -1
  803. package/build-module/components/editor-styles/index.js +4 -3
  804. package/build-module/components/editor-styles/index.js.map +1 -1
  805. package/build-module/components/floating-toolbar/index.native.js +8 -7
  806. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  807. package/build-module/components/font-appearance-control/index.js +26 -19
  808. package/build-module/components/font-appearance-control/index.js.map +1 -1
  809. package/build-module/components/font-family/index.js +12 -10
  810. package/build-module/components/font-family/index.js.map +1 -1
  811. package/build-module/components/font-sizes/with-font-sizes.js +11 -5
  812. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  813. package/build-module/components/gradients/use-gradient.js +5 -4
  814. package/build-module/components/gradients/use-gradient.js.map +1 -1
  815. package/build-module/components/iframe/index.js +28 -22
  816. package/build-module/components/iframe/index.js.map +1 -1
  817. package/build-module/components/image-editor/aspect-ratio-dropdown.js +90 -82
  818. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  819. package/build-module/components/image-editor/context.js +11 -10
  820. package/build-module/components/image-editor/context.js.map +1 -1
  821. package/build-module/components/image-editor/cropper.js +9 -8
  822. package/build-module/components/image-editor/cropper.js.map +1 -1
  823. package/build-module/components/image-editor/index.js +9 -8
  824. package/build-module/components/image-editor/index.js.map +1 -1
  825. package/build-module/components/image-editor/use-save-image.js +12 -11
  826. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  827. package/build-module/components/image-editor/use-transform-image.js +6 -5
  828. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  829. package/build-module/components/image-editor/zoom-dropdown.js +13 -10
  830. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  831. package/build-module/components/image-size-control/index.js +12 -11
  832. package/build-module/components/image-size-control/index.js.map +1 -1
  833. package/build-module/components/inner-blocks/button-block-appender.js +8 -7
  834. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  835. package/build-module/components/inner-blocks/default-block-appender.js +9 -7
  836. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  837. package/build-module/components/inner-blocks/index.js +3 -1
  838. package/build-module/components/inner-blocks/index.js.map +1 -1
  839. package/build-module/components/inner-blocks/index.native.js +3 -1
  840. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  841. package/build-module/components/inserter/block-patterns-explorer/explorer.js +10 -8
  842. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  843. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +12 -9
  844. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  845. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +24 -20
  846. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  847. package/build-module/components/inserter/block-patterns-tab.js +26 -20
  848. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  849. package/build-module/components/inserter/block-types-tab.js +9 -7
  850. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  851. package/build-module/components/inserter/block-types-tab.native.js +9 -8
  852. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  853. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +5 -3
  854. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  855. package/build-module/components/inserter/hooks/use-block-types-state.js +6 -5
  856. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  857. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -9
  858. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  859. package/build-module/components/inserter/index.js +36 -28
  860. package/build-module/components/inserter/index.js.map +1 -1
  861. package/build-module/components/inserter/index.native.js +46 -37
  862. package/build-module/components/inserter/index.native.js.map +1 -1
  863. package/build-module/components/inserter/library.js +12 -11
  864. package/build-module/components/inserter/library.js.map +1 -1
  865. package/build-module/components/inserter/menu.js +12 -11
  866. package/build-module/components/inserter/menu.js.map +1 -1
  867. package/build-module/components/inserter/menu.native.js +31 -27
  868. package/build-module/components/inserter/menu.native.js.map +1 -1
  869. package/build-module/components/inserter/panel.js +6 -5
  870. package/build-module/components/inserter/panel.js.map +1 -1
  871. package/build-module/components/inserter/pattern-panel.js +7 -6
  872. package/build-module/components/inserter/pattern-panel.js.map +1 -1
  873. package/build-module/components/inserter/preview-panel.js +4 -3
  874. package/build-module/components/inserter/preview-panel.js.map +1 -1
  875. package/build-module/components/inserter/quick-inserter.js +7 -6
  876. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  877. package/build-module/components/inserter/reusable-blocks-tab.js +18 -13
  878. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  879. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -5
  880. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  881. package/build-module/components/inserter/search-items.js +23 -7
  882. package/build-module/components/inserter/search-items.js.map +1 -1
  883. package/build-module/components/inserter/search-results.js +15 -14
  884. package/build-module/components/inserter/search-results.js.map +1 -1
  885. package/build-module/components/inserter/search-results.native.js +11 -10
  886. package/build-module/components/inserter/search-results.native.js.map +1 -1
  887. package/build-module/components/inserter/tabs.js +7 -6
  888. package/build-module/components/inserter/tabs.js.map +1 -1
  889. package/build-module/components/inserter/tabs.native.js +55 -37
  890. package/build-module/components/inserter/tabs.native.js.map +1 -1
  891. package/build-module/components/inserter/utils.native.js +10 -8
  892. package/build-module/components/inserter/utils.native.js.map +1 -1
  893. package/build-module/components/inserter-draggable-blocks/index.js +12 -10
  894. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  895. package/build-module/components/inserter-list-item/index.js +75 -69
  896. package/build-module/components/inserter-list-item/index.js.map +1 -1
  897. package/build-module/components/inserter-listbox/index.js +4 -3
  898. package/build-module/components/inserter-listbox/index.js.map +1 -1
  899. package/build-module/components/inserter-listbox/item.js +7 -6
  900. package/build-module/components/inserter-listbox/item.js.map +1 -1
  901. package/build-module/components/inspector-controls/block-support-slot-container.js +5 -4
  902. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  903. package/build-module/components/inspector-controls/block-support-tools-panel.js +8 -6
  904. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  905. package/build-module/components/inspector-controls/fill.js +5 -4
  906. package/build-module/components/inspector-controls/fill.js.map +1 -1
  907. package/build-module/components/inspector-controls/fill.native.js +6 -5
  908. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  909. package/build-module/components/inspector-controls/slot.js +7 -6
  910. package/build-module/components/inspector-controls/slot.js.map +1 -1
  911. package/build-module/components/inspector-controls/slot.native.js +5 -4
  912. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  913. package/build-module/components/justify-content-control/ui.js +10 -8
  914. package/build-module/components/justify-content-control/ui.js.map +1 -1
  915. package/build-module/components/letter-spacing-control/index.js +6 -5
  916. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  917. package/build-module/components/line-height-control/index.js +5 -4
  918. package/build-module/components/line-height-control/index.js.map +1 -1
  919. package/build-module/components/line-height-control/index.native.js +5 -4
  920. package/build-module/components/line-height-control/index.native.js.map +1 -1
  921. package/build-module/components/link-control/index.js +25 -23
  922. package/build-module/components/link-control/index.js.map +1 -1
  923. package/build-module/components/link-control/link-preview.js +8 -7
  924. package/build-module/components/link-control/link-preview.js.map +1 -1
  925. package/build-module/components/link-control/search-create-button.js +9 -7
  926. package/build-module/components/link-control/search-create-button.js.map +1 -1
  927. package/build-module/components/link-control/search-input.js +21 -20
  928. package/build-module/components/link-control/search-input.js.map +1 -1
  929. package/build-module/components/link-control/search-item.js +10 -9
  930. package/build-module/components/link-control/search-item.js.map +1 -1
  931. package/build-module/components/link-control/search-results.js +15 -14
  932. package/build-module/components/link-control/search-results.js.map +1 -1
  933. package/build-module/components/link-control/settings-drawer.js +7 -5
  934. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  935. package/build-module/components/link-control/use-search-handler.js +4 -3
  936. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  937. package/build-module/components/list-view/appender.js +27 -23
  938. package/build-module/components/list-view/appender.js.map +1 -1
  939. package/build-module/components/list-view/block-contents.js +32 -28
  940. package/build-module/components/list-view/block-contents.js.map +1 -1
  941. package/build-module/components/list-view/block-select-button.js +18 -17
  942. package/build-module/components/list-view/block-select-button.js.map +1 -1
  943. package/build-module/components/list-view/block.js +79 -66
  944. package/build-module/components/list-view/block.js.map +1 -1
  945. package/build-module/components/list-view/drop-indicator.js +5 -4
  946. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  947. package/build-module/components/list-view/expander.js +4 -3
  948. package/build-module/components/list-view/expander.js.map +1 -1
  949. package/build-module/components/list-view/index.js +11 -10
  950. package/build-module/components/list-view/index.js.map +1 -1
  951. package/build-module/components/list-view/leaf.js +11 -10
  952. package/build-module/components/list-view/leaf.js.map +1 -1
  953. package/build-module/components/list-view/list-item.js +8 -7
  954. package/build-module/components/list-view/list-item.js.map +1 -1
  955. package/build-module/components/media-placeholder/index.js +86 -68
  956. package/build-module/components/media-placeholder/index.js.map +1 -1
  957. package/build-module/components/media-placeholder/index.native.js +5 -4
  958. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  959. package/build-module/components/media-replace-flow/index.js +85 -72
  960. package/build-module/components/media-replace-flow/index.js.map +1 -1
  961. package/build-module/components/media-upload/check.js +5 -4
  962. package/build-module/components/media-upload/check.js.map +1 -1
  963. package/build-module/components/multi-selection-inspector/index.js +4 -3
  964. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  965. package/build-module/components/navigable-toolbar/index.js +8 -7
  966. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  967. package/build-module/components/observe-typing/index.js +4 -3
  968. package/build-module/components/observe-typing/index.js.map +1 -1
  969. package/build-module/components/panel-color-settings/index.js +16 -12
  970. package/build-module/components/panel-color-settings/index.js.map +1 -1
  971. package/build-module/components/plain-text/index.js +6 -4
  972. package/build-module/components/plain-text/index.js.map +1 -1
  973. package/build-module/components/preview-options/index.js +8 -7
  974. package/build-module/components/preview-options/index.js.map +1 -1
  975. package/build-module/components/provider/block-refs-provider.js +4 -3
  976. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  977. package/build-module/components/provider/use-block-sync.js +8 -7
  978. package/build-module/components/provider/use-block-sync.js.map +1 -1
  979. package/build-module/components/provider/with-registry-provider.js +7 -5
  980. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  981. package/build-module/components/responsive-block-control/label.js +6 -5
  982. package/build-module/components/responsive-block-control/label.js.map +1 -1
  983. package/build-module/components/rich-text/embed-handler-picker.native.js +7 -5
  984. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  985. package/build-module/components/rich-text/file-paste-handler.js +6 -3
  986. package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
  987. package/build-module/components/rich-text/format-edit.js +8 -7
  988. package/build-module/components/rich-text/format-edit.js.map +1 -1
  989. package/build-module/components/rich-text/format-toolbar/index.js +18 -9
  990. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  991. package/build-module/components/rich-text/format-toolbar-container.js +6 -4
  992. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  993. package/build-module/components/rich-text/index.js +44 -40
  994. package/build-module/components/rich-text/index.js.map +1 -1
  995. package/build-module/components/rich-text/index.native.js +145 -122
  996. package/build-module/components/rich-text/index.native.js.map +1 -1
  997. package/build-module/components/rich-text/input-event.js +5 -4
  998. package/build-module/components/rich-text/input-event.js.map +1 -1
  999. package/build-module/components/rich-text/shortcut.js +6 -5
  1000. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1001. package/build-module/components/rich-text/split-value.js +10 -8
  1002. package/build-module/components/rich-text/split-value.js.map +1 -1
  1003. package/build-module/components/rich-text/toolbar-button.js +7 -6
  1004. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1005. package/build-module/components/rich-text/use-caret-in-format.js +4 -3
  1006. package/build-module/components/rich-text/use-caret-in-format.js.map +1 -1
  1007. package/build-module/components/rich-text/use-enter.js +6 -3
  1008. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1009. package/build-module/components/rich-text/use-format-types.js +13 -10
  1010. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1011. package/build-module/components/rich-text/use-input-rules.js +15 -9
  1012. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1013. package/build-module/components/rich-text/use-mark-persistent.js +5 -4
  1014. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1015. package/build-module/components/rich-text/use-paste-handler.js +28 -4
  1016. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1017. package/build-module/components/rich-text/utils.js +7 -5
  1018. package/build-module/components/rich-text/utils.js.map +1 -1
  1019. package/build-module/components/skip-to-selected-block/index.js +4 -3
  1020. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1021. package/build-module/components/text-decoration-control/index.js +5 -4
  1022. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1023. package/build-module/components/text-transform-control/index.js +5 -4
  1024. package/build-module/components/text-transform-control/index.js.map +1 -1
  1025. package/build-module/components/tool-selector/index.js +16 -13
  1026. package/build-module/components/tool-selector/index.js.map +1 -1
  1027. package/build-module/components/typewriter/index.js +9 -6
  1028. package/build-module/components/typewriter/index.js.map +1 -1
  1029. package/build-module/components/ungroup-button/index.native.js +12 -9
  1030. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1031. package/build-module/components/unit-control/index.js +5 -4
  1032. package/build-module/components/unit-control/index.js.map +1 -1
  1033. package/build-module/components/url-input/index.js +12 -9
  1034. package/build-module/components/url-input/index.js.map +1 -1
  1035. package/build-module/components/url-input/index.native.js +8 -6
  1036. package/build-module/components/url-input/index.native.js.map +1 -1
  1037. package/build-module/components/url-popover/image-url-input-ui.js +12 -11
  1038. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1039. package/build-module/components/url-popover/index.js +9 -8
  1040. package/build-module/components/url-popover/index.js.map +1 -1
  1041. package/build-module/components/url-popover/link-editor.js +8 -7
  1042. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1043. package/build-module/components/url-popover/link-viewer-url.js +6 -5
  1044. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1045. package/build-module/components/url-popover/link-viewer.js +9 -8
  1046. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1047. package/build-module/components/use-block-drop-zone/index.js +8 -7
  1048. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1049. package/build-module/components/use-moving-animation/index.js +17 -13
  1050. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1051. package/build-module/components/use-no-recursive-renders/index.js +10 -6
  1052. package/build-module/components/use-no-recursive-renders/index.js.map +1 -1
  1053. package/build-module/components/use-setting/index.js +1 -1
  1054. package/build-module/components/use-setting/index.js.map +1 -1
  1055. package/build-module/components/warning/index.js +7 -6
  1056. package/build-module/components/warning/index.js.map +1 -1
  1057. package/build-module/components/warning/index.native.js +10 -9
  1058. package/build-module/components/warning/index.native.js.map +1 -1
  1059. package/build-module/components/writing-flow/index.js +5 -4
  1060. package/build-module/components/writing-flow/index.js.map +1 -1
  1061. package/build-module/hooks/align.js +9 -4
  1062. package/build-module/hooks/align.js.map +1 -1
  1063. package/build-module/hooks/border.js +3 -1
  1064. package/build-module/hooks/border.js.map +1 -1
  1065. package/build-module/hooks/color-panel.js +7 -6
  1066. package/build-module/hooks/color-panel.js.map +1 -1
  1067. package/build-module/hooks/dimensions.js +2 -1
  1068. package/build-module/hooks/dimensions.js.map +1 -1
  1069. package/build-module/hooks/duotone.js +13 -10
  1070. package/build-module/hooks/duotone.js.map +1 -1
  1071. package/build-module/hooks/font-appearance.js +13 -10
  1072. package/build-module/hooks/font-appearance.js.map +1 -1
  1073. package/build-module/hooks/font-family.js +27 -18
  1074. package/build-module/hooks/font-family.js.map +1 -1
  1075. package/build-module/hooks/font-size.js +9 -7
  1076. package/build-module/hooks/font-size.js.map +1 -1
  1077. package/build-module/hooks/gap.js +9 -7
  1078. package/build-module/hooks/gap.js.map +1 -1
  1079. package/build-module/hooks/layout.js +16 -13
  1080. package/build-module/hooks/layout.js.map +1 -1
  1081. package/build-module/hooks/letter-spacing.js +9 -7
  1082. package/build-module/hooks/letter-spacing.js.map +1 -1
  1083. package/build-module/hooks/line-height.js +9 -7
  1084. package/build-module/hooks/line-height.js.map +1 -1
  1085. package/build-module/hooks/margin.js +9 -7
  1086. package/build-module/hooks/margin.js.map +1 -1
  1087. package/build-module/hooks/padding.js +9 -7
  1088. package/build-module/hooks/padding.js.map +1 -1
  1089. package/build-module/hooks/style.js +7 -3
  1090. package/build-module/hooks/style.js.map +1 -1
  1091. package/build-module/hooks/text-decoration.js +9 -7
  1092. package/build-module/hooks/text-decoration.js.map +1 -1
  1093. package/build-module/hooks/text-transform.js +9 -7
  1094. package/build-module/hooks/text-transform.js.map +1 -1
  1095. package/build-module/hooks/typography.js +2 -1
  1096. package/build-module/hooks/typography.js.map +1 -1
  1097. package/build-module/hooks/typography.native.js +2 -1
  1098. package/build-module/hooks/typography.native.js.map +1 -1
  1099. package/build-module/hooks/use-border-props.js +5 -4
  1100. package/build-module/hooks/use-border-props.js.map +1 -1
  1101. package/build-module/layouts/flex.js +67 -39
  1102. package/build-module/layouts/flex.js.map +1 -1
  1103. package/build-module/layouts/flow.js +10 -8
  1104. package/build-module/layouts/flow.js.map +1 -1
  1105. package/build-module/layouts/index.js +2 -1
  1106. package/build-module/layouts/index.js.map +1 -1
  1107. package/build-module/layouts/utils.js +2 -1
  1108. package/build-module/layouts/utils.js.map +1 -1
  1109. package/build-module/store/actions.js +271 -206
  1110. package/build-module/store/actions.js.map +1 -1
  1111. package/build-module/store/array.js +2 -1
  1112. package/build-module/store/array.js.map +1 -1
  1113. package/build-module/store/reducer.js +108 -34
  1114. package/build-module/store/reducer.js.map +1 -1
  1115. package/build-module/store/selectors.js +158 -90
  1116. package/build-module/store/selectors.js.map +1 -1
  1117. package/build-module/utils/block-variation-transforms.js +4 -3
  1118. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1119. package/build-module/utils/get-paste-event-data.js +10 -6
  1120. package/build-module/utils/get-paste-event-data.js.map +1 -1
  1121. package/build-module/utils/math.js +2 -1
  1122. package/build-module/utils/math.js.map +1 -1
  1123. package/build-module/utils/parse-css-unit-to-px.js +5 -2
  1124. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1125. package/build-module/utils/transform-styles/index.js +8 -6
  1126. package/build-module/utils/transform-styles/index.js.map +1 -1
  1127. package/build-module/utils/transform-styles/transforms/wrap.js +28 -25
  1128. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1129. package/build-style/style-rtl.css +68 -68
  1130. package/build-style/style.css +68 -68
  1131. package/package.json +27 -27
  1132. package/src/components/block-list-appender/style.scss +0 -42
  1133. package/src/components/button-block-appender/style.scss +0 -17
  1134. package/src/components/colors-gradients/panel-color-gradient-settings.js +56 -25
  1135. package/src/components/default-block-appender/style.scss +90 -16
  1136. package/src/components/inner-blocks/style.scss +4 -10
  1137. package/src/components/rich-text/use-paste-handler.js +22 -0
  1138. package/src/components/use-setting/index.js +1 -1
  1139. package/src/layouts/flex.js +25 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-moving-animation/index.js"],"names":["useSpring","useState","useLayoutEffect","useReducer","useMemo","useRef","useReducedMotion","getScrollContainer","counterReducer","state","getAbsolutePosition","element","top","offsetTop","left","offsetLeft","useMovingAnimation","isSelected","adjustScrolling","enableAnimation","triggerAnimationOnChange","ref","prefersReducedMotion","triggeredAnimation","triggerAnimation","finishedAnimation","endAnimation","transform","setTransform","x","y","previous","current","preserveScrollPosition","scrollContainer","prevRect","getBoundingClientRect","blockRect","diff","scrollTop","style","destination","Math","round","onFrameChange","isMoving","transformOrigin","zIndex","onChange","value","from","to","reset","config","mass","tension","friction","immediate"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,mBAA1B;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,eAFD,EAGCC,UAHD,EAICC,OAJD,EAKCC,MALD,QAMO,oBANP;AAOA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,kBAAT,QAAmC,gBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,cAAc,GAAKC,KAAF,IAAaA,KAAK,GAAG,CAA5C;;AAEA,MAAMC,mBAAmB,GAAKC,OAAF,IAAe;AAC1C,SAAO;AACNC,IAAAA,GAAG,EAAED,OAAO,CAACE,SADP;AAENC,IAAAA,IAAI,EAAEH,OAAO,CAACI;AAFR,GAAP;AAIA,CALD;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAA,CAAC,EAAE;AAFA,KALM;AASVsB,IAAAA,KAAK,EAAE7B,kBAAkB,KAAKE,iBATpB;AAUV4B,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,OAAO,EAAE,IAApB;AAA0BC,MAAAA,QAAQ,EAAE;AAApC,KAVE;AAWVC,IAAAA,SAAS,EAAEnC,oBAXD;AAYV0B,IAAAA;AAZU,GAAF,CAAT;AAeA,SAAO3B,GAAP;AACA;;AAED,eAAeL,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { useSpring } from '@react-spring/web';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Simple reducer used to increment a counter.\n *\n * @param {number} state Previous counter value.\n * @return {number} New state value.\n */\nconst counterReducer = ( state ) => state + 1;\n\nconst getAbsolutePosition = ( element ) => {\n\treturn {\n\t\ttop: element.offsetTop,\n\t\tleft: element.offsetLeft,\n\t};\n};\n\n/**\n * Hook used to compute the styles required to move a div into a new position.\n *\n * The way this animation works is the following:\n * - It first renders the element as if there was no animation.\n * - It takes a snapshot of the position of the block to use it\n * as a destination point for the animation.\n * - It restores the element to the previous position using a CSS transform\n * - It uses the \"resetAnimation\" flag to reset the animation\n * from the beginning in order to animate to the new destination point.\n *\n * @param {Object} $1 Options\n * @param {boolean} $1.isSelected Whether it's the current block or not.\n * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block.\n * @param {boolean} $1.enableAnimation Enable/Disable animation.\n * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.\n */\nfunction useMovingAnimation( {\n\tisSelected,\n\tadjustScrolling,\n\tenableAnimation,\n\ttriggerAnimationOnChange,\n} ) {\n\tconst ref = useRef();\n\tconst prefersReducedMotion = useReducedMotion() || ! enableAnimation;\n\tconst [ triggeredAnimation, triggerAnimation ] = useReducer(\n\t\tcounterReducer,\n\t\t0\n\t);\n\tconst [ finishedAnimation, endAnimation ] = useReducer( counterReducer, 0 );\n\tconst [ transform, setTransform ] = useState( { x: 0, y: 0 } );\n\tconst previous = useMemo(\n\t\t() => ( ref.current ? getAbsolutePosition( ref.current ) : null ),\n\t\t[ triggerAnimationOnChange ]\n\t);\n\n\t// Calculate the previous position of the block relative to the viewport and\n\t// return a function to maintain that position by scrolling.\n\tconst preserveScrollPosition = useMemo( () => {\n\t\tif ( ! adjustScrolling || ! ref.current ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( ref.current );\n\n\t\tif ( ! scrollContainer ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst prevRect = ref.current.getBoundingClientRect();\n\t\treturn () => {\n\t\t\tconst blockRect = ref.current.getBoundingClientRect();\n\t\t\tconst diff = blockRect.top - prevRect.top;\n\n\t\t\tif ( diff ) {\n\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t}\n\t\t};\n\t}, [ triggerAnimationOnChange, adjustScrolling ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( triggeredAnimation ) {\n\t\t\tendAnimation();\n\t\t}\n\t}, [ triggeredAnimation ] );\n\tuseLayoutEffect( () => {\n\t\tif ( ! previous ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion ) {\n\t\t\t// if the animation is disabled and the scroll needs to be adjusted,\n\t\t\t// just move directly to the final scroll position.\n\t\t\tpreserveScrollPosition();\n\n\t\t\treturn;\n\t\t}\n\n\t\tref.current.style.transform = '';\n\t\tconst destination = getAbsolutePosition( ref.current );\n\n\t\ttriggerAnimation();\n\t\tsetTransform( {\n\t\t\tx: Math.round( previous.left - destination.left ),\n\t\t\ty: Math.round( previous.top - destination.top ),\n\t\t} );\n\t}, [ triggerAnimationOnChange ] );\n\n\t// Only called when either the x or y value changes.\n\tfunction onFrameChange( { x, y } ) {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isMoving = x === 0 && y === 0;\n\t\tref.current.style.transformOrigin = isMoving ? '' : 'center';\n\t\tref.current.style.transform = isMoving\n\t\t\t? ''\n\t\t\t: `translate3d(${ x }px,${ y }px,0)`;\n\t\tref.current.style.zIndex = ! isSelected || isMoving ? '' : '1';\n\n\t\tpreserveScrollPosition();\n\t}\n\n\t// Called for every frame computed by useSpring.\n\tfunction onChange( { value } ) {\n\t\tlet { x, y } = value;\n\t\tx = Math.round( x );\n\t\ty = Math.round( y );\n\n\t\tif ( x !== onChange.x || y !== onChange.y ) {\n\t\t\tonFrameChange( { x, y } );\n\t\t\tonChange.x = x;\n\t\t\tonChange.y = y;\n\t\t}\n\t}\n\n\tonChange.x = 0;\n\tonChange.y = 0;\n\n\tuseSpring( {\n\t\tfrom: {\n\t\t\tx: transform.x,\n\t\t\ty: transform.y,\n\t\t},\n\t\tto: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t},\n\t\treset: triggeredAnimation !== finishedAnimation,\n\t\tconfig: { mass: 5, tension: 2000, friction: 200 },\n\t\timmediate: prefersReducedMotion,\n\t\tonChange,\n\t} );\n\n\treturn ref;\n}\n\nexport default useMovingAnimation;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-moving-animation/index.js"],"names":["useSpring","useState","useLayoutEffect","useReducer","useMemo","useRef","useReducedMotion","getScrollContainer","counterReducer","state","getAbsolutePosition","element","top","offsetTop","left","offsetLeft","useMovingAnimation","isSelected","adjustScrolling","enableAnimation","triggerAnimationOnChange","ref","prefersReducedMotion","triggeredAnimation","triggerAnimation","finishedAnimation","endAnimation","transform","setTransform","x","y","previous","current","preserveScrollPosition","scrollContainer","prevRect","getBoundingClientRect","blockRect","diff","scrollTop","style","destination","Math","round","onFrameChange","isMoving","transformOrigin","zIndex","onChange","value","from","to","reset","config","mass","tension","friction","immediate"],"mappings":"AAAA;AACA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AAKkB,QAAQ,CAAClB,CAAxC,EAA4C;AAC3Cc,MAAAA,aAAa,CAAE;AAAEf,QAAAA,CAAF;AAAKC,QAAAA;AAAL,OAAF,CAAb;AACAkB,MAAAA,QAAQ,CAACnB,CAAT,GAAaA,CAAb;AACAmB,MAAAA,QAAQ,CAAClB,CAAT,GAAaA,CAAb;AACA;AACD;;AAEDkB,EAAAA,QAAQ,CAACnB,CAAT,GAAa,CAAb;AACAmB,EAAAA,QAAQ,CAAClB,CAAT,GAAa,CAAb;AAEA9B,EAAAA,SAAS,CAAE;AACVkD,IAAAA,IAAI,EAAE;AACLrB,MAAAA,CAAC,EAAEF,SAAS,CAACE,CADR;AAELC,MAAAA,CAAC,EAAEH,SAAS,CAACG;AAFR,KADI;AAKVqB,IAAAA,EAAE,EAAE;AACHtB,MAAAA,CAAC,EAAE,CADA;AAEHC,MAAAA,CAAC,EAAE;AAFA,KALM;AASVsB,IAAAA,KAAK,EAAE7B,kBAAkB,KAAKE,iBATpB;AAUV4B,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,OAAO,EAAE,IAApB;AAA0BC,MAAAA,QAAQ,EAAE;AAApC,KAVE;AAWVC,IAAAA,SAAS,EAAEnC,oBAXD;AAYV0B,IAAAA;AAZU,GAAF,CAAT;AAeA,SAAO3B,GAAP;AACA;;AAED,eAAeL,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { useSpring } from '@react-spring/web';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Simple reducer used to increment a counter.\n *\n * @param {number} state Previous counter value.\n * @return {number} New state value.\n */\nconst counterReducer = ( state ) => state + 1;\n\nconst getAbsolutePosition = ( element ) => {\n\treturn {\n\t\ttop: element.offsetTop,\n\t\tleft: element.offsetLeft,\n\t};\n};\n\n/**\n * Hook used to compute the styles required to move a div into a new position.\n *\n * The way this animation works is the following:\n * - It first renders the element as if there was no animation.\n * - It takes a snapshot of the position of the block to use it\n * as a destination point for the animation.\n * - It restores the element to the previous position using a CSS transform\n * - It uses the \"resetAnimation\" flag to reset the animation\n * from the beginning in order to animate to the new destination point.\n *\n * @param {Object} $1 Options\n * @param {boolean} $1.isSelected Whether it's the current block or not.\n * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block.\n * @param {boolean} $1.enableAnimation Enable/Disable animation.\n * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.\n */\nfunction useMovingAnimation( {\n\tisSelected,\n\tadjustScrolling,\n\tenableAnimation,\n\ttriggerAnimationOnChange,\n} ) {\n\tconst ref = useRef();\n\tconst prefersReducedMotion = useReducedMotion() || ! enableAnimation;\n\tconst [ triggeredAnimation, triggerAnimation ] = useReducer(\n\t\tcounterReducer,\n\t\t0\n\t);\n\tconst [ finishedAnimation, endAnimation ] = useReducer( counterReducer, 0 );\n\tconst [ transform, setTransform ] = useState( { x: 0, y: 0 } );\n\tconst previous = useMemo(\n\t\t() => ( ref.current ? getAbsolutePosition( ref.current ) : null ),\n\t\t[ triggerAnimationOnChange ]\n\t);\n\n\t// Calculate the previous position of the block relative to the viewport and\n\t// return a function to maintain that position by scrolling.\n\tconst preserveScrollPosition = useMemo( () => {\n\t\tif ( ! adjustScrolling || ! ref.current ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( ref.current );\n\n\t\tif ( ! scrollContainer ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst prevRect = ref.current.getBoundingClientRect();\n\t\treturn () => {\n\t\t\tconst blockRect = ref.current.getBoundingClientRect();\n\t\t\tconst diff = blockRect.top - prevRect.top;\n\n\t\t\tif ( diff ) {\n\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t}\n\t\t};\n\t}, [ triggerAnimationOnChange, adjustScrolling ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( triggeredAnimation ) {\n\t\t\tendAnimation();\n\t\t}\n\t}, [ triggeredAnimation ] );\n\tuseLayoutEffect( () => {\n\t\tif ( ! previous ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion ) {\n\t\t\t// if the animation is disabled and the scroll needs to be adjusted,\n\t\t\t// just move directly to the final scroll position.\n\t\t\tpreserveScrollPosition();\n\n\t\t\treturn;\n\t\t}\n\n\t\tref.current.style.transform = '';\n\t\tconst destination = getAbsolutePosition( ref.current );\n\n\t\ttriggerAnimation();\n\t\tsetTransform( {\n\t\t\tx: Math.round( previous.left - destination.left ),\n\t\t\ty: Math.round( previous.top - destination.top ),\n\t\t} );\n\t}, [ triggerAnimationOnChange ] );\n\n\t// Only called when either the x or y value changes.\n\tfunction onFrameChange( { x, y } ) {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isMoving = x === 0 && y === 0;\n\t\tref.current.style.transformOrigin = isMoving ? '' : 'center';\n\t\tref.current.style.transform = isMoving\n\t\t\t? ''\n\t\t\t: `translate3d(${ x }px,${ y }px,0)`;\n\t\tref.current.style.zIndex = ! isSelected || isMoving ? '' : '1';\n\n\t\tpreserveScrollPosition();\n\t}\n\n\t// Called for every frame computed by useSpring.\n\tfunction onChange( { value } ) {\n\t\tlet { x, y } = value;\n\t\tx = Math.round( x );\n\t\ty = Math.round( y );\n\n\t\tif ( x !== onChange.x || y !== onChange.y ) {\n\t\t\tonFrameChange( { x, y } );\n\t\t\tonChange.x = x;\n\t\t\tonChange.y = y;\n\t\t}\n\t}\n\n\tonChange.x = 0;\n\tonChange.y = 0;\n\n\tuseSpring( {\n\t\tfrom: {\n\t\t\tx: transform.x,\n\t\t\ty: transform.y,\n\t\t},\n\t\tto: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t},\n\t\treset: triggeredAnimation !== finishedAnimation,\n\t\tconfig: { mass: 5, tension: 2000, friction: 200 },\n\t\timmediate: prefersReducedMotion,\n\t\tonChange,\n\t} );\n\n\treturn ref;\n}\n\nexport default useMovingAnimation;\n"]}
@@ -43,9 +43,10 @@ function addToBlockType(renderedBlocks, blockName, uniqueId) {
43
43
  */
44
44
 
45
45
 
46
- export default function useNoRecursiveRenders(uniqueId, blockName = '') {
46
+ export default function useNoRecursiveRenders(uniqueId) {
47
47
  var _previouslyRenderedBl;
48
48
 
49
+ let blockName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
49
50
  const previouslyRenderedBlocks = useContext(RenderedRefsContext);
50
51
  const {
51
52
  name
@@ -53,11 +54,14 @@ export default function useNoRecursiveRenders(uniqueId, blockName = '') {
53
54
  blockName = blockName || name;
54
55
  const hasAlreadyRendered = Boolean((_previouslyRenderedBl = previouslyRenderedBlocks[blockName]) === null || _previouslyRenderedBl === void 0 ? void 0 : _previouslyRenderedBl.has(uniqueId));
55
56
  const newRenderedBlocks = useMemo(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]);
56
- const Provider = useCallback(({
57
- children
58
- }) => createElement(RenderedRefsContext.Provider, {
59
- value: newRenderedBlocks
60
- }, children), [newRenderedBlocks]);
57
+ const Provider = useCallback(_ref => {
58
+ let {
59
+ children
60
+ } = _ref;
61
+ return createElement(RenderedRefsContext.Provider, {
62
+ value: newRenderedBlocks
63
+ }, children);
64
+ }, [newRenderedBlocks]);
61
65
  return [hasAlreadyRendered, Provider];
62
66
  }
63
67
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-no-recursive-renders/index.js"],"names":["createContext","useCallback","useContext","useMemo","useBlockEditContext","RenderedRefsContext","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","useNoRecursiveRenders","previouslyRenderedBlocks","name","hasAlreadyRendered","Boolean","has","newRenderedBlocks","Provider","children"],"mappings":";;AAAA;AACA;AACA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AAA;AAAF,GAAF,KACC,cAAC,mBAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAGF;AAAtC,KACGE,QADH,CAF0B,EAM3B,CAAEF,iBAAF,CAN2B,CAA5B;AAQA,SAAO,CAAEH,kBAAF,EAAsBI,QAAtB,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {[boolean, Function]} A tuple of:\n * - a boolean describing whether the provided id\n * has already been rendered;\n * - a React context provider to be used to wrap\n * other elements.\n */\nexport default function useNoRecursiveRenders( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\tconst hasAlreadyRendered = Boolean(\n\t\tpreviouslyRenderedBlocks[ blockName ]?.has( uniqueId )\n\t);\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\tconst Provider = useCallback(\n\t\t( { children } ) => (\n\t\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t\t{ children }\n\t\t\t</RenderedRefsContext.Provider>\n\t\t),\n\t\t[ newRenderedBlocks ]\n\t);\n\treturn [ hasAlreadyRendered, Provider ];\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-no-recursive-renders/index.js"],"names":["createContext","useCallback","useContext","useMemo","useBlockEditContext","RenderedRefsContext","addToBlockType","renderedBlocks","blockName","uniqueId","result","Set","add","useNoRecursiveRenders","previouslyRenderedBlocks","name","hasAlreadyRendered","Boolean","has","newRenderedBlocks","Provider","children"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,WAFD,EAGCC,UAHD,EAICC,OAJD,QAKO,oBALP;AAOA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,uBAApC;AAEA,MAAMC,mBAAmB,GAAGL,aAAa,CAAE,EAAF,CAAzC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASM,cAAT,CAAyBC,cAAzB,EAAyCC,SAAzC,EAAoDC,QAApD,EAA+D;AAC9D,QAAMC,MAAM,GAAG,EACd,GAAGH,cADW;AAEd,KAAEC,SAAF,GAAeD,cAAc,CAAEC,SAAF,CAAd,GACZ,IAAIG,GAAJ,CAASJ,cAAc,CAAEC,SAAF,CAAvB,CADY,GAEZ,IAAIG,GAAJ;AAJW,GAAf;AAMAD,EAAAA,MAAM,CAAEF,SAAF,CAAN,CAAoBI,GAApB,CAAyBH,QAAzB;AAEA,SAAOC,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,eAAe,SAASG,qBAAT,CAAgCJ,QAAhC,EAA2D;AAAA;;AAAA,MAAjBD,SAAiB,uEAAL,EAAK;AACzE,QAAMM,wBAAwB,GAAGZ,UAAU,CAAEG,mBAAF,CAA3C;AACA,QAAM;AAAEU,IAAAA;AAAF,MAAWX,mBAAmB,EAApC;AACAI,EAAAA,SAAS,GAAGA,SAAS,IAAIO,IAAzB;AACA,QAAMC,kBAAkB,GAAGC,OAAO,0BACjCH,wBAAwB,CAAEN,SAAF,CADS,0DACjC,sBAAuCU,GAAvC,CAA4CT,QAA5C,CADiC,CAAlC;AAGA,QAAMU,iBAAiB,GAAGhB,OAAO,CAChC,MAAMG,cAAc,CAAEQ,wBAAF,EAA4BN,SAA5B,EAAuCC,QAAvC,CADY,EAEhC,CAAEK,wBAAF,EAA4BN,SAA5B,EAAuCC,QAAvC,CAFgC,CAAjC;AAIA,QAAMW,QAAQ,GAAGnB,WAAW,CAC3B;AAAA,QAAE;AAAEoB,MAAAA;AAAF,KAAF;AAAA,WACC,cAAC,mBAAD,CAAqB,QAArB;AAA8B,MAAA,KAAK,EAAGF;AAAtC,OACGE,QADH,CADD;AAAA,GAD2B,EAM3B,CAAEF,iBAAF,CAN2B,CAA5B;AAQA,SAAO,CAAEH,kBAAF,EAAsBI,QAAtB,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit/context';\n\nconst RenderedRefsContext = createContext( {} );\n\n/**\n * Immutably adds an unique identifier to a set scoped for a given block type.\n *\n * @param {Object} renderedBlocks Rendered blocks grouped by block name\n * @param {string} blockName Name of the block.\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n *\n * @return {Object} The list of rendered blocks grouped by block name.\n */\nfunction addToBlockType( renderedBlocks, blockName, uniqueId ) {\n\tconst result = {\n\t\t...renderedBlocks,\n\t\t[ blockName ]: renderedBlocks[ blockName ]\n\t\t\t? new Set( renderedBlocks[ blockName ] )\n\t\t\t: new Set(),\n\t};\n\tresult[ blockName ].add( uniqueId );\n\n\treturn result;\n}\n\n/**\n * A React hook for keeping track of blocks previously rendered up in the block\n * tree. Blocks susceptible to recursion can use this hook in their `Edit`\n * function to prevent said recursion.\n *\n * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.\n * @param {string} blockName Optional block name.\n *\n * @return {[boolean, Function]} A tuple of:\n * - a boolean describing whether the provided id\n * has already been rendered;\n * - a React context provider to be used to wrap\n * other elements.\n */\nexport default function useNoRecursiveRenders( uniqueId, blockName = '' ) {\n\tconst previouslyRenderedBlocks = useContext( RenderedRefsContext );\n\tconst { name } = useBlockEditContext();\n\tblockName = blockName || name;\n\tconst hasAlreadyRendered = Boolean(\n\t\tpreviouslyRenderedBlocks[ blockName ]?.has( uniqueId )\n\t);\n\tconst newRenderedBlocks = useMemo(\n\t\t() => addToBlockType( previouslyRenderedBlocks, blockName, uniqueId ),\n\t\t[ previouslyRenderedBlocks, blockName, uniqueId ]\n\t);\n\tconst Provider = useCallback(\n\t\t( { children } ) => (\n\t\t\t<RenderedRefsContext.Provider value={ newRenderedBlocks }>\n\t\t\t\t{ children }\n\t\t\t</RenderedRefsContext.Provider>\n\t\t),\n\t\t[ newRenderedBlocks ]\n\t);\n\treturn [ hasAlreadyRendered, Provider ];\n}\n"]}
@@ -106,7 +106,7 @@ export default function useSetting(path) {
106
106
  if (PATHS_WITH_MERGE[normalizedPath]) {
107
107
  var _ref, _experimentalFeatures;
108
108
 
109
- return (_ref = (_experimentalFeatures = experimentalFeaturesResult.user) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.core;
109
+ return (_ref = (_experimentalFeatures = experimentalFeaturesResult.user) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.default;
110
110
  }
111
111
 
112
112
  return experimentalFeaturesResult;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-setting/index.js"],"names":["get","useSelect","__EXPERIMENTAL_PATHS_WITH_MERGE","PATHS_WITH_MERGE","useBlockEditContext","store","blockEditorStore","deprecatedFlags","settings","colors","undefined","gradients","disableCustomColors","disableCustomGradients","fontSizes","disableCustomFontSizes","enableCustomLineHeight","enableCustomUnits","enableCustomSpacing","prefixedFlags","removeCustomPrefixes","path","useSetting","name","blockName","setting","select","getSettings","normalizedPath","defaultsPath","blockPath","experimentalFeaturesResult","user","theme","core","deprecatedSettingsValue"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,+BAA+B,IAAIC,gBAA5C,QAAoE,mBAApE;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,eAApC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,MAAMC,eAAe,GAAG;AACvB,mBAAmBC,QAAF,IAChBA,QAAQ,CAACC,MAAT,KAAoBC,SAApB,GAAgCA,SAAhC,GAA4CF,QAAQ,CAACC,MAF/B;AAGvB,qBAAqBD,QAAF,IAClBA,QAAQ,CAACG,SAAT,KAAuBD,SAAvB,GAAmCA,SAAnC,GAA+CF,QAAQ,CAACG,SAJlC;AAKvB,kBAAkBH,QAAF,IACfA,QAAQ,CAACI,mBAAT,KAAiCF,SAAjC,GACGA,SADH,GAEG,CAAEF,QAAQ,CAACI,mBARQ;AASvB,0BAA0BJ,QAAF,IACvBA,QAAQ,CAACK,sBAAT,KAAoCH,SAApC,GACGA,SADH,GAEG,CAAEF,QAAQ,CAACK,sBAZQ;AAavB,0BAA0BL,QAAF,IACvBA,QAAQ,CAACM,SAAT,KAAuBJ,SAAvB,GAAmCA,SAAnC,GAA+CF,QAAQ,CAACM,SAdlC;AAevB,+BAA+BN,QAAF,IAC5BA,QAAQ,CAACO,sBAAT,KAAoCL,SAApC,GACGA,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kB,MAAM,CAAEpB,gBAAF,CAAN,CAA2BqB,WAA3B,EAAjB,CADa,CAGb;AACA;;AACA,UAAMC,cAAc,GAAGR,oBAAoB,CAAEC,IAAF,CAA3C;AACA,UAAMQ,YAAY,GAAI,0BAA0BD,cAAgB,EAAhE;AACA,UAAME,SAAS,GAAI,iCAAiCN,SAAW,IAAII,cAAgB,EAAnF;AACA,UAAMG,0BAA0B,WAC/B/B,GAAG,CAAEQ,QAAF,EAAYsB,SAAZ,CAD4B,uCACD9B,GAAG,CAAEQ,QAAF,EAAYqB,YAAZ,CADlC;;AAGA,QAAKE,0BAA0B,KAAKrB,SAApC,EAAgD;AAC/C,UAAKP,gBAAgB,CAAEyB,cAAF,CAArB,EAA0C;AAAA;;AACzC,gDACCG,0BAA0B,CAACC,IAD5B,yEAECD,0BAA0B,CAACE,KAF5B,uCAGCF,0BAA0B,CAACG,IAH5B;AAKA;;AACD,aAAOH,0BAAP;AACA,KApBY,CAsBb;;;AACA,UAAMI,uBAAuB,GAAG5B,eAAe,CAAEqB,cAAF,CAAf,GAC7BrB,eAAe,CAAEqB,cAAF,CAAf,CAAmCpB,QAAnC,CAD6B,GAE7BE,SAFH;;AAGA,QAAKyB,uBAAuB,KAAKzB,SAAjC,EAA6C;AAC5C,aAAOyB,uBAAP;AACA,KA5BY,CA8Bb;AACA;AACA;AACA;;;AACA,WAAOP,cAAc,KAAK,oBAAnB,GAA0C,IAA1C,GAAiDlB,SAAxD;AACA,GApCuB,EAqCxB,CAAEc,SAAF,EAAaH,IAAb,CArCwB,CAAzB;AAwCA,SAAOI,OAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\n\nconst deprecatedFlags = {\n\t'color.palette': ( settings ) =>\n\t\tsettings.colors === undefined ? undefined : settings.colors,\n\t'color.gradients': ( settings ) =>\n\t\tsettings.gradients === undefined ? undefined : settings.gradients,\n\t'color.custom': ( settings ) =>\n\t\tsettings.disableCustomColors === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomColors,\n\t'color.customGradient': ( settings ) =>\n\t\tsettings.disableCustomGradients === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomGradients,\n\t'typography.fontSizes': ( settings ) =>\n\t\tsettings.fontSizes === undefined ? undefined : settings.fontSizes,\n\t'typography.customFontSize': ( settings ) =>\n\t\tsettings.disableCustomFontSizes === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomFontSizes,\n\t'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,\n\t'spacing.units': ( settings ) => {\n\t\tif ( settings.enableCustomUnits === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( settings.enableCustomUnits === true ) {\n\t\t\treturn [ 'px', 'em', 'rem', 'vh', 'vw', '%' ];\n\t\t}\n\n\t\treturn settings.enableCustomUnits;\n\t},\n\t'spacing.padding': ( settings ) => settings.enableCustomSpacing,\n};\n\nconst prefixedFlags = {\n\t/*\n\t * These were only available in the plugin\n\t * and can be removed when the minimum WordPress version\n\t * for the plugin is 5.9.\n\t */\n\t'border.customColor': 'border.color',\n\t'border.customStyle': 'border.style',\n\t'border.customWidth': 'border.width',\n\t'typography.customFontStyle': 'typography.fontStyle',\n\t'typography.customFontWeight': 'typography.fontWeight',\n\t'typography.customLetterSpacing': 'typography.letterSpacing',\n\t'typography.customTextDecorations': 'typography.textDecoration',\n\t'typography.customTextTransforms': 'typography.textTransform',\n\t/*\n\t * These were part of WordPress 5.8 and we need to keep them.\n\t */\n\t'border.customRadius': 'border.radius',\n\t'spacing.customMargin': 'spacing.margin',\n\t'spacing.customPadding': 'spacing.padding',\n\t'typography.customLineHeight': 'typography.lineHeight',\n};\n\n/**\n * Remove `custom` prefixes for flags that did not land in 5.8.\n *\n * This provides continued support for `custom` prefixed properties. It will\n * be removed once third party devs have had sufficient time to update themes,\n * plugins, etc.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34485\n *\n * @param {string} path Path to desired value in settings.\n * @return {string} The value for defined setting.\n */\nconst removeCustomPrefixes = ( path ) => {\n\treturn prefixedFlags[ path ] || path;\n};\n\n/**\n * Hook that retrieves the editor setting.\n * It works with nested objects using by finding the value at path.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport default function useSetting( path ) {\n\tconst { name: blockName } = useBlockEditContext();\n\n\tconst setting = useSelect(\n\t\t( select ) => {\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\n\t\t\t// 1 - Use __experimental features, if available.\n\t\t\t// We cascade to the all value if the block one is not available.\n\t\t\tconst normalizedPath = removeCustomPrefixes( path );\n\t\t\tconst defaultsPath = `__experimentalFeatures.${ normalizedPath }`;\n\t\t\tconst blockPath = `__experimentalFeatures.blocks.${ blockName }.${ normalizedPath }`;\n\t\t\tconst experimentalFeaturesResult =\n\t\t\t\tget( settings, blockPath ) ?? get( settings, defaultsPath );\n\n\t\t\tif ( experimentalFeaturesResult !== undefined ) {\n\t\t\t\tif ( PATHS_WITH_MERGE[ normalizedPath ] ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\texperimentalFeaturesResult.user ??\n\t\t\t\t\t\texperimentalFeaturesResult.theme ??\n\t\t\t\t\t\texperimentalFeaturesResult.core\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn experimentalFeaturesResult;\n\t\t\t}\n\n\t\t\t// 2 - Use deprecated settings, otherwise.\n\t\t\tconst deprecatedSettingsValue = deprecatedFlags[ normalizedPath ]\n\t\t\t\t? deprecatedFlags[ normalizedPath ]( settings )\n\t\t\t\t: undefined;\n\t\t\tif ( deprecatedSettingsValue !== undefined ) {\n\t\t\t\treturn deprecatedSettingsValue;\n\t\t\t}\n\n\t\t\t// 3 - Fall back for typography.dropCap:\n\t\t\t// This is only necessary to support typography.dropCap.\n\t\t\t// when __experimentalFeatures are not present (core without plugin).\n\t\t\t// To remove when __experimentalFeatures are ported to core.\n\t\t\treturn normalizedPath === 'typography.dropCap' ? true : undefined;\n\t\t},\n\t\t[ blockName, path ]\n\t);\n\n\treturn setting;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-setting/index.js"],"names":["get","useSelect","__EXPERIMENTAL_PATHS_WITH_MERGE","PATHS_WITH_MERGE","useBlockEditContext","store","blockEditorStore","deprecatedFlags","settings","colors","undefined","gradients","disableCustomColors","disableCustomGradients","fontSizes","disableCustomFontSizes","enableCustomLineHeight","enableCustomUnits","enableCustomSpacing","prefixedFlags","removeCustomPrefixes","path","useSetting","name","blockName","setting","select","getSettings","normalizedPath","defaultsPath","blockPath","experimentalFeaturesResult","user","theme","default","deprecatedSettingsValue"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,+BAA+B,IAAIC,gBAA5C,QAAoE,mBAApE;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,eAApC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,MAAMC,eAAe,GAAG;AACvB,mBAAmBC,QAAF,IAChBA,QAAQ,CAACC,MAAT,KAAoBC,SAApB,GAAgCA,SAAhC,GAA4CF,QAAQ,CAACC,MAF/B;AAGvB,qBAAqBD,QAAF,IAClBA,QAAQ,CAACG,SAAT,KAAuBD,SAAvB,GAAmCA,SAAnC,GAA+CF,QAAQ,CAACG,SAJlC;AAKvB,kBAAkBH,QAAF,IACfA,QAAQ,CAACI,mBAAT,KAAiCF,SAAjC,GACGA,SADH,GAEG,CAAEF,QAAQ,CAACI,mBARQ;AASvB,0B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CArCwB,CAAzB;AAwCA,SAAOI,OAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __EXPERIMENTAL_PATHS_WITH_MERGE as PATHS_WITH_MERGE } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\n\nconst deprecatedFlags = {\n\t'color.palette': ( settings ) =>\n\t\tsettings.colors === undefined ? undefined : settings.colors,\n\t'color.gradients': ( settings ) =>\n\t\tsettings.gradients === undefined ? undefined : settings.gradients,\n\t'color.custom': ( settings ) =>\n\t\tsettings.disableCustomColors === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomColors,\n\t'color.customGradient': ( settings ) =>\n\t\tsettings.disableCustomGradients === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomGradients,\n\t'typography.fontSizes': ( settings ) =>\n\t\tsettings.fontSizes === undefined ? undefined : settings.fontSizes,\n\t'typography.customFontSize': ( settings ) =>\n\t\tsettings.disableCustomFontSizes === undefined\n\t\t\t? undefined\n\t\t\t: ! settings.disableCustomFontSizes,\n\t'typography.lineHeight': ( settings ) => settings.enableCustomLineHeight,\n\t'spacing.units': ( settings ) => {\n\t\tif ( settings.enableCustomUnits === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( settings.enableCustomUnits === true ) {\n\t\t\treturn [ 'px', 'em', 'rem', 'vh', 'vw', '%' ];\n\t\t}\n\n\t\treturn settings.enableCustomUnits;\n\t},\n\t'spacing.padding': ( settings ) => settings.enableCustomSpacing,\n};\n\nconst prefixedFlags = {\n\t/*\n\t * These were only available in the plugin\n\t * and can be removed when the minimum WordPress version\n\t * for the plugin is 5.9.\n\t */\n\t'border.customColor': 'border.color',\n\t'border.customStyle': 'border.style',\n\t'border.customWidth': 'border.width',\n\t'typography.customFontStyle': 'typography.fontStyle',\n\t'typography.customFontWeight': 'typography.fontWeight',\n\t'typography.customLetterSpacing': 'typography.letterSpacing',\n\t'typography.customTextDecorations': 'typography.textDecoration',\n\t'typography.customTextTransforms': 'typography.textTransform',\n\t/*\n\t * These were part of WordPress 5.8 and we need to keep them.\n\t */\n\t'border.customRadius': 'border.radius',\n\t'spacing.customMargin': 'spacing.margin',\n\t'spacing.customPadding': 'spacing.padding',\n\t'typography.customLineHeight': 'typography.lineHeight',\n};\n\n/**\n * Remove `custom` prefixes for flags that did not land in 5.8.\n *\n * This provides continued support for `custom` prefixed properties. It will\n * be removed once third party devs have had sufficient time to update themes,\n * plugins, etc.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34485\n *\n * @param {string} path Path to desired value in settings.\n * @return {string} The value for defined setting.\n */\nconst removeCustomPrefixes = ( path ) => {\n\treturn prefixedFlags[ path ] || path;\n};\n\n/**\n * Hook that retrieves the editor setting.\n * It works with nested objects using by finding the value at path.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport default function useSetting( path ) {\n\tconst { name: blockName } = useBlockEditContext();\n\n\tconst setting = useSelect(\n\t\t( select ) => {\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\n\t\t\t// 1 - Use __experimental features, if available.\n\t\t\t// We cascade to the all value if the block one is not available.\n\t\t\tconst normalizedPath = removeCustomPrefixes( path );\n\t\t\tconst defaultsPath = `__experimentalFeatures.${ normalizedPath }`;\n\t\t\tconst blockPath = `__experimentalFeatures.blocks.${ blockName }.${ normalizedPath }`;\n\t\t\tconst experimentalFeaturesResult =\n\t\t\t\tget( settings, blockPath ) ?? get( settings, defaultsPath );\n\n\t\t\tif ( experimentalFeaturesResult !== undefined ) {\n\t\t\t\tif ( PATHS_WITH_MERGE[ normalizedPath ] ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\texperimentalFeaturesResult.user ??\n\t\t\t\t\t\texperimentalFeaturesResult.theme ??\n\t\t\t\t\t\texperimentalFeaturesResult.default\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn experimentalFeaturesResult;\n\t\t\t}\n\n\t\t\t// 2 - Use deprecated settings, otherwise.\n\t\t\tconst deprecatedSettingsValue = deprecatedFlags[ normalizedPath ]\n\t\t\t\t? deprecatedFlags[ normalizedPath ]( settings )\n\t\t\t\t: undefined;\n\t\t\tif ( deprecatedSettingsValue !== undefined ) {\n\t\t\t\treturn deprecatedSettingsValue;\n\t\t\t}\n\n\t\t\t// 3 - Fall back for typography.dropCap:\n\t\t\t// This is only necessary to support typography.dropCap.\n\t\t\t// when __experimentalFeatures are not present (core without plugin).\n\t\t\t// To remove when __experimentalFeatures are ported to core.\n\t\t\treturn normalizedPath === 'typography.dropCap' ? true : undefined;\n\t\t},\n\t\t[ blockName, path ]\n\t);\n\n\treturn setting;\n}\n"]}
@@ -13,12 +13,13 @@ import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
13
13
  import { __ } from '@wordpress/i18n';
14
14
  import { moreHorizontal } from '@wordpress/icons';
15
15
 
16
- function Warning({
17
- className,
18
- actions,
19
- children,
20
- secondaryActions
21
- }) {
16
+ function Warning(_ref) {
17
+ let {
18
+ className,
19
+ actions,
20
+ children,
21
+ secondaryActions
22
+ } = _ref;
22
23
  return createElement("div", {
23
24
  className: classnames(className, 'block-editor-warning')
24
25
  }, createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.js"],"names":["classnames","Children","DropdownMenu","MenuGroup","MenuItem","__","moreHorizontal","Warning","className","actions","children","secondaryActions","count","map","action","i","position","item","pos","onClick","title"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAA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n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreHorizontal } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t<p className=\"block-editor-warning__message\">{ children }</p>\n\n\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\ticon={ moreHorizontal }\n\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\tclassName: 'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.js"],"names":["classnames","Children","DropdownMenu","MenuGroup","MenuItem","__","moreHorizontal","Warning","className","actions","children","secondaryActions","count","map","action","i","position","item","pos","onClick","title"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,kBAA/B;;AAEA,SAASC,OAAT,OAAuE;AAAA,MAArD;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,OAAb;AAAsBC,IAAAA,QAAtB;AAAgCC,IAAAA;AAAhC,GAAqD;AACtE,SACC;AAAK,IAAA,SAAS,EAAGX,UAAU,CAAEQ,SAAF,EAAa,sBAAb;AAA3B,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KAA+CE,QAA/C,CADD,EAGG,CAAET,QAAQ,CAACW,KAAT,CAAgBH,OAAhB,IAA4B,CAA5B,IAAiCE,gBAAnC,KACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGV,QAAQ,CAACW,KAAT,CAAgBH,OAAhB,IAA4B,CAA5B,IACDR,QAAQ,CAACY,GAAT,CAAcJ,OAAd,EAAuB,CAAEK,MAAF,EAAUC,CAAV,KACtB;AACC,IAAA,GAAG,EAAGA,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,MAJH,CADD,CAFF,EAUGH,gBAAgB,IACjB,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,IAAI,EAAGL,cAFR;AAGC,IAAA,KAAK,EAAGD,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,YAAY,EAAG;AACdW,MAAAA,QAAQ,EAAE,aADI;AAEdR,MAAAA,SAAS,EAAE;AAFG,KAJhB;AAQC,IAAA,OAAO;AARR,KAUG,MACD,cAAC,SAAD,QACGG,gBAAgB,CAACE,GAAjB,CACD,CAAEI,IAAF,EAAQC,GAAR,KACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAGD,IAAI,CAACE,OADhB;AAEC,IAAA,GAAG,EAAGD;AAFP,KAIGD,IAAI,CAACG,KAJR,CAFA,CADH,CAXF,CAXF,CAJF,CADD,CADD;AAgDA;AAED;AACA;AACA;;;AACA,eAAeb,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreHorizontal } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t<p className=\"block-editor-warning__message\">{ children }</p>\n\n\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\ticon={ moreHorizontal }\n\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\tclassName: 'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"]}
@@ -18,15 +18,16 @@ import { normalizeIconObject } from '@wordpress/blocks';
18
18
 
19
19
  import styles from './style.scss';
20
20
 
21
- function Warning({
22
- title,
23
- message,
24
- icon,
25
- iconClass,
26
- preferredColorScheme,
27
- getStylesFromColorScheme,
28
- ...viewProps
29
- }) {
21
+ function Warning(_ref) {
22
+ let {
23
+ title,
24
+ message,
25
+ icon,
26
+ iconClass,
27
+ preferredColorScheme,
28
+ getStylesFromColorScheme,
29
+ ...viewProps
30
+ } = _ref;
30
31
  icon = icon && normalizeIconObject(icon);
31
32
  const internalIconClass = 'warning-icon' + '-' + preferredColorScheme;
32
33
  const titleStyle = getStylesFromColorScheme(styles.title, styles.titleDark);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"names":["View","Text","Icon","withPreferredColorScheme","normalizeIconObject","styles","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","internalIconClass","titleStyle","titleDark","messageStyle","messageDark","container","containerDark","src"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,mBAAT,QAAoC,mBAApC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;;AAEA,SAASC,OAAT,CAAkB;AACjBC,EAAAA,KADiB;AAEjBC,EAAAA,OAFiB;AAGjBC,EAAAA,IAHiB;AAIjBC,EAAAA,SAJiB;AAKjBC,EAAAA,oBALiB;AAMjBC,EAAAA,wBANiB;AAOjB,KAAGC;AAPc,CAAlB,EAQI;AACHJ,EAAAA,IAAI,GAAGA,IAAI,IAAIL,mBAAmB,CAAEK,IAAF,CAAlC;AACA,QAAMK,iBAAiB,GAAG,iBAAiB,GAAjB,GAAuBH,oBAAjD;AACA,QAAMI,UAAU,GAAGH,wBAAwB,CAC1CP,MAAM,CAACE,KADmC,EAE1CF,MAAM,CAACW,SAFmC,CAA3C;AAIA,QAAMC,YAAY,GAAGL,wBAAwB,CAC5CP,MAAM,CAACG,OADqC,EAE5CH,MAAM,CAACa,WAFqC,CAA7C;AAKA,SACC,cAAC,IAAD;AACC,IAAA,KAAK,EAAGN,wBAAwB,CAC/BP,MAAM,CAACc,SADwB,EAE/Bd,MAAM,CAACe,aAFwB;AADjC,KAKMP,SALN,GAOGJ,IAAI,IACL,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGJ,MAAM,CAACI;AAArB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGC,SAAS,IAAII,iBAD1B;AAEC,IAAA,IAAI,EAAGL,IAAI,IAAIA,IAAI,CAACY,GAAb,GAAmBZ,IAAI,CAACY,GAAxB,GAA8BZ;AAFtC,IADD,CARF,EAeGF,KAAK,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGQ;AAAd,KAA6BR,KAA7B,CAfZ,EAgBGC,OAAO,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGS;AAAd,KAA+BT,OAA/B,CAhBd,CADD;AAoBA;;AAED,eAAeL,wBAAwB,CAAEG,OAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { normalizeIconObject } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nfunction Warning( {\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\tconst titleStyle = getStylesFromColorScheme(\n\t\tstyles.title,\n\t\tstyles.titleDark\n\t);\n\tconst messageStyle = getStylesFromColorScheme(\n\t\tstyles.message,\n\t\tstyles.messageDark\n\t);\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t\t{ ...viewProps }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<View style={ styles.icon }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={ iconClass || internalIconClass }\n\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ title && <Text style={ titleStyle }>{ title }</Text> }\n\t\t\t{ message && <Text style={ messageStyle }>{ message }</Text> }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"names":["View","Text","Icon","withPreferredColorScheme","normalizeIconObject","styles","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","internalIconClass","titleStyle","titleDark","messageStyle","messageDark","container","containerDark","src"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,mBAAT,QAAoC,mBAApC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;;AAEA,SAASC,OAAT,OAQI;AAAA,MARc;AACjBC,IAAAA,KADiB;AAEjBC,IAAAA,OAFiB;AAGjBC,IAAAA,IAHiB;AAIjBC,IAAAA,SAJiB;AAKjBC,IAAAA,oBALiB;AAMjBC,IAAAA,wBANiB;AAOjB,OAAGC;AAPc,GAQd;AACHJ,EAAAA,IAAI,GAAGA,IAAI,IAAIL,mBAAmB,CAAEK,IAAF,CAAlC;AACA,QAAMK,iBAAiB,GAAG,iBAAiB,GAAjB,GAAuBH,oBAAjD;AACA,QAAMI,UAAU,GAAGH,wBAAwB,CAC1CP,MAAM,CAACE,KADmC,EAE1CF,MAAM,CAACW,SAFmC,CAA3C;AAIA,QAAMC,YAAY,GAAGL,wBAAwB,CAC5CP,MAAM,CAACG,OADqC,EAE5CH,MAAM,CAACa,WAFqC,CAA7C;AAKA,SACC,cAAC,IAAD;AACC,IAAA,KAAK,EAAGN,wBAAwB,CAC/BP,MAAM,CAACc,SADwB,EAE/Bd,MAAM,CAACe,aAFwB;AADjC,KAKMP,SALN,GAOGJ,IAAI,IACL,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGJ,MAAM,CAACI;AAArB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGC,SAAS,IAAII,iBAD1B;AAEC,IAAA,IAAI,EAAGL,IAAI,IAAIA,IAAI,CAACY,GAAb,GAAmBZ,IAAI,CAACY,GAAxB,GAA8BZ;AAFtC,IADD,CARF,EAeGF,KAAK,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGQ;AAAd,KAA6BR,KAA7B,CAfZ,EAgBGC,OAAO,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGS;AAAd,KAA+BT,OAA/B,CAhBd,CADD;AAoBA;;AAED,eAAeL,wBAAwB,CAAEG,OAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { normalizeIconObject } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nfunction Warning( {\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\tconst titleStyle = getStylesFromColorScheme(\n\t\tstyles.title,\n\t\tstyles.titleDark\n\t);\n\tconst messageStyle = getStylesFromColorScheme(\n\t\tstyles.message,\n\t\tstyles.messageDark\n\t);\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t\t{ ...viewProps }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<View style={ styles.icon }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={ iconClass || internalIconClass }\n\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ title && <Text style={ titleStyle }>{ title }</Text> }\n\t\t\t{ message && <Text style={ messageStyle }>{ message }</Text> }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"]}
@@ -39,10 +39,11 @@ export function useWritingFlow() {
39
39
  }, [hasMultiSelection])]), after];
40
40
  }
41
41
 
42
- function WritingFlow({
43
- children,
44
- ...props
45
- }, forwardedRef) {
42
+ function WritingFlow(_ref, forwardedRef) {
43
+ let {
44
+ children,
45
+ ...props
46
+ } = _ref;
46
47
  const [before, ref, after] = useWritingFlow();
47
48
  return createElement(Fragment, null, before, createElement("div", _extends({}, props, {
48
49
  ref: useMergeRefs([ref, forwardedRef]),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"names":["classNames","useSelect","__","useMergeRefs","useRefEffect","forwardRef","useMultiSelection","useTabNav","useArrowNav","useSelectAll","store","blockEditorStore","useWritingFlow","before","ref","after","hasMultiSelection","select","node","tabIndex","setAttribute","removeAttribute","WritingFlow","children","props","forwardedRef","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YA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BH,cAAc,EAA7C;AACA,SACC,8BACGC,MADH,EAEC,kCACMW,KADN;AAEC,IAAA,GAAG,EAAGrB,YAAY,CAAE,CAAEW,GAAF,EAAOW,YAAP,CAAF,CAFnB;AAGC,IAAA,SAAS,EAAGzB,UAAU,CACrBwB,KAAK,CAACE,SADe,EAErB,2BAFqB;AAHvB,MAQGH,QARH,CAFD,EAYGR,KAZH,CADD;AAgBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,eAAeV,UAAU,CAAEiB,WAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMultiSelection from './use-multi-selection';\nimport useTabNav from './use-tab-nav';\nimport useArrowNav from './use-arrow-nav';\nimport useSelectAll from './use-select-all';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useWritingFlow() {\n\tconst [ before, ref, after ] = useTabNav();\n\tconst hasMultiSelection = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasMultiSelection(),\n\t\t[]\n\t);\n\n\treturn [\n\t\tbefore,\n\t\tuseMergeRefs( [\n\t\t\tref,\n\t\t\tuseMultiSelection(),\n\t\t\tuseSelectAll(),\n\t\t\tuseArrowNav(),\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tnode.tabIndex = -1;\n\n\t\t\t\t\tif ( ! hasMultiSelection ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.setAttribute(\n\t\t\t\t\t\t'aria-label',\n\t\t\t\t\t\t__( 'Multiple selected blocks' )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tnode.removeAttribute( 'aria-label' );\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ hasMultiSelection ]\n\t\t\t),\n\t\t] ),\n\t\tafter,\n\t];\n}\n\nfunction WritingFlow( { children, ...props }, forwardedRef ) {\n\tconst [ before, ref, after ] = useWritingFlow();\n\treturn (\n\t\t<>\n\t\t\t{ before }\n\t\t\t<div\n\t\t\t\t{ ...props }\n\t\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\t\tclassName={ classNames(\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'block-editor-writing-flow'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t\t{ after }\n\t\t</>\n\t);\n}\n\n/**\n * Handles selection and navigation across blocks. This component should be\n * wrapped around BlockList.\n *\n * @param {Object} props Component properties.\n * @param {WPElement} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"names":["classNames","useSelect","__","useMergeRefs","useRefEffect","forwardRef","useMultiSelection","useTabNav","useArrowNav","useSelectAll","store","blockEditorStore","useWritingFlow","before","ref","after","hasMultiSelection","select","node","tabIndex","setAttribute","removeAttribute","WritingFlow","forwardedRef","children","props","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,EAAuBC,YAAvB,QAA2C,oBAA3C;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,OAAO,SAASC,cAAT,GAA0B;AAChC,QAAM,CAAEC,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBR,SAAS,EAAxC;AACA,QAAMS,iBAAiB,GAAGf,SAAS,CAChCgB,MAAF,IAAcA,MAAM,CAAEN,gBAAF,CAAN,CAA2BK,iBAA3B,EADoB,EAElC,EAFkC,CAAnC;AAKA,SAAO,CACNH,MADM,EAENV,YAAY,CAAE,CACbW,GADa,EAEbR,iBAAiB,EAFJ,EAGbG,YAAY,EAHC,EAIbD,WAAW,EAJE,EAKbJ,YAAY,CACTc,IAAF,IAAY;AACXA,IAAAA,IAAI,CAACC,QAAL,GAAgB,CAAC,CAAjB;;AAEA,QAAK,CAAEH,iBAAP,EAA2B;AAC1B;AACA;;AAEDE,IAAAA,IAAI,CAACE,YAAL,CACC,YADD,EAEClB,EAAE,CAAE,0BAAF,CAFH;AAKA,WAAO,MAAM;AACZgB,MAAAA,IAAI,CAACG,eAAL,CAAsB,YAAtB;AACA,KAFD;AAGA,GAhBU,EAiBX,CAAEL,iBAAF,CAjBW,CALC,CAAF,CAFN,EA2BND,KA3BM,CAAP;AA6BA;;AAED,SAASO,WAAT,OAA8CC,YAA9C,EAA6D;AAAA,MAAvC;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAAuC;AAC5D,QAAM,CAAEZ,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBH,cAAc,EAA7C;AACA,SACC,8BACGC,MADH,EAEC,kCACMY,KADN;AAEC,IAAA,GAAG,EAAGtB,YAAY,CAAE,CAAEW,GAAF,EAAOS,YAAP,CAAF,CAFnB;AAGC,IAAA,SAAS,EAAGvB,UAAU,CACrByB,KAAK,CAACC,SADe,EAErB,2BAFqB;AAHvB,MAQGF,QARH,CAFD,EAYGT,KAZH,CADD;AAgBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,eAAeV,UAAU,CAAEiB,WAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMultiSelection from './use-multi-selection';\nimport useTabNav from './use-tab-nav';\nimport useArrowNav from './use-arrow-nav';\nimport useSelectAll from './use-select-all';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useWritingFlow() {\n\tconst [ before, ref, after ] = useTabNav();\n\tconst hasMultiSelection = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasMultiSelection(),\n\t\t[]\n\t);\n\n\treturn [\n\t\tbefore,\n\t\tuseMergeRefs( [\n\t\t\tref,\n\t\t\tuseMultiSelection(),\n\t\t\tuseSelectAll(),\n\t\t\tuseArrowNav(),\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tnode.tabIndex = -1;\n\n\t\t\t\t\tif ( ! hasMultiSelection ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.setAttribute(\n\t\t\t\t\t\t'aria-label',\n\t\t\t\t\t\t__( 'Multiple selected blocks' )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tnode.removeAttribute( 'aria-label' );\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ hasMultiSelection ]\n\t\t\t),\n\t\t] ),\n\t\tafter,\n\t];\n}\n\nfunction WritingFlow( { children, ...props }, forwardedRef ) {\n\tconst [ before, ref, after ] = useWritingFlow();\n\treturn (\n\t\t<>\n\t\t\t{ before }\n\t\t\t<div\n\t\t\t\t{ ...props }\n\t\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\t\tclassName={ classNames(\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'block-editor-writing-flow'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t\t{ after }\n\t\t</>\n\t);\n}\n\n/**\n * Handles selection and navigation across blocks. This component should be\n * wrapped around BlockList.\n *\n * @param {Object} props Component properties.\n * @param {WPElement} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"]}
@@ -50,7 +50,9 @@ const WIDE_ALIGNMENTS = ['wide', 'full'];
50
50
  * @return {string[]} Valid alignments.
51
51
  */
52
52
 
53
- export function getValidAlignments(blockAlign, hasWideBlockSupport = true, hasWideEnabled = true) {
53
+ export function getValidAlignments(blockAlign) {
54
+ let hasWideBlockSupport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
55
+ let hasWideEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
54
56
  let validAlignments;
55
57
 
56
58
  if (Array.isArray(blockAlign)) {
@@ -114,9 +116,12 @@ export const withToolbarControls = createHigherOrderComponent(BlockEdit => props
114
116
  // Slot.
115
117
 
116
118
  const blockAllowedAlignments = getValidAlignments(getBlockSupport(blockName, 'align'), hasBlockSupport(blockName, 'alignWide', true));
117
- const validAlignments = useAvailableAlignments(blockAllowedAlignments).map(({
118
- name
119
- }) => name);
119
+ const validAlignments = useAvailableAlignments(blockAllowedAlignments).map(_ref => {
120
+ let {
121
+ name
122
+ } = _ref;
123
+ return name;
124
+ });
120
125
 
121
126
  const updateAlignment = nextAlign => {
122
127
  if (!nextAlign) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/align.js"],"names":["classnames","has","without","createHigherOrderComponent","addFilter","getBlockSupport","getBlockType","hasBlockSupport","BlockControls","BlockAlignmentControl","useAvailableAlignments","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","addAttribute","settings","attributes","align","type","enum","withToolbarControls","BlockEdit","props","name","blockName","blockAllowedAlignments","map","updateAlignment","nextAlign","blockType","blockDefaultAlign","default","setAttributes","length","withDataAlign","BlockListBlock","undefined","wrapperProps","some","alignment","addAssignedAlign","isAlignValid","className"],"mapp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BC,SAAF,IAAiBA,SAAS,CAAChB,IAAV,KAAmBN,KAA1D,CADD,EAEE;AACDoB,IAAAA,YAAY,GAAG,EAAE,GAAGA,YAAL;AAAmB,oBAAcpB;AAAjC,KAAf;AACA;;AAED,SAAO,cAAC,cAAD,eAAqBK,KAArB;AAA6B,IAAA,YAAY,EAAGe;AAA5C,KAAP;AACA,CA1BqD,CAAhD;AA6BP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,gBAAT,CAA2BlB,KAA3B,EAAkCO,SAAlC,EAA6Cb,UAA7C,EAA0D;AAChE,QAAM;AAAEC,IAAAA;AAAF,MAAYD,UAAlB;AACA,QAAMX,UAAU,GAAGT,eAAe,CAAEiC,SAAF,EAAa,OAAb,CAAlC;AACA,QAAMvB,mBAAmB,GAAGR,eAAe,CAAE+B,SAAF,EAAa,WAAb,EAA0B,IAA1B,CAA3C,CAHgE,CAKhE;AACA;AACA;;AACA,QAAMY,YAAY,GAAGrC,kBAAkB,CACtCC,UADsC,EAEtCC,mBAFsC,CAAlB,CAGnBO,QAHmB,CAGTI,KAHS,CAArB;;AAIA,MAAKwB,YAAL,EAAoB;AACnBnB,IAAAA,KAAK,CAACoB,SAAN,GAAkBnD,UAAU,CAAG,QAAQ0B,KAAO,EAAlB,EAAqBK,KAAK,CAACoB,SAA3B,CAA5B;AACA;;AAED,SAAOpB,KAAP;AACA;AAED3B,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRmB,YAHQ,CAAT;AAKAnB,SAAS,CACR,uBADQ,EAER,mCAFQ,EAGRuC,aAHQ,CAAT;AAKAvC,SAAS,CACR,kBADQ,EAER,yCAFQ,EAGRyB,mBAHQ,CAAT;AAKAzB,SAAS,CACR,kCADQ,EAER,6BAFQ,EAGR6C,gBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { has, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn without( validAlignments, ...WIDE_ALIGNMENTS );\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// allow blocks to specify their own attribute definition with default values if needed.\n\tif ( has( settings.attributes, [ 'align', 'type' ] ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by updateAlignment function\n\t\t\t\t// in withToolbarControls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new toolbar controls for block\n * alignment, if block defines support.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withToolbarControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\t// Compute the block valid alignments by taking into account,\n\t\t// if the theme supports wide alignments or not and the layout's\n\t\t// availble alignments. We do that for conditionally rendering\n\t\t// Slot.\n\t\tconst blockAllowedAlignments = getValidAlignments(\n\t\t\tgetBlockSupport( blockName, 'align' ),\n\t\t\thasBlockSupport( blockName, 'alignWide', true )\n\t\t);\n\n\t\tconst validAlignments = useAvailableAlignments(\n\t\t\tblockAllowedAlignments\n\t\t).map( ( { name } ) => name );\n\n\t\tconst updateAlignment = ( nextAlign ) => {\n\t\t\tif ( ! nextAlign ) {\n\t\t\t\tconst blockType = getBlockType( props.name );\n\t\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\t\tnextAlign = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tprops.setAttributes( { align: nextAlign } );\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ !! validAlignments.length && (\n\t\t\t\t\t<BlockControls\n\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t__experimentalShareWithChildBlocks\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockAlignmentControl\n\t\t\t\t\t\t\tvalue={ props.attributes.align }\n\t\t\t\t\t\t\tonChange={ updateAlignment }\n\t\t\t\t\t\t\tcontrols={ validAlignments }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to add alignment wrapper props.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withDataAlign = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst { align } = attributes;\n\t\tconst blockAllowedAlignments = getValidAlignments(\n\t\t\tgetBlockSupport( name, 'align' ),\n\t\t\thasBlockSupport( name, 'alignWide', true )\n\t\t);\n\t\tconst validAlignments = useAvailableAlignments(\n\t\t\tblockAllowedAlignments\n\t\t);\n\n\t\t// If an alignment is not assigned, there's no need to go through the\n\t\t// effort to validate or assign its value.\n\t\tif ( align === undefined ) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\tlet wrapperProps = props.wrapperProps;\n\t\tif (\n\t\t\tvalidAlignments.some( ( alignment ) => alignment.name === align )\n\t\t) {\n\t\t\twrapperProps = { ...wrapperProps, 'data-align': align };\n\t\t}\n\n\t\treturn <BlockListBlock { ...props } wrapperProps={ wrapperProps } />;\n\t}\n);\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = classnames( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/align/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/align/with-data-align',\n\twithDataAlign\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/align/with-toolbar-controls',\n\twithToolbarControls\n);\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/align/addAssignedAlign',\n\taddAssignedAlign\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/align.js"],"names":["classnames","has","without","createHigherOrderComponent","addFilter","getBlockSupport","getBlockType","hasBlockSupport","BlockControls","BlockAlignmentControl","useAvailableAlignments","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","addAttribute","settings","attributes","align","type","enum","withToolbarControls","BlockEdit","props","name","blockName","blockAllowedAlignments","map","updateAlignment","nextAlign","blockType","blockDefaultAlign","default","setAttributes","length","withDataAlign","BlockListBlock","undefined","wrapperProps","some","alignment","addAssignedAlign","isAlignValid","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,GAAT,EAAcC,OAAd,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,eADD,EAECC,YAFD,EAGCC,eAHD,QAIO,mBAJP;AAMA;AACA;AACA;;AACA,SAASC,aAAT,EAAwBC,qBAAxB,QAAqD,eAArD;AACA,OAAOC,sBAA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;AACA;AACA;AACA;;AACA,OAAO,SAASG,gBAAT,CAA2BlB,KAA3B,EAAkCO,SAAlC,EAA6Cb,UAA7C,EAA0D;AAChE,QAAM;AAAEC,IAAAA;AAAF,MAAYD,UAAlB;AACA,QAAMX,UAAU,GAAGT,eAAe,CAAEiC,SAAF,EAAa,OAAb,CAAlC;AACA,QAAMvB,mBAAmB,GAAGR,eAAe,CAAE+B,SAAF,EAAa,WAAb,EAA0B,IAA1B,CAA3C,CAHgE,CAKhE;AACA;AACA;;AACA,QAAMY,YAAY,GAAGrC,kBAAkB,CACtCC,UADsC,EAEtCC,mBAFsC,CAAlB,CAGnBO,QAHmB,CAGTI,KAHS,CAArB;;AAIA,MAAKwB,YAAL,EAAoB;AACnBnB,IAAAA,KAAK,CAACoB,SAAN,GAAkBnD,UAAU,CAAG,QAAQ0B,KAAO,EAAlB,EAAqBK,KAAK,CAACoB,SAA3B,CAA5B;AACA;;AAED,SAAOpB,KAAP;AACA;AAED3B,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRmB,YAHQ,CAAT;AAKAnB,SAAS,CACR,uBADQ,EAER,mCAFQ,EAGRuC,aAHQ,CAAT;AAKAvC,SAAS,CACR,kBADQ,EAER,yCAFQ,EAGRyB,mBAHQ,CAAT;AAKAzB,SAAS,CACR,kCADQ,EAER,6BAFQ,EAGR6C,gBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { has, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn without( validAlignments, ...WIDE_ALIGNMENTS );\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// allow blocks to specify their own attribute definition with default values if needed.\n\tif ( has( settings.attributes, [ 'align', 'type' ] ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by updateAlignment function\n\t\t\t\t// in withToolbarControls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new toolbar controls for block\n * alignment, if block defines support.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withToolbarControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\t// Compute the block valid alignments by taking into account,\n\t\t// if the theme supports wide alignments or not and the layout's\n\t\t// availble alignments. We do that for conditionally rendering\n\t\t// Slot.\n\t\tconst blockAllowedAlignments = getValidAlignments(\n\t\t\tgetBlockSupport( blockName, 'align' ),\n\t\t\thasBlockSupport( blockName, 'alignWide', true )\n\t\t);\n\n\t\tconst validAlignments = useAvailableAlignments(\n\t\t\tblockAllowedAlignments\n\t\t).map( ( { name } ) => name );\n\n\t\tconst updateAlignment = ( nextAlign ) => {\n\t\t\tif ( ! nextAlign ) {\n\t\t\t\tconst blockType = getBlockType( props.name );\n\t\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\t\tnextAlign = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tprops.setAttributes( { align: nextAlign } );\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ !! validAlignments.length && (\n\t\t\t\t\t<BlockControls\n\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t__experimentalShareWithChildBlocks\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockAlignmentControl\n\t\t\t\t\t\t\tvalue={ props.attributes.align }\n\t\t\t\t\t\t\tonChange={ updateAlignment }\n\t\t\t\t\t\t\tcontrols={ validAlignments }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to add alignment wrapper props.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withDataAlign = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst { align } = attributes;\n\t\tconst blockAllowedAlignments = getValidAlignments(\n\t\t\tgetBlockSupport( name, 'align' ),\n\t\t\thasBlockSupport( name, 'alignWide', true )\n\t\t);\n\t\tconst validAlignments = useAvailableAlignments(\n\t\t\tblockAllowedAlignments\n\t\t);\n\n\t\t// If an alignment is not assigned, there's no need to go through the\n\t\t// effort to validate or assign its value.\n\t\tif ( align === undefined ) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\tlet wrapperProps = props.wrapperProps;\n\t\tif (\n\t\t\tvalidAlignments.some( ( alignment ) => alignment.name === align )\n\t\t) {\n\t\t\twrapperProps = { ...wrapperProps, 'data-align': align };\n\t\t}\n\n\t\treturn <BlockListBlock { ...props } wrapperProps={ wrapperProps } />;\n\t}\n);\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = classnames( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/align/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/align/with-data-align',\n\twithDataAlign\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/align/with-toolbar-controls',\n\twithToolbarControls\n);\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/align/addAssignedAlign',\n\taddAssignedAlign\n);\n"]}
@@ -47,7 +47,9 @@ export function BorderPanel(props) {
47
47
  * @return {boolean} Whether there is support.
48
48
  */
49
49
 
50
- export function hasBorderSupport(blockName, feature = 'any') {
50
+ export function hasBorderSupport(blockName) {
51
+ let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';
52
+
51
53
  if (Platform.OS !== 'web') {
52
54
  return false;
53
55
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/border.js"],"names":["getBlockSupport","PanelBody","Platform","__","InspectorControls","useSetting","BorderColorEdit","BorderRadiusEdit","BorderStyleEdit","BorderWidthEdit","BORDER_SUPPORT_KEY","BorderPanel","props","isDisabled","useIsBorderDisabled","isSupported","hasBorderSupport","name","isColorSupported","isRadiusSupported","isStyleSupported","isWidthSupported","blockName","feature","OS","support","color","radius","width","style","shouldSkipSerialization","blockType","__experimentalSkipSerialization","configs","every","Boolean"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,mBAAhC;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,eAAT,QAAgC,gBAAhC;AACA,SAASC,gBAAT,QAAiC,iBAAjC;AACA,SAASC,eAAT,QAAgC,gBAAhC;AACA,SAASC,eAAT,QAAgC,gBAAhC;AAEA,OAAO,MAAMC,kBAAkB,GAAG,sBAA3B;AAEP,OAAO,SAASC,WAAT,CAAsBC,K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KAAhD,EAAwD;AAC9D,MAAKrB,QAAQ,CAACsB,EAAT,KAAgB,KAArB,EAA6B;AAC5B,WAAO,KAAP;AACA;;AAED,QAAMC,OAAO,GAAGzB,eAAe,CAAEsB,SAAF,EAAaZ,kBAAb,CAA/B;;AAEA,MAAKe,OAAO,KAAK,IAAjB,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,MAAKF,OAAO,KAAK,KAAjB,EAAyB;AACxB,WAAO,CAAC,EACPE,OAAO,SAAP,IAAAA,OAAO,WAAP,IAAAA,OAAO,CAAEC,KAAT,IACAD,OADA,aACAA,OADA,eACAA,OAAO,CAAEE,MADT,IAEAF,OAFA,aAEAA,OAFA,eAEAA,OAAO,CAAEG,KAFT,IAGAH,OAHA,aAGAA,OAHA,eAGAA,OAAO,CAAEI,KAJF,CAAR;AAMA;;AAED,SAAO,CAAC,EAAEJ,OAAF,aAAEA,OAAF,eAAEA,OAAO,CAAIF,OAAJ,CAAT,CAAR;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASO,uBAAT,CAAkCC,SAAlC,EAA8C;AACpD,QAAMN,OAAO,GAAGzB,eAAe,CAAE+B,SAAF,EAAarB,kBAAb,CAA/B;AAEA,SAAOe,OAAP,aAAOA,OAAP,uBAAOA,OAAO,CAAEO,+BAAhB;AACA;AAED;AACA;AACA;AACA;AACA;;AACA,MAAMlB,mBAAmB,GAAG,MAAM;AACjC,QAAMmB,OAAO,GAAG,CACf,CAAE5B,UAAU,CAAE,cAAF,CADG,EAEf,CAAEA,UAAU,CAAE,eAAF,CAFG,EAGf,CAAEA,UAAU,CAAE,cAAF,CAHG,EAIf,CAAEA,UAAU,CAAE,cAAF,CAJG,CAAhB;AAOA,SAAO4B,OAAO,CAACC,KAAR,CAAeC,OAAf,CAAP;AACA,CATD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { PanelBody } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport useSetting from '../components/use-setting';\nimport { BorderColorEdit } from './border-color';\nimport { BorderRadiusEdit } from './border-radius';\nimport { BorderStyleEdit } from './border-style';\nimport { BorderWidthEdit } from './border-width';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\n\nexport function BorderPanel( props ) {\n\tconst isDisabled = useIsBorderDisabled( props );\n\tconst isSupported = hasBorderSupport( props.name );\n\n\tconst isColorSupported =\n\t\tuseSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );\n\n\tconst isRadiusSupported =\n\t\tuseSetting( 'border.radius' ) &&\n\t\thasBorderSupport( props.name, 'radius' );\n\n\tconst isStyleSupported =\n\t\tuseSetting( 'border.style' ) && hasBorderSupport( props.name, 'style' );\n\n\tconst isWidthSupported =\n\t\tuseSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__border-controls\"\n\t\t\t\ttitle={ __( 'Border' ) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t{ ( isWidthSupported || isStyleSupported ) && (\n\t\t\t\t\t<div className=\"block-editor-hooks__border-controls-row\">\n\t\t\t\t\t\t{ isWidthSupported && <BorderWidthEdit { ...props } /> }\n\t\t\t\t\t\t{ isStyleSupported && <BorderStyleEdit { ...props } /> }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ isColorSupported && <BorderColorEdit { ...props } /> }\n\t\t\t\t{ isRadiusSupported && <BorderRadiusEdit { ...props } /> }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, 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 * Check whether serialization of border classes and styles should be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n *\n * @return {boolean} Whether serialization of border properties should occur.\n */\nexport function shouldSkipSerialization( blockType ) {\n\tconst support = getBlockSupport( blockType, BORDER_SUPPORT_KEY );\n\n\treturn support?.__experimentalSkipSerialization;\n}\n\n/**\n * Determines if all border support features have been disabled.\n *\n * @return {boolean} If border support is completely disabled.\n */\nconst useIsBorderDisabled = () => {\n\tconst configs = [\n\t\t! useSetting( 'border.color' ),\n\t\t! useSetting( 'border.radius' ),\n\t\t! useSetting( 'border.style' ),\n\t\t! useSetting( 'border.width' ),\n\t];\n\n\treturn configs.every( Boolean );\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/border.js"],"names":["getBlockSupport","PanelBody","Platform","__","InspectorControls","useSetting","BorderColorEdit","BorderRadiusEdit","BorderStyleEdit","BorderWidthEdit","BORDER_SUPPORT_KEY","BorderPanel","props","isDisabled","useIsBorderDisabled","isSupported","hasBorderSupport","name","isColorSupported","isRadiusSupported","isStyleSupported","isWidthSupported","blockName","feature","OS","support","color","radius","width","style","shouldSkipSerialization","blockType","__experimentalSkipSerialization","configs","every","Boolean"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,mBAAhC;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;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CADG,EAEf,CAAEA,UAAU,CAAE,eAAF,CAFG,EAGf,CAAEA,UAAU,CAAE,cAAF,CAHG,EAIf,CAAEA,UAAU,CAAE,cAAF,CAJG,CAAhB;AAOA,SAAO4B,OAAO,CAACC,KAAR,CAAeC,OAAf,CAAP;AACA,CATD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { PanelBody } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport useSetting from '../components/use-setting';\nimport { BorderColorEdit } from './border-color';\nimport { BorderRadiusEdit } from './border-radius';\nimport { BorderStyleEdit } from './border-style';\nimport { BorderWidthEdit } from './border-width';\n\nexport const BORDER_SUPPORT_KEY = '__experimentalBorder';\n\nexport function BorderPanel( props ) {\n\tconst isDisabled = useIsBorderDisabled( props );\n\tconst isSupported = hasBorderSupport( props.name );\n\n\tconst isColorSupported =\n\t\tuseSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );\n\n\tconst isRadiusSupported =\n\t\tuseSetting( 'border.radius' ) &&\n\t\thasBorderSupport( props.name, 'radius' );\n\n\tconst isStyleSupported =\n\t\tuseSetting( 'border.style' ) && hasBorderSupport( props.name, 'style' );\n\n\tconst isWidthSupported =\n\t\tuseSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__border-controls\"\n\t\t\t\ttitle={ __( 'Border' ) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t{ ( isWidthSupported || isStyleSupported ) && (\n\t\t\t\t\t<div className=\"block-editor-hooks__border-controls-row\">\n\t\t\t\t\t\t{ isWidthSupported && <BorderWidthEdit { ...props } /> }\n\t\t\t\t\t\t{ isStyleSupported && <BorderStyleEdit { ...props } /> }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ isColorSupported && <BorderColorEdit { ...props } /> }\n\t\t\t\t{ isRadiusSupported && <BorderRadiusEdit { ...props } /> }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( blockName, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( blockName, 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 * Check whether serialization of border classes and styles should be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n *\n * @return {boolean} Whether serialization of border properties should occur.\n */\nexport function shouldSkipSerialization( blockType ) {\n\tconst support = getBlockSupport( blockType, BORDER_SUPPORT_KEY );\n\n\treturn support?.__experimentalSkipSerialization;\n}\n\n/**\n * Determines if all border support features have been disabled.\n *\n * @return {boolean} If border support is completely disabled.\n */\nconst useIsBorderDisabled = () => {\n\tconst configs = [\n\t\t! useSetting( 'border.color' ),\n\t\t! useSetting( 'border.radius' ),\n\t\t! useSetting( 'border.style' ),\n\t\t! useSetting( 'border.width' ),\n\t];\n\n\treturn configs.every( Boolean );\n};\n"]}
@@ -18,12 +18,13 @@ function getComputedStyle(node) {
18
18
  return node.ownerDocument.defaultView.getComputedStyle(node);
19
19
  }
20
20
 
21
- export default function ColorPanel({
22
- settings,
23
- clientId,
24
- enableContrastChecking = true,
25
- showTitle = true
26
- }) {
21
+ export default function ColorPanel(_ref) {
22
+ let {
23
+ settings,
24
+ clientId,
25
+ enableContrastChecking = true,
26
+ showTitle = true
27
+ } = _ref;
27
28
  const [detectedBackgroundColor, setDetectedBackgroundColor] = useState();
28
29
  const [detectedColor, setDetectedColor] = useState();
29
30
  const ref = useBlockRef(clientId);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/color-panel.js"],"names":["useState","useEffect","__","PanelColorGradientSettings","ContrastChecker","InspectorControls","__unstableUseBlockRef","useBlockRef","getComputedStyle","node","ownerDocument","defaultView","ColorPanel","settings","clientId","enableContrastChecking","showTitle","detectedBackgroundColor","setDetectedBackgroundColor","detectedColor","setDetectedColor","ref","current","color","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,0BAAP,MAAuC,8DAAvC;AACA,OAAOC,eAAP,MAA4B,gCAA5B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SAASC,qBAAqB,IAAIC,WAAlC,QAAqD,yDAArD;;AAEA,SAASC,gBAAT,CAA2BC,IAA3B,EAAkC;AACjC,SAAOA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BH,gBAA/B,CAAiDC,IAAjD,CAAP;AACA;;AAED,eAAe,SAASG,UAAT,CAAqB;AACnCC,EAAAA,QADmC;AAEnCC,EAAAA,QAFmC;AAGnCC,EAAAA,sBAAsB,GAAG,IAHU;AAInCC,EAAAA,SAAS,GAAG;AAJuB,CAArB,EAKX;AACH,QAAM,CAAEC,uBAAF,EAA2BC,0BAA3B,IAA0DlB,QAAQ,EAAxE;AACA,QAAM,CAAEmB,aAAF,EAAiBC,gBAAjB,IAAsCpB,QAAQ,EAApD;AACA,QAAMqB,GAAG,GAAGd,WAAW,CAAEO,QAAF,CAAvB;AAEAb,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAK,CAAEc,sBAAP,EAAgC;AAC/B;AACA;;AAED,QAAK,CAAEM,GAAG,CAACC,OAAX,EAAqB;AACpB;AACA;;AACDF,IAAAA,gBAAgB,CAAEZ,gBAAgB,CAAEa,GAAG,CAACC,OAAN,CAAhB,CAAgCC,KAAlC,CAAhB;AAEA,QAAIC,mBAAmB,GAAGH,GAAG,CAACC,OAA9B;AACA,QAAIG,eAAe,GAAGjB,gBAAgB,CAAEgB,mBAAF,CAAhB,CACpBC,eADF;;AAEA,WACCA,eAAe,KAAK,kBAApB,IACAD,mBAAmB,CAACE,UADpB,IAEAF,mBAAmB,CAACE,UAApB,CAA+BC,QAA/B,KACCH,mBAAmB,CAACE,UAApB,CAA+BE,YAJjC,EAKE;AACDJ,MAAAA,mBAAmB,GAAGA,mBAAmB,CAACE,UAA1C;AACAD,MAAAA,eAAe,GAAGjB,gBAAgB,CAAEgB,mBAAF,CAAhB,CAChBC,eADF;AAEA;;AAEDP,IAAAA,0BAA0B,CAAEO,eAAF,CAA1B;AACA,GAzBQ,CAAT;AA2BA,SACC,cAAC,iBAAD,QACC,cAAC,0BAAD;AACC,IAAA,KAAK,EAAGvB,EAAE,CAAE,OAAF,CADX;AAEC,IAAA,WAAW,EAAG,KAFf;AAGC,IAAA,QAAQ,EAAGW,QAHZ;AAIC,IAAA,SAAS,EAAGG,SAJb;AAKC,IAAA,gCAAgC;AALjC,KAOGD,sBAAsB,IACvB,cAAC,eAAD;AACC,IAAA,eAAe,EAAGE,uBADnB;AAEC,IAAA,SAAS,EAAGE;AAFb,IARF,CADD,CADD;AAkBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PanelColorGradientSettings from '../components/colors-gradients/panel-color-gradient-settings';\nimport ContrastChecker from '../components/contrast-checker';\nimport InspectorControls from '../components/inspector-controls';\nimport { __unstableUseBlockRef as useBlockRef } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport default function ColorPanel( {\n\tsettings,\n\tclientId,\n\tenableContrastChecking = true,\n\tshowTitle = true,\n} ) {\n\tconst [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState();\n\tconst [ detectedColor, setDetectedColor ] = useState();\n\tconst ref = useBlockRef( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! enableContrastChecking ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tsetDetectedColor( getComputedStyle( ref.current ).color );\n\n\t\tlet backgroundColorNode = ref.current;\n\t\tlet backgroundColor = getComputedStyle( backgroundColorNode )\n\t\t\t.backgroundColor;\n\t\twhile (\n\t\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\t\tbackgroundColorNode.parentNode &&\n\t\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t\t) {\n\t\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\t\tbackgroundColor = getComputedStyle( backgroundColorNode )\n\t\t\t\t.backgroundColor;\n\t\t}\n\n\t\tsetDetectedBackgroundColor( backgroundColor );\n\t} );\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelColorGradientSettings\n\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t\tsettings={ settings }\n\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t>\n\t\t\t\t{ enableContrastChecking && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\tbackgroundColor={ detectedBackgroundColor }\n\t\t\t\t\t\ttextColor={ detectedColor }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelColorGradientSettings>\n\t\t</InspectorControls>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/color-panel.js"],"names":["useState","useEffect","__","PanelColorGradientSettings","ContrastChecker","InspectorControls","__unstableUseBlockRef","useBlockRef","getComputedStyle","node","ownerDocument","defaultView","ColorPanel","settings","clientId","enableContrastChecking","showTitle","detectedBackgroundColor","setDetectedBackgroundColor","detectedColor","setDetectedColor","ref","current","color","backgroundColorNode","backgroundColor","parentNode","nodeType","ELEMENT_NODE"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,0BAAP,MAAuC,8DAAvC;AACA,OAAOC,eAAP,MAA4B,gCAA5B;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SAASC,qBAAqB,IAAIC,WAAlC,QAAqD,yDAArD;;AAEA,SAASC,gBAAT,CAA2BC,IAA3B,EAAkC;AACjC,SAAOA,IAAI,CAACC,aAAL,CAAmBC,WAAnB,CAA+BH,gBAA/B,CAAiDC,IAAjD,CAAP;AACA;;AAED,eAAe,SAASG,UAAT,OAKX;AAAA,MALgC;AACnCC,IAAAA,QADmC;AAEnCC,IAAAA,QAFmC;AAGnCC,IAAAA,sBAAsB,GAAG,IAHU;AAInCC,IAAAA,SAAS,GAAG;AAJuB,GAKhC;AACH,QAAM,CAAEC,uBAAF,EAA2BC,0BAA3B,IAA0DlB,QAAQ,EAAxE;AACA,QAAM,CAAEmB,aAAF,EAAiBC,gBAAjB,IAAsCpB,QAAQ,EAApD;AACA,QAAMqB,GAAG,GAAGd,WAAW,CAAEO,QAAF,CAAvB;AAEAb,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAK,CAAEc,sBAAP,EAAgC;AAC/B;AACA;;AAED,QAAK,CAAEM,GAAG,CAACC,OAAX,EAAqB;AACpB;AACA;;AACDF,IAAAA,gBAAgB,CAAEZ,gBAAgB,CAAEa,GAAG,CAACC,OAAN,CAAhB,CAAgCC,KAAlC,CAAhB;AAEA,QAAIC,mBAAmB,GAAGH,GAAG,CAACC,OAA9B;AACA,QAAIG,eAAe,GAAGjB,gBAAgB,CAAEgB,mBAAF,CAAhB,CACpBC,eADF;;AAEA,WACCA,eAAe,KAAK,kBAApB,IACAD,mBAAmB,CAACE,UADpB,IAEAF,mBAAmB,CAACE,UAApB,CAA+BC,QAA/B,KACCH,mBAAmB,CAACE,UAApB,CAA+BE,YAJjC,EAKE;AACDJ,MAAAA,mBAAmB,GAAGA,mBAAmB,CAACE,UAA1C;AACAD,MAAAA,eAAe,GAAGjB,gBAAgB,CAAEgB,mBAAF,CAAhB,CAChBC,eADF;AAEA;;AAEDP,IAAAA,0BAA0B,CAAEO,eAAF,CAA1B;AACA,GAzBQ,CAAT;AA2BA,SACC,cAAC,iBAAD,QACC,cAAC,0BAAD;AACC,IAAA,KAAK,EAAGvB,EAAE,CAAE,OAAF,CADX;AAEC,IAAA,WAAW,EAAG,KAFf;AAGC,IAAA,QAAQ,EAAGW,QAHZ;AAIC,IAAA,SAAS,EAAGG,SAJb;AAKC,IAAA,gCAAgC;AALjC,KAOGD,sBAAsB,IACvB,cAAC,eAAD;AACC,IAAA,eAAe,EAAGE,uBADnB;AAEC,IAAA,SAAS,EAAGE;AAFb,IARF,CADD,CADD;AAkBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PanelColorGradientSettings from '../components/colors-gradients/panel-color-gradient-settings';\nimport ContrastChecker from '../components/contrast-checker';\nimport InspectorControls from '../components/inspector-controls';\nimport { __unstableUseBlockRef as useBlockRef } from '../components/block-list/use-block-props/use-block-refs';\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nexport default function ColorPanel( {\n\tsettings,\n\tclientId,\n\tenableContrastChecking = true,\n\tshowTitle = true,\n} ) {\n\tconst [ detectedBackgroundColor, setDetectedBackgroundColor ] = useState();\n\tconst [ detectedColor, setDetectedColor ] = useState();\n\tconst ref = useBlockRef( clientId );\n\n\tuseEffect( () => {\n\t\tif ( ! enableContrastChecking ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tsetDetectedColor( getComputedStyle( ref.current ).color );\n\n\t\tlet backgroundColorNode = ref.current;\n\t\tlet backgroundColor = getComputedStyle( backgroundColorNode )\n\t\t\t.backgroundColor;\n\t\twhile (\n\t\t\tbackgroundColor === 'rgba(0, 0, 0, 0)' &&\n\t\t\tbackgroundColorNode.parentNode &&\n\t\t\tbackgroundColorNode.parentNode.nodeType ===\n\t\t\t\tbackgroundColorNode.parentNode.ELEMENT_NODE\n\t\t) {\n\t\t\tbackgroundColorNode = backgroundColorNode.parentNode;\n\t\t\tbackgroundColor = getComputedStyle( backgroundColorNode )\n\t\t\t\t.backgroundColor;\n\t\t}\n\n\t\tsetDetectedBackgroundColor( backgroundColor );\n\t} );\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelColorGradientSettings\n\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\tinitialOpen={ false }\n\t\t\t\tsettings={ settings }\n\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t>\n\t\t\t\t{ enableContrastChecking && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\tbackgroundColor={ detectedBackgroundColor }\n\t\t\t\t\t\ttextColor={ detectedColor }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</PanelColorGradientSettings>\n\t\t</InspectorControls>\n\t);\n}\n"]}
@@ -99,7 +99,8 @@ export function hasDimensionsSupport(blockName) {
99
99
  * @return {boolean} If spacing support is completely disabled.
100
100
  */
101
101
 
102
- const useIsDimensionsDisabled = (props = {}) => {
102
+ const useIsDimensionsDisabled = function () {
103
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
103
104
  const gapDisabled = useIsGapDisabled(props);
104
105
  const paddingDisabled = useIsPaddingDisabled(props);
105
106
  const marginDisabled = useIsMarginDisabled(props);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"names":["__experimentalToolsPanelItem","ToolsPanelItem","Platform","__","getBlockSupport","InspectorControls","GapEdit","hasGapSupport","hasGapValue","resetGap","useIsGapDisabled","MarginEdit","hasMarginSupport","hasMarginValue","resetMargin","useIsMarginDisabled","PaddingEdit","hasPaddingSupport","hasPaddingValue","resetPadding","useIsPaddingDisabled","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","DimensionsPanel","props","isGapDisabled","isPaddingDisabled","isMarginDisabled","isDisabled","useIsDimensionsDisabled","isSupported","hasDimensionsSupport","name","defaultSpacingControls","createResetAllFilter","attribute","newAttributes","style","spacing","undefined","padding","clientId","margin","blockGap","blockName","OS","gapDisabled","paddingDisabled","marginDisabled","useCustomSides","feature","support","useIsDimensionsSupportValid","sides","some","side","includes","console","warn"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,4BAA4B,IAAIC,cAAzC,QAA+D,uBAA/D;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SACCC,OADD,EAECC,aAFD,EAGCC,WAHD,EAICC,QAJD,EAKCC,gBALD,QAMO,OANP;AAOA,SACCC,UADD,EAECC,gBAFD,EAGCC,cAHD,EAICC,WAJD,EAKCC,mBALD,QAMO,UANP;AAOA,SACCC,WADD,EAECC,iBAFD,EAGCC,eAHD,EAICC,YAJD,EAKCC,oBALD,QAMO,WANP;AAQA,OAAO,MAAMC,mBAAmB,GAAG,SAA5B;AACP,OAAO,MAAMC,SAAS,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB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,qBAAqBN,SAAW,0EADlD;AAGA,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tGapEdit,\n\thasGapSupport,\n\thasGapValue,\n\tresetGap,\n\tuseIsGapDisabled,\n} from './gap';\nimport {\n\tMarginEdit,\n\thasMarginSupport,\n\thasMarginValue,\n\tresetMargin,\n\tuseIsMarginDisabled,\n} from './margin';\nimport {\n\tPaddingEdit,\n\thasPaddingSupport,\n\thasPaddingValue,\n\tresetPadding,\n\tuseIsPaddingDisabled,\n} from './padding';\n\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\n/**\n * Inspector controls for dimensions support.\n *\n * @param {Object} props Block props.\n *\n * @return {WPElement} Inspector controls for spacing support features.\n */\nexport function DimensionsPanel( props ) {\n\tconst isGapDisabled = useIsGapDisabled( props );\n\tconst isPaddingDisabled = useIsPaddingDisabled( props );\n\tconst isMarginDisabled = useIsMarginDisabled( props );\n\tconst isDisabled = useIsDimensionsDisabled( props );\n\tconst isSupported = hasDimensionsSupport( props.name );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\tconst defaultSpacingControls = getBlockSupport( props.name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst createResetAllFilter = ( attribute ) => ( newAttributes ) => ( {\n\t\t...newAttributes,\n\t\tstyle: {\n\t\t\t...newAttributes.style,\n\t\t\tspacing: {\n\t\t\t\t...newAttributes.style?.spacing,\n\t\t\t\t[ attribute ]: undefined,\n\t\t\t},\n\t\t},\n\t} );\n\n\treturn (\n\t\t<InspectorControls __experimentalGroup=\"dimensions\">\n\t\t\t{ ! isPaddingDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasPaddingValue( props ) }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\tonDeselect={ () => resetPadding( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'padding' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.padding }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<PaddingEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ ! isMarginDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasMarginValue( props ) }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\tonDeselect={ () => resetMargin( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'margin' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.margin }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<MarginEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ ! isGapDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasGapValue( props ) }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\tonDeselect={ () => resetGap( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'blockGap' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.blockGap }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<GapEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is dimensions related block support.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\thasGapSupport( blockName ) ||\n\t\thasPaddingSupport( blockName ) ||\n\t\thasMarginSupport( blockName )\n\t);\n}\n\n/**\n * Determines whether dimensions support has been disabled.\n *\n * @param {Object} props Block properties.\n *\n * @return {boolean} If spacing support is completely disabled.\n */\nconst useIsDimensionsDisabled = ( props = {} ) => {\n\tconst gapDisabled = useIsGapDisabled( props );\n\tconst paddingDisabled = useIsPaddingDisabled( props );\n\tconst marginDisabled = useIsMarginDisabled( props );\n\n\treturn gapDisabled && paddingDisabled && marginDisabled;\n};\n\n/**\n * Custom hook to retrieve which padding/margin is supported\n * e.g. top, right, bottom or left.\n *\n * Sides are opted into by default. It is only if a specific side is set to\n * false that it is omitted.\n *\n * @param {string} blockName Block name.\n * @param {string} feature The feature custom sides relate to e.g. padding or margins.\n *\n * @return {Object} Sides supporting custom margin.\n */\nexport function useCustomSides( blockName, feature ) {\n\tconst support = getBlockSupport( blockName, SPACING_SUPPORT_KEY );\n\n\t// Skip when setting is boolean as theme isn't setting arbitrary sides.\n\tif ( ! support || typeof support[ feature ] === 'boolean' ) {\n\t\treturn;\n\t}\n\n\treturn support[ feature ];\n}\n\n/**\n * Custom hook to determine whether the sides configured in the\n * block support are valid. A dimension property cannot declare\n * support for a mix of axial and individual sides.\n *\n * @param {string} blockName Block name.\n * @param {string} feature The feature custom sides relate to e.g. padding or margins.\n *\n * @return {boolean} If the feature has a valid configuration of sides.\n */\nexport function useIsDimensionsSupportValid( blockName, feature ) {\n\tconst sides = useCustomSides( blockName, feature );\n\n\tif (\n\t\tsides &&\n\t\tsides.some( ( side ) => ALL_SIDES.includes( side ) ) &&\n\t\tsides.some( ( side ) => AXIAL_SIDES.includes( side ) )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t`The ${ feature } support for the \"${ blockName }\" block can not be configured to support both axial and arbitrary sides.`\n\t\t);\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/dimensions.js"],"names":["__experimentalToolsPanelItem","ToolsPanelItem","Platform","__","getBlockSupport","InspectorControls","GapEdit","hasGapSupport","hasGapValue","resetGap","useIsGapDisabled","MarginEdit","hasMarginSupport","hasMarginValue","resetMargin","useIsMarginDisabled","PaddingEdit","hasPaddingSupport","hasPaddingValue","resetPadding","useIsPaddingDisabled","SPACING_SUPPORT_KEY","ALL_SIDES","AXIAL_SIDES","DimensionsPanel","props","isGapDisabled","isPaddingDisabled","isMarginDisabled","isDisabled","useIsDimensionsDisabled","isSupported","hasDimensionsSupport","name","defaultSpacingControls","createResetAllFilter","attribute","newAttributes","style","spacing","undefined","padding","clientId","margin","blockGap","blockName","OS","gapDisabled","paddingDisabled","marginDisabled","useCustomSides","feature","support","useIsDimensionsSupportValid","sides","some","side","includes","console","warn"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,4BAA4B,IAAIC,cAAzC,QAA+D,uBAA/D;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SACCC,OADD,EAECC,aAFD,EAGCC,WAHD,EAICC,QAJD,EAKCC,gBALD,QAMO,OANP;AAOA,SACCC,UADD,EAECC,gBAFD,EAGCC,cAHD,EAICC,WAJD,EAKCC,mBALD,QAMO,UANP;AAOA,SACCC,WADD,EAECC,iBAFD,EAGCC,eAHD,EAICC,YAJD,EAKCC,oBALD,QAMO,WANP;AAQA,OAAO,MAAMC,mBAAmB,GAAG,SAA5B;AACP,OAAO,MAAMC,SAAS,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAAlB;AACP,OAAO,MAAMC,WAAW,GAAG,CAAE,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AAED,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tGapEdit,\n\thasGapSupport,\n\thasGapValue,\n\tresetGap,\n\tuseIsGapDisabled,\n} from './gap';\nimport {\n\tMarginEdit,\n\thasMarginSupport,\n\thasMarginValue,\n\tresetMargin,\n\tuseIsMarginDisabled,\n} from './margin';\nimport {\n\tPaddingEdit,\n\thasPaddingSupport,\n\thasPaddingValue,\n\tresetPadding,\n\tuseIsPaddingDisabled,\n} from './padding';\n\nexport const SPACING_SUPPORT_KEY = 'spacing';\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nexport const AXIAL_SIDES = [ 'vertical', 'horizontal' ];\n\n/**\n * Inspector controls for dimensions support.\n *\n * @param {Object} props Block props.\n *\n * @return {WPElement} Inspector controls for spacing support features.\n */\nexport function DimensionsPanel( props ) {\n\tconst isGapDisabled = useIsGapDisabled( props );\n\tconst isPaddingDisabled = useIsPaddingDisabled( props );\n\tconst isMarginDisabled = useIsMarginDisabled( props );\n\tconst isDisabled = useIsDimensionsDisabled( props );\n\tconst isSupported = hasDimensionsSupport( props.name );\n\n\tif ( isDisabled || ! isSupported ) {\n\t\treturn null;\n\t}\n\n\tconst defaultSpacingControls = getBlockSupport( props.name, [\n\t\tSPACING_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\tconst createResetAllFilter = ( attribute ) => ( newAttributes ) => ( {\n\t\t...newAttributes,\n\t\tstyle: {\n\t\t\t...newAttributes.style,\n\t\t\tspacing: {\n\t\t\t\t...newAttributes.style?.spacing,\n\t\t\t\t[ attribute ]: undefined,\n\t\t\t},\n\t\t},\n\t} );\n\n\treturn (\n\t\t<InspectorControls __experimentalGroup=\"dimensions\">\n\t\t\t{ ! isPaddingDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasPaddingValue( props ) }\n\t\t\t\t\tlabel={ __( 'Padding' ) }\n\t\t\t\t\tonDeselect={ () => resetPadding( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'padding' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.padding }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<PaddingEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ ! isMarginDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasMarginValue( props ) }\n\t\t\t\t\tlabel={ __( 'Margin' ) }\n\t\t\t\t\tonDeselect={ () => resetMargin( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'margin' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.margin }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<MarginEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ ! isGapDisabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => hasGapValue( props ) }\n\t\t\t\t\tlabel={ __( 'Block spacing' ) }\n\t\t\t\t\tonDeselect={ () => resetGap( props ) }\n\t\t\t\t\tresetAllFilter={ createResetAllFilter( 'blockGap' ) }\n\t\t\t\t\tisShownByDefault={ defaultSpacingControls?.blockGap }\n\t\t\t\t\tpanelId={ props.clientId }\n\t\t\t\t>\n\t\t\t\t\t<GapEdit { ...props } />\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</InspectorControls>\n\t);\n}\n\n/**\n * Determine whether there is dimensions related block support.\n *\n * @param {string} blockName Block name.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasDimensionsSupport( blockName ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\thasGapSupport( blockName ) ||\n\t\thasPaddingSupport( blockName ) ||\n\t\thasMarginSupport( blockName )\n\t);\n}\n\n/**\n * Determines whether dimensions support has been disabled.\n *\n * @param {Object} props Block properties.\n *\n * @return {boolean} If spacing support is completely disabled.\n */\nconst useIsDimensionsDisabled = ( props = {} ) => {\n\tconst gapDisabled = useIsGapDisabled( props );\n\tconst paddingDisabled = useIsPaddingDisabled( props );\n\tconst marginDisabled = useIsMarginDisabled( props );\n\n\treturn gapDisabled && paddingDisabled && marginDisabled;\n};\n\n/**\n * Custom hook to retrieve which padding/margin is supported\n * e.g. top, right, bottom or left.\n *\n * Sides are opted into by default. It is only if a specific side is set to\n * false that it is omitted.\n *\n * @param {string} blockName Block name.\n * @param {string} feature The feature custom sides relate to e.g. padding or margins.\n *\n * @return {Object} Sides supporting custom margin.\n */\nexport function useCustomSides( blockName, feature ) {\n\tconst support = getBlockSupport( blockName, SPACING_SUPPORT_KEY );\n\n\t// Skip when setting is boolean as theme isn't setting arbitrary sides.\n\tif ( ! support || typeof support[ feature ] === 'boolean' ) {\n\t\treturn;\n\t}\n\n\treturn support[ feature ];\n}\n\n/**\n * Custom hook to determine whether the sides configured in the\n * block support are valid. A dimension property cannot declare\n * support for a mix of axial and individual sides.\n *\n * @param {string} blockName Block name.\n * @param {string} feature The feature custom sides relate to e.g. padding or margins.\n *\n * @return {boolean} If the feature has a valid configuration of sides.\n */\nexport function useIsDimensionsSupportValid( blockName, feature ) {\n\tconst sides = useCustomSides( blockName, feature );\n\n\tif (\n\t\tsides &&\n\t\tsides.some( ( side ) => ALL_SIDES.includes( side ) ) &&\n\t\tsides.some( ( side ) => AXIAL_SIDES.includes( side ) )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t`The ${ feature } support for the \"${ blockName }\" block can not be configured to support both axial and arbitrary sides.`\n\t\t);\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n"]}