@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":["CustomSelectControl","componentsPrivateApis","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","blockEditorStore","parents","length","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","Platform","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","BlockList","__unstableElementContext","positionSelector","css"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA;;;;AAbA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAA0B,wBAAQC,uBAAR,CAAhC;AAEA,MAAMC,oBAAoB,GAAG,UAA7B;AAEA,MAAMC,gBAAgB,GACrB,gEADD;AAGA,MAAMC,cAAc,GAAG;AACtBC,EAAAA,GAAG,EAAE,SADiB;AAEtBC,EAAAA,KAAK,EAAE,EAFe;AAGtBC,EAAAA,IAAI,EAAE,cAAI,SAAJ,CAHgB;AAItBC,EAAAA,SAAS,EAAEL;AAJW,CAAvB;AAOA,MAAMM,aAAa,GAAG;AACrBJ,EAAAA,GAAG,EAAE,QADgB;AAErBC,EAAAA,KAAK,EAAE,Q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,MAAAA,KAAK,EAAEkB,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAElB;AAFJ,KAAF,CAAd,IAGO,EAJR;AAKA,GAvBiC,CAyBlC;;;AACA,QAAMR,SAAS,GAAG,yBAAYyB,KAAZ,aAAYA,KAAZ,uBAAYA,KAAK,CAAEzB,SAAnB,EAA8B;AAC/C,KAAG,gBAAgBqE,EAAI,EAAvB,GAA4BD,mBAAmB,IAAI,CAAC,CAAEM,GADP;AACY;AAC3D,KAAG,eAAehD,UAAhB,aAAgBA,UAAhB,6CAAgBA,UAAU,CAAElB,KAA5B,gFAAgB,mBAAmBI,QAAnC,0DAAgB,sBAA6BF,IAAM,EAArD,GACC0D,mBAAmB,IACnB,CAAC,CAAEM,GADH,IAEA,CAAC,EAAEhD,UAAF,aAAEA,UAAF,qCAAEA,UAAU,CAAElB,KAAd,wEAAE,mBAAmBI,QAArB,kDAAE,sBAA6BF,IAA/B;AAL6C,GAA9B,CAAlB;AAQA,SACC,qDACG0D,mBAAmB,IACpBE,OADC,IAED,CAAC,CAAEI,GAFF,IAGD,2BAAc,2CAASA,GAAT,CAAd,EAAsCJ,OAAtC,CAJF,EAKC,4BAAC,cAAD,6BAAqB7C,KAArB;AAA6B,IAAA,SAAS,EAAGzB;AAAzC,KALD,CADD;AASA,CA5CgC,EA6CjC,oBA7CiC,CAA3B;;AAgDP,sBACC,uBADD,EAEC,2CAFD,EAGCiE,kBAHD;AAKA,sBACC,kBADD,EAEC,8CAFD,EAGCJ,qBAHD","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":["CustomSelectControl","componentsPrivateApis","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","blockEditorStore","parents","length","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","Platform","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","BlockList","__unstableElementContext","positionSelector","css"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA;;;;AAbA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAA0B,wBAAQC,uBAAR,CAAhC;AAEA,MAAMC,oBAAoB,GAAG,UAA7B;AAEA,MAAMC,gBAAgB,GACrB,gEADD;AAGA,MAAMC,cAAc,GAAG;AACtBC,EAAAA,GAAG,EAAE,SADiB;AAEtBC,EAAAA,KAAK,EAAE,EAFe;AAGtBC,EAAAA,IAAI,EAAE,cAAI,SAAJ,CAHgB;AAItBC,EAAAA,SAAS,EAAEL;AAJW,CAAvB;AAOA,MAAMM,aAAa,GAAG;AACrBJ,EAAAA,GAAG,EAAE,QADgB;AAErBC,EAAAA,KAAK,EAAE,QAFc;AAGrBC,EAAAA,IAAI,EAAE,cAAI,QAAJ,EAAc,iDAAd,CAHe;AAIrBC,EAAAA,SAAS,EAAEL,gBAJU;AAKrBO,EAAAA,kBAAkB,EAAE,cACnB,qEADmB;AALC,CAAtB;AAUA,MAAMC,YAAY,GAAG;AACpBN,EAAAA,GAAG,EAAE,OADe;AAEpBC,EAAAA,KAAK,EAAE,OAFa;AAGpBC,EAAAA,IAAI,EAAE,cAAI,OAAJ,EAAa,iDAAb,CAHc;AAIpBC,EAAAA,SAAS,EAAEL,gBAJS;AAKpBO,EAAAA,kBAAkB,EAAE,cACnB,oDADmB;AALA,CAArB;AAUA,MAAME,cAAc,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAAvB;AACA,MAAMC,oBAAoB,GAAG,CAAE,QAAF,EAAY,OAAZ,CAA7B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,cAAT,CAAyB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AACA,QAAMI,OAAO,GAAG,yBAAYC,mBAAUC,wBAAtB,CAAhB,CAVkC,CAYlC;;AACA,QAAMC,gBAAgB,GAAI,iBAAiBJ,EAAI,iBAAiBA,EAAI,EAApE,CAbkC,CAelC;;AACA,MAAIK,GAAJ;;AACA,MAAKN,mBAAL,EAA2B;AAC1BM,IAAAA,GAAG,GACFpE,cAAc,CAAE;AACfC,MAAAA,QAAQ,EAAEkE,gBADK;AAEfjE,MAAAA,KAAK,EAAEkB,UAAU,EAAElB;AAFJ,KAAF,CAAd,IAGO,EAJR;AAKA,GAvBiC,CAyBlC;;;AACA,QAAMR,SAAS,GAAG,yBAAYyB,KAAK,EAAEzB,SAAnB,EAA8B;AAC/C,KAAG,gBAAgBqE,EAAI,EAAvB,GAA4BD,mBAAmB,IAAI,CAAC,CAAEM,GADP;AACY;AAC3D,KAAG,eAAehD,UAAU,EAAElB,KAAZ,EAAmBI,QAAnB,EAA6BF,IAAM,EAArD,GACC0D,mBAAmB,IACnB,CAAC,CAAEM,GADH,IAEA,CAAC,CAAEhD,UAAU,EAAElB,KAAZ,EAAmBI,QAAnB,EAA6BF;AALc,GAA9B,CAAlB;AAQA,SACC,qDACG0D,mBAAmB,IACpBE,OADC,IAED,CAAC,CAAEI,GAFF,IAGD,2BAAc,2CAASA,GAAT,CAAd,EAAsCJ,OAAtC,CAJF,EAKC,4BAAC,cAAD,6BAAqB7C,KAArB;AAA6B,IAAA,SAAS,EAAGzB;AAAzC,KALD,CADD;AASA,CA5CgC,EA6CjC,oBA7CiC,CAA3B;;AAgDP,sBACC,uBADD,EAEC,2CAFD,EAGCiE,kBAHD;AAKA,sBACC,kBADD,EAEC,8CAFD,EAGCJ,qBAHD","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"]}
@@ -10,14 +10,12 @@ var _blocks = require("@wordpress/blocks");
10
10
  const hasSettingsSupport = blockType => (0, _blocks.hasBlockSupport)(blockType, '__experimentalSettings', false);
11
11
 
12
12
  function addAttribute(settings) {
13
- var _settings$attributes;
14
-
15
13
  if (!hasSettingsSupport(settings)) {
16
14
  return settings;
17
15
  } // Allow blocks to specify their own attribute definition with default values if needed.
18
16
 
19
17
 
20
- if (!(settings !== null && settings !== void 0 && (_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 && _settings$attributes.settings)) {
18
+ if (!settings?.attributes?.settings) {
21
19
  settings.attributes = { ...settings.attributes,
22
20
  settings: {
23
21
  type: 'object'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/settings.js"],"names":["hasSettingsSupport","blockType","addAttribute","settings","attributes","type"],"mappings":";;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,kBAAkB,GAAKC,SAAF,IAC1B,6BAAiBA,SAAjB,EAA4B,wBAA5B,EAAsD,KAAtD,CADD;;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;;AAED,sBACC,0BADD,EAEC,4BAFD,EAGCD,YAHD","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":["hasSettingsSupport","blockType","addAttribute","settings","attributes","type"],"mappings":";;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,kBAAkB,GAAKC,SAAF,IAC1B,6BAAiBA,SAAjB,EAA4B,wBAA5B,EAAsD,KAAtD,CADD;;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;;AAED,sBACC,0BADD,EAEC,4BAFD,EAGCD,YAHD","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"]}
@@ -39,6 +39,8 @@ var _useDisplayBlockControls = _interopRequireDefault(require("../components/use
39
39
 
40
40
  var _utils = require("./utils");
41
41
 
42
+ var _blockEditingMode = require("../components/block-editing-mode");
43
+
42
44
  /**
43
45
  * External dependencies
44
46
  */
@@ -62,8 +64,7 @@ const hasStyleSupport = blockType => styleSupportKeys.some(key => (0, _blocks.ha
62
64
  */
63
65
 
64
66
 
65
- function getInlineStyles() {
66
- let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
67
+ function getInlineStyles(styles = {}) {
67
68
  const output = {}; // The goal is to move everything to server side generated engine styles
68
69
  // This is temporary as we absorb more and more styles into the engine.
69
70
 
@@ -235,9 +236,7 @@ const renamedFeatures = {
235
236
  * @return {Object} Styles object with the specified paths removed.
236
237
  */
237
238
 
238
- function omitStyle(style, paths) {
239
- let preserveReference = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
240
-
239
+ function omitStyle(style, paths, preserveReference = false) {
241
240
  if (!style) {
242
241
  return style;
243
242
  }
@@ -278,9 +277,7 @@ function omitStyle(style, paths) {
278
277
  */
279
278
 
280
279
 
281
- function addSaveProps(props, blockType, attributes) {
282
- let skipPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : skipSerializationPathsSave;
283
-
280
+ function addSaveProps(props, blockType, attributes, skipPaths = skipSerializationPathsSave) {
284
281
  if (!hasStyleSupport(blockType)) {
285
282
  return props;
286
283
  }
@@ -288,8 +285,7 @@ function addSaveProps(props, blockType, attributes) {
288
285
  let {
289
286
  style
290
287
  } = attributes;
291
- Object.entries(skipPaths).forEach(_ref => {
292
- let [indicator, path] = _ref;
288
+ Object.entries(skipPaths).forEach(([indicator, path]) => {
293
289
  const skipSerialization = (0, _blocks.getBlockSupport)(blockType, indicator);
294
290
 
295
291
  if (skipSerialization === true) {
@@ -349,7 +345,8 @@ function addEditProps(settings) {
349
345
 
350
346
  const withBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
351
347
  const shouldDisplayControls = (0, _useDisplayBlockControls.default)();
352
- return (0, _element.createElement)(_element.Fragment, null, shouldDisplayControls && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_color.ColorEdit, props), (0, _element.createElement)(_typography.TypographyPanel, props), (0, _element.createElement)(_border.BorderPanel, props), (0, _element.createElement)(_dimensions.DimensionsPanel, props)), (0, _element.createElement)(BlockEdit, props));
348
+ const blockEditingMode = (0, _blockEditingMode.useBlockEditingMode)();
349
+ return (0, _element.createElement)(_element.Fragment, null, shouldDisplayControls && blockEditingMode === 'default' && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_color.ColorEdit, props), (0, _element.createElement)(_typography.TypographyPanel, props), (0, _element.createElement)(_border.BorderPanel, props), (0, _element.createElement)(_dimensions.DimensionsPanel, props)), (0, _element.createElement)(BlockEdit, props));
353
350
  }, 'withToolbarControls');
354
351
  /**
355
352
  * Override the default block element to include elements styles.
@@ -360,21 +357,17 @@ const withBlockControls = (0, _compose.createHigherOrderComponent)(BlockEdit =>
360
357
 
361
358
  exports.withBlockControls = withBlockControls;
362
359
  const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
363
- var _props$attributes$sty6, _props$attributes$sty7;
364
-
365
360
  const blockElementsContainerIdentifier = `wp-elements-${(0, _compose.useInstanceId)(BlockListBlock)}`;
366
361
  const skipLinkColorSerialization = (0, _utils.shouldSkipSerialization)(props.name, _color.COLOR_SUPPORT_KEY, 'link');
367
362
  const styles = (0, _element.useMemo)(() => {
368
- var _props$attributes$sty, _props$attributes$sty2, _props$attributes$sty3, _props$attributes$sty4, _props$attributes$sty5;
369
-
370
363
  // The .editor-styles-wrapper selector is required on elements styles. As it is
371
364
  // added to all other editor styles, not providing it causes reset and global
372
365
  // styles to override element styles because of higher specificity.
373
366
  const elements = [{
374
- 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,
367
+ styles: !skipLinkColorSerialization ? props.attributes.style?.elements?.link : undefined,
375
368
  selector: `.editor-styles-wrapper .${blockElementsContainerIdentifier} ${_blocks.__EXPERIMENTAL_ELEMENTS.link}`
376
369
  }, {
377
- 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,
370
+ styles: !skipLinkColorSerialization ? props.attributes.style?.elements?.link?.[':hover'] : undefined,
378
371
  selector: `.editor-styles-wrapper .${blockElementsContainerIdentifier} ${_blocks.__EXPERIMENTAL_ELEMENTS.link}:hover`
379
372
  }];
380
373
  const elementCssRules = [];
@@ -392,14 +385,14 @@ const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
392
385
  }
393
386
 
394
387
  return elementCssRules.length > 0 ? elementCssRules.join('') : undefined;
395
- }, [(_props$attributes$sty6 = props.attributes.style) === null || _props$attributes$sty6 === void 0 ? void 0 : _props$attributes$sty6.elements, blockElementsContainerIdentifier, skipLinkColorSerialization]);
388
+ }, [props.attributes.style?.elements, blockElementsContainerIdentifier, skipLinkColorSerialization]);
396
389
  const element = (0, _element.useContext)(_blockList.default.__unstableElementContext);
397
390
  return (0, _element.createElement)(_element.Fragment, null, styles && element && (0, _element.createPortal)((0, _element.createElement)("style", {
398
391
  dangerouslySetInnerHTML: {
399
392
  __html: styles
400
393
  }
401
394
  }), element), (0, _element.createElement)(BlockListBlock, (0, _extends2.default)({}, props, {
402
- className: (_props$attributes$sty7 = props.attributes.style) !== null && _props$attributes$sty7 !== void 0 && _props$attributes$sty7.elements ? (0, _classnames.default)(props.className, blockElementsContainerIdentifier) : props.className
395
+ className: props.attributes.style?.elements ? (0, _classnames.default)(props.className, blockElementsContainerIdentifier) : props.className
403
396
  })));
404
397
  }, 'withElementsStyles');
405
398
  (0, _hooks.addFilter)('blocks.registerBlockType', 'core/style/addAttribute', addAttribute);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","blockType","some","key","getInlineStyles","styles","output","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","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","ELEMENTS","elementCssRules","elementStyles","cssRule","push","join","element","BlockList","__unstableElementContext","__html","className"],"mappings":";;;;;;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAiBA,MAAMA,gBAAgB,GAAG,CACxB,GAAGC,mCADqB,EAExBC,0BAFwB,EAGxBC,wBAHwB,EAIxBC,kCAJwB,EAKxBC,+BALwB,CAAzB;;AAQA,MAAMC,eAAe,GAAKC,SAAF,IACvBP,gBAAgB,CAACQ,IAAjB,CAAyBC,GAAF,IAAW,6BAAiBF,SAAjB,EAA4BE,GAA5B,CAAlC,CADD;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,eAAT,GAAwC;AAAA,MAAdC,MAAc,uEAAL,EAAK;AAC9C,QAAMC,MAAM,GAAG,EAAf,CAD8C,CAE9C;AACA;;AACA,gCAAaD,MAAb,EAAsBE,OAAtB,CAAiCC,IAAF,IAAY;AAC1CF,IAAAA,MAAM,CAAEE,IAAI,CAACL,GAAP,CAAN,G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/D;AADiB;AAD3B,IADD,EAMC4D,OAND,CAHF,EAYC,4BAAC,cAAD,6BACM5B,KADN;AAEC,IAAA,SAAS,EACR,0BAAAA,KAAK,CAACzB,UAAN,CAAiBC,KAAjB,0EAAwB0C,QAAxB,GACG,yBACAlB,KAAK,CAACgC,SADN,EAEAjB,gCAFA,CADH,GAKGf,KAAK,CAACgC;AARX,KAZD,CADD;AA0BA,CA5EyB,EA6E1B,oBA7E0B,CAA3B;AAgFA,sBACC,0BADD,EAEC,yBAFD,EAGC3D,YAHD;AAMA,sBACC,kCADD,EAEC,yBAFD,EAGC0B,YAHD;AAMA,sBACC,0BADD,EAEC,yBAFD,EAGCQ,YAHD;AAMA,sBACC,kBADD,EAEC,gCAFD,EAGCG,iBAHD;AAMA,sBACC,uBADD,EAEC,kCAFD,EAGCG,kBAHD","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":["styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","SPACING_SUPPORT_KEY","hasStyleSupport","blockType","some","key","getInlineStyles","styles","output","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","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","ELEMENTS","elementCssRules","elementStyles","cssRule","push","join","element","BlockList","__unstableElementContext","__html","className"],"mappings":";;;;;;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AApCA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAkBA,MAAMA,gBAAgB,GAAG,CACxB,GAAGC,mCADqB,EAExBC,0BAFwB,EAGxBC,wBAHwB,EAIxBC,kCAJwB,EAKxBC,+BALwB,CAAzB;;AAQA,MAAMC,eAAe,GAAKC,SAAF,IACvBP,gBAAgB,CAACQ,IAAjB,CAAyBC,GAAF,IAAW,6BAAiBF,SAAjB,EAA4BE,GAA5B,CAAlC,CADD;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,eAAT,CAA0BC,M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KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMqB,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;;AACO,SAASC,SAAT,CAAoBT,KAApB,EAA2BU,KAA3B,EAAkCC,iBAAiB,GAAG,KAAtD,EAA8D;AACpE,MAAK,CAAEX,KAAP,EAAe;AACd,WAAOA,KAAP;AACA;;AAED,MAAIY,QAAQ,GAAGZ,KAAf;;AACA,MAAK,CAAEW,iBAAP,EAA2B;AAC1BC,IAAAA,QAAQ,GAAGC,IAAI,CAACC,KAAL,CAAYD,IAAI,CAACE,SAAL,CAAgBf,KAAhB,CAAZ,CAAX;AACA;;AAED,MAAK,CAAEgB,KAAK,CAACC,OAAN,CAAeP,KAAf,CAAP,EAAgC;AAC/BA,IAAAA,KAAK,GAAG,CAAEA,KAAF,CAAR;AACA;;AAEDA,EAAAA,KAAK,CAAChB,OAAN,CAAiBwB,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;AACt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BAHE,CA9BY,CAAf;AAoCA,QAAMY,OAAO,GAAG,yBAAYC,mBAAUC,wBAAtB,CAAhB;AAEA,SACC,qDACG/D,MAAM,IACP6D,OADC,IAED,2BACC;AACC,IAAA,uBAAuB,EAAG;AACzBG,MAAAA,MAAM,EAAEhE;AADiB;AAD3B,IADD,EAMC6D,OAND,CAHF,EAYC,4BAAC,cAAD,6BACM7B,KADN;AAEC,IAAA,SAAS,EACRA,KAAK,CAACzB,UAAN,CAAiBC,KAAjB,EAAwB2C,QAAxB,GACG,yBACAnB,KAAK,CAACiC,SADN,EAEAjB,gCAFA,CADH,GAKGhB,KAAK,CAACiC;AARX,KAZD,CADD;AA0BA,CA5EyB,EA6E1B,oBA7E0B,CAA3B;AAgFA,sBACC,0BADD,EAEC,yBAFD,EAGC5D,YAHD;AAMA,sBACC,kCADD,EAEC,yBAFD,EAGC0B,YAHD;AAMA,sBACC,0BADD,EAEC,yBAFD,EAGCQ,YAHD;AAMA,sBACC,kBADD,EAEC,gCAFD,EAGCG,iBAHD;AAMA,sBACC,uBADD,EAEC,kCAFD,EAGCI,kBAHD","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"]}
@@ -113,9 +113,7 @@ const getAlignWideSupport = nameOrType => (0, _blocks.getBlockSupport)(nameOrTyp
113
113
 
114
114
  exports.getAlignWideSupport = getAlignWideSupport;
115
115
 
116
- function hasBorderSupport(nameOrType) {
117
- let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';
118
-
116
+ function hasBorderSupport(nameOrType, feature = 'any') {
119
117
  if (_element.Platform.OS !== 'web') {
120
118
  return false;
121
119
  }
@@ -127,10 +125,10 @@ function hasBorderSupport(nameOrType) {
127
125
  }
128
126
 
129
127
  if (feature === 'any') {
130
- 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);
128
+ return !!(support?.color || support?.radius || support?.width || support?.style);
131
129
  }
132
130
 
133
- return !!(support !== null && support !== void 0 && support[feature]);
131
+ return !!support?.[feature];
134
132
  }
135
133
  /**
136
134
  * Get block support for border properties.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/supports.js"],"names":["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","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,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,0BAA0B,GAAG,wCAAnC;AACA;AACA;AACA;AACA;;AACA,MAAMC,0BAA0B,GAAG,wCAAnC;AACA,MAAMC,kBAAkB,GAAG,sBAA3B;AACA,MAAMC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AAM4C,kBAAkB,GAAK9B,UAAF,IACjC,6BAAiBA,UAAjB,EAA6Bb,qBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM4C,kBAAkB,GAAK/B,UAAF,IACjC,6BAAiBA,UAAjB,EAA6Bb,qBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM6C,gBAAgB,GAAKhC,UAAF,IAC/B,6BAAiBA,UAAjB,EAA6BL,kBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMsC,gBAAgB,GAAKjC,UAAF,IAC/B,6BAAiBA,UAAjB,EAA6BL,kBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMuC,eAAe,GAAKlC,UAAF,IAC9BF,gBAAgB,CAACqC,IAAjB,CAAyBC,GAAF,IAAW,6BAAiBpC,UAAjB,EAA6BoC,GAA7B,CAAlC,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":["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","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,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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AACA;;;;;AACO,MAAM2C,oBAAoB,GAAK5B,UAAF,IACnC,6BAAiBA,UAAjB,EAA6Bd,uBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM2C,oBAAoB,GAAK7B,UAAF,IACnC,6BAAiBA,UAAjB,EAA6Bd,uBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM4C,kBAAkB,GAAK9B,UAAF,IACjC,6BAAiBA,UAAjB,EAA6Bb,qBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM4C,kBAAkB,GAAK/B,UAAF,IACjC,6BAAiBA,UAAjB,EAA6Bb,qBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM6C,gBAAgB,GAAKhC,UAAF,IAC/B,6BAAiBA,UAAjB,EAA6BL,kBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMsC,gBAAgB,GAAKjC,UAAF,IAC/B,6BAAiBA,UAAjB,EAA6BL,kBAA7B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMuC,eAAe,GAAKlC,UAAF,IAC9BF,gBAAgB,CAACqC,IAAjB,CAAyBC,GAAF,IAAW,6BAAiBpC,UAAjB,EAA6BoC,GAA7B,CAAlC,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"]}
@@ -37,10 +37,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
37
37
  * Internal dependencies
38
38
  */
39
39
  function omit(object, keys) {
40
- return Object.fromEntries(Object.entries(object).filter(_ref => {
41
- let [key] = _ref;
42
- return !keys.includes(key);
43
- }));
40
+ return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key)));
44
41
  }
45
42
 
46
43
  const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
@@ -55,14 +52,12 @@ const TYPOGRAPHY_SUPPORT_KEYS = [_lineHeight.LINE_HEIGHT_SUPPORT_KEY, _fontSize.
55
52
  exports.TYPOGRAPHY_SUPPORT_KEYS = TYPOGRAPHY_SUPPORT_KEYS;
56
53
 
57
54
  function styleToAttributes(style) {
58
- var _style$typography, _style$typography2;
59
-
60
55
  const updatedStyle = { ...omit(style, ['fontFamily'])
61
56
  };
62
- const fontSizeValue = style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize;
63
- const fontFamilyValue = style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontFamily;
64
- const fontSizeSlug = fontSizeValue !== null && fontSizeValue !== void 0 && fontSizeValue.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined;
65
- const fontFamilySlug = fontFamilyValue !== null && fontFamilyValue !== void 0 && fontFamilyValue.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined;
57
+ const fontSizeValue = style?.typography?.fontSize;
58
+ const fontFamilyValue = style?.typography?.fontFamily;
59
+ const fontSizeSlug = fontSizeValue?.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined;
60
+ const fontFamilySlug = fontFamilyValue?.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined;
66
61
  updatedStyle.typography = { ...omit(updatedStyle.typography, ['fontFamily']),
67
62
  fontSize: fontSizeSlug ? undefined : fontSizeValue
68
63
  };
@@ -74,21 +69,18 @@ function styleToAttributes(style) {
74
69
  }
75
70
 
76
71
  function attributesToStyle(attributes) {
77
- var _attributes$style, _attributes$style2, _attributes$style2$ty;
78
-
79
72
  return { ...attributes.style,
80
- typography: { ...((_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography),
73
+ typography: { ...attributes.style?.typography,
81
74
  fontFamily: attributes.fontFamily ? 'var:preset|font-family|' + attributes.fontFamily : undefined,
82
- 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
75
+ fontSize: attributes.fontSize ? 'var:preset|font-size|' + attributes.fontSize : attributes.style?.typography?.fontSize
83
76
  }
84
77
  };
85
78
  }
86
79
 
87
- function TypographyInspectorControl(_ref2) {
88
- let {
89
- children,
90
- resetAllFilter
91
- } = _ref2;
80
+ function TypographyInspectorControl({
81
+ children,
82
+ resetAllFilter
83
+ }) {
92
84
  const attributesResetAllFilter = (0, _element.useCallback)(attributes => {
93
85
  const existingStyle = attributesToStyle(attributes);
94
86
  const updatedStyle = resetAllFilter(existingStyle);
@@ -102,14 +94,13 @@ function TypographyInspectorControl(_ref2) {
102
94
  }, children);
103
95
  }
104
96
 
105
- function TypographyPanel(_ref3) {
106
- let {
107
- clientId,
108
- name,
109
- attributes,
110
- setAttributes,
111
- __unstableParentLayout
112
- } = _ref3;
97
+ function TypographyPanel({
98
+ clientId,
99
+ name,
100
+ attributes,
101
+ setAttributes,
102
+ __unstableParentLayout
103
+ }) {
113
104
  const settings = (0, _utils.useBlockSettings)(name, __unstableParentLayout);
114
105
  const isEnabled = (0, _typographyPanel.useHasTypographyPanel)(settings);
115
106
  const value = (0, _element.useMemo)(() => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/typography.js"],"names":["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","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","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":";;;;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;AAYA,SAASA,IAAT,CAAeC,MAAf,EAAuBC,IAAvB,EAA8B;AAC7B,SAAOC,MAAM,CAACC,WAAP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sC,IAAxB,CAAgC/C,GAAF,IACpC,6BAAiB8C,SAAjB,EAA4B9C,GAA5B,CADM,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":["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","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","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":";;;;;;;;;;;AAIA;;AADA;;AAMA;;AACA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;AAYA,SAASA,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;AACO,MAAMC,sBAAsB,GAAG,YAA/B;;AACA,MAAMC,uBAAuB,GAAG,CACtCC,mCADsC,EAEtCC,+BAFsC,EAGtCL,sBAHsC,EAItCC,uBAJsC,EAKtCK,mCALsC,EAMtCP,wBANsC,EAOtCD,2BAPsC,EAQtCD,0BARsC,EAStCD,0BATsC,CAAhC;;;AAYP,SAASW,iBAAT,CAA4BC,KAA5B,EAAoC;AACnC,QAAMC,YAAY,GAAG,EAAE,GAAGtB,IAAI,CAAEqB,KAAF,EAAS,CAAE,YAAF,CAAT;AAAT,GAArB;AACA,QAAME,aAAa,GAAGF,KAAK,EAAEG,UAAP,EAAmBC,QAAzC;AACA,QAAMC,eAAe,GAAGL,KAAK,EAAEG,UAAP,EAAmBG,UAA3C;AACA,QAAMC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AJT;AAKC,IAAA,QAAQ,EAAGC,QALZ;AAMC,IAAA,eAAe,EAAGE;AANnB,IADD;AAUA;;AAEM,MAAMC,oBAAoB,GAAKC,SAAF,IAAiB;AACpD,SAAOrC,uBAAuB,CAACsC,IAAxB,CAAgC/C,GAAF,IACpC,6BAAiB8C,SAAjB,EAA4B9C,GAA5B,CADM,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"]}
@@ -51,8 +51,7 @@ const hasTypographySupport = blockName => {
51
51
  return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0, _blocks.hasBlockSupport)(blockName, key));
52
52
  };
53
53
 
54
- function useIsTypographyDisabled() {
55
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
54
+ function useIsTypographyDisabled(props = {}) {
56
55
  const configs = [(0, _fontSize.useIsFontSizeDisabled)(props), (0, _lineHeight.useIsLineHeightDisabled)(props)];
57
56
  return configs.filter(Boolean).length === configs.length;
58
57
  }