@wordpress/block-editor 15.21.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 (407) hide show
  1. package/CHANGELOG.md +17 -1
  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-patterns-list/index.cjs +1 -1
  5. package/build/components/block-patterns-list/index.cjs.map +2 -2
  6. package/build/components/block-switcher/block-transformations-menu.cjs +16 -15
  7. package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
  8. package/build/components/block-switcher/index.cjs +4 -4
  9. package/build/components/block-switcher/index.cjs.map +2 -2
  10. package/build/components/global-styles/advanced-panel.cjs +23 -15
  11. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  12. package/build/components/global-styles/background-panel.cjs +2 -2
  13. package/build/components/global-styles/background-panel.cjs.map +2 -2
  14. package/build/components/global-styles/border-panel.cjs +2 -0
  15. package/build/components/global-styles/border-panel.cjs.map +2 -2
  16. package/build/components/global-styles/dimensions-panel.cjs +1 -1
  17. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  18. package/build/components/inner-blocks/use-inner-block-template-sync.cjs +3 -1
  19. package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +2 -2
  20. package/build/components/inserter/hooks/use-patterns-state.cjs +1 -1
  21. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  22. package/build/components/inserter/index.cjs +179 -220
  23. package/build/components/inserter/index.cjs.map +3 -3
  24. package/build/components/inserter/search-results.cjs +1 -1
  25. package/build/components/inserter/search-results.cjs.map +2 -2
  26. package/build/components/list-view/block-select-button.cjs +10 -12
  27. package/build/components/list-view/block-select-button.cjs.map +2 -2
  28. package/build/components/list-view/block.cjs +2 -1
  29. package/build/components/list-view/block.cjs.map +2 -2
  30. package/build/components/provider/use-block-sync.cjs +11 -2
  31. package/build/components/provider/use-block-sync.cjs.map +2 -2
  32. package/build/components/rich-text/event-listeners/before-input-rules.cjs +4 -4
  33. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  34. package/build/components/rich-text/event-listeners/delete.cjs +4 -4
  35. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  36. package/build/components/rich-text/event-listeners/enter.cjs +7 -2
  37. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  38. package/build/components/rich-text/event-listeners/input-events.cjs +4 -4
  39. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  40. package/build/components/rich-text/event-listeners/input-rules.cjs +17 -4
  41. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  42. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +4 -4
  43. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  44. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +4 -4
  45. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  46. package/build/components/rich-text/event-listeners/shortcuts.cjs +4 -4
  47. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  48. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +4 -4
  49. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  50. package/build/components/rich-text/index.cjs +1 -23
  51. package/build/components/rich-text/index.cjs.map +2 -2
  52. package/build/components/use-block-commands/index.cjs +5 -5
  53. package/build/components/use-block-commands/index.cjs.map +2 -2
  54. package/build/hooks/anchor.cjs +11 -15
  55. package/build/hooks/anchor.cjs.map +2 -2
  56. package/build/hooks/border.cjs +0 -3
  57. package/build/hooks/border.cjs.map +2 -2
  58. package/build/hooks/color.cjs +1 -4
  59. package/build/hooks/color.cjs.map +2 -2
  60. package/build/hooks/dimensions.cjs +0 -3
  61. package/build/hooks/dimensions.cjs.map +2 -2
  62. package/build/hooks/fit-text.cjs +11 -0
  63. package/build/hooks/fit-text.cjs.map +2 -2
  64. package/build/hooks/position.cjs +19 -22
  65. package/build/hooks/position.cjs.map +2 -2
  66. package/build/hooks/supports.cjs +0 -7
  67. package/build/hooks/supports.cjs.map +2 -2
  68. package/build/store/actions.cjs +7 -3
  69. package/build/store/actions.cjs.map +2 -2
  70. package/build/store/private-actions.cjs +1 -2
  71. package/build/store/private-actions.cjs.map +2 -2
  72. package/build/store/private-selectors.cjs +23 -0
  73. package/build/store/private-selectors.cjs.map +2 -2
  74. package/build/store/reducer.cjs +14 -6
  75. package/build/store/reducer.cjs.map +2 -2
  76. package/build/store/selectors.cjs +60 -41
  77. package/build/store/selectors.cjs.map +2 -2
  78. package/build-module/components/block-compare/index.mjs +1 -1
  79. package/build-module/components/block-compare/index.mjs.map +2 -2
  80. package/build-module/components/block-patterns-list/index.mjs +1 -1
  81. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  82. package/build-module/components/block-switcher/block-transformations-menu.mjs +16 -15
  83. package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
  84. package/build-module/components/block-switcher/index.mjs +4 -4
  85. package/build-module/components/block-switcher/index.mjs.map +2 -2
  86. package/build-module/components/global-styles/advanced-panel.mjs +23 -15
  87. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  88. package/build-module/components/global-styles/background-panel.mjs +3 -3
  89. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  90. package/build-module/components/global-styles/border-panel.mjs +2 -0
  91. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  92. package/build-module/components/global-styles/dimensions-panel.mjs +2 -2
  93. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  94. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +3 -1
  95. package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +2 -2
  96. package/build-module/components/inserter/hooks/use-patterns-state.mjs +1 -1
  97. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  98. package/build-module/components/inserter/index.mjs +185 -222
  99. package/build-module/components/inserter/index.mjs.map +3 -3
  100. package/build-module/components/inserter/search-results.mjs +1 -1
  101. package/build-module/components/inserter/search-results.mjs.map +2 -2
  102. package/build-module/components/list-view/block-select-button.mjs +10 -12
  103. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  104. package/build-module/components/list-view/block.mjs +2 -1
  105. package/build-module/components/list-view/block.mjs.map +2 -2
  106. package/build-module/components/provider/use-block-sync.mjs +11 -2
  107. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  108. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +4 -4
  109. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  110. package/build-module/components/rich-text/event-listeners/delete.mjs +4 -4
  111. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  112. package/build-module/components/rich-text/event-listeners/enter.mjs +7 -2
  113. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  114. package/build-module/components/rich-text/event-listeners/input-events.mjs +4 -4
  115. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  116. package/build-module/components/rich-text/event-listeners/input-rules.mjs +17 -4
  117. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  118. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +4 -4
  119. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  120. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +4 -4
  121. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  122. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +4 -4
  123. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  124. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +4 -4
  125. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  126. package/build-module/components/rich-text/index.mjs +1 -23
  127. package/build-module/components/rich-text/index.mjs.map +2 -2
  128. package/build-module/components/use-block-commands/index.mjs +5 -5
  129. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  130. package/build-module/hooks/anchor.mjs +11 -15
  131. package/build-module/hooks/anchor.mjs.map +2 -2
  132. package/build-module/hooks/border.mjs +1 -4
  133. package/build-module/hooks/border.mjs.map +2 -2
  134. package/build-module/hooks/color.mjs +2 -5
  135. package/build-module/hooks/color.mjs.map +2 -2
  136. package/build-module/hooks/dimensions.mjs +1 -4
  137. package/build-module/hooks/dimensions.mjs.map +2 -2
  138. package/build-module/hooks/fit-text.mjs +11 -0
  139. package/build-module/hooks/fit-text.mjs.map +2 -2
  140. package/build-module/hooks/position.mjs +20 -23
  141. package/build-module/hooks/position.mjs.map +2 -2
  142. package/build-module/hooks/supports.mjs +0 -7
  143. package/build-module/hooks/supports.mjs.map +2 -2
  144. package/build-module/store/actions.mjs +7 -3
  145. package/build-module/store/actions.mjs.map +2 -2
  146. package/build-module/store/private-actions.mjs +1 -2
  147. package/build-module/store/private-actions.mjs.map +2 -2
  148. package/build-module/store/private-selectors.mjs +21 -0
  149. package/build-module/store/private-selectors.mjs.map +2 -2
  150. package/build-module/store/reducer.mjs +14 -6
  151. package/build-module/store/reducer.mjs.map +2 -2
  152. package/build-module/store/selectors.mjs +62 -42
  153. package/build-module/store/selectors.mjs.map +2 -2
  154. package/build-style/content-rtl.css +12 -0
  155. package/build-style/content.css +12 -0
  156. package/build-style/style-rtl.css +26 -8
  157. package/build-style/style.css +26 -8
  158. package/package.json +49 -46
  159. package/src/components/block-breadcrumb/README.md +2 -2
  160. package/src/components/block-compare/README.md +6 -6
  161. package/src/components/block-compare/index.js +1 -3
  162. package/src/components/block-patterns-list/index.js +1 -1
  163. package/src/components/block-preview/README.md +1 -1
  164. package/src/components/block-switcher/block-transformations-menu.js +16 -18
  165. package/src/components/block-switcher/index.js +4 -4
  166. package/src/components/block-types-list/README.md +0 -19
  167. package/src/components/global-styles/advanced-panel.js +5 -1
  168. package/src/components/global-styles/background-panel.js +3 -3
  169. package/src/components/global-styles/border-panel.js +2 -0
  170. package/src/components/global-styles/dimensions-panel.js +12 -13
  171. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -1
  172. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  173. package/src/components/inserter/index.js +257 -288
  174. package/src/components/inserter/search-results.js +1 -3
  175. package/src/components/justify-content-control/README.md +1 -1
  176. package/src/components/list-view/block-select-button.js +9 -13
  177. package/src/components/list-view/block.js +1 -0
  178. package/src/components/media-placeholder/README.md +1 -29
  179. package/src/components/media-upload/README.md +0 -19
  180. package/src/components/provider/test/use-block-sync.js +40 -0
  181. package/src/components/provider/use-block-sync.js +12 -2
  182. package/src/components/rich-text/event-listeners/before-input-rules.js +5 -4
  183. package/src/components/rich-text/event-listeners/delete.js +9 -4
  184. package/src/components/rich-text/event-listeners/enter.js +9 -2
  185. package/src/components/rich-text/event-listeners/input-events.js +13 -4
  186. package/src/components/rich-text/event-listeners/input-rules.js +20 -4
  187. package/src/components/rich-text/event-listeners/insert-replacement-text.js +9 -4
  188. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +9 -4
  189. package/src/components/rich-text/event-listeners/shortcuts.js +13 -4
  190. package/src/components/rich-text/event-listeners/undo-automatic-change.js +5 -4
  191. package/src/components/rich-text/index.js +1 -33
  192. package/src/components/unit-control/README.md +1 -1
  193. package/src/components/url-popover/README.md +1 -1
  194. package/src/components/use-block-commands/index.js +5 -5
  195. package/src/hooks/anchor.js +9 -17
  196. package/src/hooks/border.js +1 -5
  197. package/src/hooks/color.js +1 -6
  198. package/src/hooks/dimensions.js +1 -5
  199. package/src/hooks/fit-text.js +16 -0
  200. package/src/hooks/position.js +23 -27
  201. package/src/hooks/supports.js +0 -9
  202. package/src/store/actions.js +13 -3
  203. package/src/store/private-actions.js +1 -4
  204. package/src/store/private-selectors.js +42 -0
  205. package/src/store/reducer.js +19 -7
  206. package/src/store/selectors.js +91 -53
  207. package/src/store/test/actions.js +21 -0
  208. package/src/store/test/reducer.js +46 -0
  209. package/src/store/test/selectors.js +77 -0
  210. package/build/components/media-upload-progress/constants.cjs +0 -46
  211. package/build/components/media-upload-progress/constants.cjs.map +0 -7
  212. package/build/components/rich-text/native/format-edit.cjs +0 -60
  213. package/build/components/rich-text/native/format-edit.cjs.map +0 -7
  214. package/build/components/rich-text/native/index.cjs +0 -28
  215. package/build/components/rich-text/native/index.cjs.map +0 -7
  216. package/build/components/rich-text/native/use-format-types.cjs +0 -139
  217. package/build/components/rich-text/native/use-format-types.cjs.map +0 -7
  218. package/build-module/components/media-upload-progress/constants.mjs +0 -16
  219. package/build-module/components/media-upload-progress/constants.mjs.map +0 -7
  220. package/build-module/components/rich-text/native/format-edit.mjs +0 -39
  221. package/build-module/components/rich-text/native/format-edit.mjs.map +0 -7
  222. package/build-module/components/rich-text/native/index.mjs +0 -7
  223. package/build-module/components/rich-text/native/index.mjs.map +0 -7
  224. package/build-module/components/rich-text/native/use-format-types.mjs +0 -114
  225. package/build-module/components/rich-text/native/use-format-types.mjs.map +0 -7
  226. package/src/components/audio-player/audio-url-parser.native.js +0 -20
  227. package/src/components/audio-player/index.native.js +0 -225
  228. package/src/components/audio-player/styles.native.scss +0 -114
  229. package/src/components/audio-player/test/audio-url-parser.native.js +0 -53
  230. package/src/components/block-alignment-control/test/index.native.js +0 -37
  231. package/src/components/block-alignment-control/ui.native.js +0 -86
  232. package/src/components/block-caption/README.md +0 -104
  233. package/src/components/block-caption/index.native.js +0 -89
  234. package/src/components/block-caption/styles.native.scss +0 -7
  235. package/src/components/block-controls/slot.native.js +0 -33
  236. package/src/components/block-draggable/draggable-chip.native.js +0 -49
  237. package/src/components/block-draggable/dropping-insertion-point.native.js +0 -181
  238. package/src/components/block-draggable/dropping-insertion-point.native.scss +0 -8
  239. package/src/components/block-draggable/index.native.js +0 -467
  240. package/src/components/block-draggable/style.native.scss +0 -19
  241. package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +0 -73
  242. package/src/components/block-draggable/test/helpers.native.js +0 -182
  243. package/src/components/block-draggable/test/index.native.js +0 -419
  244. package/src/components/block-draggable/use-scroll-when-dragging.native.js +0 -135
  245. package/src/components/block-edit/edit.native.js +0 -49
  246. package/src/components/block-edit/test/edit.native.js +0 -65
  247. package/src/components/block-heading-level-dropdown/index.native.js +0 -68
  248. package/src/components/block-icon/index.native.js +0 -47
  249. package/src/components/block-icon/style.native.scss +0 -7
  250. package/src/components/block-list/block-crash-boundary.native.js +0 -43
  251. package/src/components/block-list/block-crash-warning.native.js +0 -21
  252. package/src/components/block-list/block-invalid-warning.native.js +0 -70
  253. package/src/components/block-list/block-list-context.native.js +0 -172
  254. package/src/components/block-list/block-list-item-cell.native.js +0 -62
  255. package/src/components/block-list/block-list-item.native.js +0 -209
  256. package/src/components/block-list/block-list-item.native.scss +0 -16
  257. package/src/components/block-list/block-outline.native.js +0 -77
  258. package/src/components/block-list/block-selection-button.native.js +0 -100
  259. package/src/components/block-list/block-selection-button.native.scss +0 -34
  260. package/src/components/block-list/block.native.js +0 -716
  261. package/src/components/block-list/block.native.scss +0 -62
  262. package/src/components/block-list/grid-item.native.js +0 -58
  263. package/src/components/block-list/index.native.js +0 -437
  264. package/src/components/block-list/insertion-point.native.js +0 -36
  265. package/src/components/block-list/style.native.scss +0 -117
  266. package/src/components/block-list/test/block-invalid-warning.native.js +0 -62
  267. package/src/components/block-list/test/block-list-context.native.js +0 -243
  268. package/src/components/block-list/test/block-outline.native.js +0 -255
  269. package/src/components/block-list/test/fixtures/block-list-context.native.js +0 -79
  270. package/src/components/block-list/test/index.native.js +0 -205
  271. package/src/components/block-list/use-block-props/index.native.js +0 -10
  272. package/src/components/block-list/use-scroll-upon-insertion.native.js +0 -52
  273. package/src/components/block-list-appender/index.native.js +0 -70
  274. package/src/components/block-list-appender/style.native.scss +0 -8
  275. package/src/components/block-media-update-progress/README.md +0 -100
  276. package/src/components/block-media-update-progress/index.native.js +0 -299
  277. package/src/components/block-media-update-progress/styles.native.scss +0 -9
  278. package/src/components/block-media-update-progress/test/index.native.js +0 -543
  279. package/src/components/block-mover/index.native.js +0 -193
  280. package/src/components/block-mover/mover-description.native.js +0 -155
  281. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +0 -218
  282. package/src/components/block-mover/test/index.native.js +0 -186
  283. package/src/components/block-settings/button.native.js +0 -41
  284. package/src/components/block-settings/container.native.js +0 -91
  285. package/src/components/block-settings/container.native.scss +0 -4
  286. package/src/components/block-settings/index.native.js +0 -5
  287. package/src/components/block-styles/index.native.js +0 -94
  288. package/src/components/block-styles/preview.native.js +0 -109
  289. package/src/components/block-styles/style.native.scss +0 -64
  290. package/src/components/block-switcher/block-transformations-menu.native.js +0 -91
  291. package/src/components/block-toolbar/block-toolbar-menu.native.js +0 -477
  292. package/src/components/block-toolbar/index.native.js +0 -126
  293. package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +0 -125
  294. package/src/components/block-toolbar/test/block-toolbar-menu.native.js +0 -405
  295. package/src/components/block-toolbar/test/index.native.js +0 -36
  296. package/src/components/block-types-list/index.native.js +0 -175
  297. package/src/components/block-types-list/style.native.scss +0 -25
  298. package/src/components/block-variation-picker/index.native.js +0 -107
  299. package/src/components/block-variation-picker/style.native.scss +0 -32
  300. package/src/components/button-block-appender/index.native.js +0 -92
  301. package/src/components/button-block-appender/styles.native.scss +0 -43
  302. package/src/components/caption/README.md +0 -44
  303. package/src/components/caption/index.native.js +0 -61
  304. package/src/components/colors-gradients/panel-color-gradient-settings.native.js +0 -59
  305. package/src/components/contrast-checker/index.native.js +0 -113
  306. package/src/components/contrast-checker/style.native.scss +0 -26
  307. package/src/components/convert-to-group-buttons/index.native.js +0 -79
  308. package/src/components/default-block-appender/index.native.js +0 -113
  309. package/src/components/default-block-appender/style.native.scss +0 -18
  310. package/src/components/floating-toolbar/floatingToolbar.android.scss +0 -4
  311. package/src/components/floating-toolbar/floatingToolbar.ios.scss +0 -3
  312. package/src/components/floating-toolbar/index.native.js +0 -141
  313. package/src/components/floating-toolbar/styles.native.scss +0 -43
  314. package/src/components/font-sizes/index.native.js +0 -7
  315. package/src/components/global-styles/color-panel.native.js +0 -207
  316. package/src/components/global-styles/test/use-global-styles-context.native.js +0 -435
  317. package/src/components/global-styles/use-global-styles-context.native.js +0 -592
  318. package/src/components/gradients/index.native.js +0 -2
  319. package/src/components/image-link-destinations/index.native.js +0 -152
  320. package/src/components/image-link-destinations/style.native.scss +0 -16
  321. package/src/components/index.native.js +0 -108
  322. package/src/components/inner-blocks/constants.native.js +0 -5
  323. package/src/components/inner-blocks/index.native.js +0 -221
  324. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +0 -124
  325. package/src/components/inserter/block-types-tab.native.js +0 -76
  326. package/src/components/inserter/hooks/use-block-type-impressions.native.js +0 -47
  327. package/src/components/inserter/hooks/use-clipboard-block.native.js +0 -40
  328. package/src/components/inserter/index.native.js +0 -424
  329. package/src/components/inserter/menu.native.js +0 -237
  330. package/src/components/inserter/no-results.native.js +0 -49
  331. package/src/components/inserter/reusable-blocks-tab.native.js +0 -45
  332. package/src/components/inserter/search-results.native.js +0 -67
  333. package/src/components/inserter/style.native.scss +0 -83
  334. package/src/components/inserter/tabs.native.js +0 -152
  335. package/src/components/inserter/test/__snapshots__/index.native.js.snap +0 -117
  336. package/src/components/inserter/test/fixtures/index.native.js +0 -12
  337. package/src/components/inserter/test/index.native.js +0 -273
  338. package/src/components/inserter/test/reusable-blocks-tab.native.js +0 -62
  339. package/src/components/inserter/test/utils.native.js +0 -37
  340. package/src/components/inserter/utils.native.js +0 -46
  341. package/src/components/inserter-button/index.native.js +0 -108
  342. package/src/components/inserter-button/style.native.scss +0 -72
  343. package/src/components/inspector-controls/fill.native.js +0 -62
  344. package/src/components/inspector-controls/slot.native.js +0 -35
  345. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +0 -31
  346. package/src/components/line-height-control/index.native.js +0 -28
  347. package/src/components/media-placeholder/index.native.js +0 -258
  348. package/src/components/media-placeholder/styles.native.scss +0 -108
  349. package/src/components/media-replace-flow/index.native.js +0 -12
  350. package/src/components/media-upload/constants.native.js +0 -14
  351. package/src/components/media-upload/index.native.js +0 -356
  352. package/src/components/media-upload/style.native.scss +0 -4
  353. package/src/components/media-upload/test/index.native.js +0 -172
  354. package/src/components/media-upload-progress/README.md +0 -100
  355. package/src/components/media-upload-progress/constants.js +0 -6
  356. package/src/components/media-upload-progress/index.native.js +0 -233
  357. package/src/components/media-upload-progress/styles.native.scss +0 -15
  358. package/src/components/media-upload-progress/test/index.native.js +0 -220
  359. package/src/components/plain-text/index.native.js +0 -164
  360. package/src/components/plain-text/style.native.scss +0 -10
  361. package/src/components/provider/index.native.js +0 -32
  362. package/src/components/rich-text/embed-handler-picker.native.js +0 -65
  363. package/src/components/rich-text/file-paste-handler.native.js +0 -3
  364. package/src/components/rich-text/format-toolbar/index.native.js +0 -21
  365. package/src/components/rich-text/format-toolbar-container.native.js +0 -16
  366. package/src/components/rich-text/index.native.js +0 -701
  367. package/src/components/rich-text/input-event.native.js +0 -10
  368. package/src/components/rich-text/native/format-edit.js +0 -44
  369. package/src/components/rich-text/native/get-format-colors.native.js +0 -47
  370. package/src/components/rich-text/native/index.js +0 -1
  371. package/src/components/rich-text/native/index.native.js +0 -1389
  372. package/src/components/rich-text/native/style.native.scss +0 -28
  373. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +0 -79
  374. package/src/components/rich-text/native/test/index.native.js +0 -345
  375. package/src/components/rich-text/native/test/performance/rich-text.native.js +0 -44
  376. package/src/components/rich-text/native/toolbar-button-with-options.native.js +0 -61
  377. package/src/components/rich-text/native/use-format-types.js +0 -146
  378. package/src/components/rich-text/remove-browser-shortcuts.native.js +0 -1
  379. package/src/components/rich-text/shortcut.native.js +0 -10
  380. package/src/components/ungroup-button/README.md +0 -23
  381. package/src/components/ungroup-button/index.native.js +0 -77
  382. package/src/components/unsupported-block-details/index.native.js +0 -187
  383. package/src/components/unsupported-block-details/style.native.scss +0 -56
  384. package/src/components/url-input/index.native.js +0 -33
  385. package/src/components/use-block-drop-zone/index.native.js +0 -207
  386. package/src/components/use-on-block-drop/index.native.js +0 -115
  387. package/src/components/use-unsupported-block-editor/index.native.js +0 -59
  388. package/src/components/video-player/gridicon-play.native.js +0 -13
  389. package/src/components/video-player/index.native.js +0 -133
  390. package/src/components/video-player/styles.native.scss +0 -29
  391. package/src/components/warning/index.native.js +0 -64
  392. package/src/components/warning/style.native.scss +0 -47
  393. package/src/hooks/align.native.js +0 -49
  394. package/src/hooks/custom-class-name.native.js +0 -70
  395. package/src/hooks/index.native.js +0 -36
  396. package/src/hooks/layout.native.js +0 -23
  397. package/src/hooks/test/__snapshots__/align.native.js.snap +0 -73
  398. package/src/hooks/test/__snapshots__/anchor.native.js.snap +0 -7
  399. package/src/hooks/test/align.native.js +0 -134
  400. package/src/hooks/test/anchor.native.js +0 -32
  401. package/src/hooks/test/use-editor-wrapper-styles.native.js +0 -282
  402. package/src/hooks/typography.native.js +0 -60
  403. package/src/hooks/use-editor-wrapper-styles.native.js +0 -250
  404. package/src/hooks/use-editor-wrapper-styles.native.scss +0 -12
  405. package/src/index.native.js +0 -6
  406. package/src/private-apis.native.js +0 -21
  407. package/src/store/defaults.native.js +0 -23
@@ -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": ";AAGA,OAAO,UAAU;AAKjB,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,iBAAiB,uBAAuB;AACjD,SAAS,aAAa,2BAA2B;AACjD,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,gBAAgB;AAKlC,SAAS,mBAAmB;AAC5B,OAAO,uBAAuB;AAC9B,OAAO,gCAAgC;AACvC,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,SAAS,wBAAwB;AAyPpC;AAvPN,IAAM,uBAAuB;AAE7B,IAAM,iBAAiB;AAAA,EAC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EACd,MAAM,SAAS,KAAM,OAAQ;AAC5B,UAAM,qBAAqB,sBAAuB,KAAM;AACxD,QAAK,oBAAqB;AACzB,aAAO;AAAA,IACR;AACA,WAAO,oBAAC,qBAAoB,GAAG,OAAQ;AAAA,EACxC;AAAA,EACA;AAAA,EACA,eAAe,CAAE,OAAQ;AAAA,EACzB,WAAY,MAAO;AAClB,WAAO,gBAAiB,MAAM,oBAAqB;AAAA,EACpD;AACD;AAGA,IAAM,iCAAiC,CAAC;AAExC,SAAS,cAAe,EAAE,MAAM,MAAM,GAAI;AACzC,QAAM,0BAA0B;AAAA,IAC/B;AAAA,IACA;AAAA,EACD;AACA,QAAM,qBAAqB,sBAAuB,EAAE,KAAK,CAAE;AAC3D,QAAM,sBAAsB,2BAA2B,CAAE;AAEzD,QAAM,KAAK,cAAe,8BAA+B;AAGzD,QAAM,mBAAmB,iBAAkB,EAAG,iBAAkB,EAAG;AAGnE,MAAI;AACJ,MAAK,qBAAsB;AAC1B,UACC,eAAgB;AAAA,MACf,UAAU;AAAA,MACV;AAAA,IACD,CAAE,KAAK;AAAA,EACT;AAGA,QAAM,YAAY,KAAM;AAAA,IACvB,CAAE,gBAAiB,EAAG,EAAG,GAAG,uBAAuB,CAAC,CAAE;AAAA;AAAA,IACtD,CAAE,eAAgB,OAAO,UAAU,IAAK,EAAG,GAC1C,uBAAuB,CAAC,CAAE,OAAO,CAAC,CAAE,OAAO,UAAU;AAAA,EACvD,CAAE;AAEF,mBAAkB,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,\n\t} );\n\n\tuseStyleOverride( { css } );\n\n\treturn { className };\n}\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,iBAAiB,uBAAuB;AACjD,SAAS,aAAa,2BAA2B;AACjD,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AAKxB,SAAS,mBAAmB;AAC5B,OAAO,uBAAuB;AAC9B,OAAO,gCAAgC;AACvC,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,SAAS,wBAAwB;AAuPtC;AArPJ,IAAM,uBAAuB;AA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UAAM,qBAAqB,sBAAuB,KAAM;AACxD,QAAK,oBAAqB;AACzB,aAAO;AAAA,IACR;AACA,WAAO,oBAAC,qBAAoB,GAAG,OAAQ;AAAA,EACxC;AAAA,EACA;AAAA,EACA,eAAe,CAAE,OAAQ;AAAA,EACzB,WAAY,MAAO;AAClB,WAAO,gBAAiB,MAAM,oBAAqB;AAAA,EACpD;AACD;AAGA,IAAM,iCAAiC,CAAC;AAExC,SAAS,cAAe,EAAE,MAAM,MAAM,GAAI;AACzC,QAAM,0BAA0B;AAAA,IAC/B;AAAA,IACA;AAAA,EACD;AACA,QAAM,qBAAqB,sBAAuB,EAAE,KAAK,CAAE;AAC3D,QAAM,sBAAsB,2BAA2B,CAAE;AAEzD,QAAM,KAAK,cAAe,8BAA+B;AAGzD,QAAM,mBAAmB,iBAAkB,EAAG,iBAAkB,EAAG;AAGnE,MAAI;AACJ,MAAK,qBAAsB;AAC1B,UACC,eAAgB;AAAA,MACf,UAAU;AAAA,MACV;AAAA,IACD,CAAE,KAAK;AAAA,EACT;AAGA,QAAM,YAAY,KAAM;AAAA,IACvB,CAAE,gBAAiB,EAAG,EAAG,GAAG,uBAAuB,CAAC,CAAE;AAAA;AAAA,IACtD,CAAE,eAAgB,OAAO,UAAU,IAAK,EAAG,GAC1C,uBAAuB,CAAC,CAAE,OAAO,CAAC,CAAE,OAAO,UAAU;AAAA,EACvD,CAAE;AAEF,mBAAkB,EAAE,IAAI,CAAE;AAE1B,SAAO,EAAE,UAAU;AACpB;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,5 @@
1
1
  // packages/block-editor/src/hooks/supports.js
2
2
  import { getBlockSupport, hasBlockSupport } from "@wordpress/blocks";
3
- import { Platform } from "@wordpress/element";
4
3
  var ALIGN_SUPPORT_KEY = "align";
5
4
  var ALIGN_WIDE_SUPPORT_KEY = "alignWide";
6
5
  var BORDER_SUPPORT_KEY = "__experimentalBorder";
@@ -45,9 +44,6 @@ var getAlignSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_SUPPORT_
45
44
  var hasAlignWideSupport = (nameOrType) => hasBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
46
45
  var getAlignWideSupport = (nameOrType) => getBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
47
46
  function hasBorderSupport(nameOrType, feature = "any") {
48
- if (Platform.OS !== "web") {
49
- return false;
50
- }
51
47
  const support = getBlockSupport(nameOrType, BORDER_SUPPORT_KEY);
52
48
  if (support === true) {
53
49
  return true;
@@ -63,9 +59,6 @@ var hasColorSupport = (nameOrType) => {
63
59
  return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
64
60
  };
65
61
  var hasLinkColorSupport = (nameOrType) => {
66
- if (Platform.OS !== "web") {
67
- return false;
68
- }
69
62
  const colorSupport = getBlockSupport(nameOrType, COLOR_SUPPORT_KEY);
70
63
  return colorSupport !== null && typeof colorSupport === "object" && !!colorSupport.link;
71
64
  };
@@ -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": ";AAGA,SAAS,iBAAiB,uBAAuB;AACjD,SAAS,gBAAgB;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;AAKj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M,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,QAAS,gBAAiB,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": ";AAGA,SAAS,iBAAiB,uBAAuB;AAEjD,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,eAChC,gBAAiB,YAAY,iBAAkB;AAQzC,IAAM,kBAAkB,CAAE,eAChC,gBAAiB,YAAY,iBAAkB;AAQzC,IAAM,sBAAsB,CAAE,eACpC,gBAAiB,YAAY,sBAAuB;AAQ9C,IAAM,sBAAsB,CAAE,eACpC,gBAAiB,YAAY,sBAAuB;AAU9C,SAAS,iBAAkB,YAAY,UAAU,OAAQ;AAC/D,QAAM,UAAU,gBAAiB,YAAY,kBAAmB;AAEhE,MAAK,YAAY,MAAO;AACvB,WAAO;AA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AY,+BAA+B,IAAK;AAQ3D,IAAM,uBAAuB,CAAE,eACrC,gBAAiB,YAAY,uBAAwB;AAQ/C,IAAM,uBAAuB,CAAE,eACrC,gBAAiB,YAAY,uBAAwB;AAQ/C,IAAM,qBAAqB,CAAE,eACnC,gBAAiB,YAAY,qBAAsB;AAQ7C,IAAM,qBAAqB,CAAE,eACnC,gBAAiB,YAAY,qBAAsB;AAQ7C,IAAM,mBAAmB,CAAE,eACjC,gBAAiB,YAAY,kBAAmB;AAQ1C,IAAM,mBAAmB,CAAE,eACjC,gBAAiB,YAAY,kBAAmB;AAQ1C,IAAM,kBAAkB,CAAE,eAChC,iBAAiB,KAAM,CAAE,QAAS,gBAAiB,YAAY,GAAI,CAAE;",
6
6
  "names": []
7
7
  }
@@ -401,7 +401,9 @@ var __unstableDeleteSelection = (isForward) => ({ registry, select, dispatch })
401
401
  attributes: {
402
402
  ...targetBlock.attributes,
403
403
  ...updatedAttributes
404
- }
404
+ },
405
+ // Block A's inner blocks sit inside the selection; only B's survive.
406
+ innerBlocks: blockB.innerBlocks
405
407
  },
406
408
  ...isForward ? [] : blocksWithTheSameType
407
409
  ];
@@ -904,8 +906,10 @@ function __unstableSaveReusableBlock() {
904
906
  function __unstableMarkLastChangeAsPersistent() {
905
907
  return { type: "MARK_LAST_CHANGE_AS_PERSISTENT" };
906
908
  }
907
- function __unstableMarkNextChangeAsNotPersistent() {
908
- return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT" };
909
+ function __unstableMarkNextChangeAsNotPersistent({
910
+ history = "merge"
911
+ } = {}) {
912
+ return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT", history };
909
913
  }
910
914
  var __unstableMarkAutomaticChange = () => ({ dispatch }) => {
911
915
  dispatch({ type: "MARK_AUTOMATIC_CHANGE" });