@wordpress/block-editor 15.20.0 → 15.21.1

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 (430) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/components/block-compare/index.cjs +2 -2
  3. package/build/components/block-compare/index.cjs.map +2 -2
  4. package/build/components/block-list/use-block-props/index.cjs +1 -1
  5. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  6. package/build/components/block-patterns-list/index.cjs +1 -1
  7. package/build/components/block-patterns-list/index.cjs.map +2 -2
  8. package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
  9. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  10. package/build/components/block-switcher/index.cjs +4 -4
  11. package/build/components/block-switcher/index.cjs.map +2 -2
  12. package/build/components/child-layout-control/index.cjs +10 -5
  13. package/build/components/child-layout-control/index.cjs.map +2 -2
  14. package/build/components/global-styles/advanced-panel.cjs +23 -15
  15. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  16. package/build/components/global-styles/background-panel.cjs +2 -2
  17. package/build/components/global-styles/background-panel.cjs.map +2 -2
  18. package/build/components/global-styles/border-panel.cjs +2 -0
  19. package/build/components/global-styles/border-panel.cjs.map +2 -2
  20. package/build/components/global-styles/dimensions-panel.cjs +5 -4
  21. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  22. package/build/components/iframe/index.cjs +3 -0
  23. package/build/components/iframe/index.cjs.map +2 -2
  24. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
  25. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
  26. package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
  27. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  28. package/build/components/inserter/index.cjs +179 -220
  29. package/build/components/inserter/index.cjs.map +3 -3
  30. package/build/components/inserter/media-tab/utils.cjs +1 -1
  31. package/build/components/inserter/media-tab/utils.cjs.map +2 -2
  32. package/build/components/inserter/search-results.cjs +1 -1
  33. package/build/components/inserter/search-results.cjs.map +2 -2
  34. package/build/components/list-view/block-select-button.cjs +10 -12
  35. package/build/components/list-view/block-select-button.cjs.map +2 -2
  36. package/build/components/list-view/block.cjs +2 -1
  37. package/build/components/list-view/block.cjs.map +2 -2
  38. package/build/components/provider/use-block-sync.cjs +11 -2
  39. package/build/components/provider/use-block-sync.cjs.map +2 -2
  40. package/build/components/rich-text/event-listeners/before-input-rules.cjs +4 -4
  41. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  42. package/build/components/rich-text/event-listeners/delete.cjs +4 -4
  43. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  44. package/build/components/rich-text/event-listeners/enter.cjs +7 -2
  45. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  46. package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
  47. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  48. package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
  49. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  50. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
  51. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  52. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
  53. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  54. package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
  55. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  56. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
  57. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  58. package/build/components/rich-text/index.cjs +1 -23
  59. package/build/components/rich-text/index.cjs.map +2 -2
  60. package/build/components/use-block-commands/index.cjs +5 -5
  61. package/build/components/use-block-commands/index.cjs.map +2 -2
  62. package/build/hooks/anchor.cjs +11 -15
  63. package/build/hooks/anchor.cjs.map +2 -2
  64. package/build/hooks/border.cjs +0 -3
  65. package/build/hooks/border.cjs.map +2 -2
  66. package/build/hooks/color.cjs +1 -4
  67. package/build/hooks/color.cjs.map +2 -2
  68. package/build/hooks/dimensions.cjs +0 -3
  69. package/build/hooks/dimensions.cjs.map +2 -2
  70. package/build/hooks/fit-text.cjs +11 -0
  71. package/build/hooks/fit-text.cjs.map +2 -2
  72. package/build/hooks/position.cjs +19 -22
  73. package/build/hooks/position.cjs.map +2 -2
  74. package/build/hooks/supports.cjs +0 -7
  75. package/build/hooks/supports.cjs.map +2 -2
  76. package/build/store/actions.cjs +7 -3
  77. package/build/store/actions.cjs.map +2 -2
  78. package/build/store/private-actions.cjs +1 -2
  79. package/build/store/private-actions.cjs.map +2 -2
  80. package/build/store/private-selectors.cjs +29 -0
  81. package/build/store/private-selectors.cjs.map +2 -2
  82. package/build/store/reducer.cjs +14 -6
  83. package/build/store/reducer.cjs.map +2 -2
  84. package/build/store/selectors.cjs +60 -41
  85. package/build/store/selectors.cjs.map +2 -2
  86. package/build-module/components/block-compare/index.mjs +1 -1
  87. package/build-module/components/block-compare/index.mjs.map +2 -2
  88. package/build-module/components/block-list/use-block-props/index.mjs +1 -1
  89. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  90. package/build-module/components/block-patterns-list/index.mjs +1 -1
  91. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  92. package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
  93. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  94. package/build-module/components/block-switcher/index.mjs +4 -4
  95. package/build-module/components/block-switcher/index.mjs.map +2 -2
  96. package/build-module/components/child-layout-control/index.mjs +10 -5
  97. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  98. package/build-module/components/global-styles/advanced-panel.mjs +23 -15
  99. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  100. package/build-module/components/global-styles/background-panel.mjs +3 -3
  101. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  102. package/build-module/components/global-styles/border-panel.mjs +2 -0
  103. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  104. package/build-module/components/global-styles/dimensions-panel.mjs +9 -6
  105. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  106. package/build-module/components/iframe/index.mjs +3 -0
  107. package/build-module/components/iframe/index.mjs.map +2 -2
  108. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
  109. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  110. package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
  111. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  112. package/build-module/components/inserter/index.mjs +185 -222
  113. package/build-module/components/inserter/index.mjs.map +3 -3
  114. package/build-module/components/inserter/media-tab/utils.mjs +1 -1
  115. package/build-module/components/inserter/media-tab/utils.mjs.map +2 -2
  116. package/build-module/components/inserter/search-results.mjs +1 -1
  117. package/build-module/components/inserter/search-results.mjs.map +2 -2
  118. package/build-module/components/list-view/block-select-button.mjs +10 -12
  119. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  120. package/build-module/components/list-view/block.mjs +2 -1
  121. package/build-module/components/list-view/block.mjs.map +2 -2
  122. package/build-module/components/provider/use-block-sync.mjs +11 -2
  123. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  124. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +4 -4
  125. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  126. package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
  127. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  128. package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
  129. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  130. package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
  131. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  132. package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
  133. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  134. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
  135. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  136. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
  137. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  138. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
  139. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  140. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
  141. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  142. package/build-module/components/rich-text/index.mjs +1 -23
  143. package/build-module/components/rich-text/index.mjs.map +2 -2
  144. package/build-module/components/use-block-commands/index.mjs +5 -5
  145. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  146. package/build-module/hooks/anchor.mjs +11 -15
  147. package/build-module/hooks/anchor.mjs.map +2 -2
  148. package/build-module/hooks/border.mjs +1 -4
  149. package/build-module/hooks/border.mjs.map +2 -2
  150. package/build-module/hooks/color.mjs +2 -5
  151. package/build-module/hooks/color.mjs.map +2 -2
  152. package/build-module/hooks/dimensions.mjs +1 -4
  153. package/build-module/hooks/dimensions.mjs.map +2 -2
  154. package/build-module/hooks/fit-text.mjs +11 -0
  155. package/build-module/hooks/fit-text.mjs.map +2 -2
  156. package/build-module/hooks/position.mjs +20 -23
  157. package/build-module/hooks/position.mjs.map +2 -2
  158. package/build-module/hooks/supports.mjs +0 -7
  159. package/build-module/hooks/supports.mjs.map +2 -2
  160. package/build-module/store/actions.mjs +7 -3
  161. package/build-module/store/actions.mjs.map +2 -2
  162. package/build-module/store/private-actions.mjs +1 -2
  163. package/build-module/store/private-actions.mjs.map +2 -2
  164. package/build-module/store/private-selectors.mjs +26 -0
  165. package/build-module/store/private-selectors.mjs.map +2 -2
  166. package/build-module/store/reducer.mjs +14 -6
  167. package/build-module/store/reducer.mjs.map +2 -2
  168. package/build-module/store/selectors.mjs +62 -42
  169. package/build-module/store/selectors.mjs.map +2 -2
  170. package/build-style/content-rtl.css +12 -0
  171. package/build-style/content.css +12 -0
  172. package/build-style/style-rtl.css +26 -8
  173. package/build-style/style.css +26 -8
  174. package/package.json +51 -48
  175. package/src/components/block-breadcrumb/README.md +2 -2
  176. package/src/components/block-compare/README.md +6 -6
  177. package/src/components/block-compare/index.js +1 -3
  178. package/src/components/block-list/use-block-props/index.js +1 -1
  179. package/src/components/block-patterns-list/index.js +1 -1
  180. package/src/components/block-preview/README.md +1 -1
  181. package/src/components/block-switcher/block-transformations-menu.js +16 -18
  182. package/src/components/block-switcher/index.js +4 -4
  183. package/src/components/block-types-list/README.md +0 -19
  184. package/src/components/child-layout-control/index.js +15 -8
  185. package/src/components/child-layout-control/test/index.js +126 -0
  186. package/src/components/colors/test/with-colors.js +1 -1
  187. package/src/components/global-styles/advanced-panel.js +5 -1
  188. package/src/components/global-styles/background-panel.js +3 -3
  189. package/src/components/global-styles/border-panel.js +2 -0
  190. package/src/components/global-styles/dimensions-panel.js +23 -16
  191. package/src/components/iframe/index.js +3 -0
  192. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
  193. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  194. package/src/components/inserter/index.js +257 -288
  195. package/src/components/inserter/media-tab/utils.js +1 -1
  196. package/src/components/inserter/search-results.js +1 -3
  197. package/src/components/justify-content-control/README.md +1 -1
  198. package/src/components/list-view/block-select-button.js +9 -13
  199. package/src/components/list-view/block.js +1 -0
  200. package/src/components/media-placeholder/README.md +1 -29
  201. package/src/components/media-upload/README.md +0 -19
  202. package/src/components/provider/test/use-block-sync.js +40 -0
  203. package/src/components/provider/use-block-sync.js +12 -2
  204. package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
  205. package/src/components/rich-text/event-listeners/delete.js +9 -4
  206. package/src/components/rich-text/event-listeners/enter.js +9 -2
  207. package/src/components/rich-text/event-listeners/input-events.js +13 -4
  208. package/src/components/rich-text/event-listeners/input-rules.js +20 -4
  209. package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
  210. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
  211. package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
  212. package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
  213. package/src/components/rich-text/index.js +1 -33
  214. package/src/components/unit-control/README.md +1 -1
  215. package/src/components/url-popover/README.md +1 -1
  216. package/src/components/use-block-commands/index.js +5 -5
  217. package/src/hooks/anchor.js +9 -17
  218. package/src/hooks/border.js +1 -5
  219. package/src/hooks/color.js +1 -6
  220. package/src/hooks/dimensions.js +1 -5
  221. package/src/hooks/fit-text.js +16 -0
  222. package/src/hooks/position.js +23 -27
  223. package/src/hooks/supports.js +0 -9
  224. package/src/store/actions.js +13 -3
  225. package/src/store/private-actions.js +1 -4
  226. package/src/store/private-selectors.js +59 -0
  227. package/src/store/reducer.js +19 -7
  228. package/src/store/selectors.js +91 -53
  229. package/src/store/test/actions.js +21 -0
  230. package/src/store/test/private-selectors.js +53 -0
  231. package/src/store/test/reducer.js +46 -0
  232. package/src/store/test/selectors.js +77 -0
  233. package/build/components/media-upload-progress/constants.cjs +0 -46
  234. package/build/components/media-upload-progress/constants.cjs.map +0 -7
  235. package/build/components/rich-text/native/format-edit.cjs +0 -60
  236. package/build/components/rich-text/native/format-edit.cjs.map +0 -7
  237. package/build/components/rich-text/native/index.cjs +0 -28
  238. package/build/components/rich-text/native/index.cjs.map +0 -7
  239. package/build/components/rich-text/native/use-format-types.cjs +0 -139
  240. package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
  241. package/build-module/components/media-upload-progress/constants.mjs +0 -16
  242. package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
  243. package/build-module/components/rich-text/native/format-edit.mjs +0 -39
  244. package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
  245. package/build-module/components/rich-text/native/index.mjs +0 -7
  246. package/build-module/components/rich-text/native/index.mjs.map +0 -7
  247. package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
  248. package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
  249. package/src/components/audio-player/audio-url-parser.native.js +0 -20
  250. package/src/components/audio-player/index.native.js +0 -225
  251. package/src/components/audio-player/styles.native.scss +0 -114
  252. package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
  253. package/src/components/block-alignment-control/test/index.native.js +0 -37
  254. package/src/components/block-alignment-control/ui.native.js +0 -86
  255. package/src/components/block-caption/README.md +0 -104
  256. package/src/components/block-caption/index.native.js +0 -89
  257. package/src/components/block-caption/styles.native.scss +0 -7
  258. package/src/components/block-controls/slot.native.js +0 -33
  259. package/src/components/block-draggable/draggable-chip.native.js +0 -49
  260. package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
  261. package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
  262. package/src/components/block-draggable/index.native.js +0 -467
  263. package/src/components/block-draggable/style.native.scss +0 -19
  264. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
  265. package/src/components/block-draggable/test/helpers.native.js +0 -182
  266. package/src/components/block-draggable/test/index.native.js +0 -419
  267. package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
  268. package/src/components/block-edit/edit.native.js +0 -49
  269. package/src/components/block-edit/test/edit.native.js +0 -65
  270. package/src/components/block-heading-level-dropdown/index.native.js +0 -68
  271. package/src/components/block-icon/index.native.js +0 -47
  272. package/src/components/block-icon/style.native.scss +0 -7
  273. package/src/components/block-list/block-crash-boundary.native.js +0 -43
  274. package/src/components/block-list/block-crash-warning.native.js +0 -21
  275. package/src/components/block-list/block-invalid-warning.native.js +0 -70
  276. package/src/components/block-list/block-list-context.native.js +0 -172
  277. package/src/components/block-list/block-list-item-cell.native.js +0 -62
  278. package/src/components/block-list/block-list-item.native.js +0 -209
  279. package/src/components/block-list/block-list-item.native.scss +0 -16
  280. package/src/components/block-list/block-outline.native.js +0 -77
  281. package/src/components/block-list/block-selection-button.native.js +0 -100
  282. package/src/components/block-list/block-selection-button.native.scss +0 -34
  283. package/src/components/block-list/block.native.js +0 -716
  284. package/src/components/block-list/block.native.scss +0 -62
  285. package/src/components/block-list/grid-item.native.js +0 -58
  286. package/src/components/block-list/index.native.js +0 -437
  287. package/src/components/block-list/insertion-point.native.js +0 -36
  288. package/src/components/block-list/style.native.scss +0 -117
  289. package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
  290. package/src/components/block-list/test/block-list-context.native.js +0 -243
  291. package/src/components/block-list/test/block-outline.native.js +0 -255
  292. package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
  293. package/src/components/block-list/test/index.native.js +0 -205
  294. package/src/components/block-list/use-block-props/index.native.js +0 -10
  295. package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
  296. package/src/components/block-list-appender/index.native.js +0 -70
  297. package/src/components/block-list-appender/style.native.scss +0 -8
  298. package/src/components/block-media-update-progress/README.md +0 -100
  299. package/src/components/block-media-update-progress/index.native.js +0 -299
  300. package/src/components/block-media-update-progress/styles.native.scss +0 -9
  301. package/src/components/block-media-update-progress/test/index.native.js +0 -543
  302. package/src/components/block-mover/index.native.js +0 -193
  303. package/src/components/block-mover/mover-description.native.js +0 -155
  304. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
  305. package/src/components/block-mover/test/index.native.js +0 -186
  306. package/src/components/block-settings/button.native.js +0 -41
  307. package/src/components/block-settings/container.native.js +0 -91
  308. package/src/components/block-settings/container.native.scss +0 -4
  309. package/src/components/block-settings/index.native.js +0 -5
  310. package/src/components/block-styles/index.native.js +0 -94
  311. package/src/components/block-styles/preview.native.js +0 -109
  312. package/src/components/block-styles/style.native.scss +0 -64
  313. package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
  314. package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
  315. package/src/components/block-toolbar/index.native.js +0 -126
  316. package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
  317. package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
  318. package/src/components/block-toolbar/test/index.native.js +0 -36
  319. package/src/components/block-types-list/index.native.js +0 -175
  320. package/src/components/block-types-list/style.native.scss +0 -25
  321. package/src/components/block-variation-picker/index.native.js +0 -107
  322. package/src/components/block-variation-picker/style.native.scss +0 -32
  323. package/src/components/button-block-appender/index.native.js +0 -92
  324. package/src/components/button-block-appender/styles.native.scss +0 -43
  325. package/src/components/caption/README.md +0 -44
  326. package/src/components/caption/index.native.js +0 -61
  327. package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
  328. package/src/components/contrast-checker/index.native.js +0 -113
  329. package/src/components/contrast-checker/style.native.scss +0 -26
  330. package/src/components/convert-to-group-buttons/index.native.js +0 -79
  331. package/src/components/default-block-appender/index.native.js +0 -113
  332. package/src/components/default-block-appender/style.native.scss +0 -18
  333. package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
  334. package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
  335. package/src/components/floating-toolbar/index.native.js +0 -141
  336. package/src/components/floating-toolbar/styles.native.scss +0 -43
  337. package/src/components/font-sizes/index.native.js +0 -7
  338. package/src/components/global-styles/color-panel.native.js +0 -207
  339. package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
  340. package/src/components/global-styles/use-global-styles-context.native.js +0 -592
  341. package/src/components/gradients/index.native.js +0 -2
  342. package/src/components/image-link-destinations/index.native.js +0 -152
  343. package/src/components/image-link-destinations/style.native.scss +0 -16
  344. package/src/components/index.native.js +0 -108
  345. package/src/components/inner-blocks/constants.native.js +0 -5
  346. package/src/components/inner-blocks/index.native.js +0 -221
  347. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
  348. package/src/components/inserter/block-types-tab.native.js +0 -76
  349. package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
  350. package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
  351. package/src/components/inserter/index.native.js +0 -424
  352. package/src/components/inserter/menu.native.js +0 -237
  353. package/src/components/inserter/no-results.native.js +0 -49
  354. package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
  355. package/src/components/inserter/search-results.native.js +0 -67
  356. package/src/components/inserter/style.native.scss +0 -83
  357. package/src/components/inserter/tabs.native.js +0 -152
  358. package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
  359. package/src/components/inserter/test/fixtures/index.native.js +0 -12
  360. package/src/components/inserter/test/index.native.js +0 -273
  361. package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
  362. package/src/components/inserter/test/utils.native.js +0 -37
  363. package/src/components/inserter/utils.native.js +0 -46
  364. package/src/components/inserter-button/index.native.js +0 -108
  365. package/src/components/inserter-button/style.native.scss +0 -72
  366. package/src/components/inspector-controls/fill.native.js +0 -62
  367. package/src/components/inspector-controls/slot.native.js +0 -35
  368. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
  369. package/src/components/line-height-control/index.native.js +0 -28
  370. package/src/components/media-placeholder/index.native.js +0 -258
  371. package/src/components/media-placeholder/styles.native.scss +0 -108
  372. package/src/components/media-replace-flow/index.native.js +0 -12
  373. package/src/components/media-upload/constants.native.js +0 -14
  374. package/src/components/media-upload/index.native.js +0 -356
  375. package/src/components/media-upload/style.native.scss +0 -4
  376. package/src/components/media-upload/test/index.native.js +0 -172
  377. package/src/components/media-upload-progress/README.md +0 -100
  378. package/src/components/media-upload-progress/constants.js +0 -6
  379. package/src/components/media-upload-progress/index.native.js +0 -233
  380. package/src/components/media-upload-progress/styles.native.scss +0 -15
  381. package/src/components/media-upload-progress/test/index.native.js +0 -220
  382. package/src/components/plain-text/index.native.js +0 -164
  383. package/src/components/plain-text/style.native.scss +0 -10
  384. package/src/components/provider/index.native.js +0 -32
  385. package/src/components/rich-text/embed-handler-picker.native.js +0 -65
  386. package/src/components/rich-text/file-paste-handler.native.js +0 -3
  387. package/src/components/rich-text/format-toolbar/index.native.js +0 -21
  388. package/src/components/rich-text/format-toolbar-container.native.js +0 -16
  389. package/src/components/rich-text/index.native.js +0 -701
  390. package/src/components/rich-text/input-event.native.js +0 -10
  391. package/src/components/rich-text/native/format-edit.js +0 -44
  392. package/src/components/rich-text/native/get-format-colors.native.js +0 -47
  393. package/src/components/rich-text/native/index.js +0 -1
  394. package/src/components/rich-text/native/index.native.js +0 -1389
  395. package/src/components/rich-text/native/style.native.scss +0 -28
  396. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
  397. package/src/components/rich-text/native/test/index.native.js +0 -345
  398. package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
  399. package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
  400. package/src/components/rich-text/native/use-format-types.js +0 -146
  401. package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
  402. package/src/components/rich-text/shortcut.native.js +0 -10
  403. package/src/components/ungroup-button/README.md +0 -23
  404. package/src/components/ungroup-button/index.native.js +0 -77
  405. package/src/components/unsupported-block-details/index.native.js +0 -187
  406. package/src/components/unsupported-block-details/style.native.scss +0 -56
  407. package/src/components/url-input/index.native.js +0 -33
  408. package/src/components/use-block-drop-zone/index.native.js +0 -207
  409. package/src/components/use-on-block-drop/index.native.js +0 -115
  410. package/src/components/use-unsupported-block-editor/index.native.js +0 -59
  411. package/src/components/video-player/gridicon-play.native.js +0 -13
  412. package/src/components/video-player/index.native.js +0 -133
  413. package/src/components/video-player/styles.native.scss +0 -29
  414. package/src/components/warning/index.native.js +0 -64
  415. package/src/components/warning/style.native.scss +0 -47
  416. package/src/hooks/align.native.js +0 -49
  417. package/src/hooks/custom-class-name.native.js +0 -70
  418. package/src/hooks/index.native.js +0 -36
  419. package/src/hooks/layout.native.js +0 -23
  420. package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
  421. package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
  422. package/src/hooks/test/align.native.js +0 -134
  423. package/src/hooks/test/anchor.native.js +0 -32
  424. package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
  425. package/src/hooks/typography.native.js +0 -60
  426. package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
  427. package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
  428. package/src/index.native.js +0 -6
  429. package/src/private-apis.native.js +0 -21
  430. package/src/store/defaults.native.js +0 -23
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/fit-text.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { useEffect, useCallback, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\nconst EMPTY_OBJECT = {};\nconst MIN_FONT_SIZE_FOR_WARNING = 12;\n\n/**\n * Internal dependencies\n */\nimport { optimizeFitText } from '../utils/fit-text-utils';\nimport { store as blockEditorStore } from '../store';\nimport { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\nimport InspectorControls from '../components/inspector-controls';\nimport FitTextSizeWarning from '../components/fit-text-size-warning';\n\nexport const FIT_TEXT_SUPPORT_KEY = 'typography.fitText';\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fitText` attribute.\n *\n * @param {Object} settings Original block settings.\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition.\n\tif ( settings.attributes?.fitText ) {\n\t\treturn settings;\n\t}\n\n\t// Add fitText attribute.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tfitText: {\n\t\t\t\ttype: 'boolean',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Custom hook to handle fit text functionality in the editor.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.fitText Fit text attribute.\n * @param {string} props.name Block name.\n * @param {string} props.clientId Block client ID.\n */\nfunction useFitText( { fitText, name, clientId } ) {\n\tconst [ fontSize, setFontSize ] = useState( null );\n\tconst hasFitTextSupport = hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY );\n\tconst blockElement = useBlockElement( clientId );\n\n\t// Monitor block attribute changes, parent changes, and block mode.\n\t// Any attribute or parent change may change the available space.\n\t// Block mode is needed to disable fit text when in HTML editing mode.\n\tconst { blockAttributes, parentId, blockMode } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId || ! hasFitTextSupport || ! fitText ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst _blockMode =\n\t\t\t\tselect( blockEditorStore ).getBlockMode( clientId );\n\t\t\tif ( _blockMode === 'html' ) {\n\t\t\t\treturn { blockMode: _blockMode };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tblockAttributes:\n\t\t\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ),\n\t\t\t\tparentId:\n\t\t\t\t\tselect( blockEditorStore ).getBlockRootClientId( clientId ),\n\t\t\t\tblockMode: _blockMode,\n\t\t\t};\n\t\t},\n\t\t[ clientId, hasFitTextSupport, fitText ]\n\t);\n\n\tconst applyFitText = useCallback( () => {\n\t\tif ( ! blockElement || ! hasFitTextSupport || ! fitText ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get or create style element with unique ID\n\t\tconst styleId = `fit-text-${ clientId }`;\n\t\tlet styleElement = blockElement.ownerDocument.getElementById( styleId );\n\t\tif ( ! styleElement ) {\n\t\t\tstyleElement = blockElement.ownerDocument.createElement( 'style' );\n\t\t\tstyleElement.id = styleId;\n\t\t\tblockElement.ownerDocument.head.appendChild( styleElement );\n\t\t}\n\n\t\tconst blockSelector = `#block-${ clientId }`;\n\n\t\tconst applyFontSizeStyle = ( size ) => {\n\t\t\tif ( size === 0 ) {\n\t\t\t\tstyleElement.textContent = '';\n\t\t\t} else {\n\t\t\t\tstyleElement.textContent = `${ blockSelector } { font-size: ${ size }px !important; }`;\n\t\t\t}\n\t\t};\n\n\t\tconst optimalSize = optimizeFitText( blockElement, applyFontSizeStyle );\n\t\tsetFontSize( optimalSize );\n\t}, [ blockElement, clientId, hasFitTextSupport, fitText ] );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! fitText ||\n\t\t\t! blockElement ||\n\t\t\t! clientId ||\n\t\t\t! hasFitTextSupport ||\n\t\t\tblockMode === 'html'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Store current element value for cleanup\n\t\tconst currentElement = blockElement;\n\t\tconst previousVisibility = currentElement.style.visibility;\n\n\t\t// Store IDs for cleanup\n\t\tlet hideFrameId = null;\n\t\tlet calculateFrameId = null;\n\t\tlet showTimeoutId = null;\n\n\t\t// We are hiding the element doing the calculation of fit text\n\t\t// and then showing it again to avoid the user noticing a flash of potentially\n\t\t// big fitText while the binary search is happening.\n\t\thideFrameId = window.requestAnimationFrame( () => {\n\t\t\tcurrentElement.style.visibility = 'hidden';\n\t\t\t// Wait for browser to render the hidden state\n\t\t\tcalculateFrameId = window.requestAnimationFrame( () => {\n\t\t\t\tapplyFitText();\n\n\t\t\t\t// Using a timeout instead of requestAnimationFrame, because\n\t\t\t\t// with requestAnimationFrame a flash of very high size\n\t\t\t\t// can still occur although rare.\n\t\t\t\tshowTimeoutId = setTimeout( () => {\n\t\t\t\t\tcurrentElement.style.visibility = previousVisibility;\n\t\t\t\t}, 10 );\n\t\t\t} );\n\t\t} );\n\n\t\t// Watch for size changes\n\t\tlet resizeObserver;\n\t\tif ( window.ResizeObserver && currentElement.parentElement ) {\n\t\t\tresizeObserver = new window.ResizeObserver( applyFitText );\n\t\t\tresizeObserver.observe( currentElement.parentElement );\n\t\t\tresizeObserver.observe( currentElement );\n\t\t}\n\n\t\t// Cleanup function\n\t\treturn () => {\n\t\t\t// Cancel pending async operations\n\t\t\tif ( hideFrameId !== null ) {\n\t\t\t\twindow.cancelAnimationFrame( hideFrameId );\n\t\t\t}\n\t\t\tif ( calculateFrameId !== null ) {\n\t\t\t\twindow.cancelAnimationFrame( calculateFrameId );\n\t\t\t}\n\t\t\tif ( showTimeoutId !== null ) {\n\t\t\t\tclearTimeout( showTimeoutId );\n\t\t\t}\n\n\t\t\tif ( resizeObserver ) {\n\t\t\t\tresizeObserver.disconnect();\n\t\t\t}\n\n\t\t\tconst styleId = `fit-text-${ clientId }`;\n\t\t\tconst styleElement =\n\t\t\t\tcurrentElement.ownerDocument.getElementById( styleId );\n\t\t\tif ( styleElement ) {\n\t\t\t\tstyleElement.remove();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tfitText,\n\t\tclientId,\n\t\tparentId,\n\t\tapplyFitText,\n\t\tblockElement,\n\t\thasFitTextSupport,\n\t\tblockMode,\n\t] );\n\n\t// Trigger fit text recalculation when content changes\n\tuseEffect( () => {\n\t\tif (\n\t\t\tfitText &&\n\t\t\tblockElement &&\n\t\t\thasFitTextSupport &&\n\t\t\tblockMode !== 'html'\n\t\t) {\n\t\t\t// Wait for next frame to ensure DOM has updated after content changes\n\t\t\tconst frameId = window.requestAnimationFrame( () => {\n\t\t\t\tif ( blockElement ) {\n\t\t\t\t\tapplyFitText();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn () => window.cancelAnimationFrame( frameId );\n\t\t}\n\t}, [\n\t\tblockAttributes,\n\t\tfitText,\n\t\tapplyFitText,\n\t\tblockElement,\n\t\thasFitTextSupport,\n\t\tblockMode,\n\t] );\n\n\treturn { fontSize };\n}\n\n/**\n * Fit text control component for the typography panel.\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId Block client ID.\n * @param {Function} props.setAttributes Function to set block attributes.\n * @param {string} props.name Block name.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @param {string} props.fontSize Font size slug.\n * @param {Object} props.style Block style object.\n */\nexport function FitTextControl( {\n\tclientId,\n\tfitText = false,\n\tsetAttributes,\n\tname,\n\tfontSize,\n\tstyle,\n} ) {\n\tif ( ! hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => fitText }\n\t\t\tlabel={ __( 'Fit text' ) }\n\t\t\tonDeselect={ () => setAttributes( { fitText: undefined } ) }\n\t\t\tresetAllFilter={ () => ( { fitText: undefined } ) }\n\t\t\tpanelId={ clientId }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Fit text' ) }\n\t\t\t\tchecked={ fitText }\n\t\t\t\tonChange={ () => {\n\t\t\t\t\tconst newFitText = ! fitText || undefined;\n\t\t\t\t\tconst updates = { fitText: newFitText };\n\n\t\t\t\t\t// When enabling fit text, clear font size if it has a value\n\t\t\t\t\tif ( newFitText ) {\n\t\t\t\t\t\tif ( fontSize ) {\n\t\t\t\t\t\t\tupdates.fontSize = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( style?.typography?.fontSize ) {\n\t\t\t\t\t\t\tupdates.style = {\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\ttypography: {\n\t\t\t\t\t\t\t\t\t...style?.typography,\n\t\t\t\t\t\t\t\t\tfontSize: undefined,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetAttributes( updates );\n\t\t\t\t} }\n\t\t\t\thelp={\n\t\t\t\t\tfitText\n\t\t\t\t\t\t? __( 'Text will resize to fit its container.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'The text will resize to fit its container, resetting other font size settings.'\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\n/**\n * Override props applied to the block element on save.\n *\n * @param {Object} props Additional props applied to the block element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @return {Object} Filtered props applied to the block element.\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tconst { fitText } = attributes;\n\n\tif ( ! fitText ) {\n\t\treturn props;\n\t}\n\n\t// Add CSS class for frontend detection and styling\n\tconst className = props.className\n\t\t? `${ props.className } has-fit-text`\n\t\t: 'has-fit-text';\n\n\treturn {\n\t\t...props,\n\t\tclassName,\n\t};\n}\n\n/**\n * Override props applied to the block element in the editor.\n *\n * @param {Object} props Component props including block attributes.\n * @param {string} props.name Block name.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @return {Object} Filtered props applied to the block element.\n */\nfunction useBlockProps( { name, fitText } ) {\n\tif ( fitText && hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn {\n\t\t\tclassName: 'has-fit-text',\n\t\t};\n\t}\n\treturn {};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fit-text/addAttribute',\n\taddAttributes\n);\n\nconst hasFitTextSupport = ( blockNameOrType ) => {\n\treturn hasBlockSupport( blockNameOrType, FIT_TEXT_SUPPORT_KEY );\n};\n\n/**\n * Component that handles the fit text font size and displays a warning\n * if the fit text font size is below a minimum threshold.\n *\n * @param {Object} props Component props.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @param {string} props.name Block name.\n * @param {string} props.clientId Block client ID.\n * @param {boolean} props.isSelected Whether the block is selected.\n * @return {Element|null} Warning component or null.\n */\nfunction FitTextFontSize( { fitText, name, clientId, isSelected } ) {\n\tconst { fontSize } = useFitText( { fitText, name, clientId } );\n\tif ( isSelected && fontSize && fontSize < MIN_FONT_SIZE_FOR_WARNING ) {\n\t\treturn (\n\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t<FitTextSizeWarning />\n\t\t\t</InspectorControls>\n\t\t);\n\t}\n\treturn null;\n}\n\n/*\n * Fit-text requires that layout calculations be done even when a block is not\n * currently selected. Therefore, the regular hooking approach using an\n * exported `edit` method is not enough, and we must use this HoC with the\n * `editor.BlockEdit` filter.\n */\nconst addFitTextControl = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn function AddFitTextControl( props ) {\n\t\tconst { name, attributes, clientId, isSelected, setAttributes } = props;\n\t\tconst { fitText } = attributes;\n\t\tconst supportsFitText = hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY );\n\t\tif ( ! supportsFitText ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t\t<FitTextControl\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tfitText={ fitText }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tfontSize={ attributes.fontSize }\n\t\t\t\t\t\tstyle={ attributes.style }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\t\t\t\t{ fitText && (\n\t\t\t\t\t<FitTextFontSize\n\t\t\t\t\t\tfitText={ fitText }\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n}, 'addFitTextControl' );\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/fit-text/add-fit-text-control',\n\taddFitTextControl\n);\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fitText', 'fontSize', 'style' ],\n\thasSupport: hasFitTextSupport,\n\tedit: () => null,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAA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IAAI,WAAY,EAAE,SAAS,MAAM,SAAS,CAAE;AAC7D,MAAK,cAAc,YAAY,WAAW,2BAA4B;AACrE,WACC,4CAAC,0BAAAC,SAAA,EAAkB,OAAM,cACxB,sDAAC,6BAAAC,SAAA,EAAmB,GACrB;AAAA,EAEF;AACA,SAAO;AACR;AAQA,IAAM,wBAAoB,2CAA4B,CAAE,cAAe;AACtE,SAAO,SAAS,kBAAmB,OAAQ;AAC1C,UAAM,EAAE,MAAM,YAAY,UAAU,YAAY,cAAc,IAAI;AAClE,UAAM,EAAE,QAAQ,IAAI;AACpB,UAAM,sBAAkB,+BAAiB,MAAM,oBAAqB;AACpE,QAAK,CAAE,iBAAkB;AACxB,aAAO,4CAAC,aAAY,GAAG,OAAQ;AAAA,IAChC;AACA,WACC,4EACC;AAAA,kDAAC,aAAY,GAAG,OAAQ;AAAA,MACxB,4CAAC,0BAAAD,SAAA,EAAkB,OAAM,cACxB;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAW,WAAW;AAAA,UACtB,OAAQ,WAAW;AAAA;AAAA,MACpB,GACD;AAAA,MACE,WACD;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,EAEF;AACD,GAAG,mBAAoB;AAAA,IAEvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAO,mBAAQ;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe,CAAE,WAAW,YAAY,OAAQ;AAAA,EAChD,YAAY;AAAA,EACZ,MAAM,MAAM;AACb;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { useEffect, useCallback, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\nconst EMPTY_OBJECT = {};\nconst MIN_FONT_SIZE_FOR_WARNING = 12;\n\n/**\n * Internal dependencies\n */\nimport { optimizeFitText } from '../utils/fit-text-utils';\nimport { store as blockEditorStore } from '../store';\nimport { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';\nimport InspectorControls from '../components/inspector-controls';\nimport FitTextSizeWarning from '../components/fit-text-size-warning';\nimport { unlock } from '../lock-unlock';\n\nexport const FIT_TEXT_SUPPORT_KEY = 'typography.fitText';\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fitText` attribute.\n *\n * @param {Object} settings Original block settings.\n * @return {Object} Filtered block settings.\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition.\n\tif ( settings.attributes?.fitText ) {\n\t\treturn settings;\n\t}\n\n\t// Add fitText attribute.\n\treturn {\n\t\t...settings,\n\t\tattributes: {\n\t\t\t...settings.attributes,\n\t\t\tfitText: {\n\t\t\t\ttype: 'boolean',\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Custom hook to handle fit text functionality in the editor.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.fitText Fit text attribute.\n * @param {string} props.name Block name.\n * @param {string} props.clientId Block client ID.\n */\nfunction useFitText( { fitText, name, clientId } ) {\n\tconst [ fontSize, setFontSize ] = useState( null );\n\tconst hasFitTextSupport = hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY );\n\tconst blockElement = useBlockElement( clientId );\n\n\t// Monitor block attribute changes, parent changes, and block mode.\n\t// Any attribute or parent change may change the available space.\n\t// Block mode is needed to disable fit text when in HTML editing mode.\n\tconst { blockAttributes, parentId, blockMode } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId || ! hasFitTextSupport || ! fitText ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst _blockMode =\n\t\t\t\tselect( blockEditorStore ).getBlockMode( clientId );\n\t\t\tif ( _blockMode === 'html' ) {\n\t\t\t\treturn { blockMode: _blockMode };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tblockAttributes:\n\t\t\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ),\n\t\t\t\tparentId:\n\t\t\t\t\tselect( blockEditorStore ).getBlockRootClientId( clientId ),\n\t\t\t\tblockMode: _blockMode,\n\t\t\t};\n\t\t},\n\t\t[ clientId, hasFitTextSupport, fitText ]\n\t);\n\n\tconst applyFitText = useCallback( () => {\n\t\tif ( ! blockElement || ! hasFitTextSupport || ! fitText ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get or create style element with unique ID\n\t\tconst styleId = `fit-text-${ clientId }`;\n\t\tlet styleElement = blockElement.ownerDocument.getElementById( styleId );\n\t\tif ( ! styleElement ) {\n\t\t\tstyleElement = blockElement.ownerDocument.createElement( 'style' );\n\t\t\tstyleElement.id = styleId;\n\t\t\tblockElement.ownerDocument.head.appendChild( styleElement );\n\t\t}\n\n\t\tconst blockSelector = `#block-${ clientId }`;\n\n\t\tconst applyFontSizeStyle = ( size ) => {\n\t\t\tif ( size === 0 ) {\n\t\t\t\tstyleElement.textContent = '';\n\t\t\t} else {\n\t\t\t\tstyleElement.textContent = `${ blockSelector } { font-size: ${ size }px !important; }`;\n\t\t\t}\n\t\t};\n\n\t\tconst optimalSize = optimizeFitText( blockElement, applyFontSizeStyle );\n\t\tsetFontSize( optimalSize );\n\t}, [ blockElement, clientId, hasFitTextSupport, fitText ] );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! fitText ||\n\t\t\t! blockElement ||\n\t\t\t! clientId ||\n\t\t\t! hasFitTextSupport ||\n\t\t\tblockMode === 'html'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Store current element value for cleanup\n\t\tconst currentElement = blockElement;\n\t\tconst previousVisibility = currentElement.style.visibility;\n\n\t\t// Store IDs for cleanup\n\t\tlet hideFrameId = null;\n\t\tlet calculateFrameId = null;\n\t\tlet showTimeoutId = null;\n\n\t\t// We are hiding the element doing the calculation of fit text\n\t\t// and then showing it again to avoid the user noticing a flash of potentially\n\t\t// big fitText while the binary search is happening.\n\t\thideFrameId = window.requestAnimationFrame( () => {\n\t\t\tcurrentElement.style.visibility = 'hidden';\n\t\t\t// Wait for browser to render the hidden state\n\t\t\tcalculateFrameId = window.requestAnimationFrame( () => {\n\t\t\t\tapplyFitText();\n\n\t\t\t\t// Using a timeout instead of requestAnimationFrame, because\n\t\t\t\t// with requestAnimationFrame a flash of very high size\n\t\t\t\t// can still occur although rare.\n\t\t\t\tshowTimeoutId = setTimeout( () => {\n\t\t\t\t\tcurrentElement.style.visibility = previousVisibility;\n\t\t\t\t}, 10 );\n\t\t\t} );\n\t\t} );\n\n\t\t// Watch for size changes\n\t\tlet resizeObserver;\n\t\tif ( window.ResizeObserver && currentElement.parentElement ) {\n\t\t\tresizeObserver = new window.ResizeObserver( applyFitText );\n\t\t\tresizeObserver.observe( currentElement.parentElement );\n\t\t\tresizeObserver.observe( currentElement );\n\t\t}\n\n\t\t// Cleanup function\n\t\treturn () => {\n\t\t\t// Cancel pending async operations\n\t\t\tif ( hideFrameId !== null ) {\n\t\t\t\twindow.cancelAnimationFrame( hideFrameId );\n\t\t\t}\n\t\t\tif ( calculateFrameId !== null ) {\n\t\t\t\twindow.cancelAnimationFrame( calculateFrameId );\n\t\t\t}\n\t\t\tif ( showTimeoutId !== null ) {\n\t\t\t\tclearTimeout( showTimeoutId );\n\t\t\t}\n\n\t\t\tif ( resizeObserver ) {\n\t\t\t\tresizeObserver.disconnect();\n\t\t\t}\n\n\t\t\tconst styleId = `fit-text-${ clientId }`;\n\t\t\tconst styleElement =\n\t\t\t\tcurrentElement.ownerDocument.getElementById( styleId );\n\t\t\tif ( styleElement ) {\n\t\t\t\tstyleElement.remove();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tfitText,\n\t\tclientId,\n\t\tparentId,\n\t\tapplyFitText,\n\t\tblockElement,\n\t\thasFitTextSupport,\n\t\tblockMode,\n\t] );\n\n\t// Trigger fit text recalculation when content changes\n\tuseEffect( () => {\n\t\tif (\n\t\t\tfitText &&\n\t\t\tblockElement &&\n\t\t\thasFitTextSupport &&\n\t\t\tblockMode !== 'html'\n\t\t) {\n\t\t\t// Wait for next frame to ensure DOM has updated after content changes\n\t\t\tconst frameId = window.requestAnimationFrame( () => {\n\t\t\t\tif ( blockElement ) {\n\t\t\t\t\tapplyFitText();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn () => window.cancelAnimationFrame( frameId );\n\t\t}\n\t}, [\n\t\tblockAttributes,\n\t\tfitText,\n\t\tapplyFitText,\n\t\tblockElement,\n\t\thasFitTextSupport,\n\t\tblockMode,\n\t] );\n\n\treturn { fontSize };\n}\n\n/**\n * Fit text control component for the typography panel.\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId Block client ID.\n * @param {Function} props.setAttributes Function to set block attributes.\n * @param {string} props.name Block name.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @param {string} props.fontSize Font size slug.\n * @param {Object} props.style Block style object.\n */\nexport function FitTextControl( {\n\tclientId,\n\tfitText = false,\n\tsetAttributes,\n\tname,\n\tfontSize,\n\tstyle,\n} ) {\n\tconst hasSelectedStyleState = useSelect(\n\t\t( select ) => {\n\t\t\tconst { hasSelectedStyleState: hasSelectedBlockStyleState } =\n\t\t\t\tunlock( select( blockEditorStore ) );\n\n\t\t\treturn hasSelectedBlockStyleState( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn null;\n\t}\n\n\tif ( hasSelectedStyleState ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => fitText }\n\t\t\tlabel={ __( 'Fit text' ) }\n\t\t\tonDeselect={ () => setAttributes( { fitText: undefined } ) }\n\t\t\tresetAllFilter={ () => ( { fitText: undefined } ) }\n\t\t\tpanelId={ clientId }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Fit text' ) }\n\t\t\t\tchecked={ fitText }\n\t\t\t\tonChange={ () => {\n\t\t\t\t\tconst newFitText = ! fitText || undefined;\n\t\t\t\t\tconst updates = { fitText: newFitText };\n\n\t\t\t\t\t// When enabling fit text, clear font size if it has a value\n\t\t\t\t\tif ( newFitText ) {\n\t\t\t\t\t\tif ( fontSize ) {\n\t\t\t\t\t\t\tupdates.fontSize = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( style?.typography?.fontSize ) {\n\t\t\t\t\t\t\tupdates.style = {\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\ttypography: {\n\t\t\t\t\t\t\t\t\t...style?.typography,\n\t\t\t\t\t\t\t\t\tfontSize: undefined,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetAttributes( updates );\n\t\t\t\t} }\n\t\t\t\thelp={\n\t\t\t\t\tfitText\n\t\t\t\t\t\t? __( 'Text will resize to fit its container.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'The text will resize to fit its container, resetting other font size settings.'\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\n/**\n * Override props applied to the block element on save.\n *\n * @param {Object} props Additional props applied to the block element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @return {Object} Filtered props applied to the block element.\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tconst { fitText } = attributes;\n\n\tif ( ! fitText ) {\n\t\treturn props;\n\t}\n\n\t// Add CSS class for frontend detection and styling\n\tconst className = props.className\n\t\t? `${ props.className } has-fit-text`\n\t\t: 'has-fit-text';\n\n\treturn {\n\t\t...props,\n\t\tclassName,\n\t};\n}\n\n/**\n * Override props applied to the block element in the editor.\n *\n * @param {Object} props Component props including block attributes.\n * @param {string} props.name Block name.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @return {Object} Filtered props applied to the block element.\n */\nfunction useBlockProps( { name, fitText } ) {\n\tif ( fitText && hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY ) ) {\n\t\treturn {\n\t\t\tclassName: 'has-fit-text',\n\t\t};\n\t}\n\treturn {};\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fit-text/addAttribute',\n\taddAttributes\n);\n\nconst hasFitTextSupport = ( blockNameOrType ) => {\n\treturn hasBlockSupport( blockNameOrType, FIT_TEXT_SUPPORT_KEY );\n};\n\n/**\n * Component that handles the fit text font size and displays a warning\n * if the fit text font size is below a minimum threshold.\n *\n * @param {Object} props Component props.\n * @param {boolean} props.fitText Whether fit text is enabled.\n * @param {string} props.name Block name.\n * @param {string} props.clientId Block client ID.\n * @param {boolean} props.isSelected Whether the block is selected.\n * @return {Element|null} Warning component or null.\n */\nfunction FitTextFontSize( { fitText, name, clientId, isSelected } ) {\n\tconst { fontSize } = useFitText( { fitText, name, clientId } );\n\tif ( isSelected && fontSize && fontSize < MIN_FONT_SIZE_FOR_WARNING ) {\n\t\treturn (\n\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t<FitTextSizeWarning />\n\t\t\t</InspectorControls>\n\t\t);\n\t}\n\treturn null;\n}\n\n/*\n * Fit-text requires that layout calculations be done even when a block is not\n * currently selected. Therefore, the regular hooking approach using an\n * exported `edit` method is not enough, and we must use this HoC with the\n * `editor.BlockEdit` filter.\n */\nconst addFitTextControl = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn function AddFitTextControl( props ) {\n\t\tconst { name, attributes, clientId, isSelected, setAttributes } = props;\n\t\tconst { fitText } = attributes;\n\t\tconst supportsFitText = hasBlockSupport( name, FIT_TEXT_SUPPORT_KEY );\n\t\tif ( ! supportsFitText ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t\t<FitTextControl\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tfitText={ fitText }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tfontSize={ attributes.fontSize }\n\t\t\t\t\t\tstyle={ attributes.style }\n\t\t\t\t\t/>\n\t\t\t\t</InspectorControls>\n\t\t\t\t{ fitText && (\n\t\t\t\t\t<FitTextFontSize\n\t\t\t\t\t\tfitText={ fitText }\n\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n}, 'addFitTextControl' );\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/fit-text/add-fit-text-control',\n\taddFitTextControl\n);\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fitText', 'fontSize', 'style' ],\n\thasSupport: hasFitTextSupport,\n\tedit: () => null,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA0B;AAC1B,oBAAgC;AAChC,qBAAiD;AACjD,kBAA0B;AAC1B,kBAAmB;AACnB,wBAGO;AACP,qBAA2C;AAQ3C,4BAAgC;AAChC,mBAA0C;AAC1C,4BAAgC;AAChC,gCAA8B;AAC9B,mCAA+B;AAC/B,yBAAuB;AA4PpB;AAvQH,IAAM,eAAe,CAAC;AACtB,IAAM,4BAA4B;A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,MAAM,SAAS,CAAE;AAC7D,MAAK,cAAc,YAAY,WAAW,2BAA4B;AACrE,WACC,4CAAC,0BAAAC,SAAA,EAAkB,OAAM,cACxB,sDAAC,6BAAAC,SAAA,EAAmB,GACrB;AAAA,EAEF;AACA,SAAO;AACR;AAQA,IAAM,wBAAoB,2CAA4B,CAAE,cAAe;AACtE,SAAO,SAAS,kBAAmB,OAAQ;AAC1C,UAAM,EAAE,MAAM,YAAY,UAAU,YAAY,cAAc,IAAI;AAClE,UAAM,EAAE,QAAQ,IAAI;AACpB,UAAM,sBAAkB,+BAAiB,MAAM,oBAAqB;AACpE,QAAK,CAAE,iBAAkB;AACxB,aAAO,4CAAC,aAAY,GAAG,OAAQ;AAAA,IAChC;AACA,WACC,4EACC;AAAA,kDAAC,aAAY,GAAG,OAAQ;AAAA,MACxB,4CAAC,0BAAAD,SAAA,EAAkB,OAAM,cACxB;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAW,WAAW;AAAA,UACtB,OAAQ,WAAW;AAAA;AAAA,MACpB,GACD;AAAA,MACE,WACD;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,EAEF;AACD,GAAG,mBAAoB;AAAA,IAEvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAO,mBAAQ;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe,CAAE,WAAW,YAAY,OAAQ;AAAA,EAChD,YAAY;AAAA,EACZ,MAAM,MAAM;AACb;",
6
6
  "names": ["hasFitTextSupport", "blockEditorStore", "ToolsPanelItem", "InspectorControls", "FitTextSizeWarning"]
7
7
  }
@@ -189,28 +189,25 @@ function PositionPanelPure({
189
189
  });
190
190
  };
191
191
  const selectedOption = value ? options.find((option) => option.value === value) || DEFAULT_OPTION : DEFAULT_OPTION;
192
- return import_element.Platform.select({
193
- web: options.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_inspector_controls.default, { group: "position", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.BaseControl, { help: stickyHelpText, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
194
- import_components.CustomSelectControl,
195
- {
196
- __next40pxDefaultSize: true,
197
- label: (0, import_i18n.__)("Position"),
198
- hideLabelFromVision: true,
199
- describedBy: (0, import_i18n.sprintf)(
200
- // translators: %s: Currently selected position.
201
- (0, import_i18n.__)("Currently selected position: %s"),
202
- selectedOption.name
203
- ),
204
- options,
205
- value: selectedOption,
206
- onChange: ({ selectedItem }) => {
207
- onChangeType(selectedItem.value);
208
- },
209
- size: "__unstable-large"
210
- }
211
- ) }) }) : null,
212
- native: null
213
- });
192
+ return options.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_inspector_controls.default, { group: "position", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.BaseControl, { help: stickyHelpText, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
193
+ import_components.CustomSelectControl,
194
+ {
195
+ __next40pxDefaultSize: true,
196
+ label: (0, import_i18n.__)("Position"),
197
+ hideLabelFromVision: true,
198
+ describedBy: (0, import_i18n.sprintf)(
199
+ // translators: %s: Currently selected position.
200
+ (0, import_i18n.__)("Currently selected position: %s"),
201
+ selectedOption.name
202
+ ),
203
+ options,
204
+ value: selectedOption,
205
+ onChange: ({ selectedItem }) => {
206
+ onChangeType(selectedItem.value);
207
+ },
208
+ size: "__unstable-large"
209
+ }
210
+ ) }) }) : null;
214
211
  }
215
212
  var position_default = {
216
213
  edit: function Edit(props) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/position.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { BaseControl, CustomSelectControl } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport useBlockDisplayInformation from '../components/use-block-display-information';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\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\thint: __(\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\thint: __( 'The block will not move when the page is scrolled.' ),\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, allowSticky ] = useSettings(\n\t\t'position.fixed',\n\t\t'position.sticky'\n\t);\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 {Element} Position panel.\n */\nexport function PositionPanelPure( {\n\tstyle = {},\n\tclientId,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { firstParentClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn { firstParentClientId: parents[ parents.length - 1 ] };\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\tconst stickyHelpText =\n\t\tallowSticky && value === STICKY_OPTION.value && blockInformation\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: the name of the parent block. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The block will stick to the scrollable area of the parent %s block.'\n\t\t\t\t\t),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: null;\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Display options if they are allowed, or if a block already has a valid value set.\n\t\t// This allows for a block to be switched off from a position type that is not allowed.\n\t\tif ( allowSticky || value === STICKY_OPTION.value ) {\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, 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 help={ stickyHelpText }>\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\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\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\nexport default {\n\tedit: function Edit( props ) {\n\t\tconst isPositionDisabled = useIsPositionDisabled( props );\n\t\tif ( isPositionDisabled ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <PositionPanelPure { ...props } />;\n\t},\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, POSITION_SUPPORT_KEY );\n\t},\n};\n\n// Used for generating the instance ID\nconst POSITION_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { name, style } ) {\n\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\tname,\n\t\tPOSITION_SUPPORT_KEY\n\t);\n\tconst isPositionDisabled = useIsPositionDisabled( { name } );\n\tconst allowPositionStyles = hasPositionBlockSupport && ! isPositionDisabled;\n\n\tconst id = useInstanceId( POSITION_BLOCK_PROPS_REFERENCE );\n\n\t// Higher specificity to override defaults in editor UI.\n\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t// Get CSS string for the current position values.\n\tlet css;\n\tif ( allowPositionStyles ) {\n\t\tcss =\n\t\t\tgetPositionCSS( {\n\t\t\t\tselector: positionSelector,\n\t\t\t\tstyle,\n\t\t\t} ) || '';\n\t}\n\n\t// Attach a `wp-container-` id-based class name.\n\tconst className = clsx( {\n\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t[ `is-position-${ style?.position?.type }` ]:\n\t\t\tallowPositionStyles && !! css && !! style?.position?.type,\n\t} );\n\n\tuseStyleOverride( { css } );\n\n\treturn { className };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;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CAAE,OAAO,CAAC,CAAE,OAAO,UAAU;AAAA,EACvD,CAAE;AAEF,qCAAkB,EAAE,IAAI,CAAE;AAE1B,SAAO,EAAE,UAAU;AACpB;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { BaseControl, CustomSelectControl } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport InspectorControls from '../components/inspector-controls';\nimport useBlockDisplayInformation from '../components/use-block-display-information';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\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\thint: __(\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\thint: __( 'The block will not move when the page is scrolled.' ),\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, allowSticky ] = useSettings(\n\t\t'position.fixed',\n\t\t'position.sticky'\n\t);\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 {Element} Position panel.\n */\nexport function PositionPanelPure( {\n\tstyle = {},\n\tclientId,\n\tname: blockName,\n\tsetAttributes,\n} ) {\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { firstParentClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn { firstParentClientId: parents[ parents.length - 1 ] };\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\tconst stickyHelpText =\n\t\tallowSticky && value === STICKY_OPTION.value && blockInformation\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: the name of the parent block. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The block will stick to the scrollable area of the parent %s block.'\n\t\t\t\t\t),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: null;\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Display options if they are allowed, or if a block already has a valid value set.\n\t\t// This allows for a block to be switched off from a position type that is not allowed.\n\t\tif ( allowSticky || value === STICKY_OPTION.value ) {\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, 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 options.length > 1 ? (\n\t\t<InspectorControls group=\"position\">\n\t\t\t<BaseControl help={ stickyHelpText }>\n\t\t\t\t<CustomSelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t) }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t} }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t</BaseControl>\n\t\t</InspectorControls>\n\t) : null;\n}\n\nexport default {\n\tedit: function Edit( props ) {\n\t\tconst isPositionDisabled = useIsPositionDisabled( props );\n\t\tif ( isPositionDisabled ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn <PositionPanelPure { ...props } />;\n\t},\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, POSITION_SUPPORT_KEY );\n\t},\n};\n\n// Used for generating the instance ID\nconst POSITION_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { name, style } ) {\n\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\tname,\n\t\tPOSITION_SUPPORT_KEY\n\t);\n\tconst isPositionDisabled = useIsPositionDisabled( { name } );\n\tconst allowPositionStyles = hasPositionBlockSupport && ! isPositionDisabled;\n\n\tconst id = useInstanceId( POSITION_BLOCK_PROPS_REFERENCE );\n\n\t// Higher specificity to override defaults in editor UI.\n\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t// Get CSS string for the current position values.\n\tlet css;\n\tif ( allowPositionStyles ) {\n\t\tcss =\n\t\t\tgetPositionCSS( {\n\t\t\t\tselector: positionSelector,\n\t\t\t\tstyle,\n\t\t\t} ) || '';\n\t}\n\n\t// Attach a `wp-container-` id-based class name.\n\tconst className = clsx( {\n\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t[ `is-position-${ style?.position?.type }` ]:\n\t\t\tallowPositionStyles && !! css && !! style?.position?.type,\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,GAC1C,uBAAuB,CAAC,CAAE,OAAO,CAAC,CAAE,OAAO,UAAU;AAAA,EACvD,CAAE;AAEF,qCAAkB,EAAE,IAAI,CAAE;AAE1B,SAAO,EAAE,UAAU;AACpB;",
6
6
  "names": ["blockEditorStore", "useBlockDisplayInformation", "InspectorControls", "clsx"]
7
7
  }
@@ -46,7 +46,6 @@ __export(supports_exports, {
46
46
  });
47
47
  module.exports = __toCommonJS(supports_exports);
48
48
  var import_blocks = require("@wordpress/blocks");
49
- var import_element = require("@wordpress/element");
50
49
  var ALIGN_SUPPORT_KEY = "align";
51
50
  var ALIGN_WIDE_SUPPORT_KEY = "alignWide";
52
51
  var BORDER_SUPPORT_KEY = "__experimentalBorder";
@@ -91,9 +90,6 @@ var getAlignSupport = (nameOrType) => (0, import_blocks.getBlockSupport)(nameOrT
91
90
  var hasAlignWideSupport = (nameOrType) => (0, import_blocks.hasBlockSupport)(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
92
91
  var getAlignWideSupport = (nameOrType) => (0, import_blocks.getBlockSupport)(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
93
92
  function hasBorderSupport(nameOrType, feature = "any") {
94
- if (import_element.Platform.OS !== "web") {
95
- return false;
96
- }
97
93
  const support = (0, import_blocks.getBlockSupport)(nameOrType, BORDER_SUPPORT_KEY);
98
94
  if (support === true) {
99
95
  return true;
@@ -109,9 +105,6 @@ var hasColorSupport = (nameOrType) => {
109
105
  return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
110
106
  };
111
107
  var hasLinkColorSupport = (nameOrType) => {
112
- if (import_element.Platform.OS !== "web") {
113
- return false;
114
- }
115
108
  const colorSupport = (0, import_blocks.getBlockSupport)(nameOrType, COLOR_SUPPORT_KEY);
116
109
  return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.link;
117
110
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/hooks/supports.js"],
4
- "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 * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,qBAAyB;AAEzB,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAC1B,IAAM,gCAAgC;AACtC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAIhC,IAAM,yBAAyB;AAI/B,IAAM,0BAA0B;AAKhC,IAAM,yBAAyB;AAK/B,IAAM,2BAA2B;AAKjC,IAAM,8BAA8B;AAKpC,IAAM,2BAA2B;AAKjC,IAAM,6BAA6B;AAMnC,IAAM,6BAA6B;AACnC,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,IAAM,uBAAuB,CAAE,QAAS;AACxC,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AACD;AAQO,IAAM,kBAAkB,CAAE,mBAChC,+BAAiB,YAAY,iBAAkB;AAQzC,IAAM,kBAAkB,CAAE,mBAChC,+BAAiB,YAAY,iBAAkB;AAQzC,IAA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sB,CAAE,mBACpC,+BAAiB,YAAY,sBAAuB;AAQ9C,IAAM,sBAAsB,CAAE,eAAgB;AACpD,QAAM,mBAAe,+BAAiB,YAAY,iBAAkB;AAEpE,SAAO,gBAAgB,aAAa,SAAS;AAC9C;AAUO,IAAM,kBAAkB,CAAE,YAAY,gBAC5C,+BAAiB,YAAY,CAAE,mBAAmB,OAAQ,CAAE;AAQtD,IAAM,4BAA4B,CAAE,mBAC1C,+BAAiB,YAAY,+BAA+B,IAAK;AAQ3D,IAAM,4BAA4B,CAAE,mBAC1C,+BAAiB,YAAY,+BAA+B,IAAK;AAQ3D,IAAM,uBAAuB,CAAE,mBACrC,+BAAiB,YAAY,uBAAwB;AAQ/C,IAAM,uBAAuB,CAAE,mBACrC,+BAAiB,YAAY,uBAAwB;AAQ/C,IAAM,qBAAqB,CAAE,mBACnC,+BAAiB,YAAY,qBAAsB;AAQ7C,IAAM,qBAAqB,CAAE,mBACnC,+BAAiB,YAAY,qBAAsB;AAQ7C,IAAM,mBAAmB,CAAE,mBACjC,+BAAiB,YAAY,kBAAmB;AAQ1C,IAAM,mBAAmB,CAAE,mBACjC,+BAAiB,YAAY,kBAAmB;AAQ1C,IAAM,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,YAAS,+BAAiB,YAAY,GAAI,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\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 * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\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\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 text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AAEjD,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB;AAC/B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAC1B,IAA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kBAAmB;AAQ1C,IAAM,mBAAmB,CAAE,mBACjC,+BAAiB,YAAY,kBAAmB;AAQ1C,IAAM,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,YAAS,+BAAiB,YAAY,GAAI,CAAE;",
6
6
  "names": []
7
7
  }
@@ -479,7 +479,9 @@ var __unstableDeleteSelection = (isForward) => ({ registry, select, dispatch })
479
479
  attributes: {
480
480
  ...targetBlock.attributes,
481
481
  ...updatedAttributes
482
- }
482
+ },
483
+ // Block A's inner blocks sit inside the selection; only B's survive.
484
+ innerBlocks: blockB.innerBlocks
483
485
  },
484
486
  ...isForward ? [] : blocksWithTheSameType
485
487
  ];
@@ -982,8 +984,10 @@ function __unstableSaveReusableBlock() {
982
984
  function __unstableMarkLastChangeAsPersistent() {
983
985
  return { type: "MARK_LAST_CHANGE_AS_PERSISTENT" };
984
986
  }
985
- function __unstableMarkNextChangeAsNotPersistent() {
986
- return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT" };
987
+ function __unstableMarkNextChangeAsNotPersistent({
988
+ history = "merge"
989
+ } = {}) {
990
+ return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT", history };
987
991
  }
988
992
  var __unstableMarkAutomaticChange = () => ({ dispatch }) => {
989
993
  dispatch({ type: "MARK_AUTOMATIC_CHANGE" });