@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
@@ -25,6 +25,7 @@ import {
25
25
  isSectionBlock,
26
26
  getParentSectionBlock,
27
27
  getSelectedBlockStyleState,
28
+ hasSelectedStyleState,
28
29
  isSelectedBlockStyleStateShownOnCanvas,
29
30
  } from '../private-selectors';
30
31
  import { getBlockEditingMode } from '../selectors';
@@ -126,6 +127,58 @@ describe( 'private selectors', () => {
126
127
  } );
127
128
  } );
128
129
 
130
+ describe( 'hasSelectedStyleState', () => {
131
+ it( 'returns false when the block has no selected state', () => {
132
+ const state = {};
133
+
134
+ expect( hasSelectedStyleState( state, 'client-1' ) ).toBe( false );
135
+ } );
136
+
137
+ it( 'returns false when another block has the selected state', () => {
138
+ const state = {
139
+ selectedBlockStyleState: {
140
+ clientId: 'client-2',
141
+ value: { viewport: 'default', pseudo: ':hover' },
142
+ },
143
+ };
144
+
145
+ expect( hasSelectedStyleState( state, 'client-1' ) ).toBe( false );
146
+ } );
147
+
148
+ it( 'returns true when a viewport state is selected', () => {
149
+ const state = {
150
+ selectedBlockStyleState: {
151
+ clientId: 'client-1',
152
+ value: { viewport: 'mobile', pseudo: 'default' },
153
+ },
154
+ };
155
+
156
+ expect( hasSelectedStyleState( state, 'client-1' ) ).toBe( true );
157
+ } );
158
+
159
+ it( 'returns true when a pseudo state is selected', () => {
160
+ const state = {
161
+ selectedBlockStyleState: {
162
+ clientId: 'client-1',
163
+ value: { viewport: 'default', pseudo: ':hover' },
164
+ },
165
+ };
166
+
167
+ expect( hasSelectedStyleState( state, 'client-1' ) ).toBe( true );
168
+ } );
169
+
170
+ it( 'returns true when viewport and pseudo states are selected', () => {
171
+ const state = {
172
+ selectedBlockStyleState: {
173
+ clientId: 'client-1',
174
+ value: { viewport: 'mobile', pseudo: ':hover' },
175
+ },
176
+ };
177
+
178
+ expect( hasSelectedStyleState( state, 'client-1' ) ).toBe( true );
179
+ } );
180
+ } );
181
+
129
182
  describe( 'isSelectedBlockStyleStateShownOnCanvas', () => {
130
183
  it( 'returns true when the block has no canvas preview state', () => {
131
184
  const state = {};
@@ -2236,6 +2236,52 @@ describe( 'state', () => {
2236
2236
  expect( subsequentState.isPersistentChange ).toBe( true );
2237
2237
  } );
2238
2238
 
2239
+ it( 'should flag ignored history for an explicitly marked not persistent change', () => {
2240
+ let original = deepFreeze(
2241
+ blocks( undefined, {
2242
+ type: 'RESET_BLOCKS',
2243
+ blocks: [
2244
+ {
2245
+ clientId: 'kumquat',
2246
+ attributes: {},
2247
+ innerBlocks: [],
2248
+ },
2249
+ ],
2250
+ } )
2251
+ );
2252
+ original = blocks( original, {
2253
+ type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT',
2254
+ history: 'ignore',
2255
+ } );
2256
+
2257
+ const nextState = blocks( original, {
2258
+ type: 'UPDATE_BLOCK_ATTRIBUTES',
2259
+ clientIds: [ 'kumquat' ],
2260
+ attributes: {
2261
+ updated: true,
2262
+ },
2263
+ } );
2264
+
2265
+ expect( nextState.isPersistentChange ).toBe( false );
2266
+ expect( nextState.lastBlockChangeHistoryMode ).toBe(
2267
+ 'ignore'
2268
+ );
2269
+
2270
+ // A subsequent change should clear the ignored history.
2271
+ const subsequentState = blocks( nextState, {
2272
+ type: 'UPDATE_BLOCK_ATTRIBUTES',
2273
+ clientIds: [ 'kumquat' ],
2274
+ attributes: {
2275
+ other: true,
2276
+ },
2277
+ } );
2278
+
2279
+ expect( subsequentState.isPersistentChange ).toBe( true );
2280
+ expect(
2281
+ subsequentState.lastBlockChangeHistoryMode
2282
+ ).toBeUndefined();
2283
+ } );
2284
+
2239
2285
  it( 'should retain reference for same state, same persistence', () => {
2240
2286
  const original = deepFreeze(
2241
2287
  blocks( undefined, {
@@ -4031,6 +4031,82 @@ describe( 'selectors', () => {
4031
4031
  } )
4032
4032
  );
4033
4033
  } );
4034
+
4035
+ it( 'should use variation metadata for transformation items', () => {
4036
+ registerBlockType( 'core/variation-transform-source', {
4037
+ apiVersion: 3,
4038
+ category: 'text',
4039
+ title: 'Variation Transform Source',
4040
+ edit: () => {},
4041
+ save: () => {},
4042
+ transforms: {
4043
+ to: [
4044
+ {
4045
+ type: 'block',
4046
+ blocks: [ 'core/variation-transform-target' ],
4047
+ variationName: 'grid',
4048
+ transform: () => {},
4049
+ },
4050
+ ],
4051
+ },
4052
+ } );
4053
+ registerBlockType( 'core/variation-transform-target', {
4054
+ apiVersion: 3,
4055
+ category: 'design',
4056
+ title: 'Group',
4057
+ icon: 'group',
4058
+ edit: () => {},
4059
+ save: () => {},
4060
+ variations: [
4061
+ {
4062
+ name: 'grid',
4063
+ title: 'Grid',
4064
+ icon: 'grid',
4065
+ attributes: { layout: { type: 'grid' } },
4066
+ scope: [ 'transform' ],
4067
+ },
4068
+ ],
4069
+ } );
4070
+
4071
+ const state = {
4072
+ blocks: {
4073
+ byClientId: new Map(),
4074
+ attributes: new Map(),
4075
+ order: new Map(),
4076
+ parents: new Map(),
4077
+ cache: {},
4078
+ blockEditingModes: new Map(),
4079
+ },
4080
+ preferences: {
4081
+ insertUsage: {
4082
+ 'core/variation-transform-target/grid': {
4083
+ count: 10,
4084
+ time: 1000,
4085
+ },
4086
+ },
4087
+ },
4088
+ blockListSettings: new Map(),
4089
+ settings: {},
4090
+ };
4091
+ const blocks = [ { name: 'core/variation-transform-source' } ];
4092
+
4093
+ try {
4094
+ const items = getBlockTransformItems( state, blocks );
4095
+
4096
+ expect( items ).toHaveLength( 1 );
4097
+ expect( items[ 0 ] ).toMatchObject( {
4098
+ id: 'core/variation-transform-target/grid',
4099
+ name: 'core/variation-transform-target',
4100
+ variationName: 'grid',
4101
+ title: 'Grid',
4102
+ icon: 'grid',
4103
+ frecency: 2.5,
4104
+ } );
4105
+ } finally {
4106
+ unregisterBlockType( 'core/variation-transform-source' );
4107
+ unregisterBlockType( 'core/variation-transform-target' );
4108
+ }
4109
+ } );
4034
4110
  } );
4035
4111
 
4036
4112
  describe( 'isValidTemplate', () => {
@@ -5005,6 +5081,7 @@ describe( '__unstableGetClientIdsTree', () => {
5005
5081
  },
5006
5082
  { clientId: 'baz', innerBlocks: [] },
5007
5083
  ] );
5084
+ expect( console ).toHaveWarned();
5008
5085
  } );
5009
5086
 
5010
5087
  it( "should return the full content tree starting from the root, consisting of stripped down block object containing only its client ID and its inner blocks' client IDs", () => {
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/media-upload-progress/constants.js
21
- var constants_exports = {};
22
- __export(constants_exports, {
23
- MEDIA_UPLOAD_STATE_FAILED: () => MEDIA_UPLOAD_STATE_FAILED,
24
- MEDIA_UPLOAD_STATE_IDLE: () => MEDIA_UPLOAD_STATE_IDLE,
25
- MEDIA_UPLOAD_STATE_PAUSED: () => MEDIA_UPLOAD_STATE_PAUSED,
26
- MEDIA_UPLOAD_STATE_RESET: () => MEDIA_UPLOAD_STATE_RESET,
27
- MEDIA_UPLOAD_STATE_SUCCEEDED: () => MEDIA_UPLOAD_STATE_SUCCEEDED,
28
- MEDIA_UPLOAD_STATE_UPLOADING: () => MEDIA_UPLOAD_STATE_UPLOADING
29
- });
30
- module.exports = __toCommonJS(constants_exports);
31
- var MEDIA_UPLOAD_STATE_IDLE = 0;
32
- var MEDIA_UPLOAD_STATE_UPLOADING = 1;
33
- var MEDIA_UPLOAD_STATE_SUCCEEDED = 2;
34
- var MEDIA_UPLOAD_STATE_FAILED = 3;
35
- var MEDIA_UPLOAD_STATE_RESET = 4;
36
- var MEDIA_UPLOAD_STATE_PAUSED = 11;
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- MEDIA_UPLOAD_STATE_FAILED,
40
- MEDIA_UPLOAD_STATE_IDLE,
41
- MEDIA_UPLOAD_STATE_PAUSED,
42
- MEDIA_UPLOAD_STATE_RESET,
43
- MEDIA_UPLOAD_STATE_SUCCEEDED,
44
- MEDIA_UPLOAD_STATE_UPLOADING
45
- });
46
- //# sourceMappingURL=constants.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/media-upload-progress/constants.js"],
4
- "sourcesContent": ["export const MEDIA_UPLOAD_STATE_IDLE = 0;\nexport const MEDIA_UPLOAD_STATE_UPLOADING = 1;\nexport const MEDIA_UPLOAD_STATE_SUCCEEDED = 2;\nexport const MEDIA_UPLOAD_STATE_FAILED = 3;\nexport const MEDIA_UPLOAD_STATE_RESET = 4;\nexport const MEDIA_UPLOAD_STATE_PAUSED = 11;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,0BAA0B;AAChC,IAAM,+BAA+B;AACrC,IAAM,+BAA+B;AACrC,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,4BAA4B;",
6
- "names": []
7
- }
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/rich-text/native/format-edit.js
21
- var format_edit_exports = {};
22
- __export(format_edit_exports, {
23
- default: () => FormatEdit
24
- });
25
- module.exports = __toCommonJS(format_edit_exports);
26
- var import_rich_text = require("@wordpress/rich-text");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- function FormatEdit({
29
- formatTypes,
30
- onChange,
31
- onFocus,
32
- value,
33
- forwardedRef
34
- }) {
35
- return formatTypes.map((settings) => {
36
- const { name, edit: Edit } = settings;
37
- if (!Edit) {
38
- return null;
39
- }
40
- const activeFormat = (0, import_rich_text.getActiveFormat)(value, name);
41
- const isActive = activeFormat !== void 0;
42
- const activeObject = (0, import_rich_text.getActiveObject)(value);
43
- const isObjectActive = activeObject !== void 0 && activeObject.type === name;
44
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
- Edit,
46
- {
47
- isActive,
48
- activeAttributes: isActive ? activeFormat.attributes || {} : {},
49
- isObjectActive,
50
- activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
51
- value,
52
- onChange,
53
- onFocus,
54
- contentRef: forwardedRef
55
- },
56
- name
57
- );
58
- });
59
- }
60
- //# sourceMappingURL=format-edit.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/format-edit.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getActiveFormat, getActiveObject } from '@wordpress/rich-text';\n\nexport default function FormatEdit( {\n\tformatTypes,\n\tonChange,\n\tonFocus,\n\tvalue,\n\tforwardedRef,\n} ) {\n\treturn formatTypes.map( ( settings ) => {\n\t\tconst { name, edit: Edit } = settings;\n\n\t\tif ( ! Edit ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst activeFormat = getActiveFormat( value, name );\n\t\tconst isActive = activeFormat !== undefined;\n\t\tconst activeObject = getActiveObject( value );\n\t\tconst isObjectActive =\n\t\t\tactiveObject !== undefined && activeObject.type === name;\n\n\t\treturn (\n\t\t\t<Edit\n\t\t\t\tkey={ name }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tactiveAttributes={\n\t\t\t\t\tisActive ? activeFormat.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tisObjectActive={ isObjectActive }\n\t\t\t\tactiveObjectAttributes={\n\t\t\t\t\tisObjectActive ? activeObject.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tcontentRef={ forwardedRef }\n\t\t\t/>\n\t\t);\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAiD;AAuB9C;AArBY,SAAR,WAA6B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SAAO,YAAY,IAAK,CAAE,aAAc;AACvC,UAAM,EAAE,MAAM,MAAM,KAAK,IAAI;AAE7B,QAAK,CAAE,MAAO;AACb,aAAO;AAAA,IACR;AAEA,UAAM,mBAAe,kCAAiB,OAAO,IAAK;AAClD,UAAM,WAAW,iBAAiB;AAClC,UAAM,mBAAe,kCAAiB,KAAM;AAC5C,UAAM,iBACL,iBAAiB,UAAa,aAAa,SAAS;AAErD,WACC;AAAA,MAAC;AAAA;AAAA,QAEA;AAAA,QACA,kBACC,WAAW,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAE7C;AAAA,QACA,wBACC,iBAAiB,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAEnD;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA;AAAA,MAZP;AAAA,IAaP;AAAA,EAEF,CAAE;AACH;",
6
- "names": []
7
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/rich-text/native/index.js
21
- var native_exports = {};
22
- __export(native_exports, {
23
- default: () => native_default
24
- });
25
- module.exports = __toCommonJS(native_exports);
26
- var native_default = () => {
27
- };
28
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/index.js"],
4
- "sourcesContent": ["export default () => {};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,iBAAQ,MAAM;AAAC;",
6
- "names": []
7
- }
@@ -1,139 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-editor/src/components/rich-text/native/use-format-types.js
21
- var use_format_types_exports = {};
22
- __export(use_format_types_exports, {
23
- useFormatTypes: () => useFormatTypes
24
- });
25
- module.exports = __toCommonJS(use_format_types_exports);
26
- var import_element = require("@wordpress/element");
27
- var import_data = require("@wordpress/data");
28
- var import_rich_text = require("@wordpress/rich-text");
29
- function formatTypesSelector(select) {
30
- return select(import_rich_text.store).getFormatTypes();
31
- }
32
- var interactiveContentTags = /* @__PURE__ */ new Set([
33
- "a",
34
- "audio",
35
- "button",
36
- "details",
37
- "embed",
38
- "iframe",
39
- "input",
40
- "label",
41
- "select",
42
- "textarea",
43
- "video"
44
- ]);
45
- function useFormatTypes({
46
- clientId,
47
- identifier,
48
- withoutInteractiveFormatting,
49
- allowedFormats
50
- }) {
51
- const allFormatTypes = (0, import_data.useSelect)(formatTypesSelector, []);
52
- const formatTypes = (0, import_element.useMemo)(() => {
53
- return allFormatTypes.filter(({ name, tagName }) => {
54
- if (allowedFormats && !allowedFormats.includes(name)) {
55
- return false;
56
- }
57
- if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
58
- return false;
59
- }
60
- return true;
61
- });
62
- }, [allFormatTypes, allowedFormats, interactiveContentTags]);
63
- const keyedSelected = (0, import_data.useSelect)(
64
- (select) => formatTypes.reduce((accumulator, type) => {
65
- if (type.__experimentalGetPropsForEditableTreePreparation) {
66
- accumulator[type.name] = type.__experimentalGetPropsForEditableTreePreparation(
67
- select,
68
- {
69
- richTextIdentifier: identifier,
70
- blockClientId: clientId
71
- }
72
- );
73
- }
74
- return accumulator;
75
- }, {}),
76
- [formatTypes, clientId, identifier]
77
- );
78
- const dispatch = (0, import_data.useDispatch)();
79
- const prepareHandlers = [];
80
- const valueHandlers = [];
81
- const changeHandlers = [];
82
- const dependencies = [];
83
- formatTypes.forEach((type) => {
84
- if (type.__experimentalCreatePrepareEditableTree) {
85
- const selected = keyedSelected[type.name];
86
- const handler = type.__experimentalCreatePrepareEditableTree(
87
- selected,
88
- {
89
- richTextIdentifier: identifier,
90
- blockClientId: clientId
91
- }
92
- );
93
- if (type.__experimentalCreateOnChangeEditableValue) {
94
- valueHandlers.push(handler);
95
- } else {
96
- prepareHandlers.push(handler);
97
- }
98
- for (const key in selected) {
99
- dependencies.push(selected[key]);
100
- }
101
- }
102
- if (type.__experimentalCreateOnChangeEditableValue) {
103
- let dispatchers = {};
104
- if (type.__experimentalGetPropsForEditableTreeChangeHandler) {
105
- dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(
106
- dispatch,
107
- {
108
- richTextIdentifier: identifier,
109
- blockClientId: clientId
110
- }
111
- );
112
- }
113
- changeHandlers.push(
114
- type.__experimentalCreateOnChangeEditableValue(
115
- {
116
- ...keyedSelected[type.name] || {},
117
- ...dispatchers
118
- },
119
- {
120
- richTextIdentifier: identifier,
121
- blockClientId: clientId
122
- }
123
- )
124
- );
125
- }
126
- });
127
- return {
128
- formatTypes,
129
- prepareHandlers,
130
- valueHandlers,
131
- changeHandlers,
132
- dependencies
133
- };
134
- }
135
- // Annotate the CommonJS export names for ESM import in node:
136
- 0 && (module.exports = {
137
- useFormatTypes
138
- });
139
- //# sourceMappingURL=use-format-types.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/use-format-types.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formatting or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\tinteractiveContentTags.has( tagName )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, interactiveContentTags ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\taccumulator[ type.name ] =\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst selected = keyedSelected[ type.name ];\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tselected,\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\n\t\t\tfor ( const key in selected ) {\n\t\t\t\tdependencies.push( selected[ key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( keyedSelected[ type.name ] || {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t};\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAwB;AACxB,kBAAuC;AACvC,uBAAuC;AAEvC,SAAS,oBAAqB,QAAS;AACtC,SAAO,OAAQ,iBAAAA,KAAc,EAAE,eAAe;AAC/C;AAOA,IAAM,yBAAyB,oBAAI,IAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;AAYK,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,qBAAiB,uBAAW,qBAAqB,CAAC,CAAE;AAC1D,QAAM,kBAAc,wBAAS,MAAM;AAClC,WAAO,eAAe,OAAQ,CAAE,EAAE,MAAM,QAAQ,MAAO;AACtD,UAAK,kBAAkB,CAAE,eAAe,SAAU,IAAK,GAAI;AAC1D,eAAO;AAAA,MACR;AAEA,UACC,gCACA,uBAAuB,IAAK,OAAQ,GACnC;AACD,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,IACR,CAAE;AAAA,EACH,GAAG,CAAE,gBAAgB,gBAAgB,sBAAuB,CAAE;AAC9D,QAAM,oBAAgB;AAAA,IACrB,CAAE,WACD,YAAY,OAAQ,CAAE,aAAa,SAAU;AAC5C,UAAK,KAAK,kDAAmD;AAC5D,oBAAa,KAAK,IAAK,IACtB,KAAK;AAAA,UACJ;AAAA,UACA;AAAA,YACC,oBAAoB;AAAA,YACpB,eAAe;AAAA,UAChB;AAAA,QACD;AAAA,MACF;AAEA,aAAO;AAAA,IACR,GAAG,CAAC,CAAE;AAAA,IACP,CAAE,aAAa,UAAU,UAAW;AAAA,EACrC;AACA,QAAM,eAAW,yBAAY;AAC7B,QAAM,kBAAkB,CAAC;AACzB,QAAM,gBAAgB,CAAC;AACvB,QAAM,iBAAiB,CAAC;AACxB,QAAM,eAAe,CAAC;AAEtB,cAAY,QAAS,CAAE,SAAU;AAChC,QAAK,KAAK,yCAA0C;AACnD,YAAM,WAAW,cAAe,KAAK,IAAK;AAC1C,YAAM,UAAU,KAAK;AAAA,QACpB;AAAA,QACA;AAAA,UACC,oBAAoB;AAAA,UACpB,eAAe;AAAA,QAChB;AAAA,MACD;AAEA,UAAK,KAAK,2CAA4C;AACrD,sBAAc,KAAM,OAAQ;AAAA,MAC7B,OAAO;AACN,wBAAgB,KAAM,OAAQ;AAAA,MAC/B;AAEA,iBAAY,OAAO,UAAW;AAC7B,qBAAa,KAAM,SAAU,GAAI,CAAE;AAAA,MACpC;AAAA,IACD;AAEA,QAAK,KAAK,2CAA4C;AACrD,UAAI,cAAc,CAAC;AAEnB,UAAK,KAAK,oDAAqD;AAC9D,sBACC,KAAK;AAAA,UACJ;AAAA,UACA;AAAA,YACC,oBAAoB;AAAA,YACpB,eAAe;AAAA,UAChB;AAAA,QACD;AAAA,MACF;AAEA,qBAAe;AAAA,QACd,KAAK;AAAA,UACJ;AAAA,YACC,GAAK,cAAe,KAAK,IAAK,KAAK,CAAC;AAAA,YACpC,GAAG;AAAA,UACJ;AAAA,UACA;AAAA,YACC,oBAAoB;AAAA,YACpB,eAAe;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD,CAAE;AAEF,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
- "names": ["richTextStore"]
7
- }
@@ -1,16 +0,0 @@
1
- // packages/block-editor/src/components/media-upload-progress/constants.js
2
- var MEDIA_UPLOAD_STATE_IDLE = 0;
3
- var MEDIA_UPLOAD_STATE_UPLOADING = 1;
4
- var MEDIA_UPLOAD_STATE_SUCCEEDED = 2;
5
- var MEDIA_UPLOAD_STATE_FAILED = 3;
6
- var MEDIA_UPLOAD_STATE_RESET = 4;
7
- var MEDIA_UPLOAD_STATE_PAUSED = 11;
8
- export {
9
- MEDIA_UPLOAD_STATE_FAILED,
10
- MEDIA_UPLOAD_STATE_IDLE,
11
- MEDIA_UPLOAD_STATE_PAUSED,
12
- MEDIA_UPLOAD_STATE_RESET,
13
- MEDIA_UPLOAD_STATE_SUCCEEDED,
14
- MEDIA_UPLOAD_STATE_UPLOADING
15
- };
16
- //# sourceMappingURL=constants.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/media-upload-progress/constants.js"],
4
- "sourcesContent": ["export const MEDIA_UPLOAD_STATE_IDLE = 0;\nexport const MEDIA_UPLOAD_STATE_UPLOADING = 1;\nexport const MEDIA_UPLOAD_STATE_SUCCEEDED = 2;\nexport const MEDIA_UPLOAD_STATE_FAILED = 3;\nexport const MEDIA_UPLOAD_STATE_RESET = 4;\nexport const MEDIA_UPLOAD_STATE_PAUSED = 11;\n"],
5
- "mappings": ";AAAO,IAAM,0BAA0B;AAChC,IAAM,+BAA+B;AACrC,IAAM,+BAA+B;AACrC,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,4BAA4B;",
6
- "names": []
7
- }
@@ -1,39 +0,0 @@
1
- // packages/block-editor/src/components/rich-text/native/format-edit.js
2
- import { getActiveFormat, getActiveObject } from "@wordpress/rich-text";
3
- import { jsx } from "react/jsx-runtime";
4
- function FormatEdit({
5
- formatTypes,
6
- onChange,
7
- onFocus,
8
- value,
9
- forwardedRef
10
- }) {
11
- return formatTypes.map((settings) => {
12
- const { name, edit: Edit } = settings;
13
- if (!Edit) {
14
- return null;
15
- }
16
- const activeFormat = getActiveFormat(value, name);
17
- const isActive = activeFormat !== void 0;
18
- const activeObject = getActiveObject(value);
19
- const isObjectActive = activeObject !== void 0 && activeObject.type === name;
20
- return /* @__PURE__ */ jsx(
21
- Edit,
22
- {
23
- isActive,
24
- activeAttributes: isActive ? activeFormat.attributes || {} : {},
25
- isObjectActive,
26
- activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
27
- value,
28
- onChange,
29
- onFocus,
30
- contentRef: forwardedRef
31
- },
32
- name
33
- );
34
- });
35
- }
36
- export {
37
- FormatEdit as default
38
- };
39
- //# sourceMappingURL=format-edit.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/format-edit.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getActiveFormat, getActiveObject } from '@wordpress/rich-text';\n\nexport default function FormatEdit( {\n\tformatTypes,\n\tonChange,\n\tonFocus,\n\tvalue,\n\tforwardedRef,\n} ) {\n\treturn formatTypes.map( ( settings ) => {\n\t\tconst { name, edit: Edit } = settings;\n\n\t\tif ( ! Edit ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst activeFormat = getActiveFormat( value, name );\n\t\tconst isActive = activeFormat !== undefined;\n\t\tconst activeObject = getActiveObject( value );\n\t\tconst isObjectActive =\n\t\t\tactiveObject !== undefined && activeObject.type === name;\n\n\t\treturn (\n\t\t\t<Edit\n\t\t\t\tkey={ name }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tactiveAttributes={\n\t\t\t\t\tisActive ? activeFormat.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tisObjectActive={ isObjectActive }\n\t\t\t\tactiveObjectAttributes={\n\t\t\t\t\tisObjectActive ? activeObject.attributes || {} : {}\n\t\t\t\t}\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tcontentRef={ forwardedRef }\n\t\t\t/>\n\t\t);\n\t} );\n}\n"],
5
- "mappings": ";AAGA,SAAS,iBAAiB,uBAAuB;AAuB9C;AArBY,SAAR,WAA6B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SAAO,YAAY,IAAK,CAAE,aAAc;AACvC,UAAM,EAAE,MAAM,MAAM,KAAK,IAAI;AAE7B,QAAK,CAAE,MAAO;AACb,aAAO;AAAA,IACR;AAEA,UAAM,eAAe,gBAAiB,OAAO,IAAK;AAClD,UAAM,WAAW,iBAAiB;AAClC,UAAM,eAAe,gBAAiB,KAAM;AAC5C,UAAM,iBACL,iBAAiB,UAAa,aAAa,SAAS;AAErD,WACC;AAAA,MAAC;AAAA;AAAA,QAEA;AAAA,QACA,kBACC,WAAW,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAE7C;AAAA,QACA,wBACC,iBAAiB,aAAa,cAAc,CAAC,IAAI,CAAC;AAAA,QAEnD;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA;AAAA,MAZP;AAAA,IAaP;AAAA,EAEF,CAAE;AACH;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- // packages/block-editor/src/components/rich-text/native/index.js
2
- var native_default = () => {
3
- };
4
- export {
5
- native_default as default
6
- };
7
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/rich-text/native/index.js"],
4
- "sourcesContent": ["export default () => {};\n"],
5
- "mappings": ";AAAA,IAAO,iBAAQ,MAAM;AAAC;",
6
- "names": []
7
- }