@wordpress/block-editor 12.1.0 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1853) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/autocompleters/block.js +11 -5
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/alignment-control/ui.js +9 -11
  5. package/build/components/alignment-control/ui.js.map +1 -1
  6. package/build/components/autocomplete/index.js +3 -4
  7. package/build/components/autocomplete/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +8 -12
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-alignment-control/ui.js +17 -21
  11. package/build/components/block-alignment-control/ui.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.native.js +14 -17
  13. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  14. package/build/components/block-alignment-control/use-available-alignments.js +5 -10
  15. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +4 -6
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +9 -7
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-caption/index.native.js +30 -35
  21. package/build/components/block-caption/index.native.js.map +1 -1
  22. package/build/components/block-card/index.js +7 -9
  23. package/build/components/block-card/index.js.map +1 -1
  24. package/build/components/block-compare/block-view.js +8 -9
  25. package/build/components/block-compare/block-view.js.map +1 -1
  26. package/build/components/block-compare/index.js +7 -9
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +4 -5
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/fill.js +15 -22
  31. package/build/components/block-controls/fill.js.map +1 -1
  32. package/build/components/block-controls/hook.js +1 -3
  33. package/build/components/block-controls/hook.js.map +1 -1
  34. package/build/components/block-controls/slot.js +28 -18
  35. package/build/components/block-controls/slot.js.map +1 -1
  36. package/build/components/block-controls/slot.native.js +7 -17
  37. package/build/components/block-controls/slot.native.js.map +1 -1
  38. package/build/components/block-draggable/draggable-chip.js +5 -6
  39. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  40. package/build/components/block-draggable/draggable-chip.native.js +3 -4
  41. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  42. package/build/components/block-draggable/dropping-insertion-point.native.js +6 -7
  43. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  44. package/build/components/block-draggable/index.js +15 -16
  45. package/build/components/block-draggable/index.js.map +1 -1
  46. package/build/components/block-draggable/index.native.js +43 -58
  47. package/build/components/block-draggable/index.native.js.map +1 -1
  48. package/build/components/block-edit/edit.js +1 -4
  49. package/build/components/block-edit/edit.js.map +1 -1
  50. package/build/components/block-edit/edit.native.js +1 -4
  51. package/build/components/block-edit/edit.native.js.map +1 -1
  52. package/build/components/block-edit-visually-button/index.js +3 -4
  53. package/build/components/block-edit-visually-button/index.js.map +1 -1
  54. package/build/components/block-editing-mode/index.js +84 -0
  55. package/build/components/block-editing-mode/index.js.map +1 -0
  56. package/build/components/block-full-height-alignment-control/index.js +6 -7
  57. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  58. package/build/components/block-icon/index.js +7 -11
  59. package/build/components/block-icon/index.js.map +1 -1
  60. package/build/components/block-icon/index.native.js +9 -13
  61. package/build/components/block-icon/index.native.js.map +1 -1
  62. package/build/components/block-inspector/index.js +36 -46
  63. package/build/components/block-inspector/index.js.map +1 -1
  64. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  65. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  66. package/build/components/block-list/block-html.js +3 -4
  67. package/build/components/block-list/block-html.js.map +1 -1
  68. package/build/components/block-list/block-invalid-warning.js +3 -4
  69. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  70. package/build/components/block-list/block-invalid-warning.native.js +10 -15
  71. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  72. package/build/components/block-list/block-list-block-context.js +15 -0
  73. package/build/components/block-list/block-list-block-context.js.map +1 -0
  74. package/build/components/block-list/block-list-context.native.js +5 -11
  75. package/build/components/block-list/block-list-context.native.js.map +1 -1
  76. package/build/components/block-list/block-list-item-cell.native.js +5 -6
  77. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  78. package/build/components/block-list/block-list-item.native.js +17 -18
  79. package/build/components/block-list/block-list-item.native.js.map +1 -1
  80. package/build/components/block-list/block-outline.native.js +8 -9
  81. package/build/components/block-list/block-outline.native.js.map +1 -1
  82. package/build/components/block-list/block-selection-button.native.js +10 -12
  83. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  84. package/build/components/block-list/block.js +68 -83
  85. package/build/components/block-list/block.js.map +1 -1
  86. package/build/components/block-list/block.native.js +69 -90
  87. package/build/components/block-list/block.native.js.map +1 -1
  88. package/build/components/block-list/index.js +12 -15
  89. package/build/components/block-list/index.js.map +1 -1
  90. package/build/components/block-list/index.native.js +143 -153
  91. package/build/components/block-list/index.native.js.map +1 -1
  92. package/build/components/block-list/insertion-point.native.js +4 -5
  93. package/build/components/block-list/insertion-point.native.js.map +1 -1
  94. package/build/components/block-list/layout.js +6 -9
  95. package/build/components/block-list/layout.js.map +1 -1
  96. package/build/components/block-list/subdirectory-icon.js +10 -13
  97. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  98. package/build/components/block-list/use-block-props/index.js +17 -13
  99. package/build/components/block-list/use-block-props/index.js.map +1 -1
  100. package/build/components/block-list/use-block-props/index.native.js +1 -2
  101. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  102. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  103. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  104. package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  105. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  106. package/build/components/block-list/use-in-between-inserter.js +8 -8
  107. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  108. package/build/components/block-list-appender/index.js +30 -15
  109. package/build/components/block-list-appender/index.js.map +1 -1
  110. package/build/components/block-list-appender/index.native.js +9 -11
  111. package/build/components/block-list-appender/index.native.js.map +1 -1
  112. package/build/components/block-lock/menu-item.js +3 -4
  113. package/build/components/block-lock/menu-item.js.map +1 -1
  114. package/build/components/block-lock/modal.js +6 -9
  115. package/build/components/block-lock/modal.js.map +1 -1
  116. package/build/components/block-lock/toolbar.js +4 -10
  117. package/build/components/block-lock/toolbar.js.map +1 -1
  118. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +67 -70
  119. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  120. package/build/components/block-mobile-toolbar/index.native.js +26 -34
  121. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  122. package/build/components/block-mover/button.js +6 -7
  123. package/build/components/block-mover/button.js.map +1 -1
  124. package/build/components/block-mover/index.js +5 -8
  125. package/build/components/block-mover/index.js.map +1 -1
  126. package/build/components/block-mover/index.native.js +23 -46
  127. package/build/components/block-mover/index.native.js.map +1 -1
  128. package/build/components/block-mover/mover-description.native.js +7 -10
  129. package/build/components/block-mover/mover-description.native.js.map +1 -1
  130. package/build/components/block-navigation/dropdown.js +20 -25
  131. package/build/components/block-navigation/dropdown.js.map +1 -1
  132. package/build/components/block-parent-selector/index.js +2 -2
  133. package/build/components/block-parent-selector/index.js.map +1 -1
  134. package/build/components/block-pattern-setup/index.js +27 -31
  135. package/build/components/block-pattern-setup/index.js.map +1 -1
  136. package/build/components/block-pattern-setup/setup-toolbar.js +35 -42
  137. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  138. package/build/components/block-patterns-list/index.js +74 -81
  139. package/build/components/block-patterns-list/index.js.map +1 -1
  140. package/build/components/block-popover/drop-zone.js +4 -5
  141. package/build/components/block-popover/drop-zone.js.map +1 -1
  142. package/build/components/block-popover/inbetween.js +10 -15
  143. package/build/components/block-popover/inbetween.js.map +1 -1
  144. package/build/components/block-popover/index.js +14 -15
  145. package/build/components/block-popover/index.js.map +1 -1
  146. package/build/components/block-preview/auto.js +6 -8
  147. package/build/components/block-preview/auto.js.map +1 -1
  148. package/build/components/block-preview/index.js +15 -18
  149. package/build/components/block-preview/index.js.map +1 -1
  150. package/build/components/block-settings/button.native.js +7 -10
  151. package/build/components/block-settings/button.native.js.map +1 -1
  152. package/build/components/block-settings-menu/block-convert-button.js +5 -7
  153. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  154. package/build/components/block-settings-menu/block-html-convert-button.js +10 -14
  155. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  156. package/build/components/block-settings-menu/block-mode-toggle.js +19 -25
  157. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  158. package/build/components/block-settings-menu/block-settings-dropdown.js +132 -111
  159. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  160. package/build/components/block-settings-menu/index.js +4 -5
  161. package/build/components/block-settings-menu/index.js.map +1 -1
  162. package/build/components/block-settings-menu-controls/index.js +14 -16
  163. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  164. package/build/components/block-styles/index.js +6 -7
  165. package/build/components/block-styles/index.js.map +1 -1
  166. package/build/components/block-styles/index.native.js +5 -7
  167. package/build/components/block-styles/index.native.js.map +1 -1
  168. package/build/components/block-styles/menu-items.js +4 -5
  169. package/build/components/block-styles/menu-items.js.map +1 -1
  170. package/build/components/block-styles/preview-panel.js +8 -12
  171. package/build/components/block-styles/preview-panel.js.map +1 -1
  172. package/build/components/block-styles/preview.native.js +6 -7
  173. package/build/components/block-styles/preview.native.js.map +1 -1
  174. package/build/components/block-styles/use-styles-for-block.js +7 -9
  175. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  176. package/build/components/block-styles/utils.js +4 -7
  177. package/build/components/block-styles/utils.js.map +1 -1
  178. package/build/components/block-switcher/block-styles-menu.js +4 -5
  179. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  180. package/build/components/block-switcher/block-transformations-menu.js +29 -26
  181. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  182. package/build/components/block-switcher/block-transformations-menu.native.js +9 -10
  183. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  184. package/build/components/block-switcher/block-variation-transformations.js +116 -0
  185. package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
  186. package/build/components/block-switcher/index.js +64 -55
  187. package/build/components/block-switcher/index.js.map +1 -1
  188. package/build/components/block-switcher/pattern-transformations-menu.js +21 -25
  189. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  190. package/build/components/block-switcher/preview-block-popover.js +3 -4
  191. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  192. package/build/components/block-switcher/utils.js +2 -3
  193. package/build/components/block-switcher/utils.js.map +1 -1
  194. package/build/components/block-title/index.js +5 -6
  195. package/build/components/block-title/index.js.map +1 -1
  196. package/build/components/block-title/use-block-display-title.js +5 -6
  197. package/build/components/block-title/use-block-display-title.js.map +1 -1
  198. package/build/components/block-toolbar/index.js +13 -12
  199. package/build/components/block-toolbar/index.js.map +1 -1
  200. package/build/components/block-toolbar/utils.js +14 -16
  201. package/build/components/block-toolbar/utils.js.map +1 -1
  202. package/build/components/block-tools/back-compat.js +3 -4
  203. package/build/components/block-tools/back-compat.js.map +1 -1
  204. package/build/components/block-tools/block-contextual-toolbar.js +10 -9
  205. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  206. package/build/components/block-tools/block-selection-button.js +6 -9
  207. package/build/components/block-tools/block-selection-button.js.map +1 -1
  208. package/build/components/block-tools/index.js +6 -7
  209. package/build/components/block-tools/index.js.map +1 -1
  210. package/build/components/block-tools/insertion-point.js +17 -14
  211. package/build/components/block-tools/insertion-point.js.map +1 -1
  212. package/build/components/block-tools/selected-block-popover.js +19 -20
  213. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  214. package/build/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  215. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  216. package/build/components/block-tools/zoom-out-mode-inserters.js +3 -4
  217. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  218. package/build/components/block-types-list/index.js +8 -9
  219. package/build/components/block-types-list/index.js.map +1 -1
  220. package/build/components/block-types-list/index.native.js +22 -27
  221. package/build/components/block-types-list/index.native.js.map +1 -1
  222. package/build/components/block-variation-picker/index.js +8 -9
  223. package/build/components/block-variation-picker/index.js.map +1 -1
  224. package/build/components/block-variation-picker/index.native.js +7 -9
  225. package/build/components/block-variation-picker/index.native.js.map +1 -1
  226. package/build/components/block-variation-transforms/index.js +30 -41
  227. package/build/components/block-variation-transforms/index.js.map +1 -1
  228. package/build/components/block-vertical-alignment-control/ui.js +7 -9
  229. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  230. package/build/components/border-radius-control/all-input-control.js +7 -8
  231. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  232. package/build/components/border-radius-control/index.js +9 -10
  233. package/build/components/border-radius-control/index.js.map +1 -1
  234. package/build/components/border-radius-control/input-controls.js +8 -11
  235. package/build/components/border-radius-control/input-controls.js.map +1 -1
  236. package/build/components/border-radius-control/linked-button.js +4 -5
  237. package/build/components/border-radius-control/linked-button.js.map +1 -1
  238. package/build/components/border-radius-control/utils.js +3 -7
  239. package/build/components/border-radius-control/utils.js.map +1 -1
  240. package/build/components/button-block-appender/index.js +13 -15
  241. package/build/components/button-block-appender/index.js.map +1 -1
  242. package/build/components/button-block-appender/index.native.js +25 -29
  243. package/build/components/button-block-appender/index.native.js.map +1 -1
  244. package/build/components/caption/index.native.js +40 -43
  245. package/build/components/caption/index.native.js.map +1 -1
  246. package/build/components/child-layout-control/index.js +5 -6
  247. package/build/components/child-layout-control/index.js.map +1 -1
  248. package/build/components/color-palette/control.js +5 -6
  249. package/build/components/color-palette/control.js.map +1 -1
  250. package/build/components/color-palette/with-color-context.js +1 -7
  251. package/build/components/color-palette/with-color-context.js.map +1 -1
  252. package/build/components/color-style-selector/index.js +28 -35
  253. package/build/components/color-style-selector/index.js.map +1 -1
  254. package/build/components/colors/utils.js +5 -8
  255. package/build/components/colors/utils.js.map +1 -1
  256. package/build/components/colors/with-colors.js +9 -24
  257. package/build/components/colors/with-colors.js.map +1 -1
  258. package/build/components/colors-gradients/control.js +19 -22
  259. package/build/components/colors-gradients/control.js.map +1 -1
  260. package/build/components/colors-gradients/dropdown.js +32 -39
  261. package/build/components/colors-gradients/dropdown.js.map +1 -1
  262. package/build/components/colors-gradients/panel-color-gradient-settings.js +20 -25
  263. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  264. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  265. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  266. package/build/components/contrast-checker/index.js +12 -13
  267. package/build/components/contrast-checker/index.js.map +1 -1
  268. package/build/components/contrast-checker/index.native.js +16 -18
  269. package/build/components/contrast-checker/index.native.js.map +1 -1
  270. package/build/components/convert-to-group-buttons/index.js +15 -11
  271. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  272. package/build/components/convert-to-group-buttons/index.native.js +86 -3
  273. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  274. package/build/components/convert-to-group-buttons/toolbar.js +6 -12
  275. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  276. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -38
  277. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  278. package/build/components/copy-handler/index.js +4 -7
  279. package/build/components/copy-handler/index.js.map +1 -1
  280. package/build/components/date-format-picker/index.js +12 -16
  281. package/build/components/date-format-picker/index.js.map +1 -1
  282. package/build/components/default-block-appender/index.js +7 -9
  283. package/build/components/default-block-appender/index.js.map +1 -1
  284. package/build/components/default-block-appender/index.native.js +8 -10
  285. package/build/components/default-block-appender/index.native.js.map +1 -1
  286. package/build/components/default-style-picker/index.js +14 -22
  287. package/build/components/default-style-picker/index.js.map +1 -1
  288. package/build/components/duotone/components.js +14 -18
  289. package/build/components/duotone/components.js.map +1 -1
  290. package/build/components/duotone/utils.js +1 -2
  291. package/build/components/duotone/utils.js.map +1 -1
  292. package/build/components/duotone-control/index.js +12 -15
  293. package/build/components/duotone-control/index.js.map +1 -1
  294. package/build/components/editable-text/index.js +5 -6
  295. package/build/components/editable-text/index.js.map +1 -1
  296. package/build/components/editor-styles/index.js +4 -5
  297. package/build/components/editor-styles/index.js.map +1 -1
  298. package/build/components/floating-toolbar/index.native.js +7 -8
  299. package/build/components/floating-toolbar/index.native.js.map +1 -1
  300. package/build/components/font-appearance-control/index.js +19 -26
  301. package/build/components/font-appearance-control/index.js.map +1 -1
  302. package/build/components/font-family/index.js +10 -12
  303. package/build/components/font-family/index.js.map +1 -1
  304. package/build/components/font-sizes/fluid-utils.js +17 -21
  305. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  306. package/build/components/font-sizes/utils.js +6 -12
  307. package/build/components/font-sizes/utils.js.map +1 -1
  308. package/build/components/font-sizes/with-font-sizes.js +11 -30
  309. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  310. package/build/components/global-styles/advanced-panel.js +7 -10
  311. package/build/components/global-styles/advanced-panel.js.map +1 -1
  312. package/build/components/global-styles/border-panel.js +45 -78
  313. package/build/components/global-styles/border-panel.js.map +1 -1
  314. package/build/components/global-styles/color-panel.js +104 -147
  315. package/build/components/global-styles/color-panel.js.map +1 -1
  316. package/build/components/global-styles/color-panel.native.js +25 -42
  317. package/build/components/global-styles/color-panel.native.js.map +1 -1
  318. package/build/components/global-styles/dimensions-panel.js +81 -111
  319. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  320. package/build/components/global-styles/effects-panel.js +58 -72
  321. package/build/components/global-styles/effects-panel.js.map +1 -1
  322. package/build/components/global-styles/filters-panel.js +53 -71
  323. package/build/components/global-styles/filters-panel.js.map +1 -1
  324. package/build/components/global-styles/get-block-css-selector.js +4 -7
  325. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  326. package/build/components/global-styles/hooks.js +22 -37
  327. package/build/components/global-styles/hooks.js.map +1 -1
  328. package/build/components/global-styles/typography-panel.js +69 -125
  329. package/build/components/global-styles/typography-panel.js.map +1 -1
  330. package/build/components/global-styles/typography-utils.js +49 -26
  331. package/build/components/global-styles/typography-utils.js.map +1 -1
  332. package/build/components/global-styles/use-global-styles-output.js +140 -235
  333. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  334. package/build/components/global-styles/utils.js +11 -27
  335. package/build/components/global-styles/utils.js.map +1 -1
  336. package/build/components/gradients/use-gradient.js +6 -7
  337. package/build/components/gradients/use-gradient.js.map +1 -1
  338. package/build/components/height-control/index.js +9 -10
  339. package/build/components/height-control/index.js.map +1 -1
  340. package/build/components/iframe/index.js +52 -80
  341. package/build/components/iframe/index.js.map +1 -1
  342. package/build/components/iframe/use-compatibility-styles.js +29 -20
  343. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  344. package/build/components/image-editor/aspect-ratio-dropdown.js +83 -91
  345. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  346. package/build/components/image-editor/context.js +9 -10
  347. package/build/components/image-editor/context.js.map +1 -1
  348. package/build/components/image-editor/cropper.js +11 -12
  349. package/build/components/image-editor/cropper.js.map +1 -1
  350. package/build/components/image-editor/index.js +12 -13
  351. package/build/components/image-editor/index.js.map +1 -1
  352. package/build/components/image-editor/use-save-image.js +11 -12
  353. package/build/components/image-editor/use-save-image.js.map +1 -1
  354. package/build/components/image-editor/use-transform-image.js +5 -6
  355. package/build/components/image-editor/use-transform-image.js.map +1 -1
  356. package/build/components/image-editor/zoom-dropdown.js +10 -13
  357. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  358. package/build/components/image-size-control/index.js +12 -13
  359. package/build/components/image-size-control/index.js.map +1 -1
  360. package/build/components/inner-blocks/button-block-appender.js +7 -8
  361. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  362. package/build/components/inner-blocks/default-block-appender.js +6 -8
  363. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  364. package/build/components/inner-blocks/index.js +4 -7
  365. package/build/components/inner-blocks/index.js.map +1 -1
  366. package/build/components/inner-blocks/index.native.js +8 -10
  367. package/build/components/inner-blocks/index.native.js.map +1 -1
  368. package/build/components/inner-blocks/use-block-context.js +1 -4
  369. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  370. package/build/components/inner-blocks/use-nested-settings-update.js +15 -9
  371. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  372. package/build/components/inserter/block-patterns-explorer/explorer.js +9 -11
  373. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  374. package/build/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  375. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  376. package/build/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  377. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  378. package/build/components/inserter/block-patterns-tab.js +29 -40
  379. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  380. package/build/components/inserter/block-types-tab.js +7 -9
  381. package/build/components/inserter/block-types-tab.js.map +1 -1
  382. package/build/components/inserter/block-types-tab.native.js +8 -9
  383. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  384. package/build/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  385. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  386. package/build/components/inserter/hooks/use-block-types-state.js +5 -6
  387. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  388. package/build/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  389. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  390. package/build/components/inserter/hooks/use-debounced-input.js +1 -2
  391. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
  392. package/build/components/inserter/hooks/use-insertion-point.js +10 -12
  393. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  394. package/build/components/inserter/index.js +40 -58
  395. package/build/components/inserter/index.js.map +1 -1
  396. package/build/components/inserter/index.native.js +24 -31
  397. package/build/components/inserter/index.native.js.map +1 -1
  398. package/build/components/inserter/library.js +11 -12
  399. package/build/components/inserter/library.js.map +1 -1
  400. package/build/components/inserter/media-tab/hooks.js +2 -5
  401. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  402. package/build/components/inserter/media-tab/media-list.js +6 -7
  403. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  404. package/build/components/inserter/media-tab/media-panel.js +12 -14
  405. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  406. package/build/components/inserter/media-tab/media-preview.js +47 -58
  407. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  408. package/build/components/inserter/media-tab/media-tab.js +24 -28
  409. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  410. package/build/components/inserter/media-tab/utils.js +3 -5
  411. package/build/components/inserter/media-tab/utils.js.map +1 -1
  412. package/build/components/inserter/menu.js +15 -19
  413. package/build/components/inserter/menu.js.map +1 -1
  414. package/build/components/inserter/menu.native.js +27 -31
  415. package/build/components/inserter/menu.native.js.map +1 -1
  416. package/build/components/inserter/mobile-tab-navigation.js +7 -9
  417. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  418. package/build/components/inserter/panel.js +5 -6
  419. package/build/components/inserter/panel.js.map +1 -1
  420. package/build/components/inserter/preview-panel.js +4 -5
  421. package/build/components/inserter/preview-panel.js.map +1 -1
  422. package/build/components/inserter/quick-inserter.js +9 -12
  423. package/build/components/inserter/quick-inserter.js.map +1 -1
  424. package/build/components/inserter/reusable-blocks-tab.js +13 -18
  425. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  426. package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
  427. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  428. package/build/components/inserter/search-items.js +12 -40
  429. package/build/components/inserter/search-items.js.map +1 -1
  430. package/build/components/inserter/search-results.js +34 -22
  431. package/build/components/inserter/search-results.js.map +1 -1
  432. package/build/components/inserter/search-results.native.js +11 -12
  433. package/build/components/inserter/search-results.native.js.map +1 -1
  434. package/build/components/inserter/tabs.js +8 -9
  435. package/build/components/inserter/tabs.js.map +1 -1
  436. package/build/components/inserter/tabs.native.js +37 -55
  437. package/build/components/inserter/tabs.native.js.map +1 -1
  438. package/build/components/inserter/utils.native.js +13 -17
  439. package/build/components/inserter/utils.native.js.map +1 -1
  440. package/build/components/inserter-draggable-blocks/index.js +11 -13
  441. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  442. package/build/components/inserter-list-item/index.js +68 -72
  443. package/build/components/inserter-list-item/index.js.map +1 -1
  444. package/build/components/inserter-listbox/index.js +3 -4
  445. package/build/components/inserter-listbox/index.js.map +1 -1
  446. package/build/components/inserter-listbox/item.js +6 -7
  447. package/build/components/inserter-listbox/item.js.map +1 -1
  448. package/build/components/inspector-controls/block-support-slot-container.js +4 -5
  449. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  450. package/build/components/inspector-controls/block-support-tools-panel.js +6 -8
  451. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  452. package/build/components/inspector-controls/fill.js +13 -24
  453. package/build/components/inspector-controls/fill.js.map +1 -1
  454. package/build/components/inspector-controls/fill.native.js +7 -11
  455. package/build/components/inspector-controls/fill.native.js.map +1 -1
  456. package/build/components/inspector-controls/slot.js +9 -13
  457. package/build/components/inspector-controls/slot.js.map +1 -1
  458. package/build/components/inspector-controls/slot.native.js +6 -10
  459. package/build/components/inspector-controls/slot.native.js.map +1 -1
  460. package/build/components/inspector-controls-tabs/index.js +6 -7
  461. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  462. package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  463. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  464. package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  465. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  466. package/build/components/inspector-controls-tabs/settings-tab.js +3 -6
  467. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  468. package/build/components/inspector-controls-tabs/styles-tab.js +5 -6
  469. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  470. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  471. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  472. package/build/components/inspector-popover-header/index.js +18 -22
  473. package/build/components/inspector-popover-header/index.js.map +1 -1
  474. package/build/components/justify-content-control/ui.js +8 -10
  475. package/build/components/justify-content-control/ui.js.map +1 -1
  476. package/build/components/letter-spacing-control/index.js +6 -7
  477. package/build/components/letter-spacing-control/index.js.map +1 -1
  478. package/build/components/line-height-control/index.js +13 -18
  479. package/build/components/line-height-control/index.js.map +1 -1
  480. package/build/components/line-height-control/index.native.js +4 -5
  481. package/build/components/line-height-control/index.native.js.map +1 -1
  482. package/build/components/link-control/index.js +84 -63
  483. package/build/components/link-control/index.js.map +1 -1
  484. package/build/components/link-control/is-url-like.js +32 -2
  485. package/build/components/link-control/is-url-like.js.map +1 -1
  486. package/build/components/link-control/link-preview.js +24 -27
  487. package/build/components/link-control/link-preview.js.map +1 -1
  488. package/build/components/link-control/search-create-button.js +7 -9
  489. package/build/components/link-control/search-create-button.js.map +1 -1
  490. package/build/components/link-control/search-input.js +22 -27
  491. package/build/components/link-control/search-input.js.map +1 -1
  492. package/build/components/link-control/search-item.js +13 -15
  493. package/build/components/link-control/search-item.js.map +1 -1
  494. package/build/components/link-control/search-results.js +22 -28
  495. package/build/components/link-control/search-results.js.map +1 -1
  496. package/build/components/link-control/settings-drawer.js +6 -35
  497. package/build/components/link-control/settings-drawer.js.map +1 -1
  498. package/build/components/link-control/settings.js +6 -8
  499. package/build/components/link-control/settings.js.map +1 -1
  500. package/build/components/link-control/use-internal-value.js +54 -0
  501. package/build/components/link-control/use-internal-value.js.map +1 -0
  502. package/build/components/link-control/use-rich-url-data.js +1 -1
  503. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  504. package/build/components/link-control/use-search-handler.js +10 -23
  505. package/build/components/link-control/use-search-handler.js.map +1 -1
  506. package/build/components/list-view/appender.js +18 -13
  507. package/build/components/list-view/appender.js.map +1 -1
  508. package/build/components/list-view/aria-referenced-text.js +44 -0
  509. package/build/components/list-view/aria-referenced-text.js.map +1 -0
  510. package/build/components/list-view/block-contents.js +40 -38
  511. package/build/components/list-view/block-contents.js.map +1 -1
  512. package/build/components/list-view/block-select-button.js +67 -21
  513. package/build/components/list-view/block-select-button.js.map +1 -1
  514. package/build/components/list-view/block.js +134 -120
  515. package/build/components/list-view/block.js.map +1 -1
  516. package/build/components/list-view/branch.js +6 -8
  517. package/build/components/list-view/branch.js.map +1 -1
  518. package/build/components/list-view/drop-indicator.js +4 -5
  519. package/build/components/list-view/drop-indicator.js.map +1 -1
  520. package/build/components/list-view/expander.js +3 -4
  521. package/build/components/list-view/expander.js.map +1 -1
  522. package/build/components/list-view/index.js +56 -46
  523. package/build/components/list-view/index.js.map +1 -1
  524. package/build/components/list-view/leaf.js +10 -11
  525. package/build/components/list-view/leaf.js.map +1 -1
  526. package/build/components/list-view/use-block-selection.js +4 -6
  527. package/build/components/list-view/use-block-selection.js.map +1 -1
  528. package/build/components/list-view/use-list-view-client-ids.js +29 -8
  529. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  530. package/build/components/list-view/use-list-view-drop-zone.js +25 -13
  531. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  532. package/build/components/list-view/use-list-view-expand-selected-item.js +4 -5
  533. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  534. package/build/components/list-view/use-list-view-scroll-into-view.js +5 -6
  535. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  536. package/build/components/media-placeholder/index.js +71 -92
  537. package/build/components/media-placeholder/index.js.map +1 -1
  538. package/build/components/media-placeholder/index.native.js +5 -6
  539. package/build/components/media-placeholder/index.native.js.map +1 -1
  540. package/build/components/media-replace-flow/index.js +94 -107
  541. package/build/components/media-replace-flow/index.js.map +1 -1
  542. package/build/components/media-upload/check.js +4 -5
  543. package/build/components/media-upload/check.js.map +1 -1
  544. package/build/components/media-upload/index.native.js +1 -1
  545. package/build/components/media-upload/index.native.js.map +1 -1
  546. package/build/components/multi-selection-inspector/index.js +3 -4
  547. package/build/components/multi-selection-inspector/index.js.map +1 -1
  548. package/build/components/navigable-toolbar/index.js +16 -15
  549. package/build/components/navigable-toolbar/index.js.map +1 -1
  550. package/build/components/observe-typing/index.js +3 -4
  551. package/build/components/observe-typing/index.js.map +1 -1
  552. package/build/components/panel-color-settings/index.js +4 -5
  553. package/build/components/panel-color-settings/index.js.map +1 -1
  554. package/build/components/plain-text/index.js +4 -6
  555. package/build/components/plain-text/index.js.map +1 -1
  556. package/build/components/plain-text/index.native.js +8 -14
  557. package/build/components/plain-text/index.native.js.map +1 -1
  558. package/build/components/preview-options/index.js +8 -9
  559. package/build/components/preview-options/index.js.map +1 -1
  560. package/build/components/provider/block-refs-provider.js +3 -4
  561. package/build/components/provider/block-refs-provider.js.map +1 -1
  562. package/build/components/provider/use-block-sync.js +7 -8
  563. package/build/components/provider/use-block-sync.js.map +1 -1
  564. package/build/components/provider/with-registry-provider.js +5 -7
  565. package/build/components/provider/with-registry-provider.js.map +1 -1
  566. package/build/components/publish-date-time-picker/index.js +6 -9
  567. package/build/components/publish-date-time-picker/index.js.map +1 -1
  568. package/build/components/recursion-provider/index.js +7 -11
  569. package/build/components/recursion-provider/index.js.map +1 -1
  570. package/build/components/resizable-box-popover/index.js +5 -6
  571. package/build/components/resizable-box-popover/index.js.map +1 -1
  572. package/build/components/responsive-block-control/label.js +5 -6
  573. package/build/components/responsive-block-control/label.js.map +1 -1
  574. package/build/components/rich-text/embed-handler-picker.native.js +6 -10
  575. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  576. package/build/components/rich-text/format-edit.js +7 -8
  577. package/build/components/rich-text/format-edit.js.map +1 -1
  578. package/build/components/rich-text/format-toolbar/index.js +9 -18
  579. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  580. package/build/components/rich-text/format-toolbar-container.js +13 -16
  581. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  582. package/build/components/rich-text/index.js +43 -47
  583. package/build/components/rich-text/index.js.map +1 -1
  584. package/build/components/rich-text/index.native.js +130 -157
  585. package/build/components/rich-text/index.native.js.map +1 -1
  586. package/build/components/rich-text/input-event.js +4 -5
  587. package/build/components/rich-text/input-event.js.map +1 -1
  588. package/build/components/rich-text/shortcut.js +5 -6
  589. package/build/components/rich-text/shortcut.js.map +1 -1
  590. package/build/components/rich-text/split-value.js +8 -10
  591. package/build/components/rich-text/split-value.js.map +1 -1
  592. package/build/components/rich-text/toolbar-button.js +6 -7
  593. package/build/components/rich-text/toolbar-button.js.map +1 -1
  594. package/build/components/rich-text/use-before-input-rules.js +1 -4
  595. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  596. package/build/components/rich-text/use-enter.js +3 -6
  597. package/build/components/rich-text/use-enter.js.map +1 -1
  598. package/build/components/rich-text/use-firefox-compat.js +32 -1
  599. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  600. package/build/components/rich-text/use-format-types.js +11 -17
  601. package/build/components/rich-text/use-format-types.js.map +1 -1
  602. package/build/components/rich-text/use-input-rules.js +9 -15
  603. package/build/components/rich-text/use-input-rules.js.map +1 -1
  604. package/build/components/rich-text/use-mark-persistent.js +4 -5
  605. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  606. package/build/components/rich-text/use-paste-handler.js +5 -7
  607. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  608. package/build/components/rich-text/utils.js +5 -7
  609. package/build/components/rich-text/utils.js.map +1 -1
  610. package/build/components/skip-to-selected-block/index.js +3 -4
  611. package/build/components/skip-to-selected-block/index.js.map +1 -1
  612. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +38 -0
  613. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  614. package/build/components/spacing-sizes-control/index.js +60 -62
  615. package/build/components/spacing-sizes-control/index.js.map +1 -1
  616. package/build/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  617. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  618. package/build/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +22 -22
  619. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  620. package/build/components/spacing-sizes-control/input-controls/single.js +51 -0
  621. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  622. package/build/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +51 -69
  623. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  624. package/build/components/spacing-sizes-control/sides-dropdown/index.js +84 -0
  625. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  626. package/build/components/spacing-sizes-control/utils.js +213 -31
  627. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  628. package/build/components/text-decoration-control/index.js +5 -6
  629. package/build/components/text-decoration-control/index.js.map +1 -1
  630. package/build/components/text-transform-control/index.js +5 -6
  631. package/build/components/text-transform-control/index.js.map +1 -1
  632. package/build/components/tool-selector/index.js +13 -16
  633. package/build/components/tool-selector/index.js.map +1 -1
  634. package/build/components/typewriter/index.js +6 -9
  635. package/build/components/typewriter/index.js.map +1 -1
  636. package/build/components/ungroup-button/index.native.js +11 -16
  637. package/build/components/ungroup-button/index.native.js.map +1 -1
  638. package/build/components/unit-control/index.js +4 -5
  639. package/build/components/unit-control/index.js.map +1 -1
  640. package/build/components/url-input/index.js +15 -23
  641. package/build/components/url-input/index.js.map +1 -1
  642. package/build/components/url-input/index.native.js +6 -8
  643. package/build/components/url-input/index.native.js.map +1 -1
  644. package/build/components/url-popover/image-url-input-ui.js +12 -15
  645. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  646. package/build/components/url-popover/index.js +12 -14
  647. package/build/components/url-popover/index.js.map +1 -1
  648. package/build/components/url-popover/link-editor.js +7 -8
  649. package/build/components/url-popover/link-editor.js.map +1 -1
  650. package/build/components/url-popover/link-viewer-url.js +5 -6
  651. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  652. package/build/components/url-popover/link-viewer.js +8 -9
  653. package/build/components/url-popover/link-viewer.js.map +1 -1
  654. package/build/components/use-block-display-information/index.js +2 -2
  655. package/build/components/use-block-display-information/index.js.map +1 -1
  656. package/build/components/use-block-drop-zone/index.js +41 -38
  657. package/build/components/use-block-drop-zone/index.js.map +1 -1
  658. package/build/components/use-block-drop-zone/index.native.js +8 -11
  659. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  660. package/build/components/use-moving-animation/index.js +9 -12
  661. package/build/components/use-moving-animation/index.js.map +1 -1
  662. package/build/components/use-on-block-drop/index.js +2 -6
  663. package/build/components/use-on-block-drop/index.js.map +1 -1
  664. package/build/components/use-on-block-drop/index.native.js +8 -10
  665. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  666. package/build/components/use-paste-styles/index.js +2 -6
  667. package/build/components/use-paste-styles/index.js.map +1 -1
  668. package/build/components/use-resize-canvas/index.js +8 -1
  669. package/build/components/use-resize-canvas/index.js.map +1 -1
  670. package/build/components/warning/index.js +6 -7
  671. package/build/components/warning/index.js.map +1 -1
  672. package/build/components/warning/index.native.js +9 -10
  673. package/build/components/warning/index.native.js.map +1 -1
  674. package/build/components/writing-flow/index.js +4 -5
  675. package/build/components/writing-flow/index.js.map +1 -1
  676. package/build/components/writing-flow/use-arrow-nav.js +13 -7
  677. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  678. package/build/components/writing-flow/use-drag-selection.js +4 -6
  679. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  680. package/build/components/writing-flow/use-tab-nav.js +9 -6
  681. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  682. package/build/hooks/align.js +11 -22
  683. package/build/hooks/align.js.map +1 -1
  684. package/build/hooks/anchor.js +6 -3
  685. package/build/hooks/anchor.js.map +1 -1
  686. package/build/hooks/aria-label.js +1 -3
  687. package/build/hooks/aria-label.js.map +1 -1
  688. package/build/hooks/behaviors.js +148 -0
  689. package/build/hooks/behaviors.js.map +1 -0
  690. package/build/hooks/border.js +25 -38
  691. package/build/hooks/border.js.map +1 -1
  692. package/build/hooks/color.js +22 -37
  693. package/build/hooks/color.js.map +1 -1
  694. package/build/hooks/content-lock-ui.js +26 -30
  695. package/build/hooks/content-lock-ui.js.map +1 -1
  696. package/build/hooks/contrast-checker.js +4 -7
  697. package/build/hooks/contrast-checker.js.map +1 -1
  698. package/build/hooks/custom-class-name.js +5 -4
  699. package/build/hooks/custom-class-name.js.map +1 -1
  700. package/build/hooks/dimensions.js +6 -39
  701. package/build/hooks/dimensions.js.map +1 -1
  702. package/build/hooks/duotone.js +36 -52
  703. package/build/hooks/duotone.js.map +1 -1
  704. package/build/hooks/font-family.js +5 -6
  705. package/build/hooks/font-family.js.map +1 -1
  706. package/build/hooks/font-size.js +14 -21
  707. package/build/hooks/font-size.js.map +1 -1
  708. package/build/hooks/gap.js +5 -6
  709. package/build/hooks/gap.js.map +1 -1
  710. package/build/hooks/index.js +2 -0
  711. package/build/hooks/index.js.map +1 -1
  712. package/build/hooks/layout.js +50 -68
  713. package/build/hooks/layout.js.map +1 -1
  714. package/build/hooks/line-height.js +5 -8
  715. package/build/hooks/line-height.js.map +1 -1
  716. package/build/hooks/lock.js +2 -2
  717. package/build/hooks/lock.js.map +1 -1
  718. package/build/hooks/margin.js +6 -9
  719. package/build/hooks/margin.js.map +1 -1
  720. package/build/hooks/metadata-name.js +4 -5
  721. package/build/hooks/metadata-name.js.map +1 -1
  722. package/build/hooks/metadata.js +3 -7
  723. package/build/hooks/metadata.js.map +1 -1
  724. package/build/hooks/padding.js +6 -9
  725. package/build/hooks/padding.js.map +1 -1
  726. package/build/hooks/position.js +26 -40
  727. package/build/hooks/position.js.map +1 -1
  728. package/build/hooks/settings.js +1 -3
  729. package/build/hooks/settings.js.map +1 -1
  730. package/build/hooks/style.js +12 -19
  731. package/build/hooks/style.js.map +1 -1
  732. package/build/hooks/supports.js +3 -5
  733. package/build/hooks/supports.js.map +1 -1
  734. package/build/hooks/typography.js +18 -27
  735. package/build/hooks/typography.js.map +1 -1
  736. package/build/hooks/typography.native.js +1 -2
  737. package/build/hooks/typography.native.js.map +1 -1
  738. package/build/hooks/use-border-props.js +1 -3
  739. package/build/hooks/use-border-props.js.map +1 -1
  740. package/build/hooks/use-color-props.js +6 -8
  741. package/build/hooks/use-color-props.js.map +1 -1
  742. package/build/hooks/use-editor-wrapper-styles.native.js +34 -39
  743. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  744. package/build/hooks/use-spacing-props.js +1 -1
  745. package/build/hooks/use-spacing-props.js.map +1 -1
  746. package/build/hooks/use-typography-props.js +8 -12
  747. package/build/hooks/use-typography-props.js.map +1 -1
  748. package/build/hooks/utils.js +6 -18
  749. package/build/hooks/utils.js.map +1 -1
  750. package/build/layouts/constrained.js +22 -27
  751. package/build/layouts/constrained.js.map +1 -1
  752. package/build/layouts/flex.js +43 -54
  753. package/build/layouts/flex.js.map +1 -1
  754. package/build/layouts/flow.js +10 -13
  755. package/build/layouts/flow.js.map +1 -1
  756. package/build/layouts/grid.js +45 -25
  757. package/build/layouts/grid.js.map +1 -1
  758. package/build/layouts/index.js +1 -2
  759. package/build/layouts/index.js.map +1 -1
  760. package/build/layouts/utils.js +3 -9
  761. package/build/layouts/utils.js.map +1 -1
  762. package/build/private-apis.js +4 -7
  763. package/build/private-apis.js.map +1 -1
  764. package/build/store/actions.js +251 -334
  765. package/build/store/actions.js.map +1 -1
  766. package/build/store/array.js +1 -2
  767. package/build/store/array.js.map +1 -1
  768. package/build/store/private-actions.js +44 -2
  769. package/build/store/private-actions.js.map +1 -1
  770. package/build/store/private-selectors.js +108 -3
  771. package/build/store/private-selectors.js.map +1 -1
  772. package/build/store/reducer.js +99 -166
  773. package/build/store/reducer.js.map +1 -1
  774. package/build/store/selectors.js +171 -231
  775. package/build/store/selectors.js.map +1 -1
  776. package/build/utils/block-variation-transforms.js +4 -7
  777. package/build/utils/block-variation-transforms.js.map +1 -1
  778. package/build/utils/math.js +1 -2
  779. package/build/utils/math.js.map +1 -1
  780. package/build/utils/object.js +1 -4
  781. package/build/utils/object.js.map +1 -1
  782. package/build/utils/order-inserter-block-items.js +39 -0
  783. package/build/utils/order-inserter-block-items.js.map +1 -0
  784. package/build/utils/parse-css-unit-to-px.js +3 -6
  785. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  786. package/build/utils/pasting.js +5 -8
  787. package/build/utils/pasting.js.map +1 -1
  788. package/build/utils/pre-parse-patterns.js +1 -1
  789. package/build/utils/pre-parse-patterns.js.map +1 -1
  790. package/build/utils/sorting.js +1 -2
  791. package/build/utils/sorting.js.map +1 -1
  792. package/build/utils/transform-styles/index.js +5 -7
  793. package/build/utils/transform-styles/index.js.map +1 -1
  794. package/build/utils/transform-styles/transforms/wrap.js +28 -31
  795. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  796. package/build-module/autocompleters/block.js +10 -5
  797. package/build-module/autocompleters/block.js.map +1 -1
  798. package/build-module/components/alignment-control/ui.js +9 -11
  799. package/build-module/components/alignment-control/ui.js.map +1 -1
  800. package/build-module/components/autocomplete/index.js +3 -4
  801. package/build-module/components/autocomplete/index.js.map +1 -1
  802. package/build-module/components/block-actions/index.js +8 -12
  803. package/build-module/components/block-actions/index.js.map +1 -1
  804. package/build-module/components/block-alignment-control/ui.js +17 -21
  805. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  806. package/build-module/components/block-alignment-control/ui.native.js +14 -17
  807. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  808. package/build-module/components/block-alignment-control/use-available-alignments.js +5 -10
  809. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  810. package/build-module/components/block-alignment-matrix-control/index.js +4 -6
  811. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  812. package/build-module/components/block-breadcrumb/index.js +8 -7
  813. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  814. package/build-module/components/block-caption/index.native.js +29 -34
  815. package/build-module/components/block-caption/index.native.js.map +1 -1
  816. package/build-module/components/block-card/index.js +7 -9
  817. package/build-module/components/block-card/index.js.map +1 -1
  818. package/build-module/components/block-compare/block-view.js +8 -9
  819. package/build-module/components/block-compare/block-view.js.map +1 -1
  820. package/build-module/components/block-compare/index.js +7 -9
  821. package/build-module/components/block-compare/index.js.map +1 -1
  822. package/build-module/components/block-context/index.js +4 -5
  823. package/build-module/components/block-context/index.js.map +1 -1
  824. package/build-module/components/block-controls/fill.js +17 -23
  825. package/build-module/components/block-controls/fill.js.map +1 -1
  826. package/build-module/components/block-controls/hook.js +1 -3
  827. package/build-module/components/block-controls/hook.js.map +1 -1
  828. package/build-module/components/block-controls/slot.js +29 -21
  829. package/build-module/components/block-controls/slot.js.map +1 -1
  830. package/build-module/components/block-controls/slot.native.js +8 -18
  831. package/build-module/components/block-controls/slot.native.js.map +1 -1
  832. package/build-module/components/block-draggable/draggable-chip.js +5 -7
  833. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  834. package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
  835. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  836. package/build-module/components/block-draggable/dropping-insertion-point.native.js +6 -7
  837. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  838. package/build-module/components/block-draggable/index.js +16 -17
  839. package/build-module/components/block-draggable/index.js.map +1 -1
  840. package/build-module/components/block-draggable/index.native.js +43 -58
  841. package/build-module/components/block-draggable/index.native.js.map +1 -1
  842. package/build-module/components/block-edit/edit.js +1 -4
  843. package/build-module/components/block-edit/edit.js.map +1 -1
  844. package/build-module/components/block-edit/edit.native.js +1 -4
  845. package/build-module/components/block-edit/edit.native.js.map +1 -1
  846. package/build-module/components/block-edit-visually-button/index.js +3 -4
  847. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  848. package/build-module/components/block-editing-mode/index.js +72 -0
  849. package/build-module/components/block-editing-mode/index.js.map +1 -0
  850. package/build-module/components/block-full-height-alignment-control/index.js +6 -7
  851. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  852. package/build-module/components/block-icon/index.js +7 -11
  853. package/build-module/components/block-icon/index.js.map +1 -1
  854. package/build-module/components/block-icon/index.native.js +9 -13
  855. package/build-module/components/block-icon/index.native.js.map +1 -1
  856. package/build-module/components/block-inspector/index.js +36 -46
  857. package/build-module/components/block-inspector/index.js.map +1 -1
  858. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  859. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  860. package/build-module/components/block-list/block-html.js +3 -4
  861. package/build-module/components/block-list/block-html.js.map +1 -1
  862. package/build-module/components/block-list/block-invalid-warning.js +3 -4
  863. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  864. package/build-module/components/block-list/block-invalid-warning.native.js +10 -15
  865. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  866. package/build-module/components/block-list/block-list-block-context.js +6 -0
  867. package/build-module/components/block-list/block-list-block-context.js.map +1 -0
  868. package/build-module/components/block-list/block-list-context.native.js +5 -11
  869. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  870. package/build-module/components/block-list/block-list-item-cell.native.js +5 -6
  871. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  872. package/build-module/components/block-list/block-list-item.native.js +17 -18
  873. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  874. package/build-module/components/block-list/block-outline.native.js +8 -9
  875. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  876. package/build-module/components/block-list/block-selection-button.native.js +10 -12
  877. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  878. package/build-module/components/block-list/block.js +65 -80
  879. package/build-module/components/block-list/block.js.map +1 -1
  880. package/build-module/components/block-list/block.native.js +69 -90
  881. package/build-module/components/block-list/block.native.js.map +1 -1
  882. package/build-module/components/block-list/index.js +12 -15
  883. package/build-module/components/block-list/index.js.map +1 -1
  884. package/build-module/components/block-list/index.native.js +144 -155
  885. package/build-module/components/block-list/index.native.js.map +1 -1
  886. package/build-module/components/block-list/insertion-point.native.js +4 -5
  887. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  888. package/build-module/components/block-list/layout.js +6 -9
  889. package/build-module/components/block-list/layout.js.map +1 -1
  890. package/build-module/components/block-list/subdirectory-icon.js +10 -13
  891. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  892. package/build-module/components/block-list/use-block-props/index.js +15 -12
  893. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  894. package/build-module/components/block-list/use-block-props/index.native.js +1 -2
  895. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  896. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  897. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  898. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  899. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  900. package/build-module/components/block-list/use-in-between-inserter.js +7 -8
  901. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  902. package/build-module/components/block-list-appender/index.js +29 -15
  903. package/build-module/components/block-list-appender/index.js.map +1 -1
  904. package/build-module/components/block-list-appender/index.native.js +9 -11
  905. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  906. package/build-module/components/block-lock/menu-item.js +3 -4
  907. package/build-module/components/block-lock/menu-item.js.map +1 -1
  908. package/build-module/components/block-lock/modal.js +6 -9
  909. package/build-module/components/block-lock/modal.js.map +1 -1
  910. package/build-module/components/block-lock/toolbar.js +5 -10
  911. package/build-module/components/block-lock/toolbar.js.map +1 -1
  912. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +66 -70
  913. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  914. package/build-module/components/block-mobile-toolbar/index.native.js +26 -34
  915. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  916. package/build-module/components/block-mover/button.js +6 -7
  917. package/build-module/components/block-mover/button.js.map +1 -1
  918. package/build-module/components/block-mover/index.js +5 -8
  919. package/build-module/components/block-mover/index.js.map +1 -1
  920. package/build-module/components/block-mover/index.native.js +23 -46
  921. package/build-module/components/block-mover/index.native.js.map +1 -1
  922. package/build-module/components/block-mover/mover-description.native.js +7 -10
  923. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  924. package/build-module/components/block-navigation/dropdown.js +20 -25
  925. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  926. package/build-module/components/block-parent-selector/index.js +2 -2
  927. package/build-module/components/block-parent-selector/index.js.map +1 -1
  928. package/build-module/components/block-pattern-setup/index.js +27 -31
  929. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  930. package/build-module/components/block-pattern-setup/setup-toolbar.js +35 -42
  931. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  932. package/build-module/components/block-patterns-list/index.js +71 -78
  933. package/build-module/components/block-patterns-list/index.js.map +1 -1
  934. package/build-module/components/block-popover/drop-zone.js +4 -5
  935. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  936. package/build-module/components/block-popover/inbetween.js +10 -15
  937. package/build-module/components/block-popover/inbetween.js.map +1 -1
  938. package/build-module/components/block-popover/index.js +14 -15
  939. package/build-module/components/block-popover/index.js.map +1 -1
  940. package/build-module/components/block-preview/auto.js +6 -8
  941. package/build-module/components/block-preview/auto.js.map +1 -1
  942. package/build-module/components/block-preview/index.js +15 -18
  943. package/build-module/components/block-preview/index.js.map +1 -1
  944. package/build-module/components/block-settings/button.native.js +7 -10
  945. package/build-module/components/block-settings/button.native.js.map +1 -1
  946. package/build-module/components/block-settings-menu/block-convert-button.js +5 -7
  947. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  948. package/build-module/components/block-settings-menu/block-html-convert-button.js +10 -14
  949. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  950. package/build-module/components/block-settings-menu/block-mode-toggle.js +19 -25
  951. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  952. package/build-module/components/block-settings-menu/block-settings-dropdown.js +135 -113
  953. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  954. package/build-module/components/block-settings-menu/index.js +4 -5
  955. package/build-module/components/block-settings-menu/index.js.map +1 -1
  956. package/build-module/components/block-settings-menu-controls/index.js +14 -16
  957. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  958. package/build-module/components/block-styles/index.js +6 -7
  959. package/build-module/components/block-styles/index.js.map +1 -1
  960. package/build-module/components/block-styles/index.native.js +5 -7
  961. package/build-module/components/block-styles/index.native.js.map +1 -1
  962. package/build-module/components/block-styles/menu-items.js +4 -5
  963. package/build-module/components/block-styles/menu-items.js.map +1 -1
  964. package/build-module/components/block-styles/preview-panel.js +8 -12
  965. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  966. package/build-module/components/block-styles/preview.native.js +6 -7
  967. package/build-module/components/block-styles/preview.native.js.map +1 -1
  968. package/build-module/components/block-styles/use-styles-for-block.js +7 -9
  969. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  970. package/build-module/components/block-styles/utils.js +4 -7
  971. package/build-module/components/block-styles/utils.js.map +1 -1
  972. package/build-module/components/block-switcher/block-styles-menu.js +4 -5
  973. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  974. package/build-module/components/block-switcher/block-transformations-menu.js +28 -26
  975. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  976. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -10
  977. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  978. package/build-module/components/block-switcher/block-variation-transformations.js +99 -0
  979. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
  980. package/build-module/components/block-switcher/index.js +63 -55
  981. package/build-module/components/block-switcher/index.js.map +1 -1
  982. package/build-module/components/block-switcher/pattern-transformations-menu.js +21 -25
  983. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  984. package/build-module/components/block-switcher/preview-block-popover.js +3 -4
  985. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  986. package/build-module/components/block-switcher/utils.js +2 -3
  987. package/build-module/components/block-switcher/utils.js.map +1 -1
  988. package/build-module/components/block-title/index.js +5 -6
  989. package/build-module/components/block-title/index.js.map +1 -1
  990. package/build-module/components/block-title/use-block-display-title.js +5 -6
  991. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  992. package/build-module/components/block-toolbar/index.js +12 -12
  993. package/build-module/components/block-toolbar/index.js.map +1 -1
  994. package/build-module/components/block-toolbar/utils.js +14 -16
  995. package/build-module/components/block-toolbar/utils.js.map +1 -1
  996. package/build-module/components/block-tools/back-compat.js +3 -4
  997. package/build-module/components/block-tools/back-compat.js.map +1 -1
  998. package/build-module/components/block-tools/block-contextual-toolbar.js +9 -9
  999. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  1000. package/build-module/components/block-tools/block-selection-button.js +6 -9
  1001. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  1002. package/build-module/components/block-tools/index.js +6 -7
  1003. package/build-module/components/block-tools/index.js.map +1 -1
  1004. package/build-module/components/block-tools/insertion-point.js +17 -14
  1005. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  1006. package/build-module/components/block-tools/selected-block-popover.js +19 -20
  1007. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  1008. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  1009. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  1010. package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -4
  1011. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  1012. package/build-module/components/block-types-list/index.js +8 -9
  1013. package/build-module/components/block-types-list/index.js.map +1 -1
  1014. package/build-module/components/block-types-list/index.native.js +22 -27
  1015. package/build-module/components/block-types-list/index.native.js.map +1 -1
  1016. package/build-module/components/block-variation-picker/index.js +8 -9
  1017. package/build-module/components/block-variation-picker/index.js.map +1 -1
  1018. package/build-module/components/block-variation-picker/index.native.js +7 -9
  1019. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  1020. package/build-module/components/block-variation-transforms/index.js +30 -41
  1021. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  1022. package/build-module/components/block-vertical-alignment-control/ui.js +7 -9
  1023. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  1024. package/build-module/components/border-radius-control/all-input-control.js +7 -8
  1025. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  1026. package/build-module/components/border-radius-control/index.js +9 -10
  1027. package/build-module/components/border-radius-control/index.js.map +1 -1
  1028. package/build-module/components/border-radius-control/input-controls.js +8 -11
  1029. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  1030. package/build-module/components/border-radius-control/linked-button.js +4 -5
  1031. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  1032. package/build-module/components/border-radius-control/utils.js +3 -7
  1033. package/build-module/components/border-radius-control/utils.js.map +1 -1
  1034. package/build-module/components/button-block-appender/index.js +13 -15
  1035. package/build-module/components/button-block-appender/index.js.map +1 -1
  1036. package/build-module/components/button-block-appender/index.native.js +25 -29
  1037. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  1038. package/build-module/components/caption/index.native.js +40 -43
  1039. package/build-module/components/caption/index.native.js.map +1 -1
  1040. package/build-module/components/child-layout-control/index.js +5 -6
  1041. package/build-module/components/child-layout-control/index.js.map +1 -1
  1042. package/build-module/components/color-palette/control.js +5 -6
  1043. package/build-module/components/color-palette/control.js.map +1 -1
  1044. package/build-module/components/color-palette/with-color-context.js +1 -6
  1045. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  1046. package/build-module/components/color-style-selector/index.js +28 -35
  1047. package/build-module/components/color-style-selector/index.js.map +1 -1
  1048. package/build-module/components/colors/utils.js +5 -8
  1049. package/build-module/components/colors/utils.js.map +1 -1
  1050. package/build-module/components/colors/with-colors.js +9 -24
  1051. package/build-module/components/colors/with-colors.js.map +1 -1
  1052. package/build-module/components/colors-gradients/control.js +19 -21
  1053. package/build-module/components/colors-gradients/control.js.map +1 -1
  1054. package/build-module/components/colors-gradients/dropdown.js +32 -39
  1055. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  1056. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +20 -24
  1057. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  1058. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  1059. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  1060. package/build-module/components/contrast-checker/index.js +12 -13
  1061. package/build-module/components/contrast-checker/index.js.map +1 -1
  1062. package/build-module/components/contrast-checker/index.native.js +16 -18
  1063. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  1064. package/build-module/components/convert-to-group-buttons/index.js +15 -11
  1065. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  1066. package/build-module/components/convert-to-group-buttons/index.native.js +75 -1
  1067. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  1068. package/build-module/components/convert-to-group-buttons/toolbar.js +6 -12
  1069. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  1070. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +21 -37
  1071. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  1072. package/build-module/components/copy-handler/index.js +4 -7
  1073. package/build-module/components/copy-handler/index.js.map +1 -1
  1074. package/build-module/components/date-format-picker/index.js +12 -16
  1075. package/build-module/components/date-format-picker/index.js.map +1 -1
  1076. package/build-module/components/default-block-appender/index.js +7 -9
  1077. package/build-module/components/default-block-appender/index.js.map +1 -1
  1078. package/build-module/components/default-block-appender/index.native.js +8 -10
  1079. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  1080. package/build-module/components/default-style-picker/index.js +14 -22
  1081. package/build-module/components/default-style-picker/index.js.map +1 -1
  1082. package/build-module/components/duotone/components.js +14 -18
  1083. package/build-module/components/duotone/components.js.map +1 -1
  1084. package/build-module/components/duotone/utils.js +1 -2
  1085. package/build-module/components/duotone/utils.js.map +1 -1
  1086. package/build-module/components/duotone-control/index.js +12 -15
  1087. package/build-module/components/duotone-control/index.js.map +1 -1
  1088. package/build-module/components/editable-text/index.js +5 -6
  1089. package/build-module/components/editable-text/index.js.map +1 -1
  1090. package/build-module/components/editor-styles/index.js +4 -5
  1091. package/build-module/components/editor-styles/index.js.map +1 -1
  1092. package/build-module/components/floating-toolbar/index.native.js +7 -8
  1093. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  1094. package/build-module/components/font-appearance-control/index.js +19 -26
  1095. package/build-module/components/font-appearance-control/index.js.map +1 -1
  1096. package/build-module/components/font-family/index.js +10 -12
  1097. package/build-module/components/font-family/index.js.map +1 -1
  1098. package/build-module/components/font-sizes/fluid-utils.js +17 -21
  1099. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  1100. package/build-module/components/font-sizes/utils.js +6 -12
  1101. package/build-module/components/font-sizes/utils.js.map +1 -1
  1102. package/build-module/components/font-sizes/with-font-sizes.js +11 -30
  1103. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  1104. package/build-module/components/global-styles/advanced-panel.js +7 -10
  1105. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  1106. package/build-module/components/global-styles/border-panel.js +45 -78
  1107. package/build-module/components/global-styles/border-panel.js.map +1 -1
  1108. package/build-module/components/global-styles/color-panel.js +104 -147
  1109. package/build-module/components/global-styles/color-panel.js.map +1 -1
  1110. package/build-module/components/global-styles/color-panel.native.js +25 -42
  1111. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  1112. package/build-module/components/global-styles/dimensions-panel.js +81 -111
  1113. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  1114. package/build-module/components/global-styles/effects-panel.js +58 -72
  1115. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  1116. package/build-module/components/global-styles/filters-panel.js +53 -71
  1117. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  1118. package/build-module/components/global-styles/get-block-css-selector.js +5 -8
  1119. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  1120. package/build-module/components/global-styles/hooks.js +22 -37
  1121. package/build-module/components/global-styles/hooks.js.map +1 -1
  1122. package/build-module/components/global-styles/typography-panel.js +69 -125
  1123. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  1124. package/build-module/components/global-styles/typography-utils.js +48 -26
  1125. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  1126. package/build-module/components/global-styles/use-global-styles-output.js +142 -237
  1127. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  1128. package/build-module/components/global-styles/utils.js +12 -28
  1129. package/build-module/components/global-styles/utils.js.map +1 -1
  1130. package/build-module/components/gradients/use-gradient.js +6 -7
  1131. package/build-module/components/gradients/use-gradient.js.map +1 -1
  1132. package/build-module/components/height-control/index.js +9 -10
  1133. package/build-module/components/height-control/index.js.map +1 -1
  1134. package/build-module/components/iframe/index.js +53 -81
  1135. package/build-module/components/iframe/index.js.map +1 -1
  1136. package/build-module/components/iframe/use-compatibility-styles.js +29 -20
  1137. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  1138. package/build-module/components/image-editor/aspect-ratio-dropdown.js +83 -91
  1139. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  1140. package/build-module/components/image-editor/context.js +9 -10
  1141. package/build-module/components/image-editor/context.js.map +1 -1
  1142. package/build-module/components/image-editor/cropper.js +11 -12
  1143. package/build-module/components/image-editor/cropper.js.map +1 -1
  1144. package/build-module/components/image-editor/index.js +12 -13
  1145. package/build-module/components/image-editor/index.js.map +1 -1
  1146. package/build-module/components/image-editor/use-save-image.js +11 -12
  1147. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  1148. package/build-module/components/image-editor/use-transform-image.js +5 -6
  1149. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  1150. package/build-module/components/image-editor/zoom-dropdown.js +10 -13
  1151. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  1152. package/build-module/components/image-size-control/index.js +12 -13
  1153. package/build-module/components/image-size-control/index.js.map +1 -1
  1154. package/build-module/components/inner-blocks/button-block-appender.js +7 -8
  1155. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1156. package/build-module/components/inner-blocks/default-block-appender.js +6 -8
  1157. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1158. package/build-module/components/inner-blocks/index.js +4 -7
  1159. package/build-module/components/inner-blocks/index.js.map +1 -1
  1160. package/build-module/components/inner-blocks/index.native.js +8 -9
  1161. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1162. package/build-module/components/inner-blocks/use-block-context.js +1 -4
  1163. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1164. package/build-module/components/inner-blocks/use-nested-settings-update.js +15 -9
  1165. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1166. package/build-module/components/inserter/block-patterns-explorer/explorer.js +9 -11
  1167. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  1168. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  1169. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  1170. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  1171. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  1172. package/build-module/components/inserter/block-patterns-tab.js +29 -40
  1173. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  1174. package/build-module/components/inserter/block-types-tab.js +7 -9
  1175. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1176. package/build-module/components/inserter/block-types-tab.native.js +8 -9
  1177. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1178. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  1179. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1180. package/build-module/components/inserter/hooks/use-block-types-state.js +5 -6
  1181. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1182. package/build-module/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  1183. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1184. package/build-module/components/inserter/hooks/use-debounced-input.js +1 -2
  1185. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
  1186. package/build-module/components/inserter/hooks/use-insertion-point.js +10 -12
  1187. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1188. package/build-module/components/inserter/index.js +40 -58
  1189. package/build-module/components/inserter/index.js.map +1 -1
  1190. package/build-module/components/inserter/index.native.js +24 -31
  1191. package/build-module/components/inserter/index.native.js.map +1 -1
  1192. package/build-module/components/inserter/library.js +11 -12
  1193. package/build-module/components/inserter/library.js.map +1 -1
  1194. package/build-module/components/inserter/media-tab/hooks.js +2 -5
  1195. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1196. package/build-module/components/inserter/media-tab/media-list.js +6 -7
  1197. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1198. package/build-module/components/inserter/media-tab/media-panel.js +12 -14
  1199. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1200. package/build-module/components/inserter/media-tab/media-preview.js +47 -58
  1201. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1202. package/build-module/components/inserter/media-tab/media-tab.js +24 -28
  1203. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1204. package/build-module/components/inserter/media-tab/utils.js +3 -5
  1205. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1206. package/build-module/components/inserter/menu.js +15 -19
  1207. package/build-module/components/inserter/menu.js.map +1 -1
  1208. package/build-module/components/inserter/menu.native.js +27 -31
  1209. package/build-module/components/inserter/menu.native.js.map +1 -1
  1210. package/build-module/components/inserter/mobile-tab-navigation.js +7 -9
  1211. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1212. package/build-module/components/inserter/panel.js +5 -6
  1213. package/build-module/components/inserter/panel.js.map +1 -1
  1214. package/build-module/components/inserter/preview-panel.js +4 -5
  1215. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1216. package/build-module/components/inserter/quick-inserter.js +9 -12
  1217. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1218. package/build-module/components/inserter/reusable-blocks-tab.js +13 -18
  1219. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  1220. package/build-module/components/inserter/reusable-blocks-tab.native.js +5 -6
  1221. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1222. package/build-module/components/inserter/search-items.js +12 -40
  1223. package/build-module/components/inserter/search-items.js.map +1 -1
  1224. package/build-module/components/inserter/search-results.js +31 -22
  1225. package/build-module/components/inserter/search-results.js.map +1 -1
  1226. package/build-module/components/inserter/search-results.native.js +11 -12
  1227. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1228. package/build-module/components/inserter/tabs.js +8 -9
  1229. package/build-module/components/inserter/tabs.js.map +1 -1
  1230. package/build-module/components/inserter/tabs.native.js +37 -55
  1231. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1232. package/build-module/components/inserter/utils.native.js +13 -17
  1233. package/build-module/components/inserter/utils.native.js.map +1 -1
  1234. package/build-module/components/inserter-draggable-blocks/index.js +11 -13
  1235. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1236. package/build-module/components/inserter-list-item/index.js +65 -69
  1237. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1238. package/build-module/components/inserter-listbox/index.js +3 -4
  1239. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1240. package/build-module/components/inserter-listbox/item.js +6 -7
  1241. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1242. package/build-module/components/inspector-controls/block-support-slot-container.js +4 -5
  1243. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1244. package/build-module/components/inspector-controls/block-support-tools-panel.js +6 -8
  1245. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1246. package/build-module/components/inspector-controls/fill.js +13 -23
  1247. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1248. package/build-module/components/inspector-controls/fill.native.js +7 -11
  1249. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1250. package/build-module/components/inspector-controls/slot.js +9 -13
  1251. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1252. package/build-module/components/inspector-controls/slot.native.js +6 -10
  1253. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1254. package/build-module/components/inspector-controls-tabs/index.js +6 -7
  1255. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1256. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  1257. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1258. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  1259. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1260. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -6
  1261. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1262. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -6
  1263. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1264. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  1265. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1266. package/build-module/components/inspector-popover-header/index.js +18 -22
  1267. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1268. package/build-module/components/justify-content-control/ui.js +8 -10
  1269. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1270. package/build-module/components/letter-spacing-control/index.js +6 -7
  1271. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1272. package/build-module/components/line-height-control/index.js +13 -18
  1273. package/build-module/components/line-height-control/index.js.map +1 -1
  1274. package/build-module/components/line-height-control/index.native.js +4 -5
  1275. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1276. package/build-module/components/link-control/index.js +83 -64
  1277. package/build-module/components/link-control/index.js.map +1 -1
  1278. package/build-module/components/link-control/is-url-like.js +32 -3
  1279. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1280. package/build-module/components/link-control/link-preview.js +24 -27
  1281. package/build-module/components/link-control/link-preview.js.map +1 -1
  1282. package/build-module/components/link-control/search-create-button.js +7 -9
  1283. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1284. package/build-module/components/link-control/search-input.js +22 -27
  1285. package/build-module/components/link-control/search-input.js.map +1 -1
  1286. package/build-module/components/link-control/search-item.js +13 -15
  1287. package/build-module/components/link-control/search-item.js.map +1 -1
  1288. package/build-module/components/link-control/search-results.js +21 -27
  1289. package/build-module/components/link-control/search-results.js.map +1 -1
  1290. package/build-module/components/link-control/settings-drawer.js +7 -33
  1291. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1292. package/build-module/components/link-control/settings.js +7 -9
  1293. package/build-module/components/link-control/settings.js.map +1 -1
  1294. package/build-module/components/link-control/use-internal-value.js +46 -0
  1295. package/build-module/components/link-control/use-internal-value.js.map +1 -0
  1296. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  1297. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1298. package/build-module/components/link-control/use-search-handler.js +10 -23
  1299. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1300. package/build-module/components/list-view/appender.js +17 -14
  1301. package/build-module/components/list-view/appender.js.map +1 -1
  1302. package/build-module/components/list-view/aria-referenced-text.js +35 -0
  1303. package/build-module/components/list-view/aria-referenced-text.js.map +1 -0
  1304. package/build-module/components/list-view/block-contents.js +40 -38
  1305. package/build-module/components/list-view/block-contents.js.map +1 -1
  1306. package/build-module/components/list-view/block-select-button.js +65 -22
  1307. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1308. package/build-module/components/list-view/block.js +131 -120
  1309. package/build-module/components/list-view/block.js.map +1 -1
  1310. package/build-module/components/list-view/branch.js +6 -8
  1311. package/build-module/components/list-view/branch.js.map +1 -1
  1312. package/build-module/components/list-view/drop-indicator.js +4 -5
  1313. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1314. package/build-module/components/list-view/expander.js +3 -4
  1315. package/build-module/components/list-view/expander.js.map +1 -1
  1316. package/build-module/components/list-view/index.js +57 -47
  1317. package/build-module/components/list-view/index.js.map +1 -1
  1318. package/build-module/components/list-view/leaf.js +10 -11
  1319. package/build-module/components/list-view/leaf.js.map +1 -1
  1320. package/build-module/components/list-view/use-block-selection.js +4 -6
  1321. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1322. package/build-module/components/list-view/use-list-view-client-ids.js +28 -8
  1323. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1324. package/build-module/components/list-view/use-list-view-drop-zone.js +25 -13
  1325. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1326. package/build-module/components/list-view/use-list-view-expand-selected-item.js +4 -5
  1327. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1328. package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -6
  1329. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1330. package/build-module/components/media-placeholder/index.js +71 -92
  1331. package/build-module/components/media-placeholder/index.js.map +1 -1
  1332. package/build-module/components/media-placeholder/index.native.js +5 -6
  1333. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1334. package/build-module/components/media-replace-flow/index.js +94 -107
  1335. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1336. package/build-module/components/media-upload/check.js +4 -5
  1337. package/build-module/components/media-upload/check.js.map +1 -1
  1338. package/build-module/components/media-upload/index.native.js +1 -1
  1339. package/build-module/components/media-upload/index.native.js.map +1 -1
  1340. package/build-module/components/multi-selection-inspector/index.js +3 -4
  1341. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1342. package/build-module/components/navigable-toolbar/index.js +16 -15
  1343. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1344. package/build-module/components/observe-typing/index.js +3 -4
  1345. package/build-module/components/observe-typing/index.js.map +1 -1
  1346. package/build-module/components/panel-color-settings/index.js +4 -5
  1347. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1348. package/build-module/components/plain-text/index.js +4 -6
  1349. package/build-module/components/plain-text/index.js.map +1 -1
  1350. package/build-module/components/plain-text/index.native.js +8 -14
  1351. package/build-module/components/plain-text/index.native.js.map +1 -1
  1352. package/build-module/components/preview-options/index.js +8 -9
  1353. package/build-module/components/preview-options/index.js.map +1 -1
  1354. package/build-module/components/provider/block-refs-provider.js +3 -4
  1355. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1356. package/build-module/components/provider/use-block-sync.js +7 -8
  1357. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1358. package/build-module/components/provider/with-registry-provider.js +5 -7
  1359. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1360. package/build-module/components/publish-date-time-picker/index.js +6 -9
  1361. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1362. package/build-module/components/recursion-provider/index.js +7 -11
  1363. package/build-module/components/recursion-provider/index.js.map +1 -1
  1364. package/build-module/components/resizable-box-popover/index.js +5 -6
  1365. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1366. package/build-module/components/responsive-block-control/label.js +5 -6
  1367. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1368. package/build-module/components/rich-text/embed-handler-picker.native.js +6 -10
  1369. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1370. package/build-module/components/rich-text/format-edit.js +7 -8
  1371. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1372. package/build-module/components/rich-text/format-toolbar/index.js +9 -18
  1373. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1374. package/build-module/components/rich-text/format-toolbar-container.js +13 -16
  1375. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1376. package/build-module/components/rich-text/index.js +43 -47
  1377. package/build-module/components/rich-text/index.js.map +1 -1
  1378. package/build-module/components/rich-text/index.native.js +130 -157
  1379. package/build-module/components/rich-text/index.native.js.map +1 -1
  1380. package/build-module/components/rich-text/input-event.js +4 -5
  1381. package/build-module/components/rich-text/input-event.js.map +1 -1
  1382. package/build-module/components/rich-text/shortcut.js +5 -6
  1383. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1384. package/build-module/components/rich-text/split-value.js +8 -10
  1385. package/build-module/components/rich-text/split-value.js.map +1 -1
  1386. package/build-module/components/rich-text/toolbar-button.js +6 -7
  1387. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1388. package/build-module/components/rich-text/use-before-input-rules.js +1 -4
  1389. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1390. package/build-module/components/rich-text/use-enter.js +3 -6
  1391. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1392. package/build-module/components/rich-text/use-firefox-compat.js +29 -1
  1393. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1394. package/build-module/components/rich-text/use-format-types.js +11 -17
  1395. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1396. package/build-module/components/rich-text/use-input-rules.js +9 -15
  1397. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1398. package/build-module/components/rich-text/use-mark-persistent.js +4 -5
  1399. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1400. package/build-module/components/rich-text/use-paste-handler.js +5 -7
  1401. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1402. package/build-module/components/rich-text/utils.js +5 -7
  1403. package/build-module/components/rich-text/utils.js.map +1 -1
  1404. package/build-module/components/skip-to-selected-block/index.js +3 -4
  1405. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1406. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +27 -0
  1407. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  1408. package/build-module/components/spacing-sizes-control/index.js +62 -63
  1409. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1410. package/build-module/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  1411. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  1412. package/build-module/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +21 -21
  1413. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  1414. package/build-module/components/spacing-sizes-control/input-controls/single.js +40 -0
  1415. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  1416. package/build-module/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +53 -70
  1417. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  1418. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +73 -0
  1419. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  1420. package/build-module/components/spacing-sizes-control/utils.js +196 -25
  1421. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1422. package/build-module/components/text-decoration-control/index.js +5 -6
  1423. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1424. package/build-module/components/text-transform-control/index.js +5 -6
  1425. package/build-module/components/text-transform-control/index.js.map +1 -1
  1426. package/build-module/components/tool-selector/index.js +13 -16
  1427. package/build-module/components/tool-selector/index.js.map +1 -1
  1428. package/build-module/components/typewriter/index.js +6 -9
  1429. package/build-module/components/typewriter/index.js.map +1 -1
  1430. package/build-module/components/ungroup-button/index.native.js +11 -14
  1431. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1432. package/build-module/components/unit-control/index.js +4 -5
  1433. package/build-module/components/unit-control/index.js.map +1 -1
  1434. package/build-module/components/url-input/index.js +15 -23
  1435. package/build-module/components/url-input/index.js.map +1 -1
  1436. package/build-module/components/url-input/index.native.js +6 -8
  1437. package/build-module/components/url-input/index.native.js.map +1 -1
  1438. package/build-module/components/url-popover/image-url-input-ui.js +12 -15
  1439. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1440. package/build-module/components/url-popover/index.js +12 -14
  1441. package/build-module/components/url-popover/index.js.map +1 -1
  1442. package/build-module/components/url-popover/link-editor.js +7 -8
  1443. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1444. package/build-module/components/url-popover/link-viewer-url.js +5 -6
  1445. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1446. package/build-module/components/url-popover/link-viewer.js +8 -9
  1447. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1448. package/build-module/components/use-block-display-information/index.js +2 -2
  1449. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1450. package/build-module/components/use-block-drop-zone/index.js +41 -39
  1451. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1452. package/build-module/components/use-block-drop-zone/index.native.js +8 -11
  1453. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1454. package/build-module/components/use-moving-animation/index.js +9 -12
  1455. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1456. package/build-module/components/use-on-block-drop/index.js +2 -6
  1457. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1458. package/build-module/components/use-on-block-drop/index.native.js +8 -10
  1459. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1460. package/build-module/components/use-paste-styles/index.js +2 -6
  1461. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1462. package/build-module/components/use-resize-canvas/index.js +8 -1
  1463. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  1464. package/build-module/components/warning/index.js +6 -7
  1465. package/build-module/components/warning/index.js.map +1 -1
  1466. package/build-module/components/warning/index.native.js +9 -10
  1467. package/build-module/components/warning/index.native.js.map +1 -1
  1468. package/build-module/components/writing-flow/index.js +4 -5
  1469. package/build-module/components/writing-flow/index.js.map +1 -1
  1470. package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
  1471. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  1472. package/build-module/components/writing-flow/use-drag-selection.js +4 -6
  1473. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1474. package/build-module/components/writing-flow/use-tab-nav.js +9 -6
  1475. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1476. package/build-module/hooks/align.js +11 -21
  1477. package/build-module/hooks/align.js.map +1 -1
  1478. package/build-module/hooks/anchor.js +5 -3
  1479. package/build-module/hooks/anchor.js.map +1 -1
  1480. package/build-module/hooks/aria-label.js +1 -3
  1481. package/build-module/hooks/aria-label.js.map +1 -1
  1482. package/build-module/hooks/behaviors.js +129 -0
  1483. package/build-module/hooks/behaviors.js.map +1 -0
  1484. package/build-module/hooks/border.js +25 -38
  1485. package/build-module/hooks/border.js.map +1 -1
  1486. package/build-module/hooks/color.js +22 -37
  1487. package/build-module/hooks/color.js.map +1 -1
  1488. package/build-module/hooks/content-lock-ui.js +23 -27
  1489. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1490. package/build-module/hooks/contrast-checker.js +4 -7
  1491. package/build-module/hooks/contrast-checker.js.map +1 -1
  1492. package/build-module/hooks/custom-class-name.js +4 -4
  1493. package/build-module/hooks/custom-class-name.js.map +1 -1
  1494. package/build-module/hooks/dimensions.js +6 -37
  1495. package/build-module/hooks/dimensions.js.map +1 -1
  1496. package/build-module/hooks/duotone.js +35 -50
  1497. package/build-module/hooks/duotone.js.map +1 -1
  1498. package/build-module/hooks/font-family.js +5 -6
  1499. package/build-module/hooks/font-family.js.map +1 -1
  1500. package/build-module/hooks/font-size.js +14 -21
  1501. package/build-module/hooks/font-size.js.map +1 -1
  1502. package/build-module/hooks/gap.js +5 -6
  1503. package/build-module/hooks/gap.js.map +1 -1
  1504. package/build-module/hooks/index.js +1 -0
  1505. package/build-module/hooks/index.js.map +1 -1
  1506. package/build-module/hooks/layout.js +49 -68
  1507. package/build-module/hooks/layout.js.map +1 -1
  1508. package/build-module/hooks/line-height.js +5 -8
  1509. package/build-module/hooks/line-height.js.map +1 -1
  1510. package/build-module/hooks/lock.js +2 -2
  1511. package/build-module/hooks/lock.js.map +1 -1
  1512. package/build-module/hooks/margin.js +6 -9
  1513. package/build-module/hooks/margin.js.map +1 -1
  1514. package/build-module/hooks/metadata-name.js +4 -5
  1515. package/build-module/hooks/metadata-name.js.map +1 -1
  1516. package/build-module/hooks/metadata.js +3 -7
  1517. package/build-module/hooks/metadata.js.map +1 -1
  1518. package/build-module/hooks/padding.js +6 -9
  1519. package/build-module/hooks/padding.js.map +1 -1
  1520. package/build-module/hooks/position.js +26 -40
  1521. package/build-module/hooks/position.js.map +1 -1
  1522. package/build-module/hooks/settings.js +1 -3
  1523. package/build-module/hooks/settings.js.map +1 -1
  1524. package/build-module/hooks/style.js +11 -19
  1525. package/build-module/hooks/style.js.map +1 -1
  1526. package/build-module/hooks/supports.js +3 -5
  1527. package/build-module/hooks/supports.js.map +1 -1
  1528. package/build-module/hooks/typography.js +18 -27
  1529. package/build-module/hooks/typography.js.map +1 -1
  1530. package/build-module/hooks/typography.native.js +1 -2
  1531. package/build-module/hooks/typography.native.js.map +1 -1
  1532. package/build-module/hooks/use-border-props.js +1 -3
  1533. package/build-module/hooks/use-border-props.js.map +1 -1
  1534. package/build-module/hooks/use-color-props.js +6 -8
  1535. package/build-module/hooks/use-color-props.js.map +1 -1
  1536. package/build-module/hooks/use-editor-wrapper-styles.native.js +34 -39
  1537. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1538. package/build-module/hooks/use-spacing-props.js +1 -1
  1539. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1540. package/build-module/hooks/use-typography-props.js +8 -12
  1541. package/build-module/hooks/use-typography-props.js.map +1 -1
  1542. package/build-module/hooks/utils.js +7 -19
  1543. package/build-module/hooks/utils.js.map +1 -1
  1544. package/build-module/layouts/constrained.js +22 -27
  1545. package/build-module/layouts/constrained.js.map +1 -1
  1546. package/build-module/layouts/flex.js +43 -54
  1547. package/build-module/layouts/flex.js.map +1 -1
  1548. package/build-module/layouts/flow.js +10 -13
  1549. package/build-module/layouts/flow.js.map +1 -1
  1550. package/build-module/layouts/grid.js +45 -25
  1551. package/build-module/layouts/grid.js.map +1 -1
  1552. package/build-module/layouts/index.js +1 -2
  1553. package/build-module/layouts/index.js.map +1 -1
  1554. package/build-module/layouts/utils.js +3 -9
  1555. package/build-module/layouts/utils.js.map +1 -1
  1556. package/build-module/private-apis.js +3 -5
  1557. package/build-module/private-apis.js.map +1 -1
  1558. package/build-module/store/actions.js +253 -336
  1559. package/build-module/store/actions.js.map +1 -1
  1560. package/build-module/store/array.js +1 -2
  1561. package/build-module/store/array.js.map +1 -1
  1562. package/build-module/store/private-actions.js +40 -2
  1563. package/build-module/store/private-actions.js.map +1 -1
  1564. package/build-module/store/private-selectors.js +97 -3
  1565. package/build-module/store/private-selectors.js.map +1 -1
  1566. package/build-module/store/reducer.js +97 -166
  1567. package/build-module/store/reducer.js.map +1 -1
  1568. package/build-module/store/selectors.js +168 -230
  1569. package/build-module/store/selectors.js.map +1 -1
  1570. package/build-module/utils/block-variation-transforms.js +4 -7
  1571. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1572. package/build-module/utils/math.js +1 -2
  1573. package/build-module/utils/math.js.map +1 -1
  1574. package/build-module/utils/object.js +1 -4
  1575. package/build-module/utils/object.js.map +1 -1
  1576. package/build-module/utils/order-inserter-block-items.js +30 -0
  1577. package/build-module/utils/order-inserter-block-items.js.map +1 -0
  1578. package/build-module/utils/parse-css-unit-to-px.js +3 -6
  1579. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1580. package/build-module/utils/pasting.js +5 -8
  1581. package/build-module/utils/pasting.js.map +1 -1
  1582. package/build-module/utils/pre-parse-patterns.js +1 -1
  1583. package/build-module/utils/pre-parse-patterns.js.map +1 -1
  1584. package/build-module/utils/sorting.js +1 -2
  1585. package/build-module/utils/sorting.js.map +1 -1
  1586. package/build-module/utils/transform-styles/index.js +5 -7
  1587. package/build-module/utils/transform-styles/index.js.map +1 -1
  1588. package/build-module/utils/transform-styles/transforms/wrap.js +25 -28
  1589. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1590. package/build-style/content-rtl.css +33 -17
  1591. package/build-style/content.css +33 -17
  1592. package/build-style/default-editor-styles-rtl.css +1 -1
  1593. package/build-style/default-editor-styles.css +1 -1
  1594. package/build-style/style-rtl.css +46 -157
  1595. package/build-style/style.css +47 -157
  1596. package/package.json +32 -31
  1597. package/src/autocompleters/block.js +15 -7
  1598. package/src/components/block-breadcrumb/index.js +11 -3
  1599. package/src/components/block-controls/fill.js +15 -17
  1600. package/src/components/block-controls/slot.js +21 -18
  1601. package/src/components/block-controls/slot.native.js +3 -8
  1602. package/src/components/block-draggable/index.js +2 -1
  1603. package/src/components/block-edit/test/edit.js +1 -1
  1604. package/src/components/block-editing-mode/index.js +71 -0
  1605. package/src/components/block-inspector/index.js +1 -0
  1606. package/src/components/block-list/block-list-block-context.js +6 -0
  1607. package/src/components/block-list/block.js +38 -56
  1608. package/src/components/block-list/block.native.js +30 -41
  1609. package/src/components/block-list/content.scss +8 -12
  1610. package/src/components/block-list/index.native.js +164 -153
  1611. package/src/components/block-list/test/index.native.js +2 -2
  1612. package/src/components/block-list/use-block-props/index.js +7 -2
  1613. package/src/components/block-list/use-in-between-inserter.js +7 -3
  1614. package/src/components/block-list-appender/index.js +26 -5
  1615. package/src/components/block-lock/toolbar.js +2 -8
  1616. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +23 -0
  1617. package/src/components/block-mover/style.scss +1 -0
  1618. package/src/components/block-settings-menu/block-settings-dropdown.js +81 -41
  1619. package/src/components/block-styles/preview-panel.js +1 -3
  1620. package/src/components/block-switcher/block-transformations-menu.js +12 -0
  1621. package/src/components/block-switcher/block-variation-transformations.js +115 -0
  1622. package/src/components/block-switcher/index.js +38 -5
  1623. package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
  1624. package/src/components/block-switcher/style.scss +6 -5
  1625. package/src/components/block-toolbar/index.js +10 -11
  1626. package/src/components/block-tools/block-contextual-toolbar.js +4 -5
  1627. package/src/components/block-tools/insertion-point.js +23 -9
  1628. package/src/components/block-tools/selected-block-popover.js +6 -0
  1629. package/src/components/button-block-appender/content.scss +22 -0
  1630. package/src/components/color-palette/test/__snapshots__/control.js.snap +66 -50
  1631. package/src/components/color-palette/with-color-context.js +2 -6
  1632. package/src/components/colors-gradients/control.js +3 -3
  1633. package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -5
  1634. package/src/components/convert-to-group-buttons/index.js +9 -2
  1635. package/src/components/convert-to-group-buttons/index.native.js +79 -1
  1636. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
  1637. package/src/components/global-styles/dimensions-panel.js +17 -7
  1638. package/src/components/global-styles/get-block-css-selector.js +2 -2
  1639. package/src/components/global-styles/style.scss +3 -0
  1640. package/src/components/global-styles/test/typography-utils.js +139 -1
  1641. package/src/components/global-styles/typography-utils.js +53 -28
  1642. package/src/components/global-styles/use-global-styles-output.js +18 -8
  1643. package/src/components/global-styles/utils.js +9 -3
  1644. package/src/components/iframe/index.js +61 -73
  1645. package/src/components/iframe/use-compatibility-styles.js +34 -18
  1646. package/src/components/inner-blocks/README.md +5 -0
  1647. package/src/components/inner-blocks/index.js +2 -0
  1648. package/src/components/inner-blocks/index.native.js +16 -6
  1649. package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
  1650. package/src/components/inserter/index.js +1 -9
  1651. package/src/components/inserter/quick-inserter.js +0 -2
  1652. package/src/components/inserter/search-results.js +32 -6
  1653. package/src/components/inspector-controls/README.md +1 -1
  1654. package/src/components/inspector-controls/fill.js +2 -6
  1655. package/src/components/inspector-controls-tabs/index.js +0 -1
  1656. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -1
  1657. package/src/components/link-control/index.js +71 -33
  1658. package/src/components/link-control/is-url-like.js +40 -3
  1659. package/src/components/link-control/search-results.js +4 -14
  1660. package/src/components/link-control/settings-drawer.js +2 -37
  1661. package/src/components/link-control/settings.js +2 -2
  1662. package/src/components/link-control/style.scss +5 -6
  1663. package/src/components/link-control/test/index.js +169 -61
  1664. package/src/components/link-control/test/is-url-like.js +66 -0
  1665. package/src/components/link-control/use-internal-value.js +60 -0
  1666. package/src/components/link-control/use-search-handler.js +10 -27
  1667. package/src/components/list-view/appender.js +6 -7
  1668. package/src/components/list-view/aria-referenced-text.js +30 -0
  1669. package/src/components/list-view/block-contents.js +10 -3
  1670. package/src/components/list-view/block-select-button.js +59 -1
  1671. package/src/components/list-view/block.js +69 -45
  1672. package/src/components/list-view/branch.js +1 -7
  1673. package/src/components/list-view/index.js +45 -22
  1674. package/src/components/list-view/style.scss +2 -10
  1675. package/src/components/list-view/test/use-list-view-drop-zone.js +38 -1
  1676. package/src/components/list-view/use-block-selection.js +2 -2
  1677. package/src/components/list-view/use-list-view-client-ids.js +21 -4
  1678. package/src/components/list-view/use-list-view-drop-zone.js +22 -4
  1679. package/src/components/media-replace-flow/test/index.js +1 -1
  1680. package/src/components/navigable-toolbar/index.js +7 -5
  1681. package/src/components/publish-date-time-picker/index.js +0 -2
  1682. package/src/components/rich-text/index.js +1 -1
  1683. package/src/components/rich-text/use-firefox-compat.js +27 -1
  1684. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +26 -0
  1685. package/src/components/spacing-sizes-control/index.js +85 -71
  1686. package/src/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +14 -13
  1687. package/src/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +15 -14
  1688. package/src/components/spacing-sizes-control/input-controls/single.js +40 -0
  1689. package/src/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +55 -80
  1690. package/src/components/spacing-sizes-control/sides-dropdown/index.js +91 -0
  1691. package/src/components/spacing-sizes-control/style.scss +28 -100
  1692. package/src/components/spacing-sizes-control/test/utils.js +233 -4
  1693. package/src/components/spacing-sizes-control/utils.js +203 -20
  1694. package/src/components/ungroup-button/index.native.js +2 -2
  1695. package/src/components/url-input/README.md +6 -0
  1696. package/src/components/url-input/index.js +1 -0
  1697. package/src/components/use-block-drop-zone/index.js +31 -17
  1698. package/src/components/use-resize-canvas/index.js +9 -1
  1699. package/src/components/writing-flow/test/index.js +15 -0
  1700. package/src/components/writing-flow/use-arrow-nav.js +17 -4
  1701. package/src/components/writing-flow/use-tab-nav.js +14 -3
  1702. package/src/hooks/align.js +3 -11
  1703. package/src/hooks/anchor.js +3 -1
  1704. package/src/hooks/behaviors.js +160 -0
  1705. package/src/hooks/custom-class-name.js +23 -19
  1706. package/src/hooks/dimensions.js +0 -40
  1707. package/src/hooks/duotone.js +3 -11
  1708. package/src/hooks/index.js +1 -0
  1709. package/src/hooks/layout.js +14 -19
  1710. package/src/hooks/style.js +3 -1
  1711. package/src/hooks/utils.js +8 -7
  1712. package/src/layouts/grid.js +29 -3
  1713. package/src/private-apis.js +2 -4
  1714. package/src/store/private-actions.js +39 -0
  1715. package/src/store/private-selectors.js +117 -0
  1716. package/src/store/reducer.js +33 -8
  1717. package/src/store/selectors.js +56 -35
  1718. package/src/store/test/private-actions.js +32 -1
  1719. package/src/store/test/private-selectors.js +333 -0
  1720. package/src/store/test/reducer.js +48 -7
  1721. package/src/store/test/selectors.js +99 -0
  1722. package/src/style.scss +0 -3
  1723. package/src/utils/order-inserter-block-items.js +26 -0
  1724. package/build/components/block-list/block-list-compact.native.js +0 -75
  1725. package/build/components/block-list/block-list-compact.native.js.map +0 -1
  1726. package/build/components/link-control/use-internal-input-value.js +0 -27
  1727. package/build/components/link-control/use-internal-input-value.js.map +0 -1
  1728. package/build/components/off-canvas-editor/appender.js +0 -125
  1729. package/build/components/off-canvas-editor/appender.js.map +0 -1
  1730. package/build/components/off-canvas-editor/block-contents.js +0 -141
  1731. package/build/components/off-canvas-editor/block-contents.js.map +0 -1
  1732. package/build/components/off-canvas-editor/block-select-button.js +0 -126
  1733. package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
  1734. package/build/components/off-canvas-editor/block.js +0 -297
  1735. package/build/components/off-canvas-editor/block.js.map +0 -1
  1736. package/build/components/off-canvas-editor/branch.js +0 -197
  1737. package/build/components/off-canvas-editor/branch.js.map +0 -1
  1738. package/build/components/off-canvas-editor/context.js +0 -19
  1739. package/build/components/off-canvas-editor/context.js.map +0 -1
  1740. package/build/components/off-canvas-editor/drop-indicator.js +0 -118
  1741. package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
  1742. package/build/components/off-canvas-editor/expander.js +0 -41
  1743. package/build/components/off-canvas-editor/expander.js.map +0 -1
  1744. package/build/components/off-canvas-editor/index.js +0 -236
  1745. package/build/components/off-canvas-editor/index.js.map +0 -1
  1746. package/build/components/off-canvas-editor/leaf-more-menu.js +0 -148
  1747. package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  1748. package/build/components/off-canvas-editor/leaf.js +0 -60
  1749. package/build/components/off-canvas-editor/leaf.js.map +0 -1
  1750. package/build/components/off-canvas-editor/link-ui.js +0 -186
  1751. package/build/components/off-canvas-editor/link-ui.js.map +0 -1
  1752. package/build/components/off-canvas-editor/update-attributes.js +0 -108
  1753. package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
  1754. package/build/components/off-canvas-editor/use-block-selection.js +0 -139
  1755. package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
  1756. package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
  1757. package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  1758. package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
  1759. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  1760. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
  1761. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  1762. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
  1763. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  1764. package/build/components/off-canvas-editor/utils.js +0 -60
  1765. package/build/components/off-canvas-editor/utils.js.map +0 -1
  1766. package/build/components/spacing-sizes-control/all-input-control.js +0 -57
  1767. package/build/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1768. package/build/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1769. package/build/components/spacing-sizes-control/input-controls.js.map +0 -1
  1770. package/build/components/spacing-sizes-control/linked-button.js +0 -37
  1771. package/build/components/spacing-sizes-control/linked-button.js.map +0 -1
  1772. package/build/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1773. package/build/components/ungroup-button/icon.js +0 -31
  1774. package/build/components/ungroup-button/icon.js.map +0 -1
  1775. package/build-module/components/block-list/block-list-compact.native.js +0 -60
  1776. package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
  1777. package/build-module/components/link-control/use-internal-input-value.js +0 -19
  1778. package/build-module/components/link-control/use-internal-input-value.js.map +0 -1
  1779. package/build-module/components/off-canvas-editor/appender.js +0 -108
  1780. package/build-module/components/off-canvas-editor/appender.js.map +0 -1
  1781. package/build-module/components/off-canvas-editor/block-contents.js +0 -121
  1782. package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
  1783. package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
  1784. package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
  1785. package/build-module/components/off-canvas-editor/block.js +0 -273
  1786. package/build-module/components/off-canvas-editor/block.js.map +0 -1
  1787. package/build-module/components/off-canvas-editor/branch.js +0 -179
  1788. package/build-module/components/off-canvas-editor/branch.js.map +0 -1
  1789. package/build-module/components/off-canvas-editor/context.js +0 -7
  1790. package/build-module/components/off-canvas-editor/context.js.map +0 -1
  1791. package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
  1792. package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
  1793. package/build-module/components/off-canvas-editor/expander.js +0 -32
  1794. package/build-module/components/off-canvas-editor/expander.js.map +0 -1
  1795. package/build-module/components/off-canvas-editor/index.js +0 -213
  1796. package/build-module/components/off-canvas-editor/index.js.map +0 -1
  1797. package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -130
  1798. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  1799. package/build-module/components/off-canvas-editor/leaf.js +0 -45
  1800. package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
  1801. package/build-module/components/off-canvas-editor/link-ui.js +0 -166
  1802. package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
  1803. package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
  1804. package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
  1805. package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
  1806. package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
  1807. package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
  1808. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  1809. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
  1810. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  1811. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
  1812. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  1813. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
  1814. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  1815. package/build-module/components/off-canvas-editor/utils.js +0 -44
  1816. package/build-module/components/off-canvas-editor/utils.js.map +0 -1
  1817. package/build-module/components/spacing-sizes-control/all-input-control.js +0 -45
  1818. package/build-module/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1819. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1820. package/build-module/components/spacing-sizes-control/input-controls.js.map +0 -1
  1821. package/build-module/components/spacing-sizes-control/linked-button.js +0 -27
  1822. package/build-module/components/spacing-sizes-control/linked-button.js.map +0 -1
  1823. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1824. package/build-module/components/ungroup-button/icon.js +0 -22
  1825. package/build-module/components/ungroup-button/icon.js.map +0 -1
  1826. package/src/components/block-list/block-list-compact.native.js +0 -63
  1827. package/src/components/link-control/use-internal-input-value.js +0 -23
  1828. package/src/components/off-canvas-editor/README.md +0 -5
  1829. package/src/components/off-canvas-editor/appender.js +0 -124
  1830. package/src/components/off-canvas-editor/block-contents.js +0 -156
  1831. package/src/components/off-canvas-editor/block-select-button.js +0 -128
  1832. package/src/components/off-canvas-editor/block.js +0 -347
  1833. package/src/components/off-canvas-editor/branch.js +0 -238
  1834. package/src/components/off-canvas-editor/context.js +0 -8
  1835. package/src/components/off-canvas-editor/drop-indicator.js +0 -126
  1836. package/src/components/off-canvas-editor/expander.js +0 -26
  1837. package/src/components/off-canvas-editor/index.js +0 -271
  1838. package/src/components/off-canvas-editor/leaf-more-menu.js +0 -158
  1839. package/src/components/off-canvas-editor/leaf.js +0 -52
  1840. package/src/components/off-canvas-editor/link-ui.js +0 -167
  1841. package/src/components/off-canvas-editor/style.scss +0 -34
  1842. package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
  1843. package/src/components/off-canvas-editor/test/utils.js +0 -50
  1844. package/src/components/off-canvas-editor/update-attributes.js +0 -99
  1845. package/src/components/off-canvas-editor/use-block-selection.js +0 -169
  1846. package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
  1847. package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
  1848. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
  1849. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
  1850. package/src/components/off-canvas-editor/utils.js +0 -58
  1851. package/src/components/spacing-sizes-control/all-input-control.js +0 -44
  1852. package/src/components/spacing-sizes-control/linked-button.js +0 -24
  1853. package/src/components/ungroup-button/icon.js +0 -26
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/position.js"],"names":["classnames","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","createHigherOrderComponent","useInstanceId","useSelect","useContext","useMemo","createPortal","Platform","addFilter","BlockList","useSetting","InspectorControls","cleanEmptyObject","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanel","clientId","hasParents","select","getBlockParents","parents","length","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","__unstableElementContext","positionSelector","css"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SACCC,WADD,EAECC,WAAW,IAAIC,qBAFhB,QAGO,uBAHP;AAIA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,UADD,EAECC,OAFD,EAGCC,YAHD,EAICC,QAJD,QAKO,oBALP;AAMA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;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AU,CAAElB,KAA5B,gFAAgB,mBAAmBI,QAAnC,0DAAgB,sBAA6BF,IAAM,EAArD,GACCwD,mBAAmB,IACnB,CAAC,CAAEK,GADH,IAEA,CAAC,EAAE7C,UAAF,aAAEA,UAAF,qCAAEA,UAAU,CAAElB,KAAd,wEAAE,mBAAmBI,QAArB,kDAAE,sBAA6BF,IAA/B;AAL6C,GAApB,CAA5B;AAQA,SACC,8BACGwD,mBAAmB,IACpBE,OADC,IAED,CAAC,CAAEG,GAFF,IAGDxF,YAAY,CAAE,6BAASwF,GAAT,CAAF,EAA0BH,OAA1B,CAJd,EAKC,cAAC,cAAD,eAAqB3C,KAArB;AAA6B,IAAA,SAAS,EAAGzB;AAAzC,KALD,CADD;AASA,CA5C0D,EA6C3D,oBA7C2D,CAArD;AAgDPf,SAAS,CACR,uBADQ,EAER,2CAFQ,EAGR8E,kBAHQ,CAAT;AAKA9E,SAAS,CACR,kBADQ,EAER,8CAFQ,EAGR0E,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseContext,\n\tuseMemo,\n\tcreatePortal,\n\tPlatform,\n} from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport useSetting from '../components/use-setting';\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst allowFixed = useSetting( 'position.fixed' );\n\tconst allowSticky = useSetting( 'position.sticky' );\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {WPElement} Position panel.\n */\nexport function PositionPanel( props ) {\n\tconst {\n\t\tattributes: { style = {} },\n\t\tclientId,\n\t\tname: blockName,\n\t\tsetAttributes,\n\t} = props;\n\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { hasParents } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn {\n\t\t\t\thasParents: parents.length,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Only display sticky option if the block has no parents (is at the root of the document),\n\t\t// or if the block already has a sticky position value set.\n\t\tif (\n\t\t\t( allowSticky && ! hasParents ) ||\n\t\t\tvalue === STICKY_OPTION.value\n\t\t) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, hasParents, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl className=\"block-editor-hooks__position-selection\">\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\n/**\n * Override the default edit UI to include position controls.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst positionSupport = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst showPositionControls =\n\t\t\tpositionSupport && ! useIsPositionDisabled( props );\n\n\t\treturn [\n\t\t\tshowPositionControls && (\n\t\t\t\t<PositionPanel key=\"position\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the position styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withPositionStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst allowPositionStyles =\n\t\t\thasPositionBlockSupport && ! useIsPositionDisabled( props );\n\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\t// Higher specificity to override defaults in editor UI.\n\t\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t\t// Get CSS string for the current position values.\n\t\tlet css;\n\t\tif ( allowPositionStyles ) {\n\t\t\tcss =\n\t\t\t\tgetPositionCSS( {\n\t\t\t\t\tselector: positionSelector,\n\t\t\t\t\tstyle: attributes?.style,\n\t\t\t\t} ) || '';\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t[ `is-position-${ attributes?.style?.position?.type }` ]:\n\t\t\t\tallowPositionStyles &&\n\t\t\t\t!! css &&\n\t\t\t\t!! attributes?.style?.position?.type,\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowPositionStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withPositionStyles'\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/position/with-position-styles',\n\twithPositionStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/position/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/position.js"],"names":["classnames","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","createHigherOrderComponent","useInstanceId","useSelect","useContext","useMemo","createPortal","Platform","addFilter","BlockList","useSetting","InspectorControls","cleanEmptyObject","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanel","clientId","hasParents","select","getBlockParents","parents","length","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","__unstableElementContext","positionSelector","css"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iB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,KAAZ,EAAmBI,QAAnB,EAA6BF;AALc,GAApB,CAA5B;AAQA,SACC,8BACGwD,mBAAmB,IACpBE,OADC,IAED,CAAC,CAAEG,GAFF,IAGDxF,YAAY,CAAE,6BAASwF,GAAT,CAAF,EAA0BH,OAA1B,CAJd,EAKC,cAAC,cAAD,eAAqB3C,KAArB;AAA6B,IAAA,SAAS,EAAGzB;AAAzC,KALD,CADD;AASA,CA5C0D,EA6C3D,oBA7C2D,CAArD;AAgDPf,SAAS,CACR,uBADQ,EAER,2CAFQ,EAGR8E,kBAHQ,CAAT;AAKA9E,SAAS,CACR,kBADQ,EAER,8CAFQ,EAGR0E,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseContext,\n\tuseMemo,\n\tcreatePortal,\n\tPlatform,\n} from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport useSetting from '../components/use-setting';\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst allowFixed = useSetting( 'position.fixed' );\n\tconst allowSticky = useSetting( 'position.sticky' );\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {WPElement} Position panel.\n */\nexport function PositionPanel( props ) {\n\tconst {\n\t\tattributes: { style = {} },\n\t\tclientId,\n\t\tname: blockName,\n\t\tsetAttributes,\n\t} = props;\n\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { hasParents } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn {\n\t\t\t\thasParents: parents.length,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Only display sticky option if the block has no parents (is at the root of the document),\n\t\t// or if the block already has a sticky position value set.\n\t\tif (\n\t\t\t( allowSticky && ! hasParents ) ||\n\t\t\tvalue === STICKY_OPTION.value\n\t\t) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, hasParents, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl className=\"block-editor-hooks__position-selection\">\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\n/**\n * Override the default edit UI to include position controls.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst positionSupport = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst showPositionControls =\n\t\t\tpositionSupport && ! useIsPositionDisabled( props );\n\n\t\treturn [\n\t\t\tshowPositionControls && (\n\t\t\t\t<PositionPanel key=\"position\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the position styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withPositionStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst allowPositionStyles =\n\t\t\thasPositionBlockSupport && ! useIsPositionDisabled( props );\n\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\t// Higher specificity to override defaults in editor UI.\n\t\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t\t// Get CSS string for the current position values.\n\t\tlet css;\n\t\tif ( allowPositionStyles ) {\n\t\t\tcss =\n\t\t\t\tgetPositionCSS( {\n\t\t\t\t\tselector: positionSelector,\n\t\t\t\t\tstyle: attributes?.style,\n\t\t\t\t} ) || '';\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t[ `is-position-${ attributes?.style?.position?.type }` ]:\n\t\t\t\tallowPositionStyles &&\n\t\t\t\t!! css &&\n\t\t\t\t!! attributes?.style?.position?.type,\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowPositionStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withPositionStyles'\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/position/with-position-styles',\n\twithPositionStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/position/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
@@ -7,14 +7,12 @@ import { hasBlockSupport } from '@wordpress/blocks';
7
7
  const hasSettingsSupport = blockType => hasBlockSupport(blockType, '__experimentalSettings', false);
8
8
 
9
9
  function addAttribute(settings) {
10
- var _settings$attributes;
11
-
12
10
  if (!hasSettingsSupport(settings)) {
13
11
  return settings;
14
12
  } // Allow blocks to specify their own attribute definition with default values if needed.
15
13
 
16
14
 
17
- if (!(settings !== null && settings !== void 0 && (_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 && _settings$attributes.settings)) {
15
+ if (!settings?.attributes?.settings) {
18
16
  settings.attributes = { ...settings.attributes,
19
17
  settings: {
20
18
  type: 'object'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/settings.js"],"names":["addFilter","hasBlockSupport","hasSettingsSupport","blockType","addAttribute","settings","attributes","type"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;;AAEA,MAAMC,kBAAkB,GAAKC,SAAF,IAC1BF,eAAe,CAAEE,SAAF,EAAa,wBAAb,EAAuC,KAAvC,CADhB;;AAGA,SAASC,YAAT,CAAuBC,QAAvB,EAAkC;AAAA;;AACjC,MAAK,CAAEH,kBAAkB,CAAEG,QAAF,CAAzB,EAAwC;AACvC,WAAOA,QAAP;AACA,GAHgC,CAKjC;;;AACA,MAAK,EAAEA,QAAF,aAAEA,QAAF,uCAAEA,QAAQ,CAAEC,UAAZ,iDAAE,qBAAsBD,QAAxB,CAAL,EAAwC;AACvCA,IAAAA,QAAQ,CAACC,UAAT,GAAsB,EACrB,GAAGD,QAAQ,CAACC,UADS;AAErBD,MAAAA,QAAQ,EAAE;AACTE,QAAAA,IAAI,EAAE;AADG;AAFW,KAAtB;AAMA;;AAED,SAAOF,QAAP;AACA;;AAEDL,SAAS,CACR,0BADQ,EAER,4BAFQ,EAGRI,YAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\nconst hasSettingsSupport = ( blockType ) =>\n\thasBlockSupport( blockType, '__experimentalSettings', false );\n\nfunction addAttribute( settings ) {\n\tif ( ! hasSettingsSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings?.attributes?.settings ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tsettings: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/settings/addAttribute',\n\taddAttribute\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/settings.js"],"names":["addFilter","hasBlockSupport","hasSettingsSupport","blockType","addAttribute","settings","attributes","type"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;;AAEA,MAAMC,kBAAkB,GAAKC,SAAF,IAC1BF,eAAe,CAAEE,SAAF,EAAa,wBAAb,EAAuC,KAAvC,CADhB;;AAGA,SAASC,YAAT,CAAuBC,QAAvB,EAAkC;AACjC,MAAK,CAAEH,kBAAkB,CAAEG,QAAF,CAAzB,EAAwC;AACvC,WAAOA,QAAP;AACA,GAHgC,CAKjC;;;AACA,MAAK,CAAEA,QAAQ,EAAEC,UAAV,EAAsBD,QAA7B,EAAwC;AACvCA,IAAAA,QAAQ,CAACC,UAAT,GAAsB,EACrB,GAAGD,QAAQ,CAACC,UADS;AAErBD,MAAAA,QAAQ,EAAE;AACTE,QAAAA,IAAI,EAAE;AADG;AAFW,KAAtB;AAMA;;AAED,SAAOF,QAAP;AACA;;AAEDL,SAAS,CACR,0BADQ,EAER,4BAFQ,EAGRI,YAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\nconst hasSettingsSupport = ( blockType ) =>\n\thasBlockSupport( blockType, '__experimentalSettings', false );\n\nfunction addAttribute( settings ) {\n\tif ( ! hasSettingsSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings?.attributes?.settings ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tsettings: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/settings/addAttribute',\n\taddAttribute\n);\n"]}
@@ -25,6 +25,7 @@ import { TypographyPanel, TYPOGRAPHY_SUPPORT_KEY, TYPOGRAPHY_SUPPORT_KEYS } from
25
25
  import { DIMENSIONS_SUPPORT_KEY, SPACING_SUPPORT_KEY, DimensionsPanel } from './dimensions';
26
26
  import useDisplayBlockControls from '../components/use-display-block-controls';
27
27
  import { shouldSkipSerialization } from './utils';
28
+ import { useBlockEditingMode } from '../components/block-editing-mode';
28
29
  const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, DIMENSIONS_SUPPORT_KEY, SPACING_SUPPORT_KEY];
29
30
 
30
31
  const hasStyleSupport = blockType => styleSupportKeys.some(key => hasBlockSupport(blockType, key));
@@ -37,8 +38,7 @@ const hasStyleSupport = blockType => styleSupportKeys.some(key => hasBlockSuppor
37
38
  */
38
39
 
39
40
 
40
- export function getInlineStyles() {
41
- let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
41
+ export function getInlineStyles(styles = {}) {
42
42
  const output = {}; // The goal is to move everything to server side generated engine styles
43
43
  // This is temporary as we absorb more and more styles into the engine.
44
44
 
@@ -209,9 +209,7 @@ const renamedFeatures = {
209
209
  * @return {Object} Styles object with the specified paths removed.
210
210
  */
211
211
 
212
- export function omitStyle(style, paths) {
213
- let preserveReference = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
214
-
212
+ export function omitStyle(style, paths, preserveReference = false) {
215
213
  if (!style) {
216
214
  return style;
217
215
  }
@@ -251,9 +249,7 @@ export function omitStyle(style, paths) {
251
249
  * @return {Object} Filtered props applied to save element.
252
250
  */
253
251
 
254
- export function addSaveProps(props, blockType, attributes) {
255
- let skipPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : skipSerializationPathsSave;
256
-
252
+ export function addSaveProps(props, blockType, attributes, skipPaths = skipSerializationPathsSave) {
257
253
  if (!hasStyleSupport(blockType)) {
258
254
  return props;
259
255
  }
@@ -261,8 +257,7 @@ export function addSaveProps(props, blockType, attributes) {
261
257
  let {
262
258
  style
263
259
  } = attributes;
264
- Object.entries(skipPaths).forEach(_ref => {
265
- let [indicator, path] = _ref;
260
+ Object.entries(skipPaths).forEach(([indicator, path]) => {
266
261
  const skipSerialization = getBlockSupport(blockType, indicator);
267
262
 
268
263
  if (skipSerialization === true) {
@@ -320,7 +315,8 @@ export function addEditProps(settings) {
320
315
 
321
316
  export const withBlockControls = createHigherOrderComponent(BlockEdit => props => {
322
317
  const shouldDisplayControls = useDisplayBlockControls();
323
- return createElement(Fragment, null, shouldDisplayControls && createElement(Fragment, null, createElement(ColorEdit, props), createElement(TypographyPanel, props), createElement(BorderPanel, props), createElement(DimensionsPanel, props)), createElement(BlockEdit, props));
318
+ const blockEditingMode = useBlockEditingMode();
319
+ return createElement(Fragment, null, shouldDisplayControls && blockEditingMode === 'default' && createElement(Fragment, null, createElement(ColorEdit, props), createElement(TypographyPanel, props), createElement(BorderPanel, props), createElement(DimensionsPanel, props)), createElement(BlockEdit, props));
324
320
  }, 'withToolbarControls');
325
321
  /**
326
322
  * Override the default block element to include elements styles.
@@ -330,21 +326,17 @@ export const withBlockControls = createHigherOrderComponent(BlockEdit => props =
330
326
  */
331
327
 
332
328
  const withElementsStyles = createHigherOrderComponent(BlockListBlock => props => {
333
- var _props$attributes$sty6, _props$attributes$sty7;
334
-
335
329
  const blockElementsContainerIdentifier = `wp-elements-${useInstanceId(BlockListBlock)}`;
336
330
  const skipLinkColorSerialization = shouldSkipSerialization(props.name, COLOR_SUPPORT_KEY, 'link');
337
331
  const styles = useMemo(() => {
338
- var _props$attributes$sty, _props$attributes$sty2, _props$attributes$sty3, _props$attributes$sty4, _props$attributes$sty5;
339
-
340
332
  // The .editor-styles-wrapper selector is required on elements styles. As it is
341
333
  // added to all other editor styles, not providing it causes reset and global
342
334
  // styles to override element styles because of higher specificity.
343
335
  const elements = [{
344
- styles: !skipLinkColorSerialization ? (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : (_props$attributes$sty2 = _props$attributes$sty.elements) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.link : undefined,
336
+ styles: !skipLinkColorSerialization ? props.attributes.style?.elements?.link : undefined,
345
337
  selector: `.editor-styles-wrapper .${blockElementsContainerIdentifier} ${ELEMENTS.link}`
346
338
  }, {
347
- styles: !skipLinkColorSerialization ? (_props$attributes$sty3 = props.attributes.style) === null || _props$attributes$sty3 === void 0 ? void 0 : (_props$attributes$sty4 = _props$attributes$sty3.elements) === null || _props$attributes$sty4 === void 0 ? void 0 : (_props$attributes$sty5 = _props$attributes$sty4.link) === null || _props$attributes$sty5 === void 0 ? void 0 : _props$attributes$sty5[':hover'] : undefined,
339
+ styles: !skipLinkColorSerialization ? props.attributes.style?.elements?.link?.[':hover'] : undefined,
348
340
  selector: `.editor-styles-wrapper .${blockElementsContainerIdentifier} ${ELEMENTS.link}:hover`
349
341
  }];
350
342
  const elementCssRules = [];
@@ -362,14 +354,14 @@ const withElementsStyles = createHigherOrderComponent(BlockListBlock => props =>
362
354
  }
363
355
 
364
356
  return elementCssRules.length > 0 ? elementCssRules.join('') : undefined;
365
- }, [(_props$attributes$sty6 = props.attributes.style) === null || _props$attributes$sty6 === void 0 ? void 0 : _props$attributes$sty6.elements, blockElementsContainerIdentifier, skipLinkColorSerialization]);
357
+ }, [props.attributes.style?.elements, blockElementsContainerIdentifier, skipLinkColorSerialization]);
366
358
  const element = useContext(BlockList.__unstableElementContext);
367
359
  return createElement(Fragment, null, styles && element && createPortal(createElement("style", {
368
360
  dangerouslySetInnerHTML: {
369
361
  __html: styles
370
362
  }
371
363
  }), element), createElement(BlockListBlock, _extends({}, props, {
372
- className: (_props$attributes$sty7 = props.attributes.style) !== null && _props$attributes$sty7 !== void 0 && _props$attributes$sty7.elements ? classnames(props.className, blockElementsContainerIdentifier) : props.className
364
+ className: props.attributes.style?.elements ? classnames(props.className, blockElementsContainerIdentifier) : props.className
373
365
  })));
374
366
  }, 'withElementsStyles');
375
367
  addFilter('blocks.registerBlockType', 'core/style/addAttribute', addAttribute);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["classnames","useContext","useMemo","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","getCSSRules","compileCSS","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","shouldSkipSerialization","styleSupportKeys","hasStyleSupport","blockType","some","key","getInlineStyles","styles","output","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","skipSerializationPathsSave","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","skipPaths","entries","indicator","skipSerialization","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","skipLinkColorSerialization","name","elements","link","undefined","selector","elementCssRules","elementStyles","cssRule","push","join","element","__unstableElementContext","__html","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,EAAqBC,OAArB,EAA8BC,YAA9B,QAAkD,oBAAlD;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,eADD,EAECC,eAFD,EAGCC,uBAAuB,IAAIC,QAH5B,QAIO,mBAJP;AAKA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,yBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,UAAhD;AACA,SAASC,iBAAT,EAA4BC,SAA5B,QAA6C,SAA7C;AACA,SACCC,eADD,EAECC,sBAFD,EAGCC,uBAHD,QAIO,cAJP;AAKA,SACCC,sBADD,EAECC,mBAFD,EAGCC,eAHD,QAIO,cAJP;AAKA,OAAOC,uBAAP,MAAoC,0CAApC;AACA,SAASC,uBAAT,QAAwC,SAAxC;AAEA,MAAMC,gBAAgB,GAAG,CACxB,GAAGN,uBADqB,EAExBN,kBAFwB,EAGxBE,iBAHwB,EAIxBK,sBAJwB,EAKxBC,mBALwB,CAAzB;;AAQA,MAAMK,eAAe,GAAKC,SAAF,IACvBF,gBAAgB,CAACG,IAAjB,CAAyBC,GAAF,IAAWxB,eAAe,CAAEsB,SAAF,EAAaE,GAAb,CAAjD,CADD;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASC,eAAT,GAAwC;AAAA,MAAdC,MAAc,uEAAL,EAAK;AAC9C,QAAMC,MAAM,GAAG,EA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;AACA;AACA;AACA;;AACA,MAAMwB,eAAe,GAAG;AAAEC,EAAAA,SAAS,EAAE;AAAb,CAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,SAAT,CAAoBR,KAApB,EAA2BS,KAA3B,EAA8D;AAAA,MAA5BC,iBAA4B,uEAAR,KAAQ;;AACpE,MAAK,CAAEV,KAAP,EAAe;AACd,WAAOA,KAAP;AACA;;AAED,MAAIW,QAAQ,GAAGX,KAAf;;AACA,MAAK,CAAEU,iBAAP,EAA2B;AAC1BC,IAAAA,QAAQ,GAAGC,IAAI,CAACC,KAAL,CAAYD,IAAI,CAACE,SAAL,CAAgBd,KAAhB,CAAZ,CAAX;AACA;;AAED,MAAK,CAAEe,KAAK,CAACC,OAAN,CAAeP,KAAf,CAAP,EAAgC;AAC/BA,IAAAA,KAAK,GAAG,CAAEA,KAAF,CAAR;AACA;;AAEDA,EAAAA,KAAK,CAACf,OAAN,CAAiBuB,IAAF,IAAY;AAC1B,QAAK,CAAEF,KAAK,CAACC,OAAN,CAAeC,IAAf,CAAP,EAA+B;AAC9BA,MAAAA,IAAI,GAAGA,IAAI,CAACC,KAAL,CAAY,GAAZ,CAAP;AACA;;AAED,QAAKD,IAAI,CAACE,MAAL,GAAc,CAAnB,EAAuB;AACtB,YAAM,CAAEC,YAAF,EAA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AAiBC,KADf,2DACF,uBAAwByC,QADtB,EAEFH,gCAFE,EAGFC,0BAHE,CA9BmB,CAAtB;AAoCA,QAAMW,OAAO,GAAGzF,UAAU,CAAEY,SAAS,CAAC8E,wBAAZ,CAA1B;AAEA,SACC,8BACG3D,MAAM,IACP0D,OADC,IAEDvF,YAAY,CACX;AACC,IAAA,uBAAuB,EAAG;AACzByF,MAAAA,MAAM,EAAE5D;AADiB;AAD3B,IADW,EAMX0D,OANW,CAHd,EAYC,cAAC,cAAD,eACM3B,KADN;AAEC,IAAA,SAAS,EACR,0BAAAA,KAAK,CAACxB,UAAN,CAAiBC,KAAjB,0EAAwByC,QAAxB,GACGjF,UAAU,CACV+D,KAAK,CAAC8B,SADI,EAEVf,gCAFU,CADb,GAKGf,KAAK,CAAC8B;AARX,KAZD,CADD;AA0BA,CA5EmD,EA6EpD,oBA7EoD,CAArD;AAgFAzF,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRiC,YAHQ,CAAT;AAMAjC,SAAS,CACR,kCADQ,EAER,yBAFQ,EAGR0D,YAHQ,CAAT;AAMA1D,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRkE,YAHQ,CAAT;AAMAlE,SAAS,CACR,kBADQ,EAER,gCAFQ,EAGRqE,iBAHQ,CAAT;AAMArE,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGRwE,kBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\nimport { shouldSkipSerialization } from './utils';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization = getBlockSupport( blockType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include elements styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\n\t\tconst skipLinkColorSerialization = shouldSkipSerialization(\n\t\t\tprops.name,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t'link'\n\t\t);\n\n\t\tconst styles = useMemo( () => {\n\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t// styles to override element styles because of higher specificity.\n\t\t\tconst elements = [\n\t\t\t\t{\n\t\t\t\t\tstyles: ! skipLinkColorSerialization\n\t\t\t\t\t\t? props.attributes.style?.elements?.link\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS.link }`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstyles: ! skipLinkColorSerialization\n\t\t\t\t\t\t? props.attributes.style?.elements?.link?.[ ':hover' ]\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS.link }:hover`,\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst elementCssRules = [];\n\t\t\tfor ( const { styles: elementStyles, selector } of elements ) {\n\t\t\t\tif ( elementStyles ) {\n\t\t\t\t\tconst cssRule = compileCSS( elementStyles, {\n\t\t\t\t\t\tselector,\n\t\t\t\t\t} );\n\t\t\t\t\telementCssRules.push( cssRule );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn elementCssRules.length > 0\n\t\t\t\t? elementCssRules.join( '' )\n\t\t\t\t: undefined;\n\t\t}, [\n\t\t\tprops.attributes.style?.elements,\n\t\t\tblockElementsContainerIdentifier,\n\t\t\tskipLinkColorSerialization,\n\t\t] );\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ styles &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.attributes.style?.elements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withElementsStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["classnames","useContext","useMemo","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","getCSSRules","compileCSS","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","shouldSkipSerialization","useBlockEditingMode","styleSupportKeys","hasStyleSupport","blockType","some","key","getInlineStyles","styles","output","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","skipSerializationPathsSave","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","skipPaths","entries","indicator","skipSerialization","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","blockEditingMode","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","skipLinkColorSerialization","name","elements","link","undefined","selector","elementCssRules","elementStyles","cssRule","push","join","element","__unstableElementContext","__html","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,EAAqBC,OAArB,EAA8BC,YAA9B,QAAkD,oBAAlD;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,eADD,EAECC,eAFD,EAGCC,uBAAuB,IAAIC,QAH5B,QAIO,mBAJP;AAKA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,yBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,UAAhD;AACA,SAASC,iBAAT,EAA4BC,SAA5B,QAA6C,SAA7C;AACA,SACCC,eADD,EAECC,sBAFD,EAGCC,uBAHD,QAIO,cAJP;AAKA,SACCC,sBADD,EAECC,mBAFD,EAGCC,eAHD,QAIO,cAJP;AAKA,OAAOC,uBAAP,MAAoC,0CAApC;AACA,SAASC,uBAAT,QAAwC,SAAxC;AACA,SAASC,mBAAT,QAAoC,kCAApC;AAEA,MAAMC,gBAAgB,GAAG,CACxB,GAAGP,uBADqB,EAExBN,kBAFwB,EAGxBE,iBAHwB,EAIxBK,sBAJwB,EAKxBC,mBALwB,CAAzB;;AAQA,MAAMM,eAAe,GAAKC,SAAF,IACvBF,gBAAgB,CAACG,IAAjB,CAAyBC,GAAF,IAAWzB,eAAe,CAAEuB,SAAF,EAAaE,GAAb,CAAjD,CADD;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASC,eAAT,CAA0BC,MAAM,GAAG,EAAnC,EAAwC;AAC9C,QAAMC,MAAM,GAAG,EAAf,CAD8C,CAE9C;AACA;;AACAvB,EAAAA,WAAW,CAAEsB,MAAF,CAAX,CAAsBE,OAAtB,CAAiCC,IAAF,IAAY;AAC1CF,IAA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AAU,CAAEY,SAAS,CAACgF,wBAAZ,CAA1B;AAEA,SACC,8BACG5D,MAAM,IACP2D,OADC,IAEDzF,YAAY,CACX;AACC,IAAA,uBAAuB,EAAG;AACzB2F,MAAAA,MAAM,EAAE7D;AADiB;AAD3B,IADW,EAMX2D,OANW,CAHd,EAYC,cAAC,cAAD,eACM5B,KADN;AAEC,IAAA,SAAS,EACRA,KAAK,CAACxB,UAAN,CAAiBC,KAAjB,EAAwB0C,QAAxB,GACGnF,UAAU,CACVgE,KAAK,CAAC+B,SADI,EAEVf,gCAFU,CADb,GAKGhB,KAAK,CAAC+B;AARX,KAZD,CADD;AA0BA,CA5EmD,EA6EpD,oBA7EoD,CAArD;AAgFA3F,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRkC,YAHQ,CAAT;AAMAlC,SAAS,CACR,kCADQ,EAER,yBAFQ,EAGR2D,YAHQ,CAAT;AAMA3D,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGRmE,YAHQ,CAAT;AAMAnE,SAAS,CACR,kBADQ,EAER,gCAFQ,EAGRsE,iBAHQ,CAAT;AAMAtE,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGR0E,kBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\nimport { shouldSkipSerialization } from './utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization = getBlockSupport( blockType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\t\tconst blockEditingMode = useBlockEditingMode();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && blockEditingMode === 'default' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include elements styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\n\t\tconst skipLinkColorSerialization = shouldSkipSerialization(\n\t\t\tprops.name,\n\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t'link'\n\t\t);\n\n\t\tconst styles = useMemo( () => {\n\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t// styles to override element styles because of higher specificity.\n\t\t\tconst elements = [\n\t\t\t\t{\n\t\t\t\t\tstyles: ! skipLinkColorSerialization\n\t\t\t\t\t\t? props.attributes.style?.elements?.link\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS.link }`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstyles: ! skipLinkColorSerialization\n\t\t\t\t\t\t? props.attributes.style?.elements?.link?.[ ':hover' ]\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselector: `.editor-styles-wrapper .${ blockElementsContainerIdentifier } ${ ELEMENTS.link }:hover`,\n\t\t\t\t},\n\t\t\t];\n\t\t\tconst elementCssRules = [];\n\t\t\tfor ( const { styles: elementStyles, selector } of elements ) {\n\t\t\t\tif ( elementStyles ) {\n\t\t\t\t\tconst cssRule = compileCSS( elementStyles, {\n\t\t\t\t\t\tselector,\n\t\t\t\t\t} );\n\t\t\t\t\telementCssRules.push( cssRule );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn elementCssRules.length > 0\n\t\t\t\t? elementCssRules.join( '' )\n\t\t\t\t: undefined;\n\t\t}, [\n\t\t\tprops.attributes.style?.elements,\n\t\t\tblockElementsContainerIdentifier,\n\t\t\tskipLinkColorSerialization,\n\t\t] );\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ styles &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tprops.attributes.style?.elements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withElementsStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
@@ -90,9 +90,7 @@ export const getAlignWideSupport = nameOrType => getBlockSupport(nameOrType, ALI
90
90
  * @return {boolean} Whether there is support.
91
91
  */
92
92
 
93
- export function hasBorderSupport(nameOrType) {
94
- let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';
95
-
93
+ export function hasBorderSupport(nameOrType, feature = 'any') {
96
94
  if (Platform.OS !== 'web') {
97
95
  return false;
98
96
  }
@@ -104,10 +102,10 @@ export function hasBorderSupport(nameOrType) {
104
102
  }
105
103
 
106
104
  if (feature === 'any') {
107
- return !!(support !== null && support !== void 0 && support.color || support !== null && support !== void 0 && support.radius || support !== null && support !== void 0 && support.width || support !== null && support !== void 0 && support.style);
105
+ return !!(support?.color || support?.radius || support?.width || support?.style);
108
106
  }
109
107
 
110
- return !!(support !== null && support !== void 0 && support[feature]);
108
+ return !!support?.[feature];
111
109
  }
112
110
  /**
113
111
  * Get block support for border properties.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/supports.js"],"names":["getBlockSupport","hasBlockSupport","Platform","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","getAlignSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA,MAAMC,iBAAiB,GAAG,OAA1B;AACA,MAAMC,sBAAsB,GAAG,WAA/B;AACA,MAAMC,kBAAkB,GAAG,sBAA3B;AACA,MAAMC,iBAAiB,GAAG,OAA1B;AACA,MAAMC,6BAA6B,GAAG,iBAAtC;AACA,MAAMC,uBAAuB,GAAG,qCAAhC;AACA,MAAMC,qBAAqB,GAAG,qBAA9B;AACA,MAAMC,uBAAuB,GAAG,uBAAhC;AACA;AACA;AACA;;AACA,MAAMC,sBAAsB,GAAG,oCAA/B;AACA;AACA;AACA;;AACA,MAAMC,uBAAuB,GAAG,qCAAhC;AACA;AACA;AACA;AACA;;AACA,MAAMC,wBAAwB,GAAG,wBAAjC;AACA;AACA;AACA;AACA;;AACA,MAAMC,2BAA2B,GAAG,yCAApC;AACA;AACA;AACA;AACA;;AACA,MAAMC,0BA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oB,GAAK3B,UAAF,IACnCrB,eAAe,CAAEqB,UAAF,EAAcd,uBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAM0C,oBAAoB,GAAK5B,UAAF,IACnCtB,eAAe,CAAEsB,UAAF,EAAcd,uBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAM2C,kBAAkB,GAAK7B,UAAF,IACjCrB,eAAe,CAAEqB,UAAF,EAAcb,qBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAM2C,kBAAkB,GAAK9B,UAAF,IACjCtB,eAAe,CAAEsB,UAAF,EAAcb,qBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAM4C,gBAAgB,GAAK/B,UAAF,IAC/BrB,eAAe,CAAEqB,UAAF,EAAcL,kBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMqC,gBAAgB,GAAKhC,UAAF,IAC/BtB,eAAe,CAAEsB,UAAF,EAAcL,kBAAd,CADT;AAGP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMsC,eAAe,GAAKjC,UAAF,IAC9BF,gBAAgB,CAACoC,IAAjB,CAAyBC,GAAF,IAAWxD,eAAe,CAAEqB,UAAF,EAAcmC,GAAd,CAAjD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = '__experimentalLayout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/supports.js"],"names":["getBlockSupport","hasBlockSupport","Platform","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","getAlignSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"mappings":"AAA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,IAAjB,CAAyBC,GAAF,IAAWxD,eAAe,CAAEqB,UAAF,EAAcmC,GAAd,CAAjD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = '__experimentalLayout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"]}
@@ -17,10 +17,7 @@ import { FONT_SIZE_SUPPORT_KEY } from './font-size';
17
17
  import { cleanEmptyObject, useBlockSettings } from './utils';
18
18
 
19
19
  function omit(object, keys) {
20
- return Object.fromEntries(Object.entries(object).filter(_ref => {
21
- let [key] = _ref;
22
- return !keys.includes(key);
23
- }));
20
+ return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key)));
24
21
  }
25
22
 
26
23
  const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
@@ -33,14 +30,12 @@ export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
33
30
  export const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
34
31
 
35
32
  function styleToAttributes(style) {
36
- var _style$typography, _style$typography2;
37
-
38
33
  const updatedStyle = { ...omit(style, ['fontFamily'])
39
34
  };
40
- const fontSizeValue = style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize;
41
- const fontFamilyValue = style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily;
42
- const fontSizeSlug = fontSizeValue !== null && fontSizeValue !== void 0 && fontSizeValue.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined;
43
- const fontFamilySlug = fontFamilyValue !== null && fontFamilyValue !== void 0 && fontFamilyValue.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined;
35
+ const fontSizeValue = style?.typography?.fontSize;
36
+ const fontFamilyValue = style?.typography?.fontFamily;
37
+ const fontSizeSlug = fontSizeValue?.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined;
38
+ const fontFamilySlug = fontFamilyValue?.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined;
44
39
  updatedStyle.typography = { ...omit(updatedStyle.typography, ['fontFamily']),
45
40
  fontSize: fontSizeSlug ? undefined : fontSizeValue
46
41
  };
@@ -52,21 +47,18 @@ function styleToAttributes(style) {
52
47
  }
53
48
 
54
49
  function attributesToStyle(attributes) {
55
- var _attributes$style, _attributes$style2, _attributes$style2$ty;
56
-
57
50
  return { ...attributes.style,
58
- typography: { ...((_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography),
51
+ typography: { ...attributes.style?.typography,
59
52
  fontFamily: attributes.fontFamily ? 'var:preset|font-family|' + attributes.fontFamily : undefined,
60
- fontSize: attributes.fontSize ? 'var:preset|font-size|' + attributes.fontSize : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : (_attributes$style2$ty = _attributes$style2.typography) === null || _attributes$style2$ty === void 0 ? void 0 : _attributes$style2$ty.fontSize
53
+ fontSize: attributes.fontSize ? 'var:preset|font-size|' + attributes.fontSize : attributes.style?.typography?.fontSize
61
54
  }
62
55
  };
63
56
  }
64
57
 
65
- function TypographyInspectorControl(_ref2) {
66
- let {
67
- children,
68
- resetAllFilter
69
- } = _ref2;
58
+ function TypographyInspectorControl({
59
+ children,
60
+ resetAllFilter
61
+ }) {
70
62
  const attributesResetAllFilter = useCallback(attributes => {
71
63
  const existingStyle = attributesToStyle(attributes);
72
64
  const updatedStyle = resetAllFilter(existingStyle);
@@ -80,14 +72,13 @@ function TypographyInspectorControl(_ref2) {
80
72
  }, children);
81
73
  }
82
74
 
83
- export function TypographyPanel(_ref3) {
84
- let {
85
- clientId,
86
- name,
87
- attributes,
88
- setAttributes,
89
- __unstableParentLayout
90
- } = _ref3;
75
+ export function TypographyPanel({
76
+ clientId,
77
+ name,
78
+ attributes,
79
+ setAttributes,
80
+ __unstableParentLayout
81
+ }) {
91
82
  const settings = useBlockSettings(name, __unstableParentLayout);
92
83
  const isEnabled = useHasTypographyPanel(settings);
93
84
  const value = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/typography.js"],"names":["getBlockSupport","hasBlockSupport","useMemo","useCallback","InspectorControls","default","StylesTypographyPanel","useHasTypographyPanel","LINE_HEIGHT_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","cleanEmptyObject","useBlockSettings","omit","object","keys","Object","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","TypographyPanel","clientId","name","setAttributes","__unstableParentLayout","settings","isEnabled","value","onChange","newStyle","defaultControls","hasTypographySupport","blockName","some"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SACCC,OAAO,IAAIC,qBADZ,EAECC,qBAFD,QAGO,8CAHP;AAKA,SAASC,uBAAT,QAAwC,eAAxC;AACA,SAASC,uBAAT,QAAwC,eAAxC;AACA,SAASC,qBAAT,QAAsC,aAAtC;AACA,SAASC,gBAAT,EAA2BC,gBAA3B,QAAmD,SAAnD;;AAEA,SAASC,IAAT,CAAeC,MAAf,EAAuBC,IAAvB,EAA8B;AAC7B,SAAOC,MAAM,CAACC,WAAP,CACND,MAAM,CAACE,OAAP,CAAgBJ,MAAhB,EAAyBK,MAAzB,CAAiC;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WAAe,CAAEL,IAAI,CAACM,QAAL,CAAeD,GAAf,CAAjB;AAAA,GAAjC,CADM,CAAP;AAGA;;AAED,MAAME,0BAA0B,GAAG,wCAAnC;AACA,MAAMC,0BAA0B,GAAG,wCAAnC;AACA,MAAMC,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QAAMC,QAAQ,GAAG5C,gBAAgB,CAAEyC,IAAF,EAAQE,sBAAR,CAAjC;AACA,QAAME,SAAS,GAAGlD,qBAAqB,CAAEiD,QAAF,CAAvC;AACA,QAAME,KAAK,GAAGxD,OAAO,CAAE,MAAM;AAC5B,WAAO0C,iBAAiB,CAAE;AACzBb,MAAAA,KAAK,EAAEc,UAAU,CAACd,KADO;AAEzBM,MAAAA,UAAU,EAAEQ,UAAU,CAACR,UAFE;AAGzBF,MAAAA,QAAQ,EAAEU,UAAU,CAACV;AAHI,KAAF,CAAxB;AAKA,GANoB,EAMlB,CAAEU,UAAU,CAACd,KAAb,EAAoBc,UAAU,CAACV,QAA/B,EAAyCU,UAAU,CAACR,UAApD,CANkB,CAArB;;AAQA,QAAMsB,QAAQ,GAAKC,QAAF,IAAgB;AAChCN,IAAAA,aAAa,CAAExB,iBAAiB,CAAE8B,QAAF,CAAnB,CAAb;AACA,GAFD;;AAIA,MAAK,CAAEH,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMI,eAAe,GAAG7D,eAAe,CAAEqD,IAAF,EAAQ,CAC9CzB,sBAD8C,EAE9C,+BAF8C,CAAR,CAAvC;AAKA,SACC,cAAC,qBAAD;AACC,IAAA,EAAE,EAAGkB,0BADN;AAEC,IAAA,OAAO,EAAGM,QAFX;AAGC,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,KAAK,EAAGE,KAJT;AAKC,IAAA,QAAQ,EAAGC,QALZ;AAMC,IAAA,eAAe,EAAGE;AANnB,IADD;AAUA;AAED,OAAO,MAAMC,oBAAoB,GAAKC,SAAF,IAAiB;AACpD,SAAOlC,uBAAuB,CAACmC,IAAxB,CAAgC5C,GAAF,IACpCnB,eAAe,CAAE8D,SAAF,EAAa3C,GAAb,CADT,CAAP;AAGA,CAJM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { cleanEmptyObject, useBlockSettings } from './utils';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( {\n\tclientId,\n\tname,\n\tattributes,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle: attributes.style,\n\t\t\tfontFamily: attributes.fontFamily,\n\t\t\tfontSize: attributes.fontSize,\n\t\t} );\n\t}, [ attributes.style, attributes.fontSize, attributes.fontFamily ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/typography.js"],"names":["getBlockSupport","hasBlockSupport","useMemo","useCallback","InspectorControls","default","StylesTypographyPanel","useHasTypographyPanel","LINE_HEIGHT_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","cleanEmptyObject","useBlockSettings","omit","object","keys","Object","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","existingStyle","TypographyPanel","clientId","name","setAttributes","__unstableParentLayout","settings","isEnabled","value","onChange","newStyle","defaultControls","hasTypographySupport","blockName","some"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SACCC,OAAO,IAAIC,qBADZ,EAECC,qBAFD,QAGO,8CAHP;AAKA,SAASC,uBAAT,QAAwC,eAAxC;AACA,SAASC,uBAAT,QAAwC,eAAxC;AACA,SAASC,qBAAT,QAAsC,aAAtC;AACA,SAASC,gBAAT,EAA2BC,gBAA3B,QAAmD,SAAnD;;AAEA,SAASC,IAAT,CAAeC,MAAf,EAAuBC,IAAvB,EAA8B;AAC7B,SAAOC,MAAM,CAACC,WAAP,CACND,MAAM,CAACE,OAAP,CAAgBJ,MAAhB,EAAyBK,MAAzB,CAAiC,CAAE,CAAEC,GAAF,CAAF,KAAe,CAAEL,IAAI,CAACM,QAAL,CAAeD,GAAf,CAAlD,CADM,CAAP;AAGA;;AAED,MAAME,0BAA0B,GAAG,wCAAnC;AACA,MAAMC,0BAA0B,GAAG,wCAAnC;AACA,MAAMC,2BAA2B,GAAG,yCAApC;AACA,MAAMC,wBAAwB,GAAG,wBAAjC;AACA,MAAMC,sBAAsB,GAAG,oCAA/B;AACA,MAAMC,uBAAuB,GAAG,qCAAhC;AACA,OAAO,MAAMC,sBAAsB,GAAG,YAA/B;AACP,OAAO,MAAMC,uBAAuB,GAAG,CACtCrB,uBADsC,EAEtCE,qBAFsC,EAGtCgB,sBAHsC,EAItCC,uBAJsC,EAKtClB,uBALsC,EAMtCgB,wBANsC,EAOtCD,2BAPsC,EAQtCD,0BARsC,EAStCD,0BATsC,CAAhC;;AAYP,SAASQ,iBAAT,CAA4BC,KAA5B,EAAoC;AACnC,QAAMC,YAAY,GAAG,EAAE,GAAGnB,IAAI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Ae,GAAG7D,eAAe,CAAEqD,IAAF,EAAQ,CAC9CzB,sBAD8C,EAE9C,+BAF8C,CAAR,CAAvC;AAKA,SACC,cAAC,qBAAD;AACC,IAAA,EAAE,EAAGkB,0BADN;AAEC,IAAA,OAAO,EAAGM,QAFX;AAGC,IAAA,QAAQ,EAAGI,QAHZ;AAIC,IAAA,KAAK,EAAGE,KAJT;AAKC,IAAA,QAAQ,EAAGC,QALZ;AAMC,IAAA,eAAe,EAAGE;AANnB,IADD;AAUA;AAED,OAAO,MAAMC,oBAAoB,GAAKC,SAAF,IAAiB;AACpD,SAAOlC,uBAAuB,CAACmC,IAAxB,CAAgC5C,GAAF,IACpCnB,eAAe,CAAE8D,SAAF,EAAa3C,GAAb,CADT,CAAP;AAGA,CAJM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { cleanEmptyObject, useBlockSettings } from './utils';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( {\n\tclientId,\n\tname,\n\tattributes,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle: attributes.style,\n\t\t\tfontFamily: attributes.fontFamily,\n\t\t\tfontSize: attributes.fontSize,\n\t\t} );\n\t}, [ attributes.style, attributes.fontSize, attributes.fontFamily ] );\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"]}
@@ -32,8 +32,7 @@ const hasTypographySupport = blockName => {
32
32
  return TYPOGRAPHY_SUPPORT_KEYS.some(key => hasBlockSupport(blockName, key));
33
33
  };
34
34
 
35
- function useIsTypographyDisabled() {
36
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
+ function useIsTypographyDisabled(props = {}) {
37
36
  const configs = [useIsFontSizeDisabled(props), useIsLineHeightDisabled(props)];
38
37
  return configs.filter(Boolean).length === configs.length;
39
38
  }