@wordpress/block-editor 7.0.4 → 8.0.3

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 (1259) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +31 -0
  3. package/build/components/alignment-control/ui.js +12 -11
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/autocomplete/index.js +5 -4
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +12 -8
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-control/ui.js +21 -17
  10. package/build/components/block-alignment-control/ui.js.map +1 -1
  11. package/build/components/block-alignment-control/use-available-alignments.js +9 -4
  12. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  13. package/build/components/block-alignment-matrix-control/index.js +6 -4
  14. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  15. package/build/components/block-breadcrumb/index.js +4 -3
  16. package/build/components/block-breadcrumb/index.js.map +1 -1
  17. package/build/components/block-caption/index.native.js +34 -29
  18. package/build/components/block-caption/index.native.js.map +1 -1
  19. package/build/components/block-card/index.js +8 -6
  20. package/build/components/block-card/index.js.map +1 -1
  21. package/build/components/block-compare/block-view.js +9 -8
  22. package/build/components/block-compare/block-view.js.map +1 -1
  23. package/build/components/block-compare/index.js +9 -7
  24. package/build/components/block-compare/index.js.map +1 -1
  25. package/build/components/block-content-overlay/index.js +7 -6
  26. package/build/components/block-content-overlay/index.js.map +1 -1
  27. package/build/components/block-context/index.js +5 -4
  28. package/build/components/block-context/index.js.map +1 -1
  29. package/build/components/block-controls/fill.js +7 -6
  30. package/build/components/block-controls/fill.js.map +1 -1
  31. package/build/components/block-controls/slot.js +5 -4
  32. package/build/components/block-controls/slot.js.map +1 -1
  33. package/build/components/block-controls/slot.native.js +5 -4
  34. package/build/components/block-controls/slot.native.js.map +1 -1
  35. package/build/components/block-draggable/draggable-chip.js +5 -4
  36. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  37. package/build/components/block-draggable/index.js +13 -11
  38. package/build/components/block-draggable/index.js.map +1 -1
  39. package/build/components/block-edit/context.js +1 -1
  40. package/build/components/block-full-height-alignment-control/index.js +7 -6
  41. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  42. package/build/components/block-icon/index.js +12 -6
  43. package/build/components/block-icon/index.js.map +1 -1
  44. package/build/components/block-icon/index.native.js +8 -6
  45. package/build/components/block-icon/index.native.js.map +1 -1
  46. package/build/components/block-inspector/index.js +24 -15
  47. package/build/components/block-inspector/index.js.map +1 -1
  48. package/build/components/block-list/block-html.js +4 -3
  49. package/build/components/block-list/block-html.js.map +1 -1
  50. package/build/components/block-list/block-invalid-warning.js +28 -20
  51. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  52. package/build/components/block-list/block-invalid-warning.native.js +5 -4
  53. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  54. package/build/components/block-list/block-list-item.native.js +6 -5
  55. package/build/components/block-list/block-list-item.native.js.map +1 -1
  56. package/build/components/block-list/block-selection-button.native.js +11 -9
  57. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  58. package/build/components/block-list/block.js +40 -33
  59. package/build/components/block-list/block.js.map +1 -1
  60. package/build/components/block-list/block.native.js +35 -29
  61. package/build/components/block-list/block.native.js.map +1 -1
  62. package/build/components/block-list/index.js +14 -12
  63. package/build/components/block-list/index.js.map +1 -1
  64. package/build/components/block-list/index.native.js +23 -18
  65. package/build/components/block-list/index.native.js.map +1 -1
  66. package/build/components/block-list/insertion-point.native.js +4 -3
  67. package/build/components/block-list/insertion-point.native.js.map +1 -1
  68. package/build/components/block-list/layout.js +8 -6
  69. package/build/components/block-list/layout.js.map +1 -1
  70. package/build/components/block-list/subdirectory-icon.js +13 -10
  71. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  72. package/build/components/block-list/use-block-props/index.js +5 -3
  73. package/build/components/block-list/use-block-props/index.js.map +1 -1
  74. package/build/components/block-list/use-block-props/index.native.js +2 -1
  75. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  76. package/build/components/block-list/use-block-props/use-block-refs.js +2 -2
  77. package/build/components/block-list/use-block-props/use-multi-selection.js +30 -14
  78. package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  79. package/build/components/block-list-appender/index.js +16 -13
  80. package/build/components/block-list-appender/index.js.map +1 -1
  81. package/build/components/block-list-appender/index.native.js +14 -11
  82. package/build/components/block-list-appender/index.native.js.map +1 -1
  83. package/build/components/block-media-update-progress/index.native.js +1 -1
  84. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  85. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  86. package/build/components/block-mobile-toolbar/index.js +4 -3
  87. package/build/components/block-mobile-toolbar/index.js.map +1 -1
  88. package/build/components/block-mobile-toolbar/index.native.js +33 -25
  89. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  90. package/build/components/block-mover/button.js +8 -7
  91. package/build/components/block-mover/button.js.map +1 -1
  92. package/build/components/block-mover/index.js +15 -13
  93. package/build/components/block-mover/index.js.map +1 -1
  94. package/build/components/block-mover/index.native.js +23 -20
  95. package/build/components/block-mover/index.native.js.map +1 -1
  96. package/build/components/block-mover/mover-description.native.js +10 -7
  97. package/build/components/block-mover/mover-description.native.js.map +1 -1
  98. package/build/components/block-navigation/dropdown.js +26 -22
  99. package/build/components/block-navigation/dropdown.js.map +1 -1
  100. package/build/components/block-pattern-setup/index.js +26 -22
  101. package/build/components/block-pattern-setup/index.js.map +1 -1
  102. package/build/components/block-pattern-setup/setup-toolbar.js +46 -39
  103. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  104. package/build/components/block-patterns-list/index.js +45 -47
  105. package/build/components/block-patterns-list/index.js.map +1 -1
  106. package/build/components/block-preview/auto.js +5 -4
  107. package/build/components/block-preview/auto.js.map +1 -1
  108. package/build/components/block-preview/index.js +8 -7
  109. package/build/components/block-preview/index.js.map +1 -1
  110. package/build/components/block-preview/live.js +4 -3
  111. package/build/components/block-preview/live.js.map +1 -1
  112. package/build/components/block-selection-clearer/index.js +1 -1
  113. package/build/components/block-settings/button.native.js +10 -7
  114. package/build/components/block-settings/button.native.js.map +1 -1
  115. package/build/components/block-settings/container.native.js +12 -8
  116. package/build/components/block-settings/container.native.js.map +1 -1
  117. package/build/components/block-settings/index.native.js +4 -2
  118. package/build/components/block-settings/index.native.js.map +1 -1
  119. package/build/components/block-settings-menu/block-convert-button.js +7 -5
  120. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  121. package/build/components/block-settings-menu/block-html-convert-button.js +14 -10
  122. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  123. package/build/components/block-settings-menu/block-mode-toggle.js +25 -19
  124. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  125. package/build/components/block-settings-menu/block-settings-dropdown.js +96 -68
  126. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  127. package/build/components/block-settings-menu/index.js +5 -4
  128. package/build/components/block-settings-menu/index.js.map +1 -1
  129. package/build/components/block-settings-menu-controls/index.js +8 -6
  130. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  131. package/build/components/block-styles/index.js +20 -17
  132. package/build/components/block-styles/index.js.map +1 -1
  133. package/build/components/block-styles/index.native.js +6 -4
  134. package/build/components/block-styles/index.native.js.map +1 -1
  135. package/build/components/block-styles/preview.native.js +9 -8
  136. package/build/components/block-styles/preview.native.js.map +1 -1
  137. package/build/components/block-switcher/block-styles-menu.js +5 -4
  138. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  139. package/build/components/block-switcher/block-transformations-menu.js +7 -6
  140. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  141. package/build/components/block-switcher/block-transformations-menu.native.js +9 -8
  142. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  143. package/build/components/block-switcher/index.js +42 -34
  144. package/build/components/block-switcher/index.js.map +1 -1
  145. package/build/components/block-switcher/pattern-transformations-menu.js +22 -18
  146. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  147. package/build/components/block-switcher/preview-block-popover.js +4 -3
  148. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  149. package/build/components/block-switcher/use-transformed-patterns.js +1 -1
  150. package/build/components/block-switcher/utils.js +2 -1
  151. package/build/components/block-switcher/utils.js.map +1 -1
  152. package/build/components/block-title/index.js +4 -3
  153. package/build/components/block-title/index.js.map +1 -1
  154. package/build/components/block-toolbar/index.js +4 -3
  155. package/build/components/block-toolbar/index.js.map +1 -1
  156. package/build/components/block-toolbar/utils.js +13 -11
  157. package/build/components/block-toolbar/utils.js.map +1 -1
  158. package/build/components/block-tools/back-compat.js +8 -5
  159. package/build/components/block-tools/back-compat.js.map +1 -1
  160. package/build/components/block-tools/block-contextual-toolbar.js +6 -5
  161. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  162. package/build/components/block-tools/block-popover.js +15 -13
  163. package/build/components/block-tools/block-popover.js.map +1 -1
  164. package/build/components/block-tools/block-selection-button.js +6 -5
  165. package/build/components/block-tools/block-selection-button.js.map +1 -1
  166. package/build/components/block-tools/index.js +6 -5
  167. package/build/components/block-tools/index.js.map +1 -1
  168. package/build/components/block-tools/insertion-point.js +12 -10
  169. package/build/components/block-tools/insertion-point.js.map +1 -1
  170. package/build/components/block-types-list/index.js +9 -8
  171. package/build/components/block-types-list/index.js.map +1 -1
  172. package/build/components/block-types-list/index.native.js +19 -15
  173. package/build/components/block-types-list/index.native.js.map +1 -1
  174. package/build/components/block-variation-picker/index.js +9 -8
  175. package/build/components/block-variation-picker/index.js.map +1 -1
  176. package/build/components/block-variation-picker/index.native.js +9 -7
  177. package/build/components/block-variation-picker/index.native.js.map +1 -1
  178. package/build/components/block-variation-transforms/index.js +22 -15
  179. package/build/components/block-variation-transforms/index.js.map +1 -1
  180. package/build/components/block-vertical-alignment-control/ui.js +9 -7
  181. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  182. package/build/components/border-radius-control/all-input-control.js +6 -5
  183. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  184. package/build/components/border-radius-control/index.js +5 -4
  185. package/build/components/border-radius-control/index.js.map +1 -1
  186. package/build/components/border-radius-control/input-controls.js +16 -11
  187. package/build/components/border-radius-control/input-controls.js.map +1 -1
  188. package/build/components/border-radius-control/linked-button.js +5 -4
  189. package/build/components/border-radius-control/linked-button.js.map +1 -1
  190. package/build/components/border-radius-control/utils.js +10 -5
  191. package/build/components/border-radius-control/utils.js.map +1 -1
  192. package/build/components/border-style-control/index.js +5 -4
  193. package/build/components/border-style-control/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.js +15 -13
  195. package/build/components/button-block-appender/index.js.map +1 -1
  196. package/build/components/button-block-appender/index.native.js +28 -24
  197. package/build/components/button-block-appender/index.native.js.map +1 -1
  198. package/build/components/caption/index.native.js +44 -41
  199. package/build/components/caption/index.native.js.map +1 -1
  200. package/build/components/color-palette/control.js +6 -5
  201. package/build/components/color-palette/control.js.map +1 -1
  202. package/build/components/color-style-selector/index.js +43 -34
  203. package/build/components/color-style-selector/index.js.map +1 -1
  204. package/build/components/colors/color-panel.js +21 -18
  205. package/build/components/colors/color-panel.js.map +1 -1
  206. package/build/components/colors/index.js +10 -8
  207. package/build/components/colors/index.js.map +1 -1
  208. package/build/components/colors/utils.js +7 -4
  209. package/build/components/colors/utils.js.map +1 -1
  210. package/build/components/colors/with-colors.js +17 -6
  211. package/build/components/colors/with-colors.js.map +1 -1
  212. package/build/components/colors-gradients/control.js +21 -59
  213. package/build/components/colors-gradients/control.js.map +1 -1
  214. package/build/components/colors-gradients/panel-color-gradient-settings.js +110 -30
  215. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  216. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  217. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  218. package/build/components/contrast-checker/index.js +18 -15
  219. package/build/components/contrast-checker/index.js.map +1 -1
  220. package/build/components/convert-to-group-buttons/index.js +9 -8
  221. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  222. package/build/components/copy-handler/index.js +6 -5
  223. package/build/components/copy-handler/index.js.map +1 -1
  224. package/build/components/default-block-appender/index.js +10 -8
  225. package/build/components/default-block-appender/index.js.map +1 -1
  226. package/build/components/default-block-appender/index.native.js +10 -8
  227. package/build/components/default-block-appender/index.native.js.map +1 -1
  228. package/build/components/default-style-picker/index.js +14 -10
  229. package/build/components/default-style-picker/index.js.map +1 -1
  230. package/build/components/duotone-control/index.js +20 -14
  231. package/build/components/duotone-control/index.js.map +1 -1
  232. package/build/components/editable-text/index.js +6 -5
  233. package/build/components/editable-text/index.js.map +1 -1
  234. package/build/components/editor-styles/index.js +4 -3
  235. package/build/components/editor-styles/index.js.map +1 -1
  236. package/build/components/floating-toolbar/index.native.js +8 -7
  237. package/build/components/floating-toolbar/index.native.js.map +1 -1
  238. package/build/components/font-appearance-control/index.js +53 -34
  239. package/build/components/font-appearance-control/index.js.map +1 -1
  240. package/build/components/font-family/index.js +12 -10
  241. package/build/components/font-family/index.js.map +1 -1
  242. package/build/components/font-sizes/index.js +6 -6
  243. package/build/components/font-sizes/index.native.js +6 -6
  244. package/build/components/font-sizes/utils.js +2 -2
  245. package/build/components/font-sizes/with-font-sizes.js +11 -5
  246. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  247. package/build/components/gradients/use-gradient.js +7 -6
  248. package/build/components/gradients/use-gradient.js.map +1 -1
  249. package/build/components/iframe/index.js +29 -23
  250. package/build/components/iframe/index.js.map +1 -1
  251. package/build/components/image-editor/aspect-ratio-dropdown.js +90 -82
  252. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  253. package/build/components/image-editor/constants.js +1 -1
  254. package/build/components/image-editor/context.js +11 -10
  255. package/build/components/image-editor/context.js.map +1 -1
  256. package/build/components/image-editor/cropper.js +9 -8
  257. package/build/components/image-editor/cropper.js.map +1 -1
  258. package/build/components/image-editor/index.js +10 -9
  259. package/build/components/image-editor/index.js.map +1 -1
  260. package/build/components/image-editor/use-save-image.js +12 -11
  261. package/build/components/image-editor/use-save-image.js.map +1 -1
  262. package/build/components/image-editor/use-transform-image.js +6 -5
  263. package/build/components/image-editor/use-transform-image.js.map +1 -1
  264. package/build/components/image-editor/zoom-dropdown.js +13 -10
  265. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  266. package/build/components/image-size-control/index.js +12 -11
  267. package/build/components/image-size-control/index.js.map +1 -1
  268. package/build/components/index.js +217 -197
  269. package/build/components/index.js.map +1 -1
  270. package/build/components/index.native.js +113 -111
  271. package/build/components/index.native.js.map +1 -1
  272. package/build/components/inner-blocks/button-block-appender.js +8 -7
  273. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  274. package/build/components/inner-blocks/default-block-appender.js +9 -7
  275. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  276. package/build/components/inner-blocks/index.js +9 -6
  277. package/build/components/inner-blocks/index.js.map +1 -1
  278. package/build/components/inner-blocks/index.native.js +8 -5
  279. package/build/components/inner-blocks/index.native.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/explorer.js +64 -0
  281. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  282. package/build/components/inserter/block-patterns-explorer/patterns-list.js +114 -0
  283. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  284. package/build/components/inserter/block-patterns-explorer/sidebar.js +82 -0
  285. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  286. package/build/components/inserter/block-patterns-tab.js +92 -57
  287. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  288. package/build/components/inserter/block-types-tab.js +9 -7
  289. package/build/components/inserter/block-types-tab.js.map +1 -1
  290. package/build/components/inserter/block-types-tab.native.js +9 -8
  291. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  292. package/build/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
  293. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  294. package/build/components/inserter/hooks/use-block-types-state.js +6 -5
  295. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  296. package/build/components/inserter/hooks/use-insertion-point.js +11 -9
  297. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  298. package/build/components/inserter/index.js +36 -28
  299. package/build/components/inserter/index.js.map +1 -1
  300. package/build/components/inserter/index.native.js +46 -37
  301. package/build/components/inserter/index.native.js.map +1 -1
  302. package/build/components/inserter/library.js +12 -11
  303. package/build/components/inserter/library.js.map +1 -1
  304. package/build/components/inserter/menu.js +12 -11
  305. package/build/components/inserter/menu.js.map +1 -1
  306. package/build/components/inserter/menu.native.js +31 -27
  307. package/build/components/inserter/menu.native.js.map +1 -1
  308. package/build/components/inserter/panel.js +6 -5
  309. package/build/components/inserter/panel.js.map +1 -1
  310. package/build/components/inserter/pattern-panel.js +25 -15
  311. package/build/components/inserter/pattern-panel.js.map +1 -1
  312. package/build/components/inserter/preview-panel.js +4 -3
  313. package/build/components/inserter/preview-panel.js.map +1 -1
  314. package/build/components/inserter/quick-inserter.js +7 -6
  315. package/build/components/inserter/quick-inserter.js.map +1 -1
  316. package/build/components/inserter/reusable-blocks-tab.js +18 -13
  317. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  318. package/build/components/inserter/reusable-blocks-tab.native.js +6 -5
  319. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  320. package/build/components/inserter/search-items.js +23 -7
  321. package/build/components/inserter/search-items.js.map +1 -1
  322. package/build/components/inserter/search-results.js +15 -14
  323. package/build/components/inserter/search-results.js.map +1 -1
  324. package/build/components/inserter/search-results.native.js +11 -10
  325. package/build/components/inserter/search-results.native.js.map +1 -1
  326. package/build/components/inserter/tabs.js +7 -6
  327. package/build/components/inserter/tabs.js.map +1 -1
  328. package/build/components/inserter/tabs.native.js +55 -37
  329. package/build/components/inserter/tabs.native.js.map +1 -1
  330. package/build/components/inserter/utils.native.js +10 -8
  331. package/build/components/inserter/utils.native.js.map +1 -1
  332. package/build/components/inserter-draggable-blocks/index.js +12 -10
  333. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  334. package/build/components/inserter-list-item/index.js +79 -73
  335. package/build/components/inserter-list-item/index.js.map +1 -1
  336. package/build/components/inserter-listbox/index.js +8 -7
  337. package/build/components/inserter-listbox/index.js.map +1 -1
  338. package/build/components/inserter-listbox/item.js +7 -6
  339. package/build/components/inserter-listbox/item.js.map +1 -1
  340. package/build/components/inspector-controls/block-support-slot-container.js +5 -4
  341. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  342. package/build/components/inspector-controls/block-support-tools-panel.js +8 -6
  343. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  344. package/build/components/inspector-controls/fill.js +5 -4
  345. package/build/components/inspector-controls/fill.js.map +1 -1
  346. package/build/components/inspector-controls/fill.native.js +6 -5
  347. package/build/components/inspector-controls/fill.native.js.map +1 -1
  348. package/build/components/inspector-controls/groups.js +3 -1
  349. package/build/components/inspector-controls/groups.js.map +1 -1
  350. package/build/components/inspector-controls/slot.js +7 -6
  351. package/build/components/inspector-controls/slot.js.map +1 -1
  352. package/build/components/inspector-controls/slot.native.js +5 -4
  353. package/build/components/inspector-controls/slot.native.js.map +1 -1
  354. package/build/components/justify-content-control/ui.js +10 -8
  355. package/build/components/justify-content-control/ui.js.map +1 -1
  356. package/build/components/letter-spacing-control/index.js +13 -9
  357. package/build/components/letter-spacing-control/index.js.map +1 -1
  358. package/build/components/line-height-control/index.js +5 -4
  359. package/build/components/line-height-control/index.js.map +1 -1
  360. package/build/components/line-height-control/index.native.js +5 -4
  361. package/build/components/line-height-control/index.native.js.map +1 -1
  362. package/build/components/line-height-control/utils.js +1 -1
  363. package/build/components/link-control/index.js +107 -52
  364. package/build/components/link-control/index.js.map +1 -1
  365. package/build/components/link-control/link-preview.js +24 -10
  366. package/build/components/link-control/link-preview.js.map +1 -1
  367. package/build/components/link-control/search-create-button.js +9 -7
  368. package/build/components/link-control/search-create-button.js.map +1 -1
  369. package/build/components/link-control/search-input.js +31 -21
  370. package/build/components/link-control/search-input.js.map +1 -1
  371. package/build/components/link-control/search-item.js +10 -9
  372. package/build/components/link-control/search-item.js.map +1 -1
  373. package/build/components/link-control/search-results.js +15 -14
  374. package/build/components/link-control/search-results.js.map +1 -1
  375. package/build/components/link-control/settings-drawer.js +7 -5
  376. package/build/components/link-control/settings-drawer.js.map +1 -1
  377. package/build/components/link-control/use-search-handler.js +5 -4
  378. package/build/components/link-control/use-search-handler.js.map +1 -1
  379. package/build/components/link-control/viewer-slot.js +1 -1
  380. package/build/components/list-view/appender.js +27 -23
  381. package/build/components/list-view/appender.js.map +1 -1
  382. package/build/components/list-view/block-contents.js +32 -28
  383. package/build/components/list-view/block-contents.js.map +1 -1
  384. package/build/components/list-view/block-select-button.js +18 -17
  385. package/build/components/list-view/block-select-button.js.map +1 -1
  386. package/build/components/list-view/block.js +122 -83
  387. package/build/components/list-view/block.js.map +1 -1
  388. package/build/components/list-view/branch.js +92 -73
  389. package/build/components/list-view/branch.js.map +1 -1
  390. package/build/components/list-view/drop-indicator.js +5 -4
  391. package/build/components/list-view/drop-indicator.js.map +1 -1
  392. package/build/components/list-view/expander.js +4 -3
  393. package/build/components/list-view/expander.js.map +1 -1
  394. package/build/components/list-view/index.js +47 -23
  395. package/build/components/list-view/index.js.map +1 -1
  396. package/build/components/list-view/leaf.js +12 -11
  397. package/build/components/list-view/leaf.js.map +1 -1
  398. package/build/components/list-view/list-item.js +8 -7
  399. package/build/components/list-view/list-item.js.map +1 -1
  400. package/build/components/list-view/use-list-view-client-ids.js +8 -58
  401. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  402. package/build/components/media-placeholder/index.js +86 -68
  403. package/build/components/media-placeholder/index.js.map +1 -1
  404. package/build/components/media-placeholder/index.native.js +5 -4
  405. package/build/components/media-placeholder/index.native.js.map +1 -1
  406. package/build/components/media-replace-flow/index.js +85 -72
  407. package/build/components/media-replace-flow/index.js.map +1 -1
  408. package/build/components/media-upload/check.js +5 -4
  409. package/build/components/media-upload/check.js.map +1 -1
  410. package/build/components/media-upload/index.native.js +1 -1
  411. package/build/components/media-upload-progress/index.native.js +1 -1
  412. package/build/components/multi-selection-inspector/index.js +4 -3
  413. package/build/components/multi-selection-inspector/index.js.map +1 -1
  414. package/build/components/navigable-toolbar/index.js +8 -7
  415. package/build/components/navigable-toolbar/index.js.map +1 -1
  416. package/build/components/observe-typing/index.js +5 -4
  417. package/build/components/observe-typing/index.js.map +1 -1
  418. package/build/components/panel-color-settings/index.js +16 -12
  419. package/build/components/panel-color-settings/index.js.map +1 -1
  420. package/build/components/plain-text/index.js +6 -4
  421. package/build/components/plain-text/index.js.map +1 -1
  422. package/build/components/preview-options/index.js +8 -7
  423. package/build/components/preview-options/index.js.map +1 -1
  424. package/build/components/provider/block-refs-provider.js +5 -4
  425. package/build/components/provider/block-refs-provider.js.map +1 -1
  426. package/build/components/provider/use-block-sync.js +8 -7
  427. package/build/components/provider/use-block-sync.js.map +1 -1
  428. package/build/components/provider/with-registry-provider.js +7 -5
  429. package/build/components/provider/with-registry-provider.js.map +1 -1
  430. package/build/components/responsive-block-control/label.js +6 -5
  431. package/build/components/responsive-block-control/label.js.map +1 -1
  432. package/build/components/rich-text/embed-handler-picker.native.js +8 -5
  433. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  434. package/build/components/rich-text/file-paste-handler.js +6 -3
  435. package/build/components/rich-text/file-paste-handler.js.map +1 -1
  436. package/build/components/rich-text/format-edit.js +36 -9
  437. package/build/components/rich-text/format-edit.js.map +1 -1
  438. package/build/components/rich-text/format-toolbar/index.js +20 -10
  439. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  440. package/build/components/rich-text/format-toolbar-container.js +6 -4
  441. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  442. package/build/components/rich-text/index.js +45 -41
  443. package/build/components/rich-text/index.js.map +1 -1
  444. package/build/components/rich-text/index.native.js +145 -122
  445. package/build/components/rich-text/index.native.js.map +1 -1
  446. package/build/components/rich-text/input-event.js +5 -4
  447. package/build/components/rich-text/input-event.js.map +1 -1
  448. package/build/components/rich-text/shortcut.js +6 -5
  449. package/build/components/rich-text/shortcut.js.map +1 -1
  450. package/build/components/rich-text/split-value.js +10 -8
  451. package/build/components/rich-text/split-value.js.map +1 -1
  452. package/build/components/rich-text/toolbar-button.js +7 -6
  453. package/build/components/rich-text/toolbar-button.js.map +1 -1
  454. package/build/components/rich-text/use-caret-in-format.js +4 -3
  455. package/build/components/rich-text/use-caret-in-format.js.map +1 -1
  456. package/build/components/rich-text/use-enter.js +6 -3
  457. package/build/components/rich-text/use-enter.js.map +1 -1
  458. package/build/components/rich-text/use-format-types.js +13 -10
  459. package/build/components/rich-text/use-format-types.js.map +1 -1
  460. package/build/components/rich-text/use-input-rules.js +15 -9
  461. package/build/components/rich-text/use-input-rules.js.map +1 -1
  462. package/build/components/rich-text/use-mark-persistent.js +5 -4
  463. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  464. package/build/components/rich-text/use-paste-handler.js +28 -4
  465. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  466. package/build/components/rich-text/utils.js +9 -7
  467. package/build/components/rich-text/utils.js.map +1 -1
  468. package/build/components/skip-to-selected-block/index.js +4 -3
  469. package/build/components/skip-to-selected-block/index.js.map +1 -1
  470. package/build/components/text-decoration-control/index.js +5 -4
  471. package/build/components/text-decoration-control/index.js.map +1 -1
  472. package/build/components/text-transform-control/index.js +5 -4
  473. package/build/components/text-transform-control/index.js.map +1 -1
  474. package/build/components/tool-selector/index.js +16 -13
  475. package/build/components/tool-selector/index.js.map +1 -1
  476. package/build/components/typewriter/index.js +10 -7
  477. package/build/components/typewriter/index.js.map +1 -1
  478. package/build/components/ungroup-button/index.native.js +12 -9
  479. package/build/components/ungroup-button/index.native.js.map +1 -1
  480. package/build/components/unit-control/index.js +5 -4
  481. package/build/components/unit-control/index.js.map +1 -1
  482. package/build/components/url-input/index.js +23 -13
  483. package/build/components/url-input/index.js.map +1 -1
  484. package/build/components/url-input/index.native.js +8 -6
  485. package/build/components/url-input/index.native.js.map +1 -1
  486. package/build/components/url-popover/image-url-input-ui.js +12 -11
  487. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  488. package/build/components/url-popover/index.js +9 -8
  489. package/build/components/url-popover/index.js.map +1 -1
  490. package/build/components/url-popover/link-editor.js +8 -7
  491. package/build/components/url-popover/link-editor.js.map +1 -1
  492. package/build/components/url-popover/link-viewer-url.js +6 -5
  493. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  494. package/build/components/url-popover/link-viewer.js +9 -8
  495. package/build/components/url-popover/link-viewer.js.map +1 -1
  496. package/build/components/use-block-drop-zone/index.js +9 -8
  497. package/build/components/use-block-drop-zone/index.js.map +1 -1
  498. package/build/components/use-moving-animation/index.js +17 -13
  499. package/build/components/use-moving-animation/index.js.map +1 -1
  500. package/build/components/use-no-recursive-renders/index.js +10 -6
  501. package/build/components/use-no-recursive-renders/index.js.map +1 -1
  502. package/build/components/use-on-block-drop/index.js +2 -2
  503. package/build/components/use-setting/index.js +48 -9
  504. package/build/components/use-setting/index.js.map +1 -1
  505. package/build/components/warning/index.js +7 -6
  506. package/build/components/warning/index.js.map +1 -1
  507. package/build/components/warning/index.native.js +10 -9
  508. package/build/components/warning/index.native.js.map +1 -1
  509. package/build/components/writing-flow/index.js +6 -5
  510. package/build/components/writing-flow/index.js.map +1 -1
  511. package/build/components/writing-flow/use-arrow-nav.js +2 -2
  512. package/build/hooks/align.js +12 -7
  513. package/build/hooks/align.js.map +1 -1
  514. package/build/hooks/border.js +9 -7
  515. package/build/hooks/border.js.map +1 -1
  516. package/build/hooks/color-panel.js +9 -7
  517. package/build/hooks/color-panel.js.map +1 -1
  518. package/build/hooks/color.js +4 -3
  519. package/build/hooks/color.js.map +1 -1
  520. package/build/hooks/dimensions.js +4 -2
  521. package/build/hooks/dimensions.js.map +1 -1
  522. package/build/hooks/duotone.js +29 -15
  523. package/build/hooks/duotone.js.map +1 -1
  524. package/build/hooks/font-appearance.js +60 -14
  525. package/build/hooks/font-appearance.js.map +1 -1
  526. package/build/hooks/font-family.js +62 -32
  527. package/build/hooks/font-family.js.map +1 -1
  528. package/build/hooks/font-size.js +57 -13
  529. package/build/hooks/font-size.js.map +1 -1
  530. package/build/hooks/gap.js +10 -8
  531. package/build/hooks/gap.js.map +1 -1
  532. package/build/hooks/index.js +16 -8
  533. package/build/hooks/index.js.map +1 -1
  534. package/build/hooks/index.native.js +16 -8
  535. package/build/hooks/index.native.js.map +1 -1
  536. package/build/hooks/layout.js +16 -13
  537. package/build/hooks/layout.js.map +1 -1
  538. package/build/hooks/letter-spacing.js +50 -11
  539. package/build/hooks/letter-spacing.js.map +1 -1
  540. package/build/hooks/line-height.js +51 -12
  541. package/build/hooks/line-height.js.map +1 -1
  542. package/build/hooks/margin.js +11 -9
  543. package/build/hooks/margin.js.map +1 -1
  544. package/build/hooks/padding.js +11 -9
  545. package/build/hooks/padding.js.map +1 -1
  546. package/build/hooks/style.js +9 -5
  547. package/build/hooks/style.js.map +1 -1
  548. package/build/hooks/text-decoration.js +48 -10
  549. package/build/hooks/text-decoration.js.map +1 -1
  550. package/build/hooks/text-transform.js +48 -10
  551. package/build/hooks/text-transform.js.map +1 -1
  552. package/build/hooks/typography.js +111 -10
  553. package/build/hooks/typography.js.map +1 -1
  554. package/build/hooks/typography.native.js +3 -2
  555. package/build/hooks/typography.native.js.map +1 -1
  556. package/build/hooks/use-border-props.js +5 -4
  557. package/build/hooks/use-border-props.js.map +1 -1
  558. package/build/hooks/use-cached-truthy.js +29 -0
  559. package/build/hooks/use-cached-truthy.js.map +1 -0
  560. package/build/index.js +21 -14
  561. package/build/index.js.map +1 -1
  562. package/build/layouts/flex.js +172 -52
  563. package/build/layouts/flex.js.map +1 -1
  564. package/build/layouts/flow.js +10 -8
  565. package/build/layouts/flow.js.map +1 -1
  566. package/build/layouts/index.js +2 -1
  567. package/build/layouts/index.js.map +1 -1
  568. package/build/layouts/utils.js +2 -1
  569. package/build/layouts/utils.js.map +1 -1
  570. package/build/store/actions.js +486 -369
  571. package/build/store/actions.js.map +1 -1
  572. package/build/store/array.js +2 -1
  573. package/build/store/array.js.map +1 -1
  574. package/build/store/index.js +6 -6
  575. package/build/store/index.js.map +1 -1
  576. package/build/store/reducer.js +145 -69
  577. package/build/store/reducer.js.map +1 -1
  578. package/build/store/selectors.js +259 -172
  579. package/build/store/selectors.js.map +1 -1
  580. package/build/utils/block-variation-transforms.js +4 -3
  581. package/build/utils/block-variation-transforms.js.map +1 -1
  582. package/build/utils/dom.js +1 -1
  583. package/build/utils/get-paste-event-data.js +10 -6
  584. package/build/utils/get-paste-event-data.js.map +1 -1
  585. package/build/utils/index.js +4 -4
  586. package/build/utils/math.js +2 -1
  587. package/build/utils/math.js.map +1 -1
  588. package/build/utils/parse-css-unit-to-px.js +6 -3
  589. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  590. package/build/utils/transform-styles/index.js +8 -6
  591. package/build/utils/transform-styles/index.js.map +1 -1
  592. package/build/utils/transform-styles/transforms/wrap.js +31 -28
  593. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  594. package/build-module/components/alignment-control/ui.js +12 -11
  595. package/build-module/components/alignment-control/ui.js.map +1 -1
  596. package/build-module/components/autocomplete/index.js +4 -3
  597. package/build-module/components/autocomplete/index.js.map +1 -1
  598. package/build-module/components/block-actions/index.js +12 -8
  599. package/build-module/components/block-actions/index.js.map +1 -1
  600. package/build-module/components/block-alignment-control/ui.js +21 -17
  601. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  602. package/build-module/components/block-alignment-control/use-available-alignments.js +9 -4
  603. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  604. package/build-module/components/block-alignment-matrix-control/index.js +6 -4
  605. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  606. package/build-module/components/block-breadcrumb/index.js +4 -3
  607. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  608. package/build-module/components/block-caption/index.native.js +34 -29
  609. package/build-module/components/block-caption/index.native.js.map +1 -1
  610. package/build-module/components/block-card/index.js +8 -6
  611. package/build-module/components/block-card/index.js.map +1 -1
  612. package/build-module/components/block-compare/block-view.js +9 -8
  613. package/build-module/components/block-compare/block-view.js.map +1 -1
  614. package/build-module/components/block-compare/index.js +9 -7
  615. package/build-module/components/block-compare/index.js.map +1 -1
  616. package/build-module/components/block-content-overlay/index.js +7 -6
  617. package/build-module/components/block-content-overlay/index.js.map +1 -1
  618. package/build-module/components/block-context/index.js +5 -4
  619. package/build-module/components/block-context/index.js.map +1 -1
  620. package/build-module/components/block-controls/fill.js +7 -6
  621. package/build-module/components/block-controls/fill.js.map +1 -1
  622. package/build-module/components/block-controls/slot.js +5 -4
  623. package/build-module/components/block-controls/slot.js.map +1 -1
  624. package/build-module/components/block-controls/slot.native.js +5 -4
  625. package/build-module/components/block-controls/slot.native.js.map +1 -1
  626. package/build-module/components/block-draggable/draggable-chip.js +5 -4
  627. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  628. package/build-module/components/block-draggable/index.js +13 -11
  629. package/build-module/components/block-draggable/index.js.map +1 -1
  630. package/build-module/components/block-full-height-alignment-control/index.js +7 -6
  631. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  632. package/build-module/components/block-icon/index.js +11 -5
  633. package/build-module/components/block-icon/index.js.map +1 -1
  634. package/build-module/components/block-icon/index.native.js +8 -6
  635. package/build-module/components/block-icon/index.native.js.map +1 -1
  636. package/build-module/components/block-inspector/index.js +20 -13
  637. package/build-module/components/block-inspector/index.js.map +1 -1
  638. package/build-module/components/block-list/block-html.js +4 -3
  639. package/build-module/components/block-list/block-html.js.map +1 -1
  640. package/build-module/components/block-list/block-invalid-warning.js +27 -19
  641. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  642. package/build-module/components/block-list/block-invalid-warning.native.js +5 -4
  643. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  644. package/build-module/components/block-list/block-list-item.native.js +6 -5
  645. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  646. package/build-module/components/block-list/block-selection-button.native.js +11 -9
  647. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  648. package/build-module/components/block-list/block.js +40 -33
  649. package/build-module/components/block-list/block.js.map +1 -1
  650. package/build-module/components/block-list/block.native.js +35 -29
  651. package/build-module/components/block-list/block.native.js.map +1 -1
  652. package/build-module/components/block-list/index.js +13 -11
  653. package/build-module/components/block-list/index.js.map +1 -1
  654. package/build-module/components/block-list/index.native.js +22 -17
  655. package/build-module/components/block-list/index.native.js.map +1 -1
  656. package/build-module/components/block-list/insertion-point.native.js +4 -3
  657. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  658. package/build-module/components/block-list/layout.js +5 -4
  659. package/build-module/components/block-list/layout.js.map +1 -1
  660. package/build-module/components/block-list/subdirectory-icon.js +13 -10
  661. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  662. package/build-module/components/block-list/use-block-props/index.js +5 -3
  663. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  664. package/build-module/components/block-list/use-block-props/index.native.js +2 -1
  665. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  666. package/build-module/components/block-list/use-block-props/use-multi-selection.js +30 -14
  667. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  668. package/build-module/components/block-list-appender/index.js +16 -13
  669. package/build-module/components/block-list-appender/index.js.map +1 -1
  670. package/build-module/components/block-list-appender/index.native.js +14 -11
  671. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  672. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  673. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  674. package/build-module/components/block-mobile-toolbar/index.js +4 -3
  675. package/build-module/components/block-mobile-toolbar/index.js.map +1 -1
  676. package/build-module/components/block-mobile-toolbar/index.native.js +33 -25
  677. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  678. package/build-module/components/block-mover/button.js +7 -6
  679. package/build-module/components/block-mover/button.js.map +1 -1
  680. package/build-module/components/block-mover/index.js +15 -13
  681. package/build-module/components/block-mover/index.js.map +1 -1
  682. package/build-module/components/block-mover/index.native.js +22 -19
  683. package/build-module/components/block-mover/index.native.js.map +1 -1
  684. package/build-module/components/block-mover/mover-description.native.js +10 -7
  685. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  686. package/build-module/components/block-navigation/dropdown.js +26 -22
  687. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  688. package/build-module/components/block-pattern-setup/index.js +26 -22
  689. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  690. package/build-module/components/block-pattern-setup/setup-toolbar.js +46 -39
  691. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  692. package/build-module/components/block-patterns-list/index.js +45 -45
  693. package/build-module/components/block-patterns-list/index.js.map +1 -1
  694. package/build-module/components/block-preview/auto.js +5 -4
  695. package/build-module/components/block-preview/auto.js.map +1 -1
  696. package/build-module/components/block-preview/index.js +8 -7
  697. package/build-module/components/block-preview/index.js.map +1 -1
  698. package/build-module/components/block-preview/live.js +4 -3
  699. package/build-module/components/block-preview/live.js.map +1 -1
  700. package/build-module/components/block-settings/button.native.js +10 -7
  701. package/build-module/components/block-settings/button.native.js.map +1 -1
  702. package/build-module/components/block-settings/container.native.js +13 -9
  703. package/build-module/components/block-settings/container.native.js.map +1 -1
  704. package/build-module/components/block-settings-menu/block-convert-button.js +7 -5
  705. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  706. package/build-module/components/block-settings-menu/block-html-convert-button.js +14 -10
  707. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  708. package/build-module/components/block-settings-menu/block-mode-toggle.js +25 -19
  709. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  710. package/build-module/components/block-settings-menu/block-settings-dropdown.js +98 -70
  711. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  712. package/build-module/components/block-settings-menu/index.js +5 -4
  713. package/build-module/components/block-settings-menu/index.js.map +1 -1
  714. package/build-module/components/block-settings-menu-controls/index.js +8 -6
  715. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  716. package/build-module/components/block-styles/index.js +20 -17
  717. package/build-module/components/block-styles/index.js.map +1 -1
  718. package/build-module/components/block-styles/index.native.js +6 -4
  719. package/build-module/components/block-styles/index.native.js.map +1 -1
  720. package/build-module/components/block-styles/preview.native.js +9 -8
  721. package/build-module/components/block-styles/preview.native.js.map +1 -1
  722. package/build-module/components/block-switcher/block-styles-menu.js +5 -4
  723. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  724. package/build-module/components/block-switcher/block-transformations-menu.js +7 -6
  725. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  726. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -8
  727. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  728. package/build-module/components/block-switcher/index.js +41 -33
  729. package/build-module/components/block-switcher/index.js.map +1 -1
  730. package/build-module/components/block-switcher/pattern-transformations-menu.js +22 -18
  731. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  732. package/build-module/components/block-switcher/preview-block-popover.js +4 -3
  733. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  734. package/build-module/components/block-switcher/utils.js +2 -1
  735. package/build-module/components/block-switcher/utils.js.map +1 -1
  736. package/build-module/components/block-title/index.js +4 -3
  737. package/build-module/components/block-title/index.js.map +1 -1
  738. package/build-module/components/block-toolbar/index.js +4 -3
  739. package/build-module/components/block-toolbar/index.js.map +1 -1
  740. package/build-module/components/block-toolbar/utils.js +13 -11
  741. package/build-module/components/block-toolbar/utils.js.map +1 -1
  742. package/build-module/components/block-tools/back-compat.js +4 -3
  743. package/build-module/components/block-tools/back-compat.js.map +1 -1
  744. package/build-module/components/block-tools/block-contextual-toolbar.js +6 -5
  745. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  746. package/build-module/components/block-tools/block-popover.js +15 -13
  747. package/build-module/components/block-tools/block-popover.js.map +1 -1
  748. package/build-module/components/block-tools/block-selection-button.js +6 -5
  749. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  750. package/build-module/components/block-tools/index.js +6 -5
  751. package/build-module/components/block-tools/index.js.map +1 -1
  752. package/build-module/components/block-tools/insertion-point.js +11 -9
  753. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  754. package/build-module/components/block-types-list/index.js +9 -8
  755. package/build-module/components/block-types-list/index.js.map +1 -1
  756. package/build-module/components/block-types-list/index.native.js +19 -15
  757. package/build-module/components/block-types-list/index.native.js.map +1 -1
  758. package/build-module/components/block-variation-picker/index.js +9 -8
  759. package/build-module/components/block-variation-picker/index.js.map +1 -1
  760. package/build-module/components/block-variation-picker/index.native.js +9 -7
  761. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  762. package/build-module/components/block-variation-transforms/index.js +22 -15
  763. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  764. package/build-module/components/block-vertical-alignment-control/ui.js +9 -7
  765. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  766. package/build-module/components/border-radius-control/all-input-control.js +6 -5
  767. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  768. package/build-module/components/border-radius-control/index.js +5 -4
  769. package/build-module/components/border-radius-control/index.js.map +1 -1
  770. package/build-module/components/border-radius-control/input-controls.js +16 -11
  771. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  772. package/build-module/components/border-radius-control/linked-button.js +5 -4
  773. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  774. package/build-module/components/border-radius-control/utils.js +8 -3
  775. package/build-module/components/border-radius-control/utils.js.map +1 -1
  776. package/build-module/components/border-style-control/index.js +5 -4
  777. package/build-module/components/border-style-control/index.js.map +1 -1
  778. package/build-module/components/button-block-appender/index.js +15 -13
  779. package/build-module/components/button-block-appender/index.js.map +1 -1
  780. package/build-module/components/button-block-appender/index.native.js +28 -24
  781. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  782. package/build-module/components/caption/index.native.js +44 -41
  783. package/build-module/components/caption/index.native.js.map +1 -1
  784. package/build-module/components/color-palette/control.js +6 -5
  785. package/build-module/components/color-palette/control.js.map +1 -1
  786. package/build-module/components/color-style-selector/index.js +43 -34
  787. package/build-module/components/color-style-selector/index.js.map +1 -1
  788. package/build-module/components/colors/color-panel.js +21 -18
  789. package/build-module/components/colors/color-panel.js.map +1 -1
  790. package/build-module/components/colors/utils.js +6 -3
  791. package/build-module/components/colors/utils.js.map +1 -1
  792. package/build-module/components/colors/with-colors.js +17 -6
  793. package/build-module/components/colors/with-colors.js.map +1 -1
  794. package/build-module/components/colors-gradients/control.js +25 -65
  795. package/build-module/components/colors-gradients/control.js.map +1 -1
  796. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +111 -30
  797. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  798. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  799. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  800. package/build-module/components/contrast-checker/index.js +18 -15
  801. package/build-module/components/contrast-checker/index.js.map +1 -1
  802. package/build-module/components/convert-to-group-buttons/index.js +9 -8
  803. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  804. package/build-module/components/copy-handler/index.js +4 -3
  805. package/build-module/components/copy-handler/index.js.map +1 -1
  806. package/build-module/components/default-block-appender/index.js +10 -8
  807. package/build-module/components/default-block-appender/index.js.map +1 -1
  808. package/build-module/components/default-block-appender/index.native.js +10 -8
  809. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  810. package/build-module/components/default-style-picker/index.js +14 -10
  811. package/build-module/components/default-style-picker/index.js.map +1 -1
  812. package/build-module/components/duotone-control/index.js +20 -14
  813. package/build-module/components/duotone-control/index.js.map +1 -1
  814. package/build-module/components/editable-text/index.js +6 -5
  815. package/build-module/components/editable-text/index.js.map +1 -1
  816. package/build-module/components/editor-styles/index.js +4 -3
  817. package/build-module/components/editor-styles/index.js.map +1 -1
  818. package/build-module/components/floating-toolbar/index.native.js +8 -7
  819. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  820. package/build-module/components/font-appearance-control/index.js +49 -34
  821. package/build-module/components/font-appearance-control/index.js.map +1 -1
  822. package/build-module/components/font-family/index.js +12 -10
  823. package/build-module/components/font-family/index.js.map +1 -1
  824. package/build-module/components/font-sizes/with-font-sizes.js +11 -5
  825. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  826. package/build-module/components/gradients/use-gradient.js +5 -4
  827. package/build-module/components/gradients/use-gradient.js.map +1 -1
  828. package/build-module/components/iframe/index.js +29 -23
  829. package/build-module/components/iframe/index.js.map +1 -1
  830. package/build-module/components/image-editor/aspect-ratio-dropdown.js +90 -82
  831. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  832. package/build-module/components/image-editor/context.js +11 -10
  833. package/build-module/components/image-editor/context.js.map +1 -1
  834. package/build-module/components/image-editor/cropper.js +9 -8
  835. package/build-module/components/image-editor/cropper.js.map +1 -1
  836. package/build-module/components/image-editor/index.js +9 -8
  837. package/build-module/components/image-editor/index.js.map +1 -1
  838. package/build-module/components/image-editor/use-save-image.js +12 -11
  839. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  840. package/build-module/components/image-editor/use-transform-image.js +6 -5
  841. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  842. package/build-module/components/image-editor/zoom-dropdown.js +13 -10
  843. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  844. package/build-module/components/image-size-control/index.js +12 -11
  845. package/build-module/components/image-size-control/index.js.map +1 -1
  846. package/build-module/components/index.js +3 -1
  847. package/build-module/components/index.js.map +1 -1
  848. package/build-module/components/index.native.js +1 -1
  849. package/build-module/components/index.native.js.map +1 -1
  850. package/build-module/components/inner-blocks/button-block-appender.js +8 -7
  851. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  852. package/build-module/components/inner-blocks/default-block-appender.js +9 -7
  853. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  854. package/build-module/components/inner-blocks/index.js +9 -6
  855. package/build-module/components/inner-blocks/index.js.map +1 -1
  856. package/build-module/components/inner-blocks/index.native.js +8 -5
  857. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  858. package/build-module/components/inserter/block-patterns-explorer/explorer.js +52 -0
  859. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  860. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +95 -0
  861. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  862. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +73 -0
  863. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  864. package/build-module/components/inserter/block-patterns-tab.js +93 -58
  865. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  866. package/build-module/components/inserter/block-types-tab.js +9 -7
  867. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  868. package/build-module/components/inserter/block-types-tab.native.js +9 -8
  869. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  870. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
  871. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  872. package/build-module/components/inserter/hooks/use-block-types-state.js +6 -5
  873. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  874. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -9
  875. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  876. package/build-module/components/inserter/index.js +36 -28
  877. package/build-module/components/inserter/index.js.map +1 -1
  878. package/build-module/components/inserter/index.native.js +46 -37
  879. package/build-module/components/inserter/index.native.js.map +1 -1
  880. package/build-module/components/inserter/library.js +12 -11
  881. package/build-module/components/inserter/library.js.map +1 -1
  882. package/build-module/components/inserter/menu.js +12 -11
  883. package/build-module/components/inserter/menu.js.map +1 -1
  884. package/build-module/components/inserter/menu.native.js +31 -27
  885. package/build-module/components/inserter/menu.native.js.map +1 -1
  886. package/build-module/components/inserter/panel.js +6 -5
  887. package/build-module/components/inserter/panel.js.map +1 -1
  888. package/build-module/components/inserter/pattern-panel.js +27 -18
  889. package/build-module/components/inserter/pattern-panel.js.map +1 -1
  890. package/build-module/components/inserter/preview-panel.js +4 -3
  891. package/build-module/components/inserter/preview-panel.js.map +1 -1
  892. package/build-module/components/inserter/quick-inserter.js +7 -6
  893. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  894. package/build-module/components/inserter/reusable-blocks-tab.js +18 -13
  895. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  896. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -5
  897. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  898. package/build-module/components/inserter/search-items.js +23 -7
  899. package/build-module/components/inserter/search-items.js.map +1 -1
  900. package/build-module/components/inserter/search-results.js +15 -14
  901. package/build-module/components/inserter/search-results.js.map +1 -1
  902. package/build-module/components/inserter/search-results.native.js +11 -10
  903. package/build-module/components/inserter/search-results.native.js.map +1 -1
  904. package/build-module/components/inserter/tabs.js +7 -6
  905. package/build-module/components/inserter/tabs.js.map +1 -1
  906. package/build-module/components/inserter/tabs.native.js +55 -37
  907. package/build-module/components/inserter/tabs.native.js.map +1 -1
  908. package/build-module/components/inserter/utils.native.js +10 -8
  909. package/build-module/components/inserter/utils.native.js.map +1 -1
  910. package/build-module/components/inserter-draggable-blocks/index.js +12 -10
  911. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  912. package/build-module/components/inserter-list-item/index.js +75 -69
  913. package/build-module/components/inserter-list-item/index.js.map +1 -1
  914. package/build-module/components/inserter-listbox/index.js +4 -3
  915. package/build-module/components/inserter-listbox/index.js.map +1 -1
  916. package/build-module/components/inserter-listbox/item.js +7 -6
  917. package/build-module/components/inserter-listbox/item.js.map +1 -1
  918. package/build-module/components/inspector-controls/block-support-slot-container.js +5 -4
  919. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  920. package/build-module/components/inspector-controls/block-support-tools-panel.js +8 -6
  921. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  922. package/build-module/components/inspector-controls/fill.js +5 -4
  923. package/build-module/components/inspector-controls/fill.js.map +1 -1
  924. package/build-module/components/inspector-controls/fill.native.js +6 -5
  925. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  926. package/build-module/components/inspector-controls/groups.js +3 -1
  927. package/build-module/components/inspector-controls/groups.js.map +1 -1
  928. package/build-module/components/inspector-controls/slot.js +7 -6
  929. package/build-module/components/inspector-controls/slot.js.map +1 -1
  930. package/build-module/components/inspector-controls/slot.native.js +5 -4
  931. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  932. package/build-module/components/justify-content-control/ui.js +10 -8
  933. package/build-module/components/justify-content-control/ui.js.map +1 -1
  934. package/build-module/components/letter-spacing-control/index.js +13 -9
  935. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  936. package/build-module/components/line-height-control/index.js +5 -4
  937. package/build-module/components/line-height-control/index.js.map +1 -1
  938. package/build-module/components/line-height-control/index.native.js +5 -4
  939. package/build-module/components/line-height-control/index.native.js.map +1 -1
  940. package/build-module/components/link-control/index.js +107 -53
  941. package/build-module/components/link-control/index.js.map +1 -1
  942. package/build-module/components/link-control/link-preview.js +24 -11
  943. package/build-module/components/link-control/link-preview.js.map +1 -1
  944. package/build-module/components/link-control/search-create-button.js +9 -7
  945. package/build-module/components/link-control/search-create-button.js.map +1 -1
  946. package/build-module/components/link-control/search-input.js +30 -21
  947. package/build-module/components/link-control/search-input.js.map +1 -1
  948. package/build-module/components/link-control/search-item.js +10 -9
  949. package/build-module/components/link-control/search-item.js.map +1 -1
  950. package/build-module/components/link-control/search-results.js +15 -14
  951. package/build-module/components/link-control/search-results.js.map +1 -1
  952. package/build-module/components/link-control/settings-drawer.js +7 -5
  953. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  954. package/build-module/components/link-control/use-search-handler.js +4 -3
  955. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  956. package/build-module/components/list-view/appender.js +27 -23
  957. package/build-module/components/list-view/appender.js.map +1 -1
  958. package/build-module/components/list-view/block-contents.js +32 -28
  959. package/build-module/components/list-view/block-contents.js.map +1 -1
  960. package/build-module/components/list-view/block-select-button.js +18 -17
  961. package/build-module/components/list-view/block-select-button.js.map +1 -1
  962. package/build-module/components/list-view/block.js +121 -83
  963. package/build-module/components/list-view/block.js.map +1 -1
  964. package/build-module/components/list-view/branch.js +92 -73
  965. package/build-module/components/list-view/branch.js.map +1 -1
  966. package/build-module/components/list-view/drop-indicator.js +5 -4
  967. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  968. package/build-module/components/list-view/expander.js +4 -3
  969. package/build-module/components/list-view/expander.js.map +1 -1
  970. package/build-module/components/list-view/index.js +49 -25
  971. package/build-module/components/list-view/index.js.map +1 -1
  972. package/build-module/components/list-view/leaf.js +12 -11
  973. package/build-module/components/list-view/leaf.js.map +1 -1
  974. package/build-module/components/list-view/list-item.js +8 -7
  975. package/build-module/components/list-view/list-item.js.map +1 -1
  976. package/build-module/components/list-view/use-list-view-client-ids.js +8 -58
  977. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  978. package/build-module/components/media-placeholder/index.js +86 -68
  979. package/build-module/components/media-placeholder/index.js.map +1 -1
  980. package/build-module/components/media-placeholder/index.native.js +5 -4
  981. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  982. package/build-module/components/media-replace-flow/index.js +85 -72
  983. package/build-module/components/media-replace-flow/index.js.map +1 -1
  984. package/build-module/components/media-upload/check.js +5 -4
  985. package/build-module/components/media-upload/check.js.map +1 -1
  986. package/build-module/components/multi-selection-inspector/index.js +4 -3
  987. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  988. package/build-module/components/navigable-toolbar/index.js +8 -7
  989. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  990. package/build-module/components/observe-typing/index.js +4 -3
  991. package/build-module/components/observe-typing/index.js.map +1 -1
  992. package/build-module/components/panel-color-settings/index.js +16 -12
  993. package/build-module/components/panel-color-settings/index.js.map +1 -1
  994. package/build-module/components/plain-text/index.js +6 -4
  995. package/build-module/components/plain-text/index.js.map +1 -1
  996. package/build-module/components/preview-options/index.js +8 -7
  997. package/build-module/components/preview-options/index.js.map +1 -1
  998. package/build-module/components/provider/block-refs-provider.js +4 -3
  999. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1000. package/build-module/components/provider/use-block-sync.js +8 -7
  1001. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1002. package/build-module/components/provider/with-registry-provider.js +7 -5
  1003. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1004. package/build-module/components/responsive-block-control/label.js +6 -5
  1005. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1006. package/build-module/components/rich-text/embed-handler-picker.native.js +8 -5
  1007. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1008. package/build-module/components/rich-text/file-paste-handler.js +6 -3
  1009. package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
  1010. package/build-module/components/rich-text/format-edit.js +36 -10
  1011. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1012. package/build-module/components/rich-text/format-toolbar/index.js +20 -10
  1013. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1014. package/build-module/components/rich-text/format-toolbar-container.js +6 -4
  1015. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1016. package/build-module/components/rich-text/index.js +44 -40
  1017. package/build-module/components/rich-text/index.js.map +1 -1
  1018. package/build-module/components/rich-text/index.native.js +145 -122
  1019. package/build-module/components/rich-text/index.native.js.map +1 -1
  1020. package/build-module/components/rich-text/input-event.js +5 -4
  1021. package/build-module/components/rich-text/input-event.js.map +1 -1
  1022. package/build-module/components/rich-text/shortcut.js +6 -5
  1023. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1024. package/build-module/components/rich-text/split-value.js +10 -8
  1025. package/build-module/components/rich-text/split-value.js.map +1 -1
  1026. package/build-module/components/rich-text/toolbar-button.js +7 -6
  1027. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1028. package/build-module/components/rich-text/use-caret-in-format.js +4 -3
  1029. package/build-module/components/rich-text/use-caret-in-format.js.map +1 -1
  1030. package/build-module/components/rich-text/use-enter.js +6 -3
  1031. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1032. package/build-module/components/rich-text/use-format-types.js +13 -10
  1033. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1034. package/build-module/components/rich-text/use-input-rules.js +15 -9
  1035. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1036. package/build-module/components/rich-text/use-mark-persistent.js +5 -4
  1037. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1038. package/build-module/components/rich-text/use-paste-handler.js +28 -4
  1039. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1040. package/build-module/components/rich-text/utils.js +7 -5
  1041. package/build-module/components/rich-text/utils.js.map +1 -1
  1042. package/build-module/components/skip-to-selected-block/index.js +4 -3
  1043. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1044. package/build-module/components/text-decoration-control/index.js +5 -4
  1045. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1046. package/build-module/components/text-transform-control/index.js +5 -4
  1047. package/build-module/components/text-transform-control/index.js.map +1 -1
  1048. package/build-module/components/tool-selector/index.js +16 -13
  1049. package/build-module/components/tool-selector/index.js.map +1 -1
  1050. package/build-module/components/typewriter/index.js +9 -6
  1051. package/build-module/components/typewriter/index.js.map +1 -1
  1052. package/build-module/components/ungroup-button/index.native.js +12 -9
  1053. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1054. package/build-module/components/unit-control/index.js +5 -4
  1055. package/build-module/components/unit-control/index.js.map +1 -1
  1056. package/build-module/components/url-input/index.js +23 -13
  1057. package/build-module/components/url-input/index.js.map +1 -1
  1058. package/build-module/components/url-input/index.native.js +8 -6
  1059. package/build-module/components/url-input/index.native.js.map +1 -1
  1060. package/build-module/components/url-popover/image-url-input-ui.js +12 -11
  1061. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1062. package/build-module/components/url-popover/index.js +9 -8
  1063. package/build-module/components/url-popover/index.js.map +1 -1
  1064. package/build-module/components/url-popover/link-editor.js +8 -7
  1065. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1066. package/build-module/components/url-popover/link-viewer-url.js +6 -5
  1067. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1068. package/build-module/components/url-popover/link-viewer.js +9 -8
  1069. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1070. package/build-module/components/use-block-drop-zone/index.js +8 -7
  1071. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1072. package/build-module/components/use-moving-animation/index.js +17 -13
  1073. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1074. package/build-module/components/use-no-recursive-renders/index.js +10 -6
  1075. package/build-module/components/use-no-recursive-renders/index.js.map +1 -1
  1076. package/build-module/components/use-setting/index.js +48 -9
  1077. package/build-module/components/use-setting/index.js.map +1 -1
  1078. package/build-module/components/warning/index.js +7 -6
  1079. package/build-module/components/warning/index.js.map +1 -1
  1080. package/build-module/components/warning/index.native.js +10 -9
  1081. package/build-module/components/warning/index.native.js.map +1 -1
  1082. package/build-module/components/writing-flow/index.js +5 -4
  1083. package/build-module/components/writing-flow/index.js.map +1 -1
  1084. package/build-module/hooks/align.js +9 -4
  1085. package/build-module/hooks/align.js.map +1 -1
  1086. package/build-module/hooks/border.js +8 -6
  1087. package/build-module/hooks/border.js.map +1 -1
  1088. package/build-module/hooks/color-panel.js +9 -7
  1089. package/build-module/hooks/color-panel.js.map +1 -1
  1090. package/build-module/hooks/dimensions.js +2 -1
  1091. package/build-module/hooks/dimensions.js.map +1 -1
  1092. package/build-module/hooks/duotone.js +29 -15
  1093. package/build-module/hooks/duotone.js.map +1 -1
  1094. package/build-module/hooks/font-appearance.js +54 -12
  1095. package/build-module/hooks/font-appearance.js.map +1 -1
  1096. package/build-module/hooks/font-family.js +57 -31
  1097. package/build-module/hooks/font-family.js.map +1 -1
  1098. package/build-module/hooks/font-size.js +52 -12
  1099. package/build-module/hooks/font-size.js.map +1 -1
  1100. package/build-module/hooks/gap.js +9 -7
  1101. package/build-module/hooks/gap.js.map +1 -1
  1102. package/build-module/hooks/index.js +1 -0
  1103. package/build-module/hooks/index.js.map +1 -1
  1104. package/build-module/hooks/index.native.js +1 -0
  1105. package/build-module/hooks/index.native.js.map +1 -1
  1106. package/build-module/hooks/layout.js +16 -13
  1107. package/build-module/hooks/layout.js.map +1 -1
  1108. package/build-module/hooks/letter-spacing.js +45 -10
  1109. package/build-module/hooks/letter-spacing.js.map +1 -1
  1110. package/build-module/hooks/line-height.js +46 -11
  1111. package/build-module/hooks/line-height.js.map +1 -1
  1112. package/build-module/hooks/margin.js +10 -8
  1113. package/build-module/hooks/margin.js.map +1 -1
  1114. package/build-module/hooks/padding.js +10 -8
  1115. package/build-module/hooks/padding.js.map +1 -1
  1116. package/build-module/hooks/style.js +7 -3
  1117. package/build-module/hooks/style.js.map +1 -1
  1118. package/build-module/hooks/text-decoration.js +43 -9
  1119. package/build-module/hooks/text-decoration.js.map +1 -1
  1120. package/build-module/hooks/text-transform.js +43 -9
  1121. package/build-module/hooks/text-transform.js.map +1 -1
  1122. package/build-module/hooks/typography.js +119 -18
  1123. package/build-module/hooks/typography.js.map +1 -1
  1124. package/build-module/hooks/typography.native.js +2 -1
  1125. package/build-module/hooks/typography.native.js.map +1 -1
  1126. package/build-module/hooks/use-border-props.js +5 -4
  1127. package/build-module/hooks/use-border-props.js.map +1 -1
  1128. package/build-module/hooks/use-cached-truthy.js +21 -0
  1129. package/build-module/hooks/use-cached-truthy.js.map +1 -0
  1130. package/build-module/index.js +1 -1
  1131. package/build-module/index.js.map +1 -1
  1132. package/build-module/layouts/flex.js +176 -56
  1133. package/build-module/layouts/flex.js.map +1 -1
  1134. package/build-module/layouts/flow.js +10 -8
  1135. package/build-module/layouts/flow.js.map +1 -1
  1136. package/build-module/layouts/index.js +2 -1
  1137. package/build-module/layouts/index.js.map +1 -1
  1138. package/build-module/layouts/utils.js +2 -1
  1139. package/build-module/layouts/utils.js.map +1 -1
  1140. package/build-module/store/actions.js +410 -320
  1141. package/build-module/store/actions.js.map +1 -1
  1142. package/build-module/store/array.js +2 -1
  1143. package/build-module/store/array.js.map +1 -1
  1144. package/build-module/store/index.js +1 -2
  1145. package/build-module/store/index.js.map +1 -1
  1146. package/build-module/store/reducer.js +129 -54
  1147. package/build-module/store/reducer.js.map +1 -1
  1148. package/build-module/store/selectors.js +197 -117
  1149. package/build-module/store/selectors.js.map +1 -1
  1150. package/build-module/utils/block-variation-transforms.js +4 -3
  1151. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1152. package/build-module/utils/get-paste-event-data.js +10 -6
  1153. package/build-module/utils/get-paste-event-data.js.map +1 -1
  1154. package/build-module/utils/math.js +2 -1
  1155. package/build-module/utils/math.js.map +1 -1
  1156. package/build-module/utils/parse-css-unit-to-px.js +5 -2
  1157. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1158. package/build-module/utils/transform-styles/index.js +8 -6
  1159. package/build-module/utils/transform-styles/index.js.map +1 -1
  1160. package/build-module/utils/transform-styles/transforms/wrap.js +28 -25
  1161. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1162. package/build-style/style-rtl.css +160 -57
  1163. package/build-style/style.css +160 -57
  1164. package/package.json +27 -28
  1165. package/src/components/alignment-control/test/__snapshots__/index.js.snap +0 -2
  1166. package/src/components/alignment-control/ui.js +1 -4
  1167. package/src/components/block-draggable/style.scss +19 -4
  1168. package/src/components/block-icon/index.js +4 -1
  1169. package/src/components/block-inspector/index.js +5 -0
  1170. package/src/components/block-list/index.native.js +1 -1
  1171. package/src/components/block-list/use-block-props/use-multi-selection.js +27 -7
  1172. package/src/components/block-navigation/dropdown.js +0 -1
  1173. package/src/components/block-patterns-list/index.js +1 -8
  1174. package/src/components/block-patterns-list/style.scss +22 -12
  1175. package/src/components/block-settings/container.native.js +7 -0
  1176. package/src/components/block-settings-menu/block-settings-dropdown.js +19 -7
  1177. package/src/components/block-styles/preview.native.js +2 -2
  1178. package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
  1179. package/src/components/color-palette/test/__snapshots__/control.js.snap +88 -63
  1180. package/src/components/colors-gradients/control.js +19 -62
  1181. package/src/components/colors-gradients/panel-color-gradient-settings.js +76 -6
  1182. package/src/components/colors-gradients/style.scss +3 -14
  1183. package/src/components/colors-gradients/test/control.js +0 -16
  1184. package/src/components/duotone-control/index.js +6 -0
  1185. package/src/components/duotone-control/style.scss +27 -12
  1186. package/src/components/font-appearance-control/index.js +22 -14
  1187. package/src/components/iframe/index.js +1 -1
  1188. package/src/components/index.js +3 -4
  1189. package/src/components/index.native.js +1 -4
  1190. package/src/components/inner-blocks/index.js +4 -4
  1191. package/src/components/inner-blocks/index.native.js +7 -4
  1192. package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
  1193. package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
  1194. package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
  1195. package/src/components/inserter/block-patterns-tab.js +107 -80
  1196. package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
  1197. package/src/components/inserter/pattern-panel.js +33 -16
  1198. package/src/components/inserter/style.scss +64 -1
  1199. package/src/components/inserter/test/block-types-tab.native.js +1 -1
  1200. package/src/components/inserter/test/fixtures/index.native.js +12 -0
  1201. package/src/components/inspector-controls/groups.js +4 -0
  1202. package/src/components/letter-spacing-control/index.js +12 -6
  1203. package/src/components/link-control/README.md +7 -0
  1204. package/src/components/link-control/index.js +99 -34
  1205. package/src/components/link-control/link-preview.js +21 -9
  1206. package/src/components/link-control/search-input.js +9 -3
  1207. package/src/components/link-control/style.scss +32 -16
  1208. package/src/components/link-control/test/index.js +179 -4
  1209. package/src/components/list-view/block.js +67 -23
  1210. package/src/components/list-view/branch.js +113 -91
  1211. package/src/components/list-view/index.js +58 -19
  1212. package/src/components/list-view/leaf.js +1 -1
  1213. package/src/components/list-view/style.scss +14 -3
  1214. package/src/components/list-view/use-list-view-client-ids.js +7 -66
  1215. package/src/components/rich-text/embed-handler-picker.native.js +1 -0
  1216. package/src/components/rich-text/format-edit.js +36 -2
  1217. package/src/components/rich-text/format-toolbar/index.js +3 -0
  1218. package/src/components/rich-text/use-paste-handler.js +22 -0
  1219. package/src/components/url-input/index.js +14 -4
  1220. package/src/components/use-setting/index.js +49 -11
  1221. package/src/hooks/border.js +8 -11
  1222. package/src/hooks/color-panel.js +1 -0
  1223. package/src/hooks/duotone.js +21 -7
  1224. package/src/hooks/font-appearance.js +38 -7
  1225. package/src/hooks/font-family.js +29 -13
  1226. package/src/hooks/font-size.js +42 -6
  1227. package/src/hooks/index.js +1 -0
  1228. package/src/hooks/index.native.js +1 -0
  1229. package/src/hooks/layout.scss +3 -1
  1230. package/src/hooks/letter-spacing.js +35 -7
  1231. package/src/hooks/line-height.js +37 -9
  1232. package/src/hooks/margin.js +1 -1
  1233. package/src/hooks/padding.js +1 -1
  1234. package/src/hooks/text-decoration.js +34 -6
  1235. package/src/hooks/text-transform.js +34 -6
  1236. package/src/hooks/typography.js +165 -15
  1237. package/src/hooks/typography.scss +16 -0
  1238. package/src/hooks/use-cached-truthy.js +20 -0
  1239. package/src/index.js +1 -0
  1240. package/src/layouts/flex.js +155 -41
  1241. package/src/store/actions.js +223 -391
  1242. package/src/store/index.js +1 -2
  1243. package/src/store/reducer.js +36 -18
  1244. package/src/store/selectors.js +52 -47
  1245. package/src/store/test/actions.js +395 -694
  1246. package/src/store/test/selectors.js +79 -21
  1247. package/src/style.scss +1 -1
  1248. package/src/utils/test/parse-css-unit-to-px.js +127 -167
  1249. package/build/components/text-decoration-and-transform/index.js +0 -39
  1250. package/build/components/text-decoration-and-transform/index.js.map +0 -1
  1251. package/build/store/controls.js +0 -44
  1252. package/build/store/controls.js.map +0 -1
  1253. package/build-module/components/text-decoration-and-transform/index.js +0 -30
  1254. package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
  1255. package/build-module/store/controls.js +0 -32
  1256. package/build-module/store/controls.js.map +0 -1
  1257. package/src/components/text-decoration-and-transform/index.js +0 -36
  1258. package/src/components/text-decoration-and-transform/style.scss +0 -3
  1259. package/src/store/controls.js +0 -39
@@ -43,12 +43,13 @@ const getAbsolutePosition = element => {
43
43
  */
44
44
 
45
45
 
46
- function useMovingAnimation({
47
- isSelected,
48
- adjustScrolling,
49
- enableAnimation,
50
- triggerAnimationOnChange
51
- }) {
46
+ function useMovingAnimation(_ref) {
47
+ let {
48
+ isSelected,
49
+ adjustScrolling,
50
+ enableAnimation,
51
+ triggerAnimationOnChange
52
+ } = _ref;
52
53
  const ref = useRef();
53
54
  const prefersReducedMotion = useReducedMotion() || !enableAnimation;
54
55
  const [triggeredAnimation, triggerAnimation] = useReducer(counterReducer, 0);
@@ -107,10 +108,12 @@ function useMovingAnimation({
107
108
  });
108
109
  }, [triggerAnimationOnChange]); // Only called when either the x or y value changes.
109
110
 
110
- function onFrameChange({
111
- x,
112
- y
113
- }) {
111
+ function onFrameChange(_ref2) {
112
+ let {
113
+ x,
114
+ y
115
+ } = _ref2;
116
+
114
117
  if (!ref.current) {
115
118
  return;
116
119
  }
@@ -123,9 +126,10 @@ function useMovingAnimation({
123
126
  } // Called for every frame computed by useSpring.
124
127
 
125
128
 
126
- function onChange({
127
- value
128
- }) {
129
+ function onChange(_ref3) {
130
+ let {
131
+ value
132
+ } = _ref3;
129
133
  let {
130
134
  x,
131
135
  y
@@ -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;AACA;AACA;;;AACA,SAASC,kBAAT,CAA6B;AAC5BC,EAAAA,UAD4B;AAE5BC,EAAAA,eAF4B;AAG5BC,EAAAA,eAH4B;AAI5BC,EAAAA;AAJ4B,CAA7B,EAKI;AACH,QAAMC,GAAG,GAAGhB,MAAM,EAAlB;AACA,QAAMiB,oBAAoB,GAAGhB,gBAAgB,MAAM,CAAEa,eAArD;AACA,QAAM,CAAEI,kBAAF,EAAsBC,gBAAtB,IAA2CrB,UAAU,CAC1DK,cAD0D,EAE1D,CAF0D,CAA3D;AAIA,QAAM,CAAEiB,iBAAF,EAAqBC,YAArB,IAAsCvB,UAAU,CAAE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\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;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,IAAA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EF,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;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,EAA0CD,SAAS,GAAG,EAAtD,EAA2D;AAAA;;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,CAAE;AAAEoB,IAAAA;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"]}
@@ -21,7 +21,7 @@ const deprecatedFlags = {
21
21
  'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients,
22
22
  'typography.fontSizes': settings => settings.fontSizes === undefined ? undefined : settings.fontSizes,
23
23
  'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes,
24
- 'typography.customLineHeight': settings => settings.enableCustomLineHeight,
24
+ 'typography.lineHeight': settings => settings.enableCustomLineHeight,
25
25
  'spacing.units': settings => {
26
26
  if (settings.enableCustomUnits === undefined) {
27
27
  return;
@@ -33,22 +33,60 @@ const deprecatedFlags = {
33
33
 
34
34
  return settings.enableCustomUnits;
35
35
  },
36
- 'spacing.customPadding': settings => settings.enableCustomSpacing
36
+ 'spacing.padding': settings => settings.enableCustomSpacing
37
+ };
38
+ const prefixedFlags = {
39
+ /*
40
+ * These were only available in the plugin
41
+ * and can be removed when the minimum WordPress version
42
+ * for the plugin is 5.9.
43
+ */
44
+ 'border.customColor': 'border.color',
45
+ 'border.customStyle': 'border.style',
46
+ 'border.customWidth': 'border.width',
47
+ 'typography.customFontStyle': 'typography.fontStyle',
48
+ 'typography.customFontWeight': 'typography.fontWeight',
49
+ 'typography.customLetterSpacing': 'typography.letterSpacing',
50
+ 'typography.customTextDecorations': 'typography.textDecoration',
51
+ 'typography.customTextTransforms': 'typography.textTransform',
52
+
53
+ /*
54
+ * These were part of WordPress 5.8 and we need to keep them.
55
+ */
56
+ 'border.customRadius': 'border.radius',
57
+ 'spacing.customMargin': 'spacing.margin',
58
+ 'spacing.customPadding': 'spacing.padding',
59
+ 'typography.customLineHeight': 'typography.lineHeight'
60
+ };
61
+ /**
62
+ * Remove `custom` prefixes for flags that did not land in 5.8.
63
+ *
64
+ * This provides continued support for `custom` prefixed properties. It will
65
+ * be removed once third party devs have had sufficient time to update themes,
66
+ * plugins, etc.
67
+ *
68
+ * @see https://github.com/WordPress/gutenberg/pull/34485
69
+ *
70
+ * @param {string} path Path to desired value in settings.
71
+ * @return {string} The value for defined setting.
72
+ */
73
+
74
+ const removeCustomPrefixes = path => {
75
+ return prefixedFlags[path] || path;
37
76
  };
38
77
  /**
39
78
  * Hook that retrieves the editor setting.
40
79
  * It works with nested objects using by finding the value at path.
41
80
  *
42
81
  * @param {string} path The path to the setting.
43
- *
44
82
  * @return {any} Returns the value defined for the setting.
45
- *
46
83
  * @example
47
84
  * ```js
48
85
  * const isEnabled = useSetting( 'typography.dropCap' );
49
86
  * ```
50
87
  */
51
88
 
89
+
52
90
  export default function useSetting(path) {
53
91
  const {
54
92
  name: blockName
@@ -59,12 +97,13 @@ export default function useSetting(path) {
59
97
  const settings = select(blockEditorStore).getSettings(); // 1 - Use __experimental features, if available.
60
98
  // We cascade to the all value if the block one is not available.
61
99
 
62
- const defaultsPath = `__experimentalFeatures.${path}`;
63
- const blockPath = `__experimentalFeatures.blocks.${blockName}.${path}`;
100
+ const normalizedPath = removeCustomPrefixes(path);
101
+ const defaultsPath = `__experimentalFeatures.${normalizedPath}`;
102
+ const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`;
64
103
  const experimentalFeaturesResult = (_get = get(settings, blockPath)) !== null && _get !== void 0 ? _get : get(settings, defaultsPath);
65
104
 
66
105
  if (experimentalFeaturesResult !== undefined) {
67
- if (PATHS_WITH_MERGE[path]) {
106
+ if (PATHS_WITH_MERGE[normalizedPath]) {
68
107
  var _ref, _experimentalFeatures;
69
108
 
70
109
  return (_ref = (_experimentalFeatures = experimentalFeaturesResult.user) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.core;
@@ -74,7 +113,7 @@ export default function useSetting(path) {
74
113
  } // 2 - Use deprecated settings, otherwise.
75
114
 
76
115
 
77
- const deprecatedSettingsValue = deprecatedFlags[path] ? deprecatedFlags[path](settings) : undefined;
116
+ const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined;
78
117
 
79
118
  if (deprecatedSettingsValue !== undefined) {
80
119
  return deprecatedSettingsValue;
@@ -84,7 +123,7 @@ export default function useSetting(path) {
84
123
  // To remove when __experimentalFeatures are ported to core.
85
124
 
86
125
 
87
- return path === 'typography.dropCap' ? true : undefined;
126
+ return normalizedPath === 'typography.dropCap' ? true : undefined;
88
127
  }, [blockName, path]);
89
128
  return setting;
90
129
  }
@@ -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","useSetting","path","name","blockName","setting","select","getSettings","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,aAA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AAEC,IAAAA,IAAI,EAAEC;AAAR,MAAsBlB,mBAAmB,EAA/C;AAEA,QAAMmB,OAAO,GAAGtB,SAAS,CACtBuB,MAAF,IAAc;AAAA;;AACb,UAAMhB,QAAQ,GAAGgB,MAAM,CAAElB,gBAAF,CAAN,CAA2BmB,WAA3B,EAAjB,CADa,CAGb;AACA;;AACA,UAAMC,YAAY,GAAI,0BAA0BN,IAAM,EAAtD;AACA,UAAMO,SAAS,GAAI,iCAAiCL,SAAW,IAAIF,IAAM,EAAzE;AACA,UAAMQ,0BAA0B,WAC/B5B,GAAG,CAAEQ,QAAF,EAAYmB,SAAZ,CAD4B,uCACD3B,GAAG,CAAEQ,QAAF,EAAYkB,YAAZ,CADlC;;AAEA,QAAKE,0BAA0B,KAAKlB,SAApC,EAAgD;AAC/C,UAAKP,gBAAgB,CAAEiB,IAAF,CAArB,EAAgC;AAAA;;AAC/B,gDACCQ,0BAA0B,CAACC,IAD5B,yEAECD,0BAA0B,CAACE,KAF5B,uCAGCF,0BAA0B,CAACG,IAH5B;AAKA;;AACD,aAAOH,0BAAP;AACA,KAlBY,CAoBb;;;AACA,UAAMI,uBAAuB,GAAGzB,eAAe,CAAEa,IAAF,CAAf,GAC7Bb,eAAe,CAAEa,IAAF,CAAf,CAAyBZ,QAAzB,CAD6B,GAE7BE,SAFH;;AAGA,QAAKsB,uBAAuB,KAAKtB,SAAjC,EAA6C;AAC5C,aAAOsB,uBAAP;AACA,KA1BY,CA4Bb;AACA;AACA;AACA;;;AACA,WAAOZ,IAAI,KAAK,oBAAT,GAAgC,IAAhC,GAAuCV,SAA9C;AACA,GAlCuB,EAmCxB,CAAEY,SAAF,EAAaF,IAAb,CAnCwB,CAAzB;AAsCA,SAAOG,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.customLineHeight': ( settings ) =>\n\t\tsettings.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.customPadding': ( settings ) => settings.enableCustomSpacing,\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 *\n * @return {any} Returns the value defined for the setting.\n *\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 defaultsPath = `__experimentalFeatures.${ path }`;\n\t\t\tconst blockPath = `__experimentalFeatures.blocks.${ blockName }.${ path }`;\n\t\t\tconst experimentalFeaturesResult =\n\t\t\t\tget( settings, blockPath ) ?? get( settings, defaultsPath );\n\t\t\tif ( experimentalFeaturesResult !== undefined ) {\n\t\t\t\tif ( PATHS_WITH_MERGE[ path ] ) {\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[ path ]\n\t\t\t\t? deprecatedFlags[ path ]( 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 path === '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","core","deprecatedSettingsValue"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AAC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AC/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"]}
@@ -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,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,kBAA/B;;AAEA,SAASC,OAAT,CAAkB;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,OAAb;AAAsBC,EAAAA,QAAtB;AAAgCC,EAAAA;AAAhC,CAAlB,EAAuE;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"]}
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,OA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hB;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,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,CAAsB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAtB,EAA8CC,YAA9C,EAA6D;AAC5D,QAAM,CAAEZ,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBH,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"],"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,sBAAP,MAAmC,gEAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,cAAc,GAAG,CAAE,MAAF,EAAU,QAAV,EAAoB,OAApB,EAA6B,MAA7B,EAAqC,MAArC,CAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG,CAAE,MAAF,EAAU,MAAV,CAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CACNC,UADM,EAENC,mBAAmB,GAAG,IAFhB,EAGNC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TI,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,sBAAP,MAAmC,gEAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,cAAc,GAAG,CAAE,MAAF,EAAU,QAAV,EAAoB,OAApB,EAA6B,MAA7B,EAAqC,MAArC,CAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,eAAe,GAAG,CAAE,MAAF,EAAU,MAAV,CAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,CACNC,UADM,EAIL;AAAA,MAFDC,mBAEC,uEAFqB,IAErB;AAAA,MADDC,cACC,uEADgB,IAChB;AACD,MAAIC,eAAJ;;AACA,MAAKC,KAAK,CAACC,OAAN,CAAeL,UAAf,CAAL,EAAmC;AAClCG,IAAAA,eAAe,GAAGN,cAAc,CAACS,MAAf,CAAyBC,KAAF,IACxCP,UAAU,CAACQ,QAAX,CAAqBD,KAArB,CADiB,CAAlB;AAGA,GAJD,MAIO,IAAKP,UAAU,KAAK,IAApB,EAA2B;AACjC;AACAG,IAAAA,eAAe,GAAG,CAAE,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AER,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"]}
@@ -21,10 +21,10 @@ export const BORDER_SUPPORT_KEY = '__experimentalBorder';
21
21
  export function BorderPanel(props) {
22
22
  const isDisabled = useIsBorderDisabled(props);
23
23
  const isSupported = hasBorderSupport(props.name);
24
- const isColorSupported = useSetting('border.customColor') && hasBorderSupport(props.name, 'color');
25
- const isRadiusSupported = useSetting('border.customRadius') && hasBorderSupport(props.name, 'radius');
26
- const isStyleSupported = useSetting('border.customStyle') && hasBorderSupport(props.name, 'style');
27
- const isWidthSupported = useSetting('border.customWidth') && hasBorderSupport(props.name, 'width');
24
+ const isColorSupported = useSetting('border.color') && hasBorderSupport(props.name, 'color');
25
+ const isRadiusSupported = useSetting('border.radius') && hasBorderSupport(props.name, 'radius');
26
+ const isStyleSupported = useSetting('border.style') && hasBorderSupport(props.name, 'style');
27
+ const isWidthSupported = useSetting('border.width') && hasBorderSupport(props.name, 'width');
28
28
 
29
29
  if (isDisabled || !isSupported) {
30
30
  return null;
@@ -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
  }
@@ -83,7 +85,7 @@ export function shouldSkipSerialization(blockType) {
83
85
  */
84
86
 
85
87
  const useIsBorderDisabled = () => {
86
- const configs = [!useSetting('border.customColor'), !useSetting('border.customRadius'), !useSetting('border.customStyle'), !useSetting('border.customWidth')];
88
+ const configs = [!useSetting('border.color'), !useSetting('border.radius'), !useSetting('border.style'), !useSetting('border.width')];
87
89
  return configs.every(Boolean);
88
90
  };
89
91
  //# sourceMappingURL=border.js.map
@@ -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,g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oBAAF,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.customColor' ) &&\n\t\thasBorderSupport( props.name, 'color' );\n\n\tconst isRadiusSupported =\n\t\tuseSetting( 'border.customRadius' ) &&\n\t\thasBorderSupport( props.name, 'radius' );\n\n\tconst isStyleSupported =\n\t\tuseSetting( 'border.customStyle' ) &&\n\t\thasBorderSupport( props.name, 'style' );\n\n\tconst isWidthSupported =\n\t\tuseSetting( 'border.customWidth' ) &&\n\t\thasBorderSupport( 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.customColor' ),\n\t\t! useSetting( 'border.customRadius' ),\n\t\t! useSetting( 'border.customStyle' ),\n\t\t! useSetting( 'border.customWidth' ),\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;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,KAAtB,EAA8B;AACpC,QAAMC,UAAU,GAAGC,mBAAmB,CAAEF,KAAF,CAAtC;AACA,QAAMG,WAAW,GAAGC,gBAAgB,CAAEJ,KAAK,CAACK,IAAR,CAApC;AAEA,QAAMC,gBAAgB,GACrBb,UAAU,CAAE,cAAF,CAAV,IAAgCW,gBAAgB,CAAEJ,KAAK,CAACK,IAAR,EAAc,OAAd,CADjD;AAGA,QAAME,iBAAiB,GACtBd,UAAU,CAAE,eAAF,CAAV,IACAW,gBAAgB,CAAEJ,KAAK,CAACK,IAAR,EAAc,QAAd,CAFjB;AAIA,QAAMG,gBAAgB,GACrBf,UAAU,CAAE,cAAF,CAAV,IAAgCW,gBAAgB,CAAEJ,KAAK,CAACK,IAAR,EAAc,OAAd,CADjD;AAGA,QAAMI,gBAAgB,GACrBhB,UAAU,CAAE,cAAF,CAAV,IAAgCW,gBAAgB,CAAEJ,KAAK,CAACK,IAAR,EAAc,OAAd,CADjD;;AAGA,MAAKJ,UAAU,IAAI,CAAEE,WAArB,EAAmC;AAClC,WAAO,IAAP;AACA;;AAED,SACC,cAAC,iBAAD,QACC,cAAC,SAAD;AACC,IAAA,SAA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AAGzB,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"]}