@wordpress/block-editor 12.15.0 → 12.16.1-next.79a6196f.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (927) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +12 -10
  4. package/build/components/block-canvas/index.js +21 -7
  5. package/build/components/block-canvas/index.js.map +1 -1
  6. package/build/components/block-card/index.js +2 -2
  7. package/build/components/block-card/index.js.map +1 -1
  8. package/build/components/block-controls/hook.js +3 -23
  9. package/build/components/block-controls/hook.js.map +1 -1
  10. package/build/components/block-draggable/draggable-chip.js +6 -1
  11. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  12. package/build/components/block-draggable/index.js +76 -6
  13. package/build/components/block-draggable/index.js.map +1 -1
  14. package/build/components/block-draggable/index.native.js +0 -6
  15. package/build/components/block-draggable/index.native.js.map +1 -1
  16. package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  17. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  18. package/build/components/block-edit/context.js +5 -1
  19. package/build/components/block-edit/context.js.map +1 -1
  20. package/build/components/block-edit/index.js +18 -9
  21. package/build/components/block-edit/index.js.map +1 -1
  22. package/build/components/block-editing-mode/index.js +2 -3
  23. package/build/components/block-editing-mode/index.js.map +1 -1
  24. package/build/components/block-info-slot-fill/index.js +3 -4
  25. package/build/components/block-info-slot-fill/index.js.map +1 -1
  26. package/build/components/block-inspector/index.js +1 -1
  27. package/build/components/block-inspector/index.js.map +1 -1
  28. package/build/components/block-list/block-list-item-cell.native.js +1 -0
  29. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  30. package/build/components/block-list/block.js +257 -95
  31. package/build/components/block-list/block.js.map +1 -1
  32. package/build/components/block-list/block.native.js +58 -23
  33. package/build/components/block-list/block.native.js.map +1 -1
  34. package/build/components/block-list/index.native.js +3 -5
  35. package/build/components/block-list/index.native.js.map +1 -1
  36. package/build/components/block-list/private-block-context.js +14 -0
  37. package/build/components/block-list/private-block-context.js.map +1 -0
  38. package/build/components/block-list/use-block-props/index.js +49 -69
  39. package/build/components/block-list/use-block-props/index.js.map +1 -1
  40. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  41. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  42. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  43. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  44. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  45. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  46. package/build/components/block-list/use-in-between-inserter.js +3 -2
  47. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  48. package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
  49. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  50. package/build/components/block-lock/toolbar.js +21 -27
  51. package/build/components/block-lock/toolbar.js.map +1 -1
  52. package/build/components/block-mover/index.js +2 -1
  53. package/build/components/block-mover/index.js.map +1 -1
  54. package/build/components/block-patterns-list/index.js +5 -5
  55. package/build/components/block-patterns-list/index.js.map +1 -1
  56. package/build/components/block-removal-warning-modal/index.js +2 -9
  57. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  58. package/build/components/block-rename/modal.js +3 -0
  59. package/build/components/block-rename/modal.js.map +1 -1
  60. package/build/components/block-settings/container.native.js +6 -4
  61. package/build/components/block-settings/container.native.js.map +1 -1
  62. package/build/components/block-styles/index.js +1 -1
  63. package/build/components/block-styles/index.js.map +1 -1
  64. package/build/components/block-styles/index.native.js +3 -2
  65. package/build/components/block-styles/index.native.js.map +1 -1
  66. package/build/components/block-switcher/index.js +4 -4
  67. package/build/components/block-switcher/index.js.map +1 -1
  68. package/build/components/block-toolbar/index.js +90 -29
  69. package/build/components/block-toolbar/index.js.map +1 -1
  70. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  71. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  72. package/build/components/block-tools/block-toolbar-popover.js +84 -0
  73. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  74. package/build/components/block-tools/index.js +27 -24
  75. package/build/components/block-tools/index.js.map +1 -1
  76. package/build/components/block-types-list/index.native.js +4 -3
  77. package/build/components/block-types-list/index.native.js.map +1 -1
  78. package/build/components/block-variation-picker/index.native.js +2 -1
  79. package/build/components/block-variation-picker/index.native.js.map +1 -1
  80. package/build/components/block-variation-transforms/index.js +29 -2
  81. package/build/components/block-variation-transforms/index.js.map +1 -1
  82. package/build/components/border-radius-control/linked-button.js +1 -1
  83. package/build/components/border-radius-control/linked-button.js.map +1 -1
  84. package/build/components/colors/utils.js +10 -2
  85. package/build/components/colors/utils.js.map +1 -1
  86. package/build/components/colors/with-colors.js +6 -2
  87. package/build/components/colors/with-colors.js.map +1 -1
  88. package/build/components/colors-gradients/control.js +28 -17
  89. package/build/components/colors-gradients/control.js.map +1 -1
  90. package/build/components/duotone-control/index.js +1 -4
  91. package/build/components/duotone-control/index.js.map +1 -1
  92. package/build/components/font-sizes/utils.js +10 -2
  93. package/build/components/font-sizes/utils.js.map +1 -1
  94. package/build/components/global-styles/border-panel.js +2 -1
  95. package/build/components/global-styles/border-panel.js.map +1 -1
  96. package/build/components/global-styles/color-panel.js +24 -21
  97. package/build/components/global-styles/color-panel.js.map +1 -1
  98. package/build/components/global-styles/dimensions-panel.js +4 -3
  99. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  100. package/build/components/global-styles/effects-panel.js +2 -1
  101. package/build/components/global-styles/effects-panel.js.map +1 -1
  102. package/build/components/global-styles/filters-panel.js +6 -3
  103. package/build/components/global-styles/filters-panel.js.map +1 -1
  104. package/build/components/global-styles/get-global-styles-changes.js +192 -0
  105. package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
  106. package/build/components/global-styles/hooks.js +3 -2
  107. package/build/components/global-styles/hooks.js.map +1 -1
  108. package/build/components/global-styles/image-settings-panel.js +7 -1
  109. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  110. package/build/components/global-styles/index.js +7 -0
  111. package/build/components/global-styles/index.js.map +1 -1
  112. package/build/components/global-styles/typography-panel.js +43 -36
  113. package/build/components/global-styles/typography-panel.js.map +1 -1
  114. package/build/components/global-styles/use-global-styles-output.js +22 -8
  115. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  116. package/build/components/global-styles/utils.js +8 -1
  117. package/build/components/global-styles/utils.js.map +1 -1
  118. package/build/components/height-control/index.js +6 -2
  119. package/build/components/height-control/index.js.map +1 -1
  120. package/build/components/image-link-destinations/index.native.js +118 -0
  121. package/build/components/image-link-destinations/index.native.js.map +1 -0
  122. package/build/components/image-size-control/index.js +2 -2
  123. package/build/components/image-size-control/index.js.map +1 -1
  124. package/build/components/index.native.js +14 -5
  125. package/build/components/index.native.js.map +1 -1
  126. package/build/components/inner-blocks/index.js +61 -22
  127. package/build/components/inner-blocks/index.js.map +1 -1
  128. package/build/components/inner-blocks/index.native.js +18 -4
  129. package/build/components/inner-blocks/index.native.js.map +1 -1
  130. package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  131. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  132. package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
  133. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  134. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  135. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  136. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
  137. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  138. package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
  139. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  140. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
  141. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  142. package/build/components/inserter/block-patterns-tab/utils.js +10 -14
  143. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  144. package/build/components/inserter/hooks/use-block-types-state.js +4 -14
  145. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  146. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  147. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  148. package/build/components/inserter/index.js +1 -2
  149. package/build/components/inserter/index.js.map +1 -1
  150. package/build/components/inserter/library.js +3 -7
  151. package/build/components/inserter/library.js.map +1 -1
  152. package/build/components/inserter/media-tab/media-panel.js +2 -2
  153. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  154. package/build/components/inserter/menu.js +26 -33
  155. package/build/components/inserter/menu.js.map +1 -1
  156. package/build/components/inserter/preview-panel.js +2 -2
  157. package/build/components/inserter/preview-panel.js.map +1 -1
  158. package/build/components/inserter/tabs.js +21 -21
  159. package/build/components/inserter/tabs.js.map +1 -1
  160. package/build/components/inserter-button/index.native.js +98 -0
  161. package/build/components/inserter-button/index.native.js.map +1 -0
  162. package/build/components/inserter-button/sparkles.js +23 -0
  163. package/build/components/inserter-button/sparkles.js.map +1 -0
  164. package/build/components/inserter-draggable-blocks/index.js +8 -4
  165. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  166. package/build/components/inserter-list-item/index.js +2 -4
  167. package/build/components/inserter-list-item/index.js.map +1 -1
  168. package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
  169. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  170. package/build/components/inspector-controls/fill.js +3 -3
  171. package/build/components/inspector-controls/fill.js.map +1 -1
  172. package/build/components/inspector-controls/fill.native.js +3 -3
  173. package/build/components/inspector-controls/fill.native.js.map +1 -1
  174. package/build/components/inspector-controls-tabs/index.js +34 -23
  175. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  176. package/build/components/list-view/block-select-button.js +4 -0
  177. package/build/components/list-view/block-select-button.js.map +1 -1
  178. package/build/components/list-view/block.js +57 -3
  179. package/build/components/list-view/block.js.map +1 -1
  180. package/build/components/media-upload-progress/constants.js +19 -0
  181. package/build/components/media-upload-progress/constants.js.map +1 -0
  182. package/build/components/media-upload-progress/index.native.js +42 -17
  183. package/build/components/media-upload-progress/index.native.js.map +1 -1
  184. package/build/components/navigable-toolbar/index.js +11 -16
  185. package/build/components/navigable-toolbar/index.js.map +1 -1
  186. package/build/components/plain-text/index.native.js +8 -3
  187. package/build/components/plain-text/index.native.js.map +1 -1
  188. package/build/components/preview-options/index.js +6 -62
  189. package/build/components/preview-options/index.js.map +1 -1
  190. package/build/components/provider/index.js +3 -1
  191. package/build/components/provider/index.js.map +1 -1
  192. package/build/components/provider/use-block-sync.js +7 -1
  193. package/build/components/provider/use-block-sync.js.map +1 -1
  194. package/build/components/rich-text/content.js +26 -23
  195. package/build/components/rich-text/content.js.map +1 -1
  196. package/build/components/rich-text/get-rich-text-values.js +2 -1
  197. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  198. package/build/components/rich-text/index.js +19 -37
  199. package/build/components/rich-text/index.js.map +1 -1
  200. package/build/components/rich-text/index.native.js +9 -16
  201. package/build/components/rich-text/index.native.js.map +1 -1
  202. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  203. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  204. package/build/components/rich-text/native/index.native.js +22 -57
  205. package/build/components/rich-text/native/index.native.js.map +1 -1
  206. package/build/components/rich-text/use-input-rules.js +7 -3
  207. package/build/components/rich-text/use-input-rules.js.map +1 -1
  208. package/build/components/rich-text/use-mark-persistent.js +1 -1
  209. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  210. package/build/components/rich-text/with-deprecations.js +50 -0
  211. package/build/components/rich-text/with-deprecations.js.map +1 -0
  212. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  213. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  214. package/build/components/url-input/index.js +9 -6
  215. package/build/components/url-input/index.js.map +1 -1
  216. package/build/components/use-block-commands/index.js +14 -18
  217. package/build/components/use-block-commands/index.js.map +1 -1
  218. package/build/components/use-block-drop-zone/index.js +108 -17
  219. package/build/components/use-block-drop-zone/index.js.map +1 -1
  220. package/build/components/use-moving-animation/index.js +100 -92
  221. package/build/components/use-moving-animation/index.js.map +1 -1
  222. package/build/components/use-on-block-drop/index.js +9 -12
  223. package/build/components/use-on-block-drop/index.js.map +1 -1
  224. package/build/components/use-resize-canvas/index.js +4 -1
  225. package/build/components/use-resize-canvas/index.js.map +1 -1
  226. package/build/components/use-settings/index.js +14 -0
  227. package/build/components/use-settings/index.js.map +1 -1
  228. package/build/components/writing-flow/index.js +0 -1
  229. package/build/components/writing-flow/index.js.map +1 -1
  230. package/build/components/writing-flow/use-drag-selection.js +15 -4
  231. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  232. package/build/components/writing-flow/use-selection-observer.js +73 -27
  233. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  234. package/build/components/writing-flow/use-tab-nav.js +7 -4
  235. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  236. package/build/hooks/align.js +21 -69
  237. package/build/hooks/align.js.map +1 -1
  238. package/build/hooks/align.native.js +11 -1
  239. package/build/hooks/align.native.js.map +1 -1
  240. package/build/hooks/anchor.js +14 -30
  241. package/build/hooks/anchor.js.map +1 -1
  242. package/build/hooks/aria-label.js +9 -1
  243. package/build/hooks/aria-label.js.map +1 -1
  244. package/build/hooks/background.js +198 -36
  245. package/build/hooks/background.js.map +1 -1
  246. package/build/hooks/block-hooks.js +24 -32
  247. package/build/hooks/block-hooks.js.map +1 -1
  248. package/build/hooks/block-renaming.js +18 -22
  249. package/build/hooks/block-renaming.js.map +1 -1
  250. package/build/hooks/border.js +53 -80
  251. package/build/hooks/border.js.map +1 -1
  252. package/build/hooks/color.js +79 -90
  253. package/build/hooks/color.js.map +1 -1
  254. package/build/hooks/content-lock-ui.js +29 -29
  255. package/build/hooks/content-lock-ui.js.map +1 -1
  256. package/build/hooks/custom-class-name.js +13 -30
  257. package/build/hooks/custom-class-name.js.map +1 -1
  258. package/build/hooks/custom-class-name.native.js +9 -1
  259. package/build/hooks/custom-class-name.native.js.map +1 -1
  260. package/build/hooks/dimensions.js +13 -14
  261. package/build/hooks/dimensions.js.map +1 -1
  262. package/build/hooks/duotone.js +31 -61
  263. package/build/hooks/duotone.js.map +1 -1
  264. package/build/hooks/font-family.js +23 -28
  265. package/build/hooks/font-family.js.map +1 -1
  266. package/build/hooks/font-size.js +52 -120
  267. package/build/hooks/font-size.js.map +1 -1
  268. package/build/hooks/index.js +27 -16
  269. package/build/hooks/index.js.map +1 -1
  270. package/build/hooks/index.native.js +15 -6
  271. package/build/hooks/index.native.js.map +1 -1
  272. package/build/hooks/layout-child.js +68 -0
  273. package/build/hooks/layout-child.js.map +1 -0
  274. package/build/hooks/layout.js +25 -104
  275. package/build/hooks/layout.js.map +1 -1
  276. package/build/hooks/padding.js +2 -2
  277. package/build/hooks/padding.js.map +1 -1
  278. package/build/hooks/position.js +40 -62
  279. package/build/hooks/position.js.map +1 -1
  280. package/build/hooks/style.js +52 -89
  281. package/build/hooks/style.js.map +1 -1
  282. package/build/hooks/typography.js +25 -10
  283. package/build/hooks/typography.js.map +1 -1
  284. package/build/hooks/typography.native.js +43 -18
  285. package/build/hooks/typography.native.js.map +1 -1
  286. package/build/hooks/use-typography-props.js +10 -2
  287. package/build/hooks/use-typography-props.js.map +1 -1
  288. package/build/hooks/utils.js +200 -10
  289. package/build/hooks/utils.js.map +1 -1
  290. package/build/private-apis.js +2 -6
  291. package/build/private-apis.js.map +1 -1
  292. package/build/private-apis.native.js +0 -2
  293. package/build/private-apis.native.js.map +1 -1
  294. package/build/store/actions.js +0 -16
  295. package/build/store/actions.js.map +1 -1
  296. package/build/store/private-actions.js +54 -0
  297. package/build/store/private-actions.js.map +1 -1
  298. package/build/store/private-selectors.js +46 -0
  299. package/build/store/private-selectors.js.map +1 -1
  300. package/build/store/reducer.js +18 -2
  301. package/build/store/reducer.js.map +1 -1
  302. package/build/store/selectors.js +11 -73
  303. package/build/store/selectors.js.map +1 -1
  304. package/build/store/undo-ignore.js +12 -0
  305. package/build/store/undo-ignore.js.map +1 -0
  306. package/build/store/utils.js +66 -0
  307. package/build/store/utils.js.map +1 -0
  308. package/build/utils/get-px-from-css-unit.js +16 -0
  309. package/build/utils/get-px-from-css-unit.js.map +1 -0
  310. package/build/utils/index.js +2 -2
  311. package/build/utils/index.js.map +1 -1
  312. package/build/utils/object.js +38 -99
  313. package/build/utils/object.js.map +1 -1
  314. package/build/utils/selection.js +9 -1
  315. package/build/utils/selection.js.map +1 -1
  316. package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
  317. package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  318. package/build-module/components/block-canvas/index.js +22 -8
  319. package/build-module/components/block-canvas/index.js.map +1 -1
  320. package/build-module/components/block-card/index.js +2 -2
  321. package/build-module/components/block-card/index.js.map +1 -1
  322. package/build-module/components/block-controls/hook.js +4 -24
  323. package/build-module/components/block-controls/hook.js.map +1 -1
  324. package/build-module/components/block-draggable/draggable-chip.js +6 -1
  325. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  326. package/build-module/components/block-draggable/index.js +76 -6
  327. package/build-module/components/block-draggable/index.js.map +1 -1
  328. package/build-module/components/block-draggable/index.native.js +1 -7
  329. package/build-module/components/block-draggable/index.native.js.map +1 -1
  330. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  331. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  332. package/build-module/components/block-edit/context.js +2 -0
  333. package/build-module/components/block-edit/context.js.map +1 -1
  334. package/build-module/components/block-edit/index.js +19 -10
  335. package/build-module/components/block-edit/index.js.map +1 -1
  336. package/build-module/components/block-editing-mode/index.js +3 -4
  337. package/build-module/components/block-editing-mode/index.js.map +1 -1
  338. package/build-module/components/block-info-slot-fill/index.js +3 -3
  339. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  340. package/build-module/components/block-inspector/index.js +1 -1
  341. package/build-module/components/block-inspector/index.js.map +1 -1
  342. package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
  343. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  344. package/build-module/components/block-list/block.js +261 -99
  345. package/build-module/components/block-list/block.js.map +1 -1
  346. package/build-module/components/block-list/block.native.js +60 -25
  347. package/build-module/components/block-list/block.native.js.map +1 -1
  348. package/build-module/components/block-list/index.native.js +3 -5
  349. package/build-module/components/block-list/index.native.js.map +1 -1
  350. package/build-module/components/block-list/private-block-context.js +6 -0
  351. package/build-module/components/block-list/private-block-context.js.map +1 -0
  352. package/build-module/components/block-list/use-block-props/index.js +50 -70
  353. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  354. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  355. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  356. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  357. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  358. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  359. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  360. package/build-module/components/block-list/use-in-between-inserter.js +3 -2
  361. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  362. package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
  363. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  364. package/build-module/components/block-lock/toolbar.js +22 -28
  365. package/build-module/components/block-lock/toolbar.js.map +1 -1
  366. package/build-module/components/block-mover/index.js +2 -1
  367. package/build-module/components/block-mover/index.js.map +1 -1
  368. package/build-module/components/block-patterns-list/index.js +6 -6
  369. package/build-module/components/block-patterns-list/index.js.map +1 -1
  370. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  371. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  372. package/build-module/components/block-rename/modal.js +3 -0
  373. package/build-module/components/block-rename/modal.js.map +1 -1
  374. package/build-module/components/block-settings/container.native.js +4 -2
  375. package/build-module/components/block-settings/container.native.js.map +1 -1
  376. package/build-module/components/block-styles/index.js +1 -1
  377. package/build-module/components/block-styles/index.js.map +1 -1
  378. package/build-module/components/block-styles/index.native.js +3 -2
  379. package/build-module/components/block-styles/index.native.js.map +1 -1
  380. package/build-module/components/block-switcher/index.js +4 -4
  381. package/build-module/components/block-switcher/index.js.map +1 -1
  382. package/build-module/components/block-toolbar/index.js +89 -27
  383. package/build-module/components/block-toolbar/index.js.map +1 -1
  384. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  385. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  386. package/build-module/components/block-tools/block-toolbar-popover.js +74 -0
  387. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  388. package/build-module/components/block-tools/index.js +27 -24
  389. package/build-module/components/block-tools/index.js.map +1 -1
  390. package/build-module/components/block-types-list/index.native.js +2 -1
  391. package/build-module/components/block-types-list/index.native.js.map +1 -1
  392. package/build-module/components/block-variation-picker/index.native.js +2 -1
  393. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  394. package/build-module/components/block-variation-transforms/index.js +30 -3
  395. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  396. package/build-module/components/border-radius-control/linked-button.js +1 -1
  397. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  398. package/build-module/components/colors/utils.js +9 -1
  399. package/build-module/components/colors/utils.js.map +1 -1
  400. package/build-module/components/colors/with-colors.js +5 -1
  401. package/build-module/components/colors/with-colors.js.map +1 -1
  402. package/build-module/components/colors-gradients/control.js +29 -18
  403. package/build-module/components/colors-gradients/control.js.map +1 -1
  404. package/build-module/components/duotone-control/index.js +1 -4
  405. package/build-module/components/duotone-control/index.js.map +1 -1
  406. package/build-module/components/font-sizes/utils.js +9 -1
  407. package/build-module/components/font-sizes/utils.js.map +1 -1
  408. package/build-module/components/global-styles/border-panel.js +3 -2
  409. package/build-module/components/global-styles/border-panel.js.map +1 -1
  410. package/build-module/components/global-styles/color-panel.js +26 -23
  411. package/build-module/components/global-styles/color-panel.js.map +1 -1
  412. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  413. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  414. package/build-module/components/global-styles/effects-panel.js +3 -2
  415. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  416. package/build-module/components/global-styles/filters-panel.js +8 -5
  417. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  418. package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
  419. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
  420. package/build-module/components/global-styles/hooks.js +3 -2
  421. package/build-module/components/global-styles/hooks.js.map +1 -1
  422. package/build-module/components/global-styles/image-settings-panel.js +7 -1
  423. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  424. package/build-module/components/global-styles/index.js +1 -0
  425. package/build-module/components/global-styles/index.js.map +1 -1
  426. package/build-module/components/global-styles/typography-panel.js +45 -38
  427. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  428. package/build-module/components/global-styles/use-global-styles-output.js +15 -1
  429. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  430. package/build-module/components/global-styles/utils.js +7 -0
  431. package/build-module/components/global-styles/utils.js.map +1 -1
  432. package/build-module/components/height-control/index.js +6 -2
  433. package/build-module/components/height-control/index.js.map +1 -1
  434. package/build-module/components/image-link-destinations/index.native.js +109 -0
  435. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  436. package/build-module/components/image-size-control/index.js +2 -2
  437. package/build-module/components/image-size-control/index.js.map +1 -1
  438. package/build-module/components/index.native.js +3 -1
  439. package/build-module/components/index.native.js.map +1 -1
  440. package/build-module/components/inner-blocks/index.js +62 -23
  441. package/build-module/components/inner-blocks/index.js.map +1 -1
  442. package/build-module/components/inner-blocks/index.native.js +18 -4
  443. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  444. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  445. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  446. package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
  447. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  448. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  449. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  450. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
  451. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  452. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
  453. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  454. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
  455. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  456. package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
  457. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  458. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
  459. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  460. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
  461. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  462. package/build-module/components/inserter/index.js +1 -2
  463. package/build-module/components/inserter/index.js.map +1 -1
  464. package/build-module/components/inserter/library.js +3 -7
  465. package/build-module/components/inserter/library.js.map +1 -1
  466. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  467. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  468. package/build-module/components/inserter/menu.js +26 -33
  469. package/build-module/components/inserter/menu.js.map +1 -1
  470. package/build-module/components/inserter/preview-panel.js +2 -2
  471. package/build-module/components/inserter/preview-panel.js.map +1 -1
  472. package/build-module/components/inserter/tabs.js +22 -22
  473. package/build-module/components/inserter/tabs.js.map +1 -1
  474. package/build-module/components/inserter-button/index.native.js +89 -0
  475. package/build-module/components/inserter-button/index.native.js.map +1 -0
  476. package/build-module/components/inserter-button/sparkles.js +15 -0
  477. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  478. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  479. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  480. package/build-module/components/inserter-list-item/index.js +2 -4
  481. package/build-module/components/inserter-list-item/index.js.map +1 -1
  482. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
  483. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  484. package/build-module/components/inspector-controls/fill.js +3 -3
  485. package/build-module/components/inspector-controls/fill.js.map +1 -1
  486. package/build-module/components/inspector-controls/fill.native.js +3 -3
  487. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  488. package/build-module/components/inspector-controls-tabs/index.js +35 -24
  489. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  490. package/build-module/components/list-view/block-select-button.js +4 -0
  491. package/build-module/components/list-view/block-select-button.js.map +1 -1
  492. package/build-module/components/list-view/block.js +58 -4
  493. package/build-module/components/list-view/block.js.map +1 -1
  494. package/build-module/components/media-upload-progress/constants.js +7 -0
  495. package/build-module/components/media-upload-progress/constants.js.map +1 -0
  496. package/build-module/components/media-upload-progress/index.native.js +37 -8
  497. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  498. package/build-module/components/navigable-toolbar/index.js +11 -16
  499. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  500. package/build-module/components/plain-text/index.native.js +6 -1
  501. package/build-module/components/plain-text/index.native.js.map +1 -1
  502. package/build-module/components/preview-options/index.js +6 -62
  503. package/build-module/components/preview-options/index.js.map +1 -1
  504. package/build-module/components/provider/index.js +3 -1
  505. package/build-module/components/provider/index.js.map +1 -1
  506. package/build-module/components/provider/use-block-sync.js +7 -1
  507. package/build-module/components/provider/use-block-sync.js.map +1 -1
  508. package/build-module/components/rich-text/content.js +25 -21
  509. package/build-module/components/rich-text/content.js.map +1 -1
  510. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  511. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  512. package/build-module/components/rich-text/index.js +21 -39
  513. package/build-module/components/rich-text/index.js.map +1 -1
  514. package/build-module/components/rich-text/index.native.js +10 -18
  515. package/build-module/components/rich-text/index.native.js.map +1 -1
  516. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  517. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  518. package/build-module/components/rich-text/native/index.native.js +22 -56
  519. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  520. package/build-module/components/rich-text/use-input-rules.js +7 -3
  521. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  522. package/build-module/components/rich-text/use-mark-persistent.js +1 -1
  523. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  524. package/build-module/components/rich-text/with-deprecations.js +42 -0
  525. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  526. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  527. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  528. package/build-module/components/url-input/index.js +9 -6
  529. package/build-module/components/url-input/index.js.map +1 -1
  530. package/build-module/components/use-block-commands/index.js +14 -18
  531. package/build-module/components/use-block-commands/index.js.map +1 -1
  532. package/build-module/components/use-block-drop-zone/index.js +107 -18
  533. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  534. package/build-module/components/use-moving-animation/index.js +102 -94
  535. package/build-module/components/use-moving-animation/index.js.map +1 -1
  536. package/build-module/components/use-on-block-drop/index.js +9 -12
  537. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  538. package/build-module/components/use-resize-canvas/index.js +4 -1
  539. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  540. package/build-module/components/use-settings/index.js +13 -1
  541. package/build-module/components/use-settings/index.js.map +1 -1
  542. package/build-module/components/writing-flow/index.js +0 -1
  543. package/build-module/components/writing-flow/index.js.map +1 -1
  544. package/build-module/components/writing-flow/use-drag-selection.js +15 -4
  545. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  546. package/build-module/components/writing-flow/use-selection-observer.js +73 -27
  547. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  548. package/build-module/components/writing-flow/use-tab-nav.js +7 -4
  549. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  550. package/build-module/hooks/align.js +20 -67
  551. package/build-module/hooks/align.js.map +1 -1
  552. package/build-module/hooks/align.native.js +1 -0
  553. package/build-module/hooks/align.native.js.map +1 -1
  554. package/build-module/hooks/anchor.js +12 -27
  555. package/build-module/hooks/anchor.js.map +1 -1
  556. package/build-module/hooks/aria-label.js +7 -1
  557. package/build-module/hooks/aria-label.js.map +1 -1
  558. package/build-module/hooks/background.js +197 -37
  559. package/build-module/hooks/background.js.map +1 -1
  560. package/build-module/hooks/block-hooks.js +22 -30
  561. package/build-module/hooks/block-hooks.js.map +1 -1
  562. package/build-module/hooks/block-renaming.js +17 -21
  563. package/build-module/hooks/block-renaming.js.map +1 -1
  564. package/build-module/hooks/border.js +52 -79
  565. package/build-module/hooks/border.js.map +1 -1
  566. package/build-module/hooks/color.js +78 -88
  567. package/build-module/hooks/color.js.map +1 -1
  568. package/build-module/hooks/content-lock-ui.js +27 -27
  569. package/build-module/hooks/content-lock-ui.js.map +1 -1
  570. package/build-module/hooks/custom-class-name.js +12 -28
  571. package/build-module/hooks/custom-class-name.js.map +1 -1
  572. package/build-module/hooks/custom-class-name.native.js +7 -1
  573. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  574. package/build-module/hooks/dimensions.js +15 -16
  575. package/build-module/hooks/dimensions.js.map +1 -1
  576. package/build-module/hooks/duotone.js +30 -61
  577. package/build-module/hooks/duotone.js.map +1 -1
  578. package/build-module/hooks/font-family.js +20 -25
  579. package/build-module/hooks/font-family.js.map +1 -1
  580. package/build-module/hooks/font-size.js +50 -120
  581. package/build-module/hooks/font-size.js.map +1 -1
  582. package/build-module/hooks/index.js +20 -16
  583. package/build-module/hooks/index.js.map +1 -1
  584. package/build-module/hooks/index.native.js +10 -6
  585. package/build-module/hooks/index.native.js.map +1 -1
  586. package/build-module/hooks/layout-child.js +60 -0
  587. package/build-module/hooks/layout-child.js.map +1 -0
  588. package/build-module/hooks/layout.js +21 -100
  589. package/build-module/hooks/layout.js.map +1 -1
  590. package/build-module/hooks/padding.js +2 -2
  591. package/build-module/hooks/padding.js.map +1 -1
  592. package/build-module/hooks/position.js +38 -59
  593. package/build-module/hooks/position.js.map +1 -1
  594. package/build-module/hooks/style.js +52 -85
  595. package/build-module/hooks/style.js.map +1 -1
  596. package/build-module/hooks/typography.js +26 -11
  597. package/build-module/hooks/typography.js.map +1 -1
  598. package/build-module/hooks/typography.native.js +43 -17
  599. package/build-module/hooks/typography.native.js.map +1 -1
  600. package/build-module/hooks/use-typography-props.js +9 -1
  601. package/build-module/hooks/use-typography-props.js.map +1 -1
  602. package/build-module/hooks/utils.js +194 -9
  603. package/build-module/hooks/utils.js.map +1 -1
  604. package/build-module/private-apis.js +2 -6
  605. package/build-module/private-apis.js.map +1 -1
  606. package/build-module/private-apis.native.js +0 -2
  607. package/build-module/private-apis.native.js.map +1 -1
  608. package/build-module/store/actions.js +0 -15
  609. package/build-module/store/actions.js.map +1 -1
  610. package/build-module/store/private-actions.js +52 -0
  611. package/build-module/store/private-actions.js.map +1 -1
  612. package/build-module/store/private-selectors.js +44 -1
  613. package/build-module/store/private-selectors.js.map +1 -1
  614. package/build-module/store/reducer.js +18 -2
  615. package/build-module/store/reducer.js.map +1 -1
  616. package/build-module/store/selectors.js +4 -65
  617. package/build-module/store/selectors.js.map +1 -1
  618. package/build-module/store/undo-ignore.js +5 -0
  619. package/build-module/store/undo-ignore.js.map +1 -0
  620. package/build-module/store/utils.js +56 -0
  621. package/build-module/store/utils.js.map +1 -0
  622. package/build-module/utils/get-px-from-css-unit.js +9 -0
  623. package/build-module/utils/get-px-from-css-unit.js.map +1 -0
  624. package/build-module/utils/index.js +1 -1
  625. package/build-module/utils/index.js.map +1 -1
  626. package/build-module/utils/object.js +37 -97
  627. package/build-module/utils/object.js.map +1 -1
  628. package/build-module/utils/selection.js +9 -1
  629. package/build-module/utils/selection.js.map +1 -1
  630. package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
  631. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  632. package/build-style/content-rtl.css +7 -6
  633. package/build-style/content.css +7 -6
  634. package/build-style/style-rtl.css +164 -301
  635. package/build-style/style.css +164 -301
  636. package/package.json +31 -31
  637. package/src/components/alignment-control/README.md +0 -5
  638. package/src/components/block-alignment-control/README.md +0 -5
  639. package/src/components/block-alignment-matrix-control/README.md +0 -10
  640. package/src/components/block-breadcrumb/README.md +0 -5
  641. package/src/components/block-canvas/index.js +29 -17
  642. package/src/components/block-canvas/style.scss +6 -0
  643. package/src/components/block-caption/README.md +2 -7
  644. package/src/components/block-card/README.md +0 -5
  645. package/src/components/block-card/index.js +6 -4
  646. package/src/components/block-card/style.scss +7 -3
  647. package/src/components/block-controls/hook.js +8 -30
  648. package/src/components/block-controls/test/index.js +3 -3
  649. package/src/components/block-draggable/draggable-chip.js +11 -1
  650. package/src/components/block-draggable/index.js +116 -4
  651. package/src/components/block-draggable/index.native.js +0 -5
  652. package/src/components/block-draggable/style.scss +35 -0
  653. package/src/components/block-draggable/test/helpers.native.js +8 -7
  654. package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  655. package/src/components/block-edit/context.js +3 -0
  656. package/src/components/block-edit/index.js +36 -10
  657. package/src/components/block-editing-mode/index.js +3 -3
  658. package/src/components/block-icon/README.md +0 -5
  659. package/src/components/block-info-slot-fill/index.js +6 -3
  660. package/src/components/block-inspector/README.md +0 -5
  661. package/src/components/block-inspector/index.js +3 -1
  662. package/src/components/block-inspector/style.scss +0 -4
  663. package/src/components/block-list/block-list-item-cell.native.js +5 -1
  664. package/src/components/block-list/block.js +309 -104
  665. package/src/components/block-list/block.native.js +69 -21
  666. package/src/components/block-list/content.scss +14 -10
  667. package/src/components/block-list/index.native.js +3 -5
  668. package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
  669. package/src/components/block-list/use-block-props/index.js +43 -86
  670. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  671. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  672. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  673. package/src/components/block-list/use-in-between-inserter.js +4 -1
  674. package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
  675. package/src/components/block-lock/toolbar.js +23 -34
  676. package/src/components/block-mover/README.md +0 -5
  677. package/src/components/block-mover/index.js +1 -1
  678. package/src/components/block-parent-selector/README.md +0 -5
  679. package/src/components/block-patterns-list/README.md +0 -5
  680. package/src/components/block-patterns-list/index.js +9 -6
  681. package/src/components/block-removal-warning-modal/index.js +7 -14
  682. package/src/components/block-rename/modal.js +7 -1
  683. package/src/components/block-settings/container.native.js +3 -5
  684. package/src/components/block-styles/index.js +1 -1
  685. package/src/components/block-styles/index.native.js +4 -2
  686. package/src/components/block-styles/style.scss +0 -11
  687. package/src/components/block-switcher/index.js +49 -59
  688. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  689. package/src/components/block-toolbar/README.md +0 -5
  690. package/src/components/block-toolbar/index.js +179 -95
  691. package/src/components/block-toolbar/style.scss +50 -66
  692. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  693. package/src/components/block-tools/block-toolbar-popover.js +84 -0
  694. package/src/components/block-tools/index.js +42 -29
  695. package/src/components/block-tools/style.scss +60 -172
  696. package/src/components/block-types-list/README.md +0 -5
  697. package/src/components/block-types-list/index.native.js +2 -1
  698. package/src/components/block-variation-picker/README.md +0 -5
  699. package/src/components/block-variation-picker/index.native.js +1 -1
  700. package/src/components/block-variation-transforms/README.md +0 -5
  701. package/src/components/block-variation-transforms/index.js +49 -3
  702. package/src/components/border-radius-control/linked-button.js +1 -1
  703. package/src/components/caption/README.md +0 -5
  704. package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
  705. package/src/components/colors/utils.js +8 -1
  706. package/src/components/colors/with-colors.js +3 -1
  707. package/src/components/colors-gradients/control.js +49 -30
  708. package/src/components/colors-gradients/style.scss +0 -7
  709. package/src/components/contrast-checker/README.md +0 -4
  710. package/src/components/copy-handler/README.md +0 -10
  711. package/src/components/duotone-control/index.js +2 -5
  712. package/src/components/duotone-control/style.scss +1 -6
  713. package/src/components/font-sizes/utils.js +7 -1
  714. package/src/components/global-styles/border-panel.js +2 -1
  715. package/src/components/global-styles/color-panel.js +36 -26
  716. package/src/components/global-styles/dimensions-panel.js +4 -3
  717. package/src/components/global-styles/effects-panel.js +2 -1
  718. package/src/components/global-styles/filters-panel.js +6 -5
  719. package/src/components/global-styles/get-global-styles-changes.js +210 -0
  720. package/src/components/global-styles/hooks.js +5 -0
  721. package/src/components/global-styles/image-settings-panel.js +6 -0
  722. package/src/components/global-styles/index.js +1 -0
  723. package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
  724. package/src/components/global-styles/typography-panel.js +60 -47
  725. package/src/components/global-styles/use-global-styles-output.js +9 -5
  726. package/src/components/global-styles/utils.js +7 -0
  727. package/src/components/height-control/README.md +2 -7
  728. package/src/components/height-control/index.js +4 -0
  729. package/src/components/image-link-destinations/index.native.js +152 -0
  730. package/src/components/image-link-destinations/style.native.scss +16 -0
  731. package/src/components/image-size-control/index.js +5 -2
  732. package/src/components/index.native.js +3 -2
  733. package/src/components/inner-blocks/README.md +13 -2
  734. package/src/components/inner-blocks/index.js +68 -29
  735. package/src/components/inner-blocks/index.native.js +19 -7
  736. package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
  737. package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
  738. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  739. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
  740. package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
  741. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
  742. package/src/components/inserter/block-patterns-tab/utils.js +11 -12
  743. package/src/components/inserter/hooks/use-block-types-state.js +9 -11
  744. package/src/components/inserter/hooks/use-patterns-state.js +2 -2
  745. package/src/components/inserter/index.js +0 -1
  746. package/src/components/inserter/library.js +2 -8
  747. package/src/components/inserter/media-tab/media-panel.js +1 -1
  748. package/src/components/inserter/menu.js +26 -36
  749. package/src/components/inserter/preview-panel.js +2 -2
  750. package/src/components/inserter/style.scss +21 -21
  751. package/src/components/inserter/tabs.js +34 -25
  752. package/src/components/inserter-button/README.md +62 -0
  753. package/src/components/inserter-button/index.native.js +116 -0
  754. package/src/components/inserter-button/sparkles.js +15 -0
  755. package/src/components/inserter-button/style.native.scss +72 -0
  756. package/src/components/inserter-draggable-blocks/index.js +18 -5
  757. package/src/components/inserter-list-item/index.js +6 -6
  758. package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
  759. package/src/components/inspector-controls/fill.js +6 -3
  760. package/src/components/inspector-controls/fill.native.js +6 -3
  761. package/src/components/inspector-controls-tabs/index.js +39 -28
  762. package/src/components/inspector-controls-tabs/style.scss +3 -2
  763. package/src/components/letter-spacing-control/README.md +0 -5
  764. package/src/components/line-height-control/README.md +0 -5
  765. package/src/components/link-control/style.scss +1 -1
  766. package/src/components/link-control/test/index.js +1 -1
  767. package/src/components/list-view/README.md +0 -5
  768. package/src/components/list-view/block-select-button.js +4 -0
  769. package/src/components/list-view/block.js +73 -2
  770. package/src/components/list-view/style.scss +6 -0
  771. package/src/components/media-upload-progress/constants.js +6 -0
  772. package/src/components/media-upload-progress/index.native.js +66 -14
  773. package/src/components/media-upload-progress/test/index.native.js +2 -2
  774. package/src/components/multi-selection-inspector/README.md +0 -5
  775. package/src/components/navigable-toolbar/README.md +2 -0
  776. package/src/components/navigable-toolbar/index.js +15 -13
  777. package/src/components/plain-text/index.native.js +6 -1
  778. package/src/components/preview-options/index.js +6 -86
  779. package/src/components/provider/index.js +1 -1
  780. package/src/components/provider/test/use-block-sync.js +20 -17
  781. package/src/components/provider/use-block-sync.js +6 -0
  782. package/src/components/rich-text/content.js +27 -20
  783. package/src/components/rich-text/get-rich-text-values.js +6 -1
  784. package/src/components/rich-text/index.js +23 -52
  785. package/src/components/rich-text/index.native.js +8 -25
  786. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  787. package/src/components/rich-text/native/index.native.js +22 -71
  788. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
  789. package/src/components/rich-text/native/test/index.native.js +72 -5
  790. package/src/components/rich-text/use-input-rules.js +8 -3
  791. package/src/components/rich-text/use-mark-persistent.js +1 -2
  792. package/src/components/rich-text/with-deprecations.js +51 -0
  793. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  794. package/src/components/text-decoration-control/README.md +40 -0
  795. package/src/components/text-transform-control/README.md +0 -4
  796. package/src/components/ungroup-button/README.md +0 -5
  797. package/src/components/unit-control/README.md +0 -4
  798. package/src/components/url-input/index.js +11 -11
  799. package/src/components/use-block-commands/index.js +18 -21
  800. package/src/components/use-block-drop-zone/index.js +181 -30
  801. package/src/components/use-moving-animation/index.js +107 -103
  802. package/src/components/use-on-block-drop/index.js +9 -24
  803. package/src/components/use-on-block-drop/test/index.js +12 -26
  804. package/src/components/use-resize-canvas/README.md +3 -7
  805. package/src/components/use-resize-canvas/index.js +4 -1
  806. package/src/components/use-settings/README.md +0 -4
  807. package/src/components/use-settings/index.js +15 -1
  808. package/src/components/writing-flow/index.js +0 -1
  809. package/src/components/writing-flow/use-drag-selection.js +18 -4
  810. package/src/components/writing-flow/use-selection-observer.js +99 -37
  811. package/src/components/writing-flow/use-tab-nav.js +7 -7
  812. package/src/hooks/align.js +16 -81
  813. package/src/hooks/align.native.js +1 -0
  814. package/src/hooks/anchor.js +14 -38
  815. package/src/hooks/aria-label.js +8 -5
  816. package/src/hooks/background.js +269 -32
  817. package/src/hooks/block-hooks.js +22 -51
  818. package/src/hooks/block-renaming.js +23 -37
  819. package/src/hooks/border.js +62 -124
  820. package/src/hooks/color.js +111 -138
  821. package/src/hooks/content-lock-ui.js +110 -122
  822. package/src/hooks/custom-class-name.js +9 -45
  823. package/src/hooks/custom-class-name.native.js +8 -5
  824. package/src/hooks/dimensions.js +14 -16
  825. package/src/hooks/duotone.js +70 -127
  826. package/src/hooks/font-family.js +14 -36
  827. package/src/hooks/font-size.js +67 -168
  828. package/src/hooks/index.js +58 -16
  829. package/src/hooks/index.native.js +22 -6
  830. package/src/hooks/layout-child.js +53 -0
  831. package/src/hooks/layout.js +17 -103
  832. package/src/hooks/padding.js +2 -2
  833. package/src/hooks/position.js +50 -90
  834. package/src/hooks/style.js +118 -193
  835. package/src/hooks/test/align.js +1 -178
  836. package/src/hooks/test/anchor.js +4 -9
  837. package/src/hooks/test/custom-class-name.js +3 -8
  838. package/src/hooks/test/style.js +4 -14
  839. package/src/hooks/typography.js +14 -16
  840. package/src/hooks/typography.native.js +31 -33
  841. package/src/hooks/use-typography-props.js +7 -1
  842. package/src/hooks/utils.js +261 -10
  843. package/src/private-apis.js +2 -6
  844. package/src/private-apis.native.js +0 -2
  845. package/src/store/actions.js +0 -15
  846. package/src/store/private-actions.js +48 -0
  847. package/src/store/private-selectors.js +56 -0
  848. package/src/store/reducer.js +20 -1
  849. package/src/store/selectors.js +10 -82
  850. package/src/store/undo-ignore.js +4 -0
  851. package/src/store/utils.js +74 -0
  852. package/src/style.scss +1 -2
  853. package/src/utils/get-px-from-css-unit.js +8 -0
  854. package/src/utils/index.js +1 -1
  855. package/src/utils/object.js +34 -104
  856. package/src/utils/selection.js +9 -2
  857. package/src/utils/test/object.js +1 -96
  858. package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
  859. package/build/components/block-list/block-list-block-context.js +0 -14
  860. package/build/components/block-list/block-list-block-context.js.map +0 -1
  861. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  862. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  863. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  864. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  865. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  866. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  867. package/build/components/block-tools/back-compat.js +0 -45
  868. package/build/components/block-tools/back-compat.js.map +0 -1
  869. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  870. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  871. package/build/components/block-tools/selected-block-tools.js +0 -113
  872. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  873. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  874. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  875. package/build/components/use-display-block-controls/index.js +0 -39
  876. package/build/components/use-display-block-controls/index.js.map +0 -1
  877. package/build/components/use-display-block-controls/index.native.js +0 -39
  878. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  879. package/build/hooks/custom-fields.js +0 -120
  880. package/build/hooks/custom-fields.js.map +0 -1
  881. package/build/utils/parse-css-unit-to-px.js +0 -302
  882. package/build/utils/parse-css-unit-to-px.js.map +0 -1
  883. package/build/utils/use-should-contextual-toolbar-show.js +0 -63
  884. package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
  885. package/build-module/components/block-list/block-list-block-context.js +0 -6
  886. package/build-module/components/block-list/block-list-block-context.js.map +0 -1
  887. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  888. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  889. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  890. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  891. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  892. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  893. package/build-module/components/block-tools/back-compat.js +0 -35
  894. package/build-module/components/block-tools/back-compat.js.map +0 -1
  895. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  896. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  897. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  898. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  899. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  900. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  901. package/build-module/components/use-display-block-controls/index.js +0 -32
  902. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  903. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  904. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  905. package/build-module/hooks/custom-fields.js +0 -118
  906. package/build-module/hooks/custom-fields.js.map +0 -1
  907. package/build-module/utils/parse-css-unit-to-px.js +0 -294
  908. package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
  909. package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
  910. package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
  911. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  912. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  913. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  914. package/src/components/block-parent-selector/style.scss +0 -11
  915. package/src/components/block-tools/back-compat.js +0 -35
  916. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  917. package/src/components/block-tools/selected-block-tools.js +0 -127
  918. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  919. package/src/components/preview-options/README.md +0 -94
  920. package/src/components/preview-options/style.scss +0 -64
  921. package/src/components/use-display-block-controls/index.js +0 -36
  922. package/src/components/use-display-block-controls/index.native.js +0 -37
  923. package/src/hooks/custom-fields.js +0 -142
  924. package/src/hooks/test/color.js +0 -112
  925. package/src/utils/parse-css-unit-to-px.js +0 -329
  926. package/src/utils/test/parse-css-unit-to-px.js +0 -172
  927. package/src/utils/use-should-contextual-toolbar-show.js +0 -85
@@ -9,10 +9,8 @@ import classnames from 'classnames';
9
9
  */
10
10
  import { useRef, useCallback, forwardRef, createContext } from '@wordpress/element';
11
11
  import { useDispatch, useSelect } from '@wordpress/data';
12
- import { children as childrenSource } from '@wordpress/blocks';
13
- import { useInstanceId, useMergeRefs } from '@wordpress/compose';
14
- import { __unstableUseRichText as useRichText, __unstableCreateElement, removeFormat } from '@wordpress/rich-text';
15
- import deprecated from '@wordpress/deprecated';
12
+ import { useMergeRefs } from '@wordpress/compose';
13
+ import { __unstableUseRichText as useRichText, removeFormat } from '@wordpress/rich-text';
16
14
  import { Popover } from '@wordpress/components';
17
15
 
18
16
  /**
@@ -38,7 +36,7 @@ import { useFirefoxCompat } from './use-firefox-compat';
38
36
  import FormatEdit from './format-edit';
39
37
  import { getAllowedFormats } from './utils';
40
38
  import { Content } from './content';
41
- import RichTextMultiline from './multiline';
39
+ import { withDeprecations } from './with-deprecations';
42
40
  export const keyboardShortcutContext = createContext();
43
41
  export const inputEventContext = createContext();
44
42
 
@@ -103,9 +101,17 @@ export function RichTextWrapper({
103
101
  props = removeNativeProps(props);
104
102
  const anchorRef = useRef();
105
103
  const {
106
- clientId
104
+ clientId,
105
+ isSelected: isBlockSelected
107
106
  } = useBlockEditContext();
108
107
  const selector = select => {
108
+ // Avoid subscribing to the block editor store if the block is not
109
+ // selected.
110
+ if (!isBlockSelected) {
111
+ return {
112
+ isSelected: false
113
+ };
114
+ }
109
115
  const {
110
116
  getSelectionStart,
111
117
  getSelectionEnd
@@ -124,14 +130,11 @@ export function RichTextWrapper({
124
130
  isSelected
125
131
  };
126
132
  };
127
- // This selector must run on every render so the right selection state is
128
- // retrieved from the store on merge.
129
- // To do: fix this somehow.
130
133
  const {
131
134
  selectionStart,
132
135
  selectionEnd,
133
136
  isSelected
134
- } = useSelect(selector);
137
+ } = useSelect(selector, [clientId, identifier, originalIsSelected, isBlockSelected]);
135
138
  const {
136
139
  getSelectionStart,
137
140
  getSelectionEnd,
@@ -273,7 +276,11 @@ export function RichTextWrapper({
273
276
  "aria-label": placeholder,
274
277
  ...props,
275
278
  ...autocompleteProps,
276
- ref: useMergeRefs([forwardedRef, autocompleteProps.ref, props.ref, richTextRef, useBeforeInputRules({
279
+ ref: useMergeRefs([
280
+ // Rich text ref must be first because its focus listener
281
+ // must be set up before any other ref calls .focus() on
282
+ // mount.
283
+ richTextRef, forwardedRef, autocompleteProps.ref, props.ref, useBeforeInputRules({
277
284
  value,
278
285
  onChange
279
286
  }), useInputRules({
@@ -318,36 +325,11 @@ export function RichTextWrapper({
318
325
  // tabIndex because Safari will focus the element. However,
319
326
  // Safari will correctly ignore nested contentEditable elements.
320
327
  ,
321
- tabIndex: props.tabIndex === 0 ? null : props.tabIndex
328
+ tabIndex: props.tabIndex === 0 ? null : props.tabIndex,
329
+ "data-wp-block-attribute-key": identifier
322
330
  }));
323
331
  }
324
- const ForwardedRichTextWrapper = forwardRef(RichTextWrapper);
325
- function RichTextSwitcher(props, ref) {
326
- let value = props.value;
327
- let onChange = props.onChange;
328
-
329
- // Handle deprecated format.
330
- if (Array.isArray(value)) {
331
- deprecated('wp.blockEditor.RichText value prop as children type', {
332
- since: '6.1',
333
- version: '6.3',
334
- alternative: 'value prop as string',
335
- link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
336
- });
337
- value = childrenSource.toHTML(props.value);
338
- onChange = newValue => props.onChange(childrenSource.fromDOM(__unstableCreateElement(document, newValue).childNodes));
339
- }
340
- const Component = props.multiline ? RichTextMultiline : ForwardedRichTextWrapper;
341
- const instanceId = useInstanceId(RichTextSwitcher);
342
- return createElement(Component, {
343
- ...props,
344
- identifier: props.identifier || instanceId,
345
- value: value,
346
- onChange: onChange,
347
- ref: ref
348
- });
349
- }
350
- const ForwardedRichTextContainer = forwardRef(RichTextSwitcher);
332
+ const ForwardedRichTextContainer = withDeprecations(forwardRef(RichTextWrapper));
351
333
  ForwardedRichTextContainer.Content = Content;
352
334
  ForwardedRichTextContainer.isEmpty = value => {
353
335
  return !value || value.length === 0;
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useRef","useCallback","forwardRef","createContext","useDispatch","useSelect","children","childrenSource","useInstanceId","useMergeRefs","__unstableUseRichText","useRichText","__unstableCreateElement","removeFormat","deprecated","Popover","useBlockEditorAutocompleteProps","useBlockEditContext","FormatToolbarContainer","store","blockEditorStore","useUndoAutomaticChange","useMarkPersistent","usePasteHandler","useBeforeInputRules","useInputRules","useDelete","useEnter","useFormatTypes","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useInsertReplacementText","useFirefoxCompat","FormatEdit","getAllowedFormats","Content","RichTextMultiline","keyboardShortcutContext","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","clientId","selector","select","getSelectionStart","getSelectionEnd","selectionStart","selectionEnd","undefined","attributeKey","offset","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","length","onSelectionChange","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","name","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","createElement","Fragment","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","contentEditable","suppressContentEditableWarning","className","tabIndex","ForwardedRichTextWrapper","RichTextSwitcher","Array","isArray","since","version","alternative","link","toHTML","newValue","fromDOM","document","childNodes","Component","instanceId","ForwardedRichTextContainer","isEmpty","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\t__unstableCreateElement,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport RichTextMultiline from './multiline';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ true }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={ props.tabIndex === 0 ? null : props.tabIndex }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextWrapper = forwardRef( RichTextWrapper );\n\nfunction RichTextSwitcher( props, ref ) {\n\tlet value = props.value;\n\tlet onChange = props.onChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\n\t\tvalue = childrenSource.toHTML( props.value );\n\t\tonChange = ( newValue ) =>\n\t\t\tprops.onChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst Component = props.multiline\n\t\t? RichTextMultiline\n\t\t: ForwardedRichTextWrapper;\n\tconst instanceId = useInstanceId( RichTextSwitcher );\n\n\treturn (\n\t\t<Component\n\t\t\t{ ...props }\n\t\t\tidentifier={ props.identifier || instanceId }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nconst ForwardedRichTextContainer = forwardRef( RichTextSwitcher );\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,IAAIC,cAAc,QAAQ,mBAAmB;AAC9D,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SACCC,qBAAqB,IAAIC,WAAW,EACpCC,uBAAuB,EACvBC,YAAY,QACN,sBAAsB;AAC7B,OAAOC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EAAE;IACP,CAAE,CAAC;IAEH/G,KAAK,GAAGtD,cAAc,CAACsK,MAAM,CAAEpI,KAAK,CAACoB,KAAM,CAAC;IAC5CE,QAAQ,GAAK+G,QAAQ,IACpBrI,KAAK,CAACsB,QAAQ,CACbxD,cAAc,CAACwK,OAAO,CACrBnK,uBAAuB,CAAEoK,QAAQ,EAAEF,QAAS,CAAC,CAACG,UAC/C,CACD,CAAC;EACH;EAEA,MAAMC,SAAS,GAAGzI,KAAK,CAAC0B,SAAS,GAC9B9B,iBAAiB,GACjBgI,wBAAwB;EAC3B,MAAMc,UAAU,GAAG3K,aAAa,CAAE8J,gBAAiB,CAAC;EAEpD,OACCZ,aAAA,CAACwB,SAAS;IAAA,GACJzI,KAAK;IACVyC,UAAU,EAAGzC,KAAK,CAACyC,UAAU,IAAIiG,UAAY;IAC7CtH,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBoE,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;AAEA,MAAMiD,0BAA0B,GAAGlL,UAAU,CAAEoK,gBAAiB,CAAC;AAEjEc,0BAA0B,CAAChJ,OAAO,GAAGA,OAAO;AAC5CgJ,0BAA0B,CAACC,OAAO,GAAKxH,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC8C,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA,eAAeyE,0BAA0B;AACzC,SAASE,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
1
+ {"version":3,"names":["classnames","useRef","useCallback","forwardRef","createContext","useDispatch","useSelect","useMergeRefs","__unstableUseRichText","useRichText","removeFormat","Popover","useBlockEditorAutocompleteProps","useBlockEditContext","FormatToolbarContainer","store","blockEditorStore","useUndoAutomaticChange","useMarkPersistent","usePasteHandler","useBeforeInputRules","useInputRules","useDelete","useEnter","useFormatTypes","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useInsertReplacementText","useFirefoxCompat","FormatEdit","getAllowedFormats","Content","withDeprecations","keyboardShortcutContext","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","clientId","isBlockSelected","selector","select","getSelectionStart","getSelectionEnd","selectionStart","selectionEnd","undefined","attributeKey","offset","getBlockRootClientId","selectionChange","adjustedAllowedFormats","hasFormats","length","onSelectionChange","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","name","addInvisibleFormats","getValue","ref","richTextRef","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","completers","record","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","createElement","Fragment","Provider","__unstableSlotNameProvider","inline","editableContentElement","role","contentEditable","suppressContentEditableWarning","className","tabIndex","ForwardedRichTextContainer","isEmpty","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport { withDeprecations } from './with-deprecations';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst { clientId, isSelected: isBlockSelected } = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector, [\n\t\tclientId,\n\t\tidentifier,\n\t\toriginalIsSelected,\n\t\tisBlockSelected,\n\t] );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ true }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={ props.tabIndex === 0 ? null : props.tabIndex }\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextContainer = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,YAAY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B,CAACC,OAAO,GAAK1G,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC+C,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA,eAAe0D,0BAA0B;AACzC,SAASE,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
@@ -23,12 +23,13 @@ import { RemoveBrowserShortcuts } from './remove-browser-shortcuts';
23
23
  import { filePasteHandler } from './file-paste-handler';
24
24
  import FormatToolbarContainer from './format-toolbar-container';
25
25
  import { store as blockEditorStore } from '../../store';
26
- import { addActiveFormats, getMultilineTag, getAllowedFormats, createLinkInParagraph } from './utils';
26
+ import { addActiveFormats, getAllowedFormats, createLinkInParagraph } from './utils';
27
27
  import EmbedHandlerPicker from './embed-handler-picker';
28
28
  import { Content } from './content';
29
29
  import RichText from './native';
30
+ import { withDeprecations } from './with-deprecations';
30
31
  const classes = 'block-editor-rich-text__editable';
31
- function RichTextWrapper({
32
+ export function RichTextWrapper({
32
33
  children,
33
34
  tagName,
34
35
  start,
@@ -36,7 +37,6 @@ function RichTextWrapper({
36
37
  value: originalValue,
37
38
  onChange: originalOnChange,
38
39
  isSelected: originalIsSelected,
39
- multiline,
40
40
  inlineToolbar,
41
41
  wrapperClassName,
42
42
  autocompleters,
@@ -58,7 +58,6 @@ function RichTextWrapper({
58
58
  disableLineBreaks,
59
59
  unstableOnFocus,
60
60
  __unstableAllowPrefixTransformations,
61
- __unstableMultilineRootTag,
62
61
  // Native props.
63
62
  __unstableMobileNoFocusOnMount,
64
63
  deleteEnter,
@@ -150,7 +149,6 @@ function RichTextWrapper({
150
149
  selectionChange,
151
150
  __unstableMarkAutomaticChange
152
151
  } = useDispatch(blockEditorStore);
153
- const multilineTag = getMultilineTag(multiline);
154
152
  const adjustedAllowedFormats = getAllowedFormats({
155
153
  allowedFormats,
156
154
  disableFormats
@@ -214,8 +212,7 @@ function RichTextWrapper({
214
212
  // with e.g. the enter key.
215
213
  if (!hasPastedBlocks || !isEmpty(before)) {
216
214
  blocks.push(onSplit(toHTMLString({
217
- value: before,
218
- multilineTag
215
+ value: before
219
216
  }), !isAfterOriginal));
220
217
  lastPastedBlockIndex += 1;
221
218
  }
@@ -232,8 +229,7 @@ function RichTextWrapper({
232
229
  // empty, the middle block is enough to set focus in.
233
230
  if (hasPastedBlocks ? !isEmpty(after) : !onSplitMiddle || !isEmpty(after)) {
234
231
  blocks.push(onSplit(toHTMLString({
235
- value: after,
236
- multilineTag
232
+ value: after
237
233
  }), isAfterOriginal));
238
234
  }
239
235
 
@@ -245,7 +241,7 @@ function RichTextWrapper({
245
241
  // Otherwise, retain the default value.
246
242
  const initialPosition = hasPastedBlocks ? -1 : 0;
247
243
  onReplace(blocks, indexToSelect, initialPosition);
248
- }, [onReplace, onSplit, multilineTag, onSplitMiddle]);
244
+ }, [onReplace, onSplit, onSplitMiddle]);
249
245
  const onEnter = useCallback(({
250
246
  value,
251
247
  onChange,
@@ -296,7 +292,7 @@ function RichTextWrapper({
296
292
  }
297
293
  },
298
294
  // eslint-disable-next-line react-hooks/exhaustive-deps
299
- [onReplace, onSplit, __unstableMarkAutomaticChange, multiline, splitValue, onSplitAtEnd]);
295
+ [onReplace, onSplit, __unstableMarkAutomaticChange, splitValue, onSplitAtEnd]);
300
296
  const onPaste = useCallback(({
301
297
  value,
302
298
  onChange,
@@ -312,8 +308,6 @@ function RichTextWrapper({
312
308
  if (isInternal) {
313
309
  const pastedValue = create({
314
310
  html,
315
- multilineTag,
316
- multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
317
311
  preserveWhiteSpace
318
312
  });
319
313
  addActiveFormats(pastedValue, activeFormats);
@@ -394,7 +388,7 @@ function RichTextWrapper({
394
388
  splitValue(value, content);
395
389
  }
396
390
  }
397
- }, [tagName, onReplace, onSplit, splitValue, __unstableEmbedURLOnPaste, multilineTag, preserveWhiteSpace, pastePlainText]);
391
+ }, [tagName, onReplace, onSplit, splitValue, __unstableEmbedURLOnPaste, preserveWhiteSpace, pastePlainText]);
398
392
  const inputRule = useCallback((value, valueToFormat) => {
399
393
  if (!onReplace) {
400
394
  return;
@@ -447,7 +441,6 @@ function RichTextWrapper({
447
441
  onPaste: onPaste,
448
442
  __unstableIsSelected: isSelected,
449
443
  __unstableInputRule: inputRule,
450
- __unstableMultilineTag: multilineTag,
451
444
  __unstableOnEnterFormattedText: enterFormattedText,
452
445
  __unstableOnExitFormattedText: exitFormattedText,
453
446
  __unstableOnCreateUndoLevel: __unstableMarkLastChangeAsPersistent,
@@ -458,8 +451,7 @@ function RichTextWrapper({
458
451
  preserveWhiteSpace: preserveWhiteSpace,
459
452
  disabled: disabled,
460
453
  unstableOnFocus: unstableOnFocus,
461
- __unstableAllowPrefixTransformations: __unstableAllowPrefixTransformations,
462
- __unstableMultilineRootTag: __unstableMultilineRootTag
454
+ __unstableAllowPrefixTransformations: __unstableAllowPrefixTransformations
463
455
  // Native props.
464
456
  ,
465
457
  blockIsSelected: originalIsSelected !== undefined ? originalIsSelected : blockIsSelected,
@@ -532,7 +524,7 @@ function RichTextWrapper({
532
524
  ref: embedHandlerPickerRef
533
525
  })));
534
526
  }
535
- const ForwardedRichTextContainer = forwardRef(RichTextWrapper);
527
+ const ForwardedRichTextContainer = withDeprecations(forwardRef(RichTextWrapper));
536
528
  ForwardedRichTextContainer.Content = Content;
537
529
  ForwardedRichTextContainer.isEmpty = value => {
538
530
  return !value || value.length === 0;
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Platform","useRef","useCallback","forwardRef","useDispatch","useSelect","pasteHandler","children","childrenSource","getBlockTransforms","findTransform","isUnmodifiedDefaultBlock","useInstanceId","useMergeRefs","__unstableCreateElement","isEmpty","insert","remove","create","split","toHTMLString","slice","isURL","Autocomplete","useBlockEditContext","RemoveBrowserShortcuts","filePasteHandler","FormatToolbarContainer","store","blockEditorStore","addActiveFormats","getMultilineTag","getAllowedFormats","createLinkInParagraph","EmbedHandlerPicker","Content","RichText","classes","RichTextWrapper","tagName","start","reversed","value","originalValue","onChange","originalOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitMiddle","onSplitMiddle","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","unstableOnFocus","__unstableAllowPrefixTransformations","__unstableMultilineRootTag","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","onBlur","setRef","disableSuggestions","disableAutocorrection","containerWidth","onEnter","onCustomEnter","props","forwardedRef","instanceId","fallbackRef","clientId","blockIsSelected","embedHandlerPickerRef","selector","select","getSelectionStart","getSelectionEnd","getSettings","didAutomaticChange","getBlock","isMultiSelecting","hasMultiSelection","selectionStart","selectionEnd","__experimentalUndo","undo","undefined","attributeKey","extraProps","OS","block","shouldBlurOnUnmount","offset","disabled","__unstableMarkLastChangeAsPersistent","enterFormattedText","exitFormattedText","selectionChange","__unstableMarkAutomaticChange","multilineTag","adjustedAllowedFormats","hasFormats","length","adjustedValue","adjustedOnChange","Array","isArray","toHTML","newValue","fromDOM","document","childNodes","onSelectionChange","selectionChangeStart","selectionChangeEnd","onDelete","isReverse","splitValue","record","pastedBlocks","blocks","before","after","hasPastedBlocks","lastPastedBlockIndex","isAfterOriginal","push","indexToSelect","initialPosition","shiftKey","canSplit","transforms","filter","type","transformation","item","regExp","test","text","transform","content","splitStart","end","splitEnd","canSplitAtEnd","onPaste","html","plainText","isInternal","files","activeFormats","pastedValue","multilineWrapperTags","HTML","mode","window","console","log","isPastedURL","trim","presentEmbedHandlerPicker","current","presentPicker","createEmbed","createLink","valueToInsert","canPasteEmbed","name","inputRule","valueToFormat","startPosition","characterBefore","trimmedTextBefore","prefixTransforms","prefix","mergedRef","createElement","ref","__unstableIsSelected","__unstableInputRule","__unstableMultilineTag","__unstableOnEnterFormattedText","__unstableOnExitFormattedText","__unstableOnCreateUndoLevel","__unstableDidAutomaticChange","__unstableUndo","id","style","nestedIsSelected","onFocus","editableProps","editableTagName","TagName","Fragment","inline","anchorRef","completers","contentRef","listBoxId","activeId","onKeyDown","className","event","ForwardedRichTextContainer","defaultProps","format","Raw","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useRef, useCallback, forwardRef } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tpasteHandler,\n\tchildren as childrenSource,\n\tgetBlockTransforms,\n\tfindTransform,\n\tisUnmodifiedDefaultBlock,\n} from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableCreateElement,\n\tisEmpty,\n\tinsert,\n\tremove,\n\tcreate,\n\tsplit,\n\ttoHTMLString,\n\tslice,\n} from '@wordpress/rich-text';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Autocomplete from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { RemoveBrowserShortcuts } from './remove-browser-shortcuts';\nimport { filePasteHandler } from './file-paste-handler';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\taddActiveFormats,\n\tgetMultilineTag,\n\tgetAllowedFormats,\n\tcreateLinkInParagraph,\n} from './utils';\nimport EmbedHandlerPicker from './embed-handler-picker';\nimport { Content } from './content';\nimport RichText from './native';\n\nconst classes = 'block-editor-rich-text__editable';\n\nfunction RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName,\n\t\tstart,\n\t\treversed,\n\t\tvalue: originalValue,\n\t\tonChange: originalOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitMiddle: onSplitMiddle,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\tunstableOnFocus,\n\t\t__unstableAllowPrefixTransformations,\n\t\t__unstableMultilineRootTag,\n\t\t// Native props.\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tonBlur,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\tcontainerWidth,\n\t\tonEnter: onCustomEnter,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\n\tidentifier = identifier || instanceId;\n\n\tconst fallbackRef = useRef();\n\tconst { clientId, isSelected: blockIsSelected } = useBlockEditContext();\n\tconst embedHandlerPickerRef = useRef();\n\tconst selector = ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSettings,\n\t\t\tdidAutomaticChange,\n\t\t\tgetBlock,\n\t\t\tisMultiSelecting,\n\t\t\thasMultiSelection,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst { __experimentalUndo: undo } = getSettings();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\tlet extraProps = {};\n\t\tif ( Platform.OS === 'native' ) {\n\t\t\t// If the block of this RichText is unmodified then it's a candidate for replacing when adding a new block.\n\t\t\t// In order to fix https://github.com/wordpress-mobile/gutenberg-mobile/issues/1126, let's blur on unmount in that case.\n\t\t\t// This apparently assumes functionality the BlockHlder actually.\n\t\t\tconst block = clientId && getBlock( clientId );\n\t\t\tconst shouldBlurOnUnmount =\n\t\t\t\tblock && isSelected && isUnmodifiedDefaultBlock( block );\n\t\t\textraProps = {\n\t\t\t\tshouldBlurOnUnmount,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tdidAutomaticChange: didAutomaticChange(),\n\t\t\tdisabled: isMultiSelecting() || hasMultiSelection(),\n\t\t\tundo,\n\t\t\t...extraProps,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst {\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tisSelected,\n\t\tdidAutomaticChange,\n\t\tdisabled,\n\t\tundo,\n\t\tshouldBlurOnUnmount,\n\t} = useSelect( selector );\n\tconst {\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tenterFormattedText,\n\t\texitFormattedText,\n\t\tselectionChange,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\tconst multilineTag = getMultilineTag( multiline );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\tlet adjustedValue = originalValue;\n\tlet adjustedOnChange = originalOnChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( originalValue ) ) {\n\t\tadjustedValue = childrenSource.toHTML( originalValue );\n\t\tadjustedOnChange = ( newValue ) =>\n\t\t\toriginalOnChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst onSelectionChange = useCallback(\n\t\t( selectionChangeStart, selectionChangeEnd ) => {\n\t\t\tselectionChange(\n\t\t\t\tclientId,\n\t\t\t\tidentifier,\n\t\t\t\tselectionChangeStart,\n\t\t\t\tselectionChangeEnd\n\t\t\t);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst onDelete = useCallback(\n\t\t( { value, isReverse } ) => {\n\t\t\tif ( onMerge ) {\n\t\t\t\tonMerge( ! isReverse );\n\t\t\t}\n\n\t\t\t// Only handle remove on Backspace. This serves dual-purpose of being\n\t\t\t// an intentional user interaction distinguishing between Backspace and\n\t\t\t// Delete to remove the empty field, but also to avoid merge & remove\n\t\t\t// causing destruction of two fields (merge, then removed merged).\n\t\t\telse if ( onRemove && isEmpty( value ) && isReverse ) {\n\t\t\t\tonRemove( ! isReverse );\n\t\t\t}\n\t\t},\n\t\t[ onMerge, onRemove ]\n\t);\n\n\t/**\n\t * Signals to the RichText owner that the block can be replaced with two\n\t * blocks as a result of splitting the block by pressing enter, or with\n\t * blocks as a result of splitting the block by pasting block content in the\n\t * instance.\n\t *\n\t * @param {Object} record The rich text value to split.\n\t * @param {Array} pastedBlocks The pasted blocks to insert, if any.\n\t */\n\tconst splitValue = useCallback(\n\t\t( record, pastedBlocks = [] ) => {\n\t\t\tif ( ! onReplace || ! onSplit ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blocks = [];\n\t\t\tconst [ before, after ] = split( record );\n\t\t\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\t\t\tlet lastPastedBlockIndex = -1;\n\n\t\t\t// Consider the after value to be the original it is not empty and\n\t\t\t// the before value *is* empty.\n\t\t\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t\t\t// Create a block with the content before the caret if there's no pasted\n\t\t\t// blocks, or if there are pasted blocks and the value is not empty.\n\t\t\t// We do not want a leading empty block on paste, but we do if split\n\t\t\t// with e.g. the enter key.\n\t\t\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: before,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\t! isAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tlastPastedBlockIndex += 1;\n\t\t\t}\n\n\t\t\tif ( hasPastedBlocks ) {\n\t\t\t\tblocks.push( ...pastedBlocks );\n\t\t\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t\t\t} else if ( onSplitMiddle ) {\n\t\t\t\tblocks.push( onSplitMiddle() );\n\t\t\t}\n\n\t\t\t// If there's pasted blocks, append a block with non empty content\n\t\t\t// after the caret. Otherwise, do append an empty block if there\n\t\t\t// is no `onSplitMiddle` prop, but if there is and the content is\n\t\t\t// empty, the middle block is enough to set focus in.\n\t\t\tif (\n\t\t\t\thasPastedBlocks\n\t\t\t\t\t? ! isEmpty( after )\n\t\t\t\t\t: ! onSplitMiddle || ! isEmpty( after )\n\t\t\t) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( {\n\t\t\t\t\t\t\tvalue: after,\n\t\t\t\t\t\t\tmultilineTag,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t\tisAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If there are pasted blocks, set the selection to the last one.\n\t\t\t// Otherwise, set the selection to the second block.\n\t\t\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t\t\t// If there are pasted blocks, move the caret to the end of the selected block\n\t\t\t// Otherwise, retain the default value.\n\t\t\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\t\t\tonReplace( blocks, indexToSelect, initialPosition );\n\t\t},\n\t\t[ onReplace, onSplit, multilineTag, onSplitMiddle ]\n\t);\n\n\tconst onEnter = useCallback(\n\t\t( { value, onChange, shiftKey } ) => {\n\t\t\tconst canSplit = onReplace && onSplit;\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t);\n\t\t\t\tconst transformation = findTransform( transforms, ( item ) => {\n\t\t\t\t\treturn item.regExp.test( value.text );\n\t\t\t\t} );\n\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\tonReplace( [\n\t\t\t\t\t\ttransformation.transform( { content: value.text } ),\n\t\t\t\t\t] );\n\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( onCustomEnter ) {\n\t\t\t\tonCustomEnter();\n\t\t\t}\n\n\t\t\tconst { text, start: splitStart, end: splitEnd } = value;\n\t\t\tconst canSplitAtEnd =\n\t\t\t\tonSplitAtEnd &&\n\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\tsplitEnd === text.length;\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t}\n\t\t\t} else if ( canSplit ) {\n\t\t\t\tsplitValue( value );\n\t\t\t} else if ( canSplitAtEnd ) {\n\t\t\t\tonSplitAtEnd();\n\t\t\t} else if (\n\t\t\t\t// For some blocks it's desirable to split at the end of the\n\t\t\t\t// block when there are two line breaks at the end of the\n\t\t\t\t// block, so triple Enter exits the block.\n\t\t\t\tonSplitAtDoubleLineEnd &&\n\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\tsplitEnd === text.length &&\n\t\t\t\ttext.slice( -2 ) === '\\n\\n'\n\t\t\t) {\n\t\t\t\tvalue.start = value.end - 2;\n\t\t\t\tonChange( remove( value ) );\n\t\t\t\tonSplitAtDoubleLineEnd();\n\t\t\t} else if ( ! disableLineBreaks ) {\n\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\t__unstableMarkAutomaticChange,\n\t\t\tmultiline,\n\t\t\tsplitValue,\n\t\t\tonSplitAtEnd,\n\t\t]\n\t);\n\n\tconst onPaste = useCallback(\n\t\t( {\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\thtml,\n\t\t\tplainText,\n\t\t\tisInternal,\n\t\t\tfiles,\n\t\t\tactiveFormats,\n\t\t} ) => {\n\t\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t\t// without filtering the data. The filters are only meant for externally\n\t\t\t// pasted content and remove inline styles.\n\t\t\tif ( isInternal ) {\n\t\t\t\tconst pastedValue = create( {\n\t\t\t\t\thtml,\n\t\t\t\t\tmultilineTag,\n\t\t\t\t\tmultilineWrapperTags:\n\t\t\t\t\t\tmultilineTag === 'li' ? [ 'ul', 'ol' ] : undefined,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\t\t\t\taddActiveFormats( pastedValue, activeFormats );\n\t\t\t\tonChange( insert( value, pastedValue ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( pastePlainText ) {\n\t\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only process file if no HTML is present.\n\t\t\t// Note: a pasted file may have the URL as plain text.\n\t\t\tif ( files && files.length && ! html ) {\n\t\t\t\tconst content = pasteHandler( {\n\t\t\t\t\tHTML: filePasteHandler( files ),\n\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\ttagName,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\twindow.console.log( 'Received items:\\n\\n', files );\n\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tonReplace( content );\n\t\t\t\t} else {\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet mode = onReplace && onSplit ? 'AUTO' : 'INLINE';\n\n\t\t\tconst isPastedURL = isURL( plainText.trim() );\n\t\t\tconst presentEmbedHandlerPicker = () =>\n\t\t\t\tembedHandlerPickerRef.current?.presentPicker( {\n\t\t\t\t\tcreateEmbed: () =>\n\t\t\t\t\t\tonReplace( content, content.length - 1, -1 ),\n\t\t\t\t\tcreateLink: () =>\n\t\t\t\t\t\tcreateLinkInParagraph( plainText.trim(), onReplace ),\n\t\t\t\t} );\n\n\t\t\tif (\n\t\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisPastedURL\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst content = pasteHandler( {\n\t\t\t\tHTML: html,\n\t\t\t\tplainText,\n\t\t\t\tmode,\n\t\t\t\ttagName,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\n\t\t\tif ( typeof content === 'string' ) {\n\t\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\t\taddActiveFormats( valueToInsert, activeFormats );\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t} else if ( content.length > 0 ) {\n\t\t\t\t// When an URL is pasted in an empty paragraph then the EmbedHandlerPicker should showcase options allowing the transformation of that URL\n\t\t\t\t// into either an Embed block or a link within the target paragraph. If the paragraph is non-empty, the URL is pasted as text.\n\t\t\t\tconst canPasteEmbed =\n\t\t\t\t\tisPastedURL &&\n\t\t\t\t\tcontent.length === 1 &&\n\t\t\t\t\tcontent[ 0 ].name === 'core/embed';\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( __unstableEmbedURLOnPaste ) {\n\t\t\t\t\t\t\tpresentEmbedHandlerPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonReplace( content, content.length - 1, -1 );\n\t\t\t\t} else {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\tsplitValue,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tmultilineTag,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t]\n\t);\n\n\tconst inputRule = useCallback(\n\t\t( value, valueToFormat ) => {\n\t\t\tif ( ! onReplace ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { start: startPosition, text } = value;\n\t\t\tconst characterBefore = text.slice(\n\t\t\t\tstartPosition - 1,\n\t\t\t\tstartPosition\n\t\t\t);\n\n\t\t\t// The character right before the caret must be a plain space.\n\t\t\tif ( characterBefore !== ' ' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst trimmedTextBefore = text.slice( 0, startPosition ).trim();\n\t\t\tconst prefixTransforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t( { type } ) => type === 'prefix'\n\t\t\t);\n\t\t\tconst transformation = findTransform(\n\t\t\t\tprefixTransforms,\n\t\t\t\t( { prefix } ) => {\n\t\t\t\t\treturn trimmedTextBefore === prefix;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( ! transformation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst content = valueToFormat(\n\t\t\t\tslice( value, startPosition, text.length )\n\t\t\t);\n\t\t\tconst block = transformation.transform( content );\n\n\t\t\tonReplace( [ block ] );\n\t\t\t__unstableMarkAutomaticChange();\n\t\t},\n\t\t[ onReplace, __unstableMarkAutomaticChange ]\n\t);\n\n\tconst mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );\n\n\treturn (\n\t\t<RichText\n\t\t\tclientId={ clientId }\n\t\t\tidentifier={ identifier }\n\t\t\tref={ mergedRef }\n\t\t\tvalue={ adjustedValue }\n\t\t\tonChange={ adjustedOnChange }\n\t\t\tselectionStart={ selectionStart }\n\t\t\tselectionEnd={ selectionEnd }\n\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\ttagName={ tagName }\n\t\t\tstart={ start }\n\t\t\treversed={ reversed }\n\t\t\tplaceholder={ placeholder }\n\t\t\tallowedFormats={ adjustedAllowedFormats }\n\t\t\twithoutInteractiveFormatting={ withoutInteractiveFormatting }\n\t\t\tonEnter={ onEnter }\n\t\t\tonDelete={ onDelete }\n\t\t\tonPaste={ onPaste }\n\t\t\t__unstableIsSelected={ isSelected }\n\t\t\t__unstableInputRule={ inputRule }\n\t\t\t__unstableMultilineTag={ multilineTag }\n\t\t\t__unstableOnEnterFormattedText={ enterFormattedText }\n\t\t\t__unstableOnExitFormattedText={ exitFormattedText }\n\t\t\t__unstableOnCreateUndoLevel={ __unstableMarkLastChangeAsPersistent }\n\t\t\t__unstableMarkAutomaticChange={ __unstableMarkAutomaticChange }\n\t\t\t__unstableDidAutomaticChange={ didAutomaticChange }\n\t\t\t__unstableUndo={ undo }\n\t\t\t__unstableDisableFormats={ disableFormats }\n\t\t\tpreserveWhiteSpace={ preserveWhiteSpace }\n\t\t\tdisabled={ disabled }\n\t\t\tunstableOnFocus={ unstableOnFocus }\n\t\t\t__unstableAllowPrefixTransformations={\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t}\n\t\t\t__unstableMultilineRootTag={ __unstableMultilineRootTag }\n\t\t\t// Native props.\n\t\t\tblockIsSelected={\n\t\t\t\toriginalIsSelected !== undefined\n\t\t\t\t\t? originalIsSelected\n\t\t\t\t\t: blockIsSelected\n\t\t\t}\n\t\t\tshouldBlurOnUnmount={ shouldBlurOnUnmount }\n\t\t\t__unstableMobileNoFocusOnMount={ __unstableMobileNoFocusOnMount }\n\t\t\tdeleteEnter={ deleteEnter }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\ttextAlign={ textAlign }\n\t\t\tselectionColor={ selectionColor }\n\t\t\ttagsToEliminate={ tagsToEliminate }\n\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\tfontSize={ fontSize }\n\t\t\tfontFamily={ fontFamily }\n\t\t\tfontWeight={ fontWeight }\n\t\t\tfontStyle={ fontStyle }\n\t\t\tminWidth={ minWidth }\n\t\t\tmaxWidth={ maxWidth }\n\t\t\tonBlur={ onBlur }\n\t\t\tsetRef={ setRef }\n\t\t\tdisableSuggestions={ disableSuggestions }\n\t\t\tdisableAutocorrection={ disableAutocorrection }\n\t\t\tcontainerWidth={ containerWidth }\n\t\t\t// Props to be set on the editable container are destructured on the\n\t\t\t// element itself for web (see below), but passed through rich text\n\t\t\t// for native.\n\t\t\tid={ props.id }\n\t\t\tstyle={ props.style }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tisSelected: nestedIsSelected,\n\t\t\t\tvalue,\n\t\t\t\tonChange,\n\t\t\t\tonFocus,\n\t\t\t\teditableProps,\n\t\t\t\teditableTagName: TagName,\n\t\t\t} ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ children && children( { value, onChange, onFocus } ) }\n\t\t\t\t\t{ nestedIsSelected && hasFormats && (\n\t\t\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\t\t\tanchorRef={ fallbackRef.current }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ nestedIsSelected && <RemoveBrowserShortcuts /> }\n\t\t\t\t\t<Autocomplete\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\tcompleters={ autocompleters }\n\t\t\t\t\t\trecord={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisSelected={ nestedIsSelected }\n\t\t\t\t\t\tcontentRef={ fallbackRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { listBoxId, activeId, onKeyDown } ) => (\n\t\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t\t{ ...editableProps }\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tprops.style\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t...props.style,\n\t\t\t\t\t\t\t\t\t\t\t\t...editableProps.style,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: editableProps.style\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\teditableProps.className\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taria-autocomplete={\n\t\t\t\t\t\t\t\t\tlistBoxId ? 'list' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-owns={ listBoxId }\n\t\t\t\t\t\t\t\taria-activedescendant={ activeId }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tonKeyDown( event );\n\t\t\t\t\t\t\t\t\teditableProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Autocomplete>\n\t\t\t\t\t<EmbedHandlerPicker ref={ embedHandlerPickerRef } />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</RichText>\n\t);\n}\n\nconst ForwardedRichTextContainer = forwardRef( RichTextWrapper );\n\nForwardedRichTextContainer.Content = Content;\n\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nForwardedRichTextContainer.Content.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n};\n\nForwardedRichTextContainer.Raw = RichText;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,UAAU,QAAQ,oBAAoB;AAC9E,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,YAAY,EACZC,QAAQ,IAAIC,cAAc,EAC1BC,kBAAkB,EAClBC,aAAa,EACbC,wBAAwB,QAClB,mBAAmB;AAC1B,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SACCC,uBAAuB,EACvBC,OAAO,EACPC,MAAM,EACNC,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AGhH,SACrB;IACD,aAAYgH,SAAW;IACvB,yBAAwBC,QAAU;IAClCC,SAAS,EAAKE,KAAK,IAAM;MACxBF,SAAS,CAAEE,KAAM,CAAC;MAClBZ,aAAa,CAACU,SAAS,CAAEE,KAAM,CAAC;IACjC;EAAG,CACH,CAEW,CAAC,EACf1B,aAAA,CAAC5K,kBAAkB;IAAC6K,GAAG,EAAGzG;EAAuB,CAAE,CAClD,CAEM,CAAC;AAEb;AAEA,MAAMmI,0BAA0B,GAAGtO,UAAU,CAAEmC,eAAgB,CAAC;AAEhEmM,0BAA0B,CAACtM,OAAO,GAAGA,OAAO;AAE5CsM,0BAA0B,CAAC1N,OAAO,GAAK2B,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC0F,MAAM,KAAK,CAAC;AACrC,CAAC;AAEDqG,0BAA0B,CAACtM,OAAO,CAACuM,YAAY,GAAG;EACjDC,MAAM,EAAE,QAAQ;EAChBjM,KAAK,EAAE;AACR,CAAC;AAED+L,0BAA0B,CAACG,GAAG,GAAGxM,QAAQ;;AAEzC;AACA;AACA;AACA,eAAeqM,0BAA0B;AACzC,SAASI,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
1
+ {"version":3,"names":["classnames","Platform","useRef","useCallback","forwardRef","useDispatch","useSelect","pasteHandler","children","childrenSource","getBlockTransforms","findTransform","isUnmodifiedDefaultBlock","useInstanceId","useMergeRefs","__unstableCreateElement","isEmpty","insert","remove","create","split","toHTMLString","slice","isURL","Autocomplete","useBlockEditContext","RemoveBrowserShortcuts","filePasteHandler","FormatToolbarContainer","store","blockEditorStore","addActiveFormats","getAllowedFormats","createLinkInParagraph","EmbedHandlerPicker","Content","RichText","withDeprecations","classes","RichTextWrapper","tagName","start","reversed","value","originalValue","onChange","originalOnChange","isSelected","originalIsSelected","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitMiddle","onSplitMiddle","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","unstableOnFocus","__unstableAllowPrefixTransformations","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","onBlur","setRef","disableSuggestions","disableAutocorrection","containerWidth","onEnter","onCustomEnter","props","forwardedRef","instanceId","fallbackRef","clientId","blockIsSelected","embedHandlerPickerRef","selector","select","getSelectionStart","getSelectionEnd","getSettings","didAutomaticChange","getBlock","isMultiSelecting","hasMultiSelection","selectionStart","selectionEnd","__experimentalUndo","undo","undefined","attributeKey","extraProps","OS","block","shouldBlurOnUnmount","offset","disabled","__unstableMarkLastChangeAsPersistent","enterFormattedText","exitFormattedText","selectionChange","__unstableMarkAutomaticChange","adjustedAllowedFormats","hasFormats","length","adjustedValue","adjustedOnChange","Array","isArray","toHTML","newValue","fromDOM","document","childNodes","onSelectionChange","selectionChangeStart","selectionChangeEnd","onDelete","isReverse","splitValue","record","pastedBlocks","blocks","before","after","hasPastedBlocks","lastPastedBlockIndex","isAfterOriginal","push","indexToSelect","initialPosition","shiftKey","canSplit","transforms","filter","type","transformation","item","regExp","test","text","transform","content","splitStart","end","splitEnd","canSplitAtEnd","onPaste","html","plainText","isInternal","files","activeFormats","pastedValue","HTML","mode","window","console","log","isPastedURL","trim","presentEmbedHandlerPicker","current","presentPicker","createEmbed","createLink","valueToInsert","canPasteEmbed","name","inputRule","valueToFormat","startPosition","characterBefore","trimmedTextBefore","prefixTransforms","prefix","mergedRef","createElement","ref","__unstableIsSelected","__unstableInputRule","__unstableOnEnterFormattedText","__unstableOnExitFormattedText","__unstableOnCreateUndoLevel","__unstableDidAutomaticChange","__unstableUndo","id","style","nestedIsSelected","onFocus","editableProps","editableTagName","TagName","Fragment","inline","anchorRef","completers","contentRef","listBoxId","activeId","onKeyDown","className","event","ForwardedRichTextContainer","defaultProps","format","Raw","RichTextShortcut","RichTextToolbarButton","__unstableRichTextInputEvent"],"sources":["@wordpress/block-editor/src/components/rich-text/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Platform, useRef, useCallback, forwardRef } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tpasteHandler,\n\tchildren as childrenSource,\n\tgetBlockTransforms,\n\tfindTransform,\n\tisUnmodifiedDefaultBlock,\n} from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableCreateElement,\n\tisEmpty,\n\tinsert,\n\tremove,\n\tcreate,\n\tsplit,\n\ttoHTMLString,\n\tslice,\n} from '@wordpress/rich-text';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Autocomplete from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { RemoveBrowserShortcuts } from './remove-browser-shortcuts';\nimport { filePasteHandler } from './file-paste-handler';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\taddActiveFormats,\n\tgetAllowedFormats,\n\tcreateLinkInParagraph,\n} from './utils';\nimport EmbedHandlerPicker from './embed-handler-picker';\nimport { Content } from './content';\nimport RichText from './native';\nimport { withDeprecations } from './with-deprecations';\n\nconst classes = 'block-editor-rich-text__editable';\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName,\n\t\tstart,\n\t\treversed,\n\t\tvalue: originalValue,\n\t\tonChange: originalOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitMiddle: onSplitMiddle,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\tunstableOnFocus,\n\t\t__unstableAllowPrefixTransformations,\n\t\t// Native props.\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tonBlur,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\tcontainerWidth,\n\t\tonEnter: onCustomEnter,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\n\tidentifier = identifier || instanceId;\n\n\tconst fallbackRef = useRef();\n\tconst { clientId, isSelected: blockIsSelected } = useBlockEditContext();\n\tconst embedHandlerPickerRef = useRef();\n\tconst selector = ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSettings,\n\t\t\tdidAutomaticChange,\n\t\t\tgetBlock,\n\t\t\tisMultiSelecting,\n\t\t\thasMultiSelection,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\tconst { __experimentalUndo: undo } = getSettings();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\tlet extraProps = {};\n\t\tif ( Platform.OS === 'native' ) {\n\t\t\t// If the block of this RichText is unmodified then it's a candidate for replacing when adding a new block.\n\t\t\t// In order to fix https://github.com/wordpress-mobile/gutenberg-mobile/issues/1126, let's blur on unmount in that case.\n\t\t\t// This apparently assumes functionality the BlockHlder actually.\n\t\t\tconst block = clientId && getBlock( clientId );\n\t\t\tconst shouldBlurOnUnmount =\n\t\t\t\tblock && isSelected && isUnmodifiedDefaultBlock( block );\n\t\t\textraProps = {\n\t\t\t\tshouldBlurOnUnmount,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t\tdidAutomaticChange: didAutomaticChange(),\n\t\t\tdisabled: isMultiSelecting() || hasMultiSelection(),\n\t\t\tundo,\n\t\t\t...extraProps,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst {\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tisSelected,\n\t\tdidAutomaticChange,\n\t\tdisabled,\n\t\tundo,\n\t\tshouldBlurOnUnmount,\n\t} = useSelect( selector );\n\tconst {\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tenterFormattedText,\n\t\texitFormattedText,\n\t\tselectionChange,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\tlet adjustedValue = originalValue;\n\tlet adjustedOnChange = originalOnChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( originalValue ) ) {\n\t\tadjustedValue = childrenSource.toHTML( originalValue );\n\t\tadjustedOnChange = ( newValue ) =>\n\t\t\toriginalOnChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst onSelectionChange = useCallback(\n\t\t( selectionChangeStart, selectionChangeEnd ) => {\n\t\t\tselectionChange(\n\t\t\t\tclientId,\n\t\t\t\tidentifier,\n\t\t\t\tselectionChangeStart,\n\t\t\t\tselectionChangeEnd\n\t\t\t);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst onDelete = useCallback(\n\t\t( { value, isReverse } ) => {\n\t\t\tif ( onMerge ) {\n\t\t\t\tonMerge( ! isReverse );\n\t\t\t}\n\n\t\t\t// Only handle remove on Backspace. This serves dual-purpose of being\n\t\t\t// an intentional user interaction distinguishing between Backspace and\n\t\t\t// Delete to remove the empty field, but also to avoid merge & remove\n\t\t\t// causing destruction of two fields (merge, then removed merged).\n\t\t\telse if ( onRemove && isEmpty( value ) && isReverse ) {\n\t\t\t\tonRemove( ! isReverse );\n\t\t\t}\n\t\t},\n\t\t[ onMerge, onRemove ]\n\t);\n\n\t/**\n\t * Signals to the RichText owner that the block can be replaced with two\n\t * blocks as a result of splitting the block by pressing enter, or with\n\t * blocks as a result of splitting the block by pasting block content in the\n\t * instance.\n\t *\n\t * @param {Object} record The rich text value to split.\n\t * @param {Array} pastedBlocks The pasted blocks to insert, if any.\n\t */\n\tconst splitValue = useCallback(\n\t\t( record, pastedBlocks = [] ) => {\n\t\t\tif ( ! onReplace || ! onSplit ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst blocks = [];\n\t\t\tconst [ before, after ] = split( record );\n\t\t\tconst hasPastedBlocks = pastedBlocks.length > 0;\n\t\t\tlet lastPastedBlockIndex = -1;\n\n\t\t\t// Consider the after value to be the original it is not empty and\n\t\t\t// the before value *is* empty.\n\t\t\tconst isAfterOriginal = isEmpty( before ) && ! isEmpty( after );\n\n\t\t\t// Create a block with the content before the caret if there's no pasted\n\t\t\t// blocks, or if there are pasted blocks and the value is not empty.\n\t\t\t// We do not want a leading empty block on paste, but we do if split\n\t\t\t// with e.g. the enter key.\n\t\t\tif ( ! hasPastedBlocks || ! isEmpty( before ) ) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit(\n\t\t\t\t\t\ttoHTMLString( { value: before } ),\n\t\t\t\t\t\t! isAfterOriginal\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tlastPastedBlockIndex += 1;\n\t\t\t}\n\n\t\t\tif ( hasPastedBlocks ) {\n\t\t\t\tblocks.push( ...pastedBlocks );\n\t\t\t\tlastPastedBlockIndex += pastedBlocks.length;\n\t\t\t} else if ( onSplitMiddle ) {\n\t\t\t\tblocks.push( onSplitMiddle() );\n\t\t\t}\n\n\t\t\t// If there's pasted blocks, append a block with non empty content\n\t\t\t// after the caret. Otherwise, do append an empty block if there\n\t\t\t// is no `onSplitMiddle` prop, but if there is and the content is\n\t\t\t// empty, the middle block is enough to set focus in.\n\t\t\tif (\n\t\t\t\thasPastedBlocks\n\t\t\t\t\t? ! isEmpty( after )\n\t\t\t\t\t: ! onSplitMiddle || ! isEmpty( after )\n\t\t\t) {\n\t\t\t\tblocks.push(\n\t\t\t\t\tonSplit( toHTMLString( { value: after } ), isAfterOriginal )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If there are pasted blocks, set the selection to the last one.\n\t\t\t// Otherwise, set the selection to the second block.\n\t\t\tconst indexToSelect = hasPastedBlocks ? lastPastedBlockIndex : 1;\n\n\t\t\t// If there are pasted blocks, move the caret to the end of the selected block\n\t\t\t// Otherwise, retain the default value.\n\t\t\tconst initialPosition = hasPastedBlocks ? -1 : 0;\n\n\t\t\tonReplace( blocks, indexToSelect, initialPosition );\n\t\t},\n\t\t[ onReplace, onSplit, onSplitMiddle ]\n\t);\n\n\tconst onEnter = useCallback(\n\t\t( { value, onChange, shiftKey } ) => {\n\t\t\tconst canSplit = onReplace && onSplit;\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t);\n\t\t\t\tconst transformation = findTransform( transforms, ( item ) => {\n\t\t\t\t\treturn item.regExp.test( value.text );\n\t\t\t\t} );\n\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\tonReplace( [\n\t\t\t\t\t\ttransformation.transform( { content: value.text } ),\n\t\t\t\t\t] );\n\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( onCustomEnter ) {\n\t\t\t\tonCustomEnter();\n\t\t\t}\n\n\t\t\tconst { text, start: splitStart, end: splitEnd } = value;\n\t\t\tconst canSplitAtEnd =\n\t\t\t\tonSplitAtEnd &&\n\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\tsplitEnd === text.length;\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif ( ! disableLineBreaks ) {\n\t\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t\t}\n\t\t\t} else if ( canSplit ) {\n\t\t\t\tsplitValue( value );\n\t\t\t} else if ( canSplitAtEnd ) {\n\t\t\t\tonSplitAtEnd();\n\t\t\t} else if (\n\t\t\t\t// For some blocks it's desirable to split at the end of the\n\t\t\t\t// block when there are two line breaks at the end of the\n\t\t\t\t// block, so triple Enter exits the block.\n\t\t\t\tonSplitAtDoubleLineEnd &&\n\t\t\t\tsplitStart === splitEnd &&\n\t\t\t\tsplitEnd === text.length &&\n\t\t\t\ttext.slice( -2 ) === '\\n\\n'\n\t\t\t) {\n\t\t\t\tvalue.start = value.end - 2;\n\t\t\t\tonChange( remove( value ) );\n\t\t\t\tonSplitAtDoubleLineEnd();\n\t\t\t} else if ( ! disableLineBreaks ) {\n\t\t\t\tonChange( insert( value, '\\n' ) );\n\t\t\t}\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\t__unstableMarkAutomaticChange,\n\t\t\tsplitValue,\n\t\t\tonSplitAtEnd,\n\t\t]\n\t);\n\n\tconst onPaste = useCallback(\n\t\t( {\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\thtml,\n\t\t\tplainText,\n\t\t\tisInternal,\n\t\t\tfiles,\n\t\t\tactiveFormats,\n\t\t} ) => {\n\t\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t\t// without filtering the data. The filters are only meant for externally\n\t\t\t// pasted content and remove inline styles.\n\t\t\tif ( isInternal ) {\n\t\t\t\tconst pastedValue = create( {\n\t\t\t\t\thtml,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\t\t\t\taddActiveFormats( pastedValue, activeFormats );\n\t\t\t\tonChange( insert( value, pastedValue ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( pastePlainText ) {\n\t\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only process file if no HTML is present.\n\t\t\t// Note: a pasted file may have the URL as plain text.\n\t\t\tif ( files && files.length && ! html ) {\n\t\t\t\tconst content = pasteHandler( {\n\t\t\t\t\tHTML: filePasteHandler( files ),\n\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\ttagName,\n\t\t\t\t\tpreserveWhiteSpace,\n\t\t\t\t} );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\twindow.console.log( 'Received items:\\n\\n', files );\n\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tonReplace( content );\n\t\t\t\t} else {\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet mode = onReplace && onSplit ? 'AUTO' : 'INLINE';\n\n\t\t\tconst isPastedURL = isURL( plainText.trim() );\n\t\t\tconst presentEmbedHandlerPicker = () =>\n\t\t\t\tembedHandlerPickerRef.current?.presentPicker( {\n\t\t\t\t\tcreateEmbed: () =>\n\t\t\t\t\t\tonReplace( content, content.length - 1, -1 ),\n\t\t\t\t\tcreateLink: () =>\n\t\t\t\t\t\tcreateLinkInParagraph( plainText.trim(), onReplace ),\n\t\t\t\t} );\n\n\t\t\tif (\n\t\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\t\tisEmpty( value ) &&\n\t\t\t\tisPastedURL\n\t\t\t) {\n\t\t\t\tmode = 'BLOCKS';\n\t\t\t}\n\n\t\t\tconst content = pasteHandler( {\n\t\t\t\tHTML: html,\n\t\t\t\tplainText,\n\t\t\t\tmode,\n\t\t\t\ttagName,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\n\t\t\tif ( typeof content === 'string' ) {\n\t\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\t\taddActiveFormats( valueToInsert, activeFormats );\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t} else if ( content.length > 0 ) {\n\t\t\t\t// When an URL is pasted in an empty paragraph then the EmbedHandlerPicker should showcase options allowing the transformation of that URL\n\t\t\t\t// into either an Embed block or a link within the target paragraph. If the paragraph is non-empty, the URL is pasted as text.\n\t\t\t\tconst canPasteEmbed =\n\t\t\t\t\tisPastedURL &&\n\t\t\t\t\tcontent.length === 1 &&\n\t\t\t\t\tcontent[ 0 ].name === 'core/embed';\n\t\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( __unstableEmbedURLOnPaste ) {\n\t\t\t\t\t\t\tpresentEmbedHandlerPicker();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonReplace( content, content.length - 1, -1 );\n\t\t\t\t} else {\n\t\t\t\t\tif ( canPasteEmbed ) {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tinsert( value, create( { text: plainText } ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsplitValue( value, content );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\tonSplit,\n\t\t\tsplitValue,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t]\n\t);\n\n\tconst inputRule = useCallback(\n\t\t( value, valueToFormat ) => {\n\t\t\tif ( ! onReplace ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { start: startPosition, text } = value;\n\t\t\tconst characterBefore = text.slice(\n\t\t\t\tstartPosition - 1,\n\t\t\t\tstartPosition\n\t\t\t);\n\n\t\t\t// The character right before the caret must be a plain space.\n\t\t\tif ( characterBefore !== ' ' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst trimmedTextBefore = text.slice( 0, startPosition ).trim();\n\t\t\tconst prefixTransforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t( { type } ) => type === 'prefix'\n\t\t\t);\n\t\t\tconst transformation = findTransform(\n\t\t\t\tprefixTransforms,\n\t\t\t\t( { prefix } ) => {\n\t\t\t\t\treturn trimmedTextBefore === prefix;\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( ! transformation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst content = valueToFormat(\n\t\t\t\tslice( value, startPosition, text.length )\n\t\t\t);\n\t\t\tconst block = transformation.transform( content );\n\n\t\t\tonReplace( [ block ] );\n\t\t\t__unstableMarkAutomaticChange();\n\t\t},\n\t\t[ onReplace, __unstableMarkAutomaticChange ]\n\t);\n\n\tconst mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] );\n\n\treturn (\n\t\t<RichText\n\t\t\tclientId={ clientId }\n\t\t\tidentifier={ identifier }\n\t\t\tref={ mergedRef }\n\t\t\tvalue={ adjustedValue }\n\t\t\tonChange={ adjustedOnChange }\n\t\t\tselectionStart={ selectionStart }\n\t\t\tselectionEnd={ selectionEnd }\n\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\ttagName={ tagName }\n\t\t\tstart={ start }\n\t\t\treversed={ reversed }\n\t\t\tplaceholder={ placeholder }\n\t\t\tallowedFormats={ adjustedAllowedFormats }\n\t\t\twithoutInteractiveFormatting={ withoutInteractiveFormatting }\n\t\t\tonEnter={ onEnter }\n\t\t\tonDelete={ onDelete }\n\t\t\tonPaste={ onPaste }\n\t\t\t__unstableIsSelected={ isSelected }\n\t\t\t__unstableInputRule={ inputRule }\n\t\t\t__unstableOnEnterFormattedText={ enterFormattedText }\n\t\t\t__unstableOnExitFormattedText={ exitFormattedText }\n\t\t\t__unstableOnCreateUndoLevel={ __unstableMarkLastChangeAsPersistent }\n\t\t\t__unstableMarkAutomaticChange={ __unstableMarkAutomaticChange }\n\t\t\t__unstableDidAutomaticChange={ didAutomaticChange }\n\t\t\t__unstableUndo={ undo }\n\t\t\t__unstableDisableFormats={ disableFormats }\n\t\t\tpreserveWhiteSpace={ preserveWhiteSpace }\n\t\t\tdisabled={ disabled }\n\t\t\tunstableOnFocus={ unstableOnFocus }\n\t\t\t__unstableAllowPrefixTransformations={\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t}\n\t\t\t// Native props.\n\t\t\tblockIsSelected={\n\t\t\t\toriginalIsSelected !== undefined\n\t\t\t\t\t? originalIsSelected\n\t\t\t\t\t: blockIsSelected\n\t\t\t}\n\t\t\tshouldBlurOnUnmount={ shouldBlurOnUnmount }\n\t\t\t__unstableMobileNoFocusOnMount={ __unstableMobileNoFocusOnMount }\n\t\t\tdeleteEnter={ deleteEnter }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\ttextAlign={ textAlign }\n\t\t\tselectionColor={ selectionColor }\n\t\t\ttagsToEliminate={ tagsToEliminate }\n\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\tfontSize={ fontSize }\n\t\t\tfontFamily={ fontFamily }\n\t\t\tfontWeight={ fontWeight }\n\t\t\tfontStyle={ fontStyle }\n\t\t\tminWidth={ minWidth }\n\t\t\tmaxWidth={ maxWidth }\n\t\t\tonBlur={ onBlur }\n\t\t\tsetRef={ setRef }\n\t\t\tdisableSuggestions={ disableSuggestions }\n\t\t\tdisableAutocorrection={ disableAutocorrection }\n\t\t\tcontainerWidth={ containerWidth }\n\t\t\t// Props to be set on the editable container are destructured on the\n\t\t\t// element itself for web (see below), but passed through rich text\n\t\t\t// for native.\n\t\t\tid={ props.id }\n\t\t\tstyle={ props.style }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tisSelected: nestedIsSelected,\n\t\t\t\tvalue,\n\t\t\t\tonChange,\n\t\t\t\tonFocus,\n\t\t\t\teditableProps,\n\t\t\t\teditableTagName: TagName,\n\t\t\t} ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ children && children( { value, onChange, onFocus } ) }\n\t\t\t\t\t{ nestedIsSelected && hasFormats && (\n\t\t\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\t\t\tanchorRef={ fallbackRef.current }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ nestedIsSelected && <RemoveBrowserShortcuts /> }\n\t\t\t\t\t<Autocomplete\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\tcompleters={ autocompleters }\n\t\t\t\t\t\trecord={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisSelected={ nestedIsSelected }\n\t\t\t\t\t\tcontentRef={ fallbackRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { listBoxId, activeId, onKeyDown } ) => (\n\t\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t\t{ ...editableProps }\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tprops.style\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t...props.style,\n\t\t\t\t\t\t\t\t\t\t\t\t...editableProps.style,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: editableProps.style\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\teditableProps.className\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taria-autocomplete={\n\t\t\t\t\t\t\t\t\tlistBoxId ? 'list' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-owns={ listBoxId }\n\t\t\t\t\t\t\t\taria-activedescendant={ activeId }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tonKeyDown( event );\n\t\t\t\t\t\t\t\t\teditableProps.onKeyDown( event );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Autocomplete>\n\t\t\t\t\t<EmbedHandlerPicker ref={ embedHandlerPickerRef } />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</RichText>\n\t);\n}\n\nconst ForwardedRichTextContainer = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nForwardedRichTextContainer.Content = Content;\n\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nForwardedRichTextContainer.Content.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n};\n\nForwardedRichTextContainer.Raw = RichText;\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,UAAU,QAAQ,oBAAoB;AAC9E,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,YAAY,EACZC,QAAQ,IAAIC,cAAc,EAC1BC,kBAAkB,EAClBC,aAAa,EACbC,wBAAwB,QAClB,mBAAmB;AAC1B,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,SACCC,uBAAuB,EACvBC,OAAO,EACPC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,KAAK,EACLC,YAAY,EACZC,KAAK,QACC,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,gBAAgB;;AAEtC;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,OAAOC,sBAAsB,MAAM,4BAA4B;AAC/D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SACCC,gBAAgB,EAChBC,iBAAiB,EACjBC,qBAAqB,QACf,SAAS;AAChB,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SAASC,OAAO,QAAQ,WAAW;AACnC,OAAOC,QAAQ,MAAM,UAAU;AAC/B,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,MAAMC,OAAO,GAAG,kCAAkC;AAElD,OAAO,SAASC,eAAeA,CAC9B;EACC/B,QAAQ;EACRgC,OAAO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AO;IAAA,GACFF,aAAa;IAAA,GACbzH,KAAK;IACVsH,KAAK,EACJtH,KAAK,CAACsH,KAAK,GACR;MACA,GAAGtH,KAAK,CAACsH,KAAK;MACd,GAAGG,aAAa,CAACH;IACjB,CAAC,GACDG,aAAa,CAACH,KACjB;IACDc,SAAS,EAAGnO,UAAU,CACrBsC,OAAO,EACPyD,KAAK,CAACoI,SAAS,EACfX,aAAa,CAACW,SACf,CAAG;IACH,qBACCH,SAAS,GAAG,MAAM,GAAG7G,SACrB;IACD,aAAY6G,SAAW;IACvB,yBAAwBC,QAAU;IAClCC,SAAS,EAAKE,KAAK,IAAM;MACxBF,SAAS,CAAEE,KAAM,CAAC;MAClBZ,aAAa,CAACU,SAAS,CAAEE,KAAM,CAAC;IACjC;EAAG,CACH,CAEW,CAAC,EACfzB,aAAA,CAACzK,kBAAkB;IAAC0K,GAAG,EAAGvG;EAAuB,CAAE,CAClD,CAEM,CAAC;AAEb;AAEA,MAAMgI,0BAA0B,GAAGhM,gBAAgB,CAClDjC,UAAU,CAAEmC,eAAgB,CAC7B,CAAC;AAED8L,0BAA0B,CAAClM,OAAO,GAAGA,OAAO;AAE5CkM,0BAA0B,CAACrN,OAAO,GAAK2B,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAACuF,MAAM,KAAK,CAAC;AACrC,CAAC;AAEDmG,0BAA0B,CAAClM,OAAO,CAACmM,YAAY,GAAG;EACjDC,MAAM,EAAE,QAAQ;EAChB5L,KAAK,EAAE;AACR,CAAC;AAED0L,0BAA0B,CAACG,GAAG,GAAGpM,QAAQ;;AAEzC;AACA;AACA;AACA,eAAeiM,0BAA0B;AACzC,SAASI,gBAAgB,QAAQ,YAAY;AAC7C,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,4BAA4B,QAAQ,eAAe"}
@@ -4,31 +4,29 @@
4
4
  import { getColorObjectByAttributeValues } from '../../../components/colors';
5
5
  const FORMAT_TYPE = 'core/text-color';
6
6
  const REGEX_TO_MATCH = /^has-(.*)-color$/;
7
- const TAGS_TO_SEARCH = /\<mark/;
8
- export function getFormatColors(value, formats, colors) {
9
- if (value?.search(TAGS_TO_SEARCH) !== -1) {
10
- const newFormats = formats.slice();
11
- newFormats.forEach(format => {
12
- format.forEach(currentFormat => {
13
- if (currentFormat?.type === FORMAT_TYPE) {
14
- const className = currentFormat?.attributes?.class;
15
- currentFormat.attributes.style = currentFormat.attributes.style.replace(/ /g, '');
16
- className?.split(' ').forEach(currentClass => {
17
- const match = currentClass.match(REGEX_TO_MATCH);
18
- if (match) {
19
- const [, colorSlug] = currentClass.match(REGEX_TO_MATCH);
20
- const colorObject = getColorObjectByAttributeValues(colors, colorSlug);
21
- const currentStyles = currentFormat?.attributes?.style;
22
- if (colorObject && (!currentStyles || currentStyles?.indexOf(colorObject.color) === -1)) {
23
- currentFormat.attributes.style = [`color: ${colorObject.color}`, currentStyles].join(';');
24
- }
7
+ export function getFormatColors(formats, colors) {
8
+ const newFormats = formats.slice();
9
+
10
+ // We are looping through a sparse array where empty indices will be
11
+ // skipped.
12
+ newFormats.forEach(format => {
13
+ format.forEach(currentFormat => {
14
+ if (currentFormat?.type === FORMAT_TYPE) {
15
+ const className = currentFormat?.attributes?.class;
16
+ className?.split(' ').forEach(currentClass => {
17
+ const match = currentClass.match(REGEX_TO_MATCH);
18
+ if (match) {
19
+ const [, colorSlug] = currentClass.match(REGEX_TO_MATCH);
20
+ const colorObject = getColorObjectByAttributeValues(colors, colorSlug);
21
+ const currentStyles = currentFormat?.attributes?.style;
22
+ if (colorObject && (!currentStyles || currentStyles?.indexOf(colorObject.color) === -1)) {
23
+ currentFormat.attributes.style = [`color: ${colorObject.color}`, currentStyles].join(';');
25
24
  }
26
- });
27
- }
28
- });
25
+ }
26
+ });
27
+ }
29
28
  });
30
- return newFormats;
31
- }
32
- return formats;
29
+ });
30
+ return newFormats;
33
31
  }
34
32
  //# sourceMappingURL=get-format-colors.native.js.map