@wordpress/block-editor 12.24.0 → 12.25.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 (510) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/components/alignment-control/ui.js +3 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-inspector/index.js +1 -1
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-list/block.js +0 -9
  8. package/build/components/block-list/block.js.map +1 -1
  9. package/build/components/block-list/index.js +4 -3
  10. package/build/components/block-list/index.js.map +1 -1
  11. package/build/components/block-list/index.native.js +1 -9
  12. package/build/components/block-list/index.native.js.map +1 -1
  13. package/build/components/block-list/use-block-props/index.js +6 -6
  14. package/build/components/block-list/use-block-props/index.js.map +1 -1
  15. package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
  16. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  17. package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
  18. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  19. package/build/components/block-mover/index.native.js +3 -1
  20. package/build/components/block-mover/index.native.js.map +1 -1
  21. package/build/components/block-settings-menu/block-settings-dropdown.js +0 -25
  22. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  23. package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
  24. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  25. package/build/components/block-switcher/use-transformed-patterns.js +6 -2
  26. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  27. package/build/components/block-switcher/utils.js +15 -5
  28. package/build/components/block-switcher/utils.js.map +1 -1
  29. package/build/components/block-toolbar/use-has-block-toolbar.js +14 -9
  30. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  31. package/build/components/block-tools/index.js +3 -1
  32. package/build/components/block-tools/index.js.map +1 -1
  33. package/build/components/block-tools/use-show-block-tools.js +2 -5
  34. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  35. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -1
  36. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  37. package/build/components/block-variation-picker/index.js +3 -2
  38. package/build/components/block-variation-picker/index.js.map +1 -1
  39. package/build/components/block-variation-transforms/index.js +3 -1
  40. package/build/components/block-variation-transforms/index.js.map +1 -1
  41. package/build/components/floating-toolbar/index.native.js +9 -5
  42. package/build/components/floating-toolbar/index.native.js.map +1 -1
  43. package/build/components/global-styles/background-panel.js +1 -1
  44. package/build/components/global-styles/background-panel.js.map +1 -1
  45. package/build/components/global-styles/color-panel.js +3 -1
  46. package/build/components/global-styles/color-panel.js.map +1 -1
  47. package/build/components/global-styles/dimensions-panel.js +16 -0
  48. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +3 -2
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +23 -23
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/use-global-styles-output.js +149 -132
  54. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build/components/global-styles/utils.js +45 -0
  56. package/build/components/global-styles/utils.js.map +1 -1
  57. package/build/components/inner-blocks/index.js +16 -2
  58. package/build/components/inner-blocks/index.js.map +1 -1
  59. package/build/components/inserter/block-patterns-tab/index.js +12 -31
  60. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  61. package/build/components/inserter/block-types-tab.js +4 -0
  62. package/build/components/inserter/block-types-tab.js.map +1 -1
  63. package/build/components/inserter/category-tabs/index.js +56 -0
  64. package/build/components/inserter/category-tabs/index.js.map +1 -0
  65. package/build/components/inserter/media-tab/index.js +2 -2
  66. package/build/components/inserter/media-tab/index.js.map +1 -1
  67. package/build/components/inserter/media-tab/media-panel.js +0 -25
  68. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  69. package/build/components/inserter/media-tab/media-preview.js +13 -3
  70. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  71. package/build/components/inserter/media-tab/media-tab.js +15 -29
  72. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  73. package/build/components/inserter/menu.js +59 -69
  74. package/build/components/inserter/menu.js.map +1 -1
  75. package/build/components/inserter/tabs.js +6 -6
  76. package/build/components/inserter/tabs.js.map +1 -1
  77. package/build/components/line-height-control/index.js +6 -2
  78. package/build/components/line-height-control/index.js.map +1 -1
  79. package/build/components/link-control/search-item.js +9 -3
  80. package/build/components/link-control/search-item.js.map +1 -1
  81. package/build/components/list-view/block-select-button.js +5 -170
  82. package/build/components/list-view/block-select-button.js.map +1 -1
  83. package/build/components/list-view/block.js +166 -14
  84. package/build/components/list-view/block.js.map +1 -1
  85. package/build/components/list-view/index.js +1 -1
  86. package/build/components/list-view/index.js.map +1 -1
  87. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  88. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  89. package/build/components/list-view/utils.js +3 -1
  90. package/build/components/list-view/utils.js.map +1 -1
  91. package/build/components/media-placeholder/index.js +3 -3
  92. package/build/components/media-placeholder/index.js.map +1 -1
  93. package/build/components/navigable-toolbar/index.js +3 -1
  94. package/build/components/navigable-toolbar/index.js.map +1 -1
  95. package/build/components/provider/block-refs-provider.js +3 -4
  96. package/build/components/provider/block-refs-provider.js.map +1 -1
  97. package/build/components/provider/use-block-sync.js +3 -12
  98. package/build/components/provider/use-block-sync.js.map +1 -1
  99. package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
  100. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  101. package/build/components/rich-text/event-listeners/delete.js +58 -0
  102. package/build/components/rich-text/event-listeners/delete.js.map +1 -0
  103. package/build/components/rich-text/event-listeners/enter.js +98 -0
  104. package/build/components/rich-text/event-listeners/enter.js.map +1 -0
  105. package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
  106. package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  107. package/build/components/rich-text/event-listeners/index.js +44 -0
  108. package/build/components/rich-text/event-listeners/index.js.map +1 -0
  109. package/build/components/rich-text/event-listeners/input-events.js +22 -0
  110. package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
  111. package/build/components/rich-text/event-listeners/input-rules.js +135 -0
  112. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
  113. package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
  114. package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  115. package/build/components/rich-text/event-listeners/paste-handler.js +146 -0
  116. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  117. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
  118. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  119. package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
  120. package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  121. package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
  122. package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  123. package/build/components/rich-text/index.js +11 -31
  124. package/build/components/rich-text/index.js.map +1 -1
  125. package/build/components/rich-text/index.native.js +13 -3
  126. package/build/components/rich-text/index.native.js.map +1 -1
  127. package/build/components/rich-text/multiline.js +6 -2
  128. package/build/components/rich-text/multiline.js.map +1 -1
  129. package/build/components/rich-text/native/index.native.js +12 -0
  130. package/build/components/rich-text/native/index.native.js.map +1 -1
  131. package/build/components/rich-text/use-format-types.js +8 -4
  132. package/build/components/rich-text/use-format-types.js.map +1 -1
  133. package/build/components/segmented-text-control/index.js +62 -0
  134. package/build/components/segmented-text-control/index.js.map +1 -0
  135. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  136. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  137. package/build/components/text-alignment-control/index.js +76 -0
  138. package/build/components/text-alignment-control/index.js.map +1 -0
  139. package/build/components/text-decoration-control/index.js +21 -25
  140. package/build/components/text-decoration-control/index.js.map +1 -1
  141. package/build/components/text-transform-control/index.js +18 -22
  142. package/build/components/text-transform-control/index.js.map +1 -1
  143. package/build/components/use-block-display-information/index.js +9 -3
  144. package/build/components/use-block-display-information/index.js.map +1 -1
  145. package/build/components/use-on-block-drop/index.js +3 -1
  146. package/build/components/use-on-block-drop/index.js.map +1 -1
  147. package/build/components/writing-flow/use-drag-selection.js +3 -1
  148. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  149. package/build/components/writing-flow/use-tab-nav.js +3 -1
  150. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  151. package/build/components/writing-mode-control/index.js +16 -20
  152. package/build/components/writing-mode-control/index.js.map +1 -1
  153. package/build/hooks/duotone.js +3 -1
  154. package/build/hooks/duotone.js.map +1 -1
  155. package/build/hooks/utils.js +11 -6
  156. package/build/hooks/utils.js.map +1 -1
  157. package/build/private-apis.js +4 -2
  158. package/build/private-apis.js.map +1 -1
  159. package/build/store/actions.js +32 -8
  160. package/build/store/actions.js.map +1 -1
  161. package/build/store/private-selectors.js +27 -6
  162. package/build/store/private-selectors.js.map +1 -1
  163. package/build/store/reducer.js +11 -8
  164. package/build/store/reducer.js.map +1 -1
  165. package/build/store/selectors.js +21 -7
  166. package/build/store/selectors.js.map +1 -1
  167. package/build/utils/object.js +17 -0
  168. package/build/utils/object.js.map +1 -1
  169. package/build/utils/order-inserter-block-items.js +6 -2
  170. package/build/utils/order-inserter-block-items.js.map +1 -1
  171. package/build/utils/pasting.js +6 -2
  172. package/build/utils/pasting.js.map +1 -1
  173. package/build-module/components/alignment-control/ui.js +3 -1
  174. package/build-module/components/alignment-control/ui.js.map +1 -1
  175. package/build-module/components/block-inspector/index.js +1 -1
  176. package/build-module/components/block-inspector/index.js.map +1 -1
  177. package/build-module/components/block-list/block.js +0 -9
  178. package/build-module/components/block-list/block.js.map +1 -1
  179. package/build-module/components/block-list/index.js +4 -3
  180. package/build-module/components/block-list/index.js.map +1 -1
  181. package/build-module/components/block-list/index.native.js +1 -9
  182. package/build-module/components/block-list/index.native.js.map +1 -1
  183. package/build-module/components/block-list/use-block-props/index.js +6 -6
  184. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  185. package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
  186. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  187. package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
  188. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  189. package/build-module/components/block-mover/index.native.js +3 -1
  190. package/build-module/components/block-mover/index.native.js.map +1 -1
  191. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -26
  192. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  193. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
  194. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  195. package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
  196. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  197. package/build-module/components/block-switcher/utils.js +15 -5
  198. package/build-module/components/block-switcher/utils.js.map +1 -1
  199. package/build-module/components/block-toolbar/use-has-block-toolbar.js +14 -9
  200. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  201. package/build-module/components/block-tools/index.js +3 -1
  202. package/build-module/components/block-tools/index.js.map +1 -1
  203. package/build-module/components/block-tools/use-show-block-tools.js +2 -5
  204. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  205. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -1
  206. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  207. package/build-module/components/block-variation-picker/index.js +3 -2
  208. package/build-module/components/block-variation-picker/index.js.map +1 -1
  209. package/build-module/components/block-variation-transforms/index.js +3 -1
  210. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  211. package/build-module/components/floating-toolbar/index.native.js +9 -5
  212. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  213. package/build-module/components/global-styles/background-panel.js +1 -1
  214. package/build-module/components/global-styles/background-panel.js.map +1 -1
  215. package/build-module/components/global-styles/color-panel.js +3 -1
  216. package/build-module/components/global-styles/color-panel.js.map +1 -1
  217. package/build-module/components/global-styles/dimensions-panel.js +17 -1
  218. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  219. package/build-module/components/global-styles/hooks.js +3 -2
  220. package/build-module/components/global-styles/hooks.js.map +1 -1
  221. package/build-module/components/global-styles/typography-panel.js +24 -24
  222. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  223. package/build-module/components/global-styles/use-global-styles-output.js +149 -132
  224. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  225. package/build-module/components/global-styles/utils.js +44 -0
  226. package/build-module/components/global-styles/utils.js.map +1 -1
  227. package/build-module/components/inner-blocks/index.js +16 -2
  228. package/build-module/components/inner-blocks/index.js.map +1 -1
  229. package/build-module/components/inserter/block-patterns-tab/index.js +13 -32
  230. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  231. package/build-module/components/inserter/block-types-tab.js +4 -0
  232. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  233. package/build-module/components/inserter/category-tabs/index.js +49 -0
  234. package/build-module/components/inserter/category-tabs/index.js.map +1 -0
  235. package/build-module/components/inserter/media-tab/index.js +1 -1
  236. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  237. package/build-module/components/inserter/media-tab/media-panel.js +0 -24
  238. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  239. package/build-module/components/inserter/media-tab/media-preview.js +13 -3
  240. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  241. package/build-module/components/inserter/media-tab/media-tab.js +17 -31
  242. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  243. package/build-module/components/inserter/menu.js +61 -71
  244. package/build-module/components/inserter/menu.js.map +1 -1
  245. package/build-module/components/inserter/tabs.js +6 -6
  246. package/build-module/components/inserter/tabs.js.map +1 -1
  247. package/build-module/components/line-height-control/index.js +6 -2
  248. package/build-module/components/line-height-control/index.js.map +1 -1
  249. package/build-module/components/link-control/search-item.js +9 -3
  250. package/build-module/components/link-control/search-item.js.map +1 -1
  251. package/build-module/components/list-view/block-select-button.js +7 -172
  252. package/build-module/components/list-view/block-select-button.js.map +1 -1
  253. package/build-module/components/list-view/block.js +167 -15
  254. package/build-module/components/list-view/block.js.map +1 -1
  255. package/build-module/components/list-view/index.js +1 -1
  256. package/build-module/components/list-view/index.js.map +1 -1
  257. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  258. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  259. package/build-module/components/list-view/utils.js +3 -1
  260. package/build-module/components/list-view/utils.js.map +1 -1
  261. package/build-module/components/media-placeholder/index.js +3 -3
  262. package/build-module/components/media-placeholder/index.js.map +1 -1
  263. package/build-module/components/navigable-toolbar/index.js +3 -1
  264. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  265. package/build-module/components/provider/block-refs-provider.js +3 -4
  266. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  267. package/build-module/components/provider/use-block-sync.js +4 -13
  268. package/build-module/components/provider/use-block-sync.js.map +1 -1
  269. package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
  270. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  271. package/build-module/components/rich-text/event-listeners/delete.js +51 -0
  272. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
  273. package/build-module/components/rich-text/event-listeners/enter.js +92 -0
  274. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
  275. package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
  276. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  277. package/build-module/components/rich-text/event-listeners/index.js +36 -0
  278. package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
  279. package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
  280. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
  281. package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
  282. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
  283. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
  284. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  285. package/build-module/components/rich-text/event-listeners/paste-handler.js +142 -0
  286. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  287. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
  288. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  289. package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
  290. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  291. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  292. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  293. package/build-module/components/rich-text/index.js +12 -32
  294. package/build-module/components/rich-text/index.js.map +1 -1
  295. package/build-module/components/rich-text/index.native.js +13 -3
  296. package/build-module/components/rich-text/index.native.js.map +1 -1
  297. package/build-module/components/rich-text/multiline.js +6 -2
  298. package/build-module/components/rich-text/multiline.js.map +1 -1
  299. package/build-module/components/rich-text/native/index.native.js +12 -0
  300. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  301. package/build-module/components/rich-text/use-format-types.js +8 -4
  302. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  303. package/build-module/components/segmented-text-control/index.js +55 -0
  304. package/build-module/components/segmented-text-control/index.js.map +1 -0
  305. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  306. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  307. package/build-module/components/text-alignment-control/index.js +68 -0
  308. package/build-module/components/text-alignment-control/index.js.map +1 -0
  309. package/build-module/components/text-decoration-control/index.js +21 -25
  310. package/build-module/components/text-decoration-control/index.js.map +1 -1
  311. package/build-module/components/text-transform-control/index.js +18 -22
  312. package/build-module/components/text-transform-control/index.js.map +1 -1
  313. package/build-module/components/use-block-display-information/index.js +9 -3
  314. package/build-module/components/use-block-display-information/index.js.map +1 -1
  315. package/build-module/components/use-on-block-drop/index.js +3 -1
  316. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  317. package/build-module/components/writing-flow/use-drag-selection.js +3 -1
  318. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  319. package/build-module/components/writing-flow/use-tab-nav.js +3 -1
  320. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  321. package/build-module/components/writing-mode-control/index.js +16 -20
  322. package/build-module/components/writing-mode-control/index.js.map +1 -1
  323. package/build-module/hooks/duotone.js +3 -1
  324. package/build-module/hooks/duotone.js.map +1 -1
  325. package/build-module/hooks/utils.js +11 -6
  326. package/build-module/hooks/utils.js.map +1 -1
  327. package/build-module/private-apis.js +4 -2
  328. package/build-module/private-apis.js.map +1 -1
  329. package/build-module/store/actions.js +32 -8
  330. package/build-module/store/actions.js.map +1 -1
  331. package/build-module/store/private-selectors.js +27 -5
  332. package/build-module/store/private-selectors.js.map +1 -1
  333. package/build-module/store/reducer.js +11 -8
  334. package/build-module/store/reducer.js.map +1 -1
  335. package/build-module/store/selectors.js +21 -7
  336. package/build-module/store/selectors.js.map +1 -1
  337. package/build-module/utils/object.js +16 -0
  338. package/build-module/utils/object.js.map +1 -1
  339. package/build-module/utils/order-inserter-block-items.js +6 -2
  340. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  341. package/build-module/utils/pasting.js +6 -2
  342. package/build-module/utils/pasting.js.map +1 -1
  343. package/build-style/content-rtl.css +41 -68
  344. package/build-style/content.css +41 -68
  345. package/build-style/style-rtl.css +100 -199
  346. package/build-style/style.css +100 -199
  347. package/package.json +31 -31
  348. package/src/components/alignment-control/ui.js +3 -1
  349. package/src/components/block-bindings-toolbar-indicator/style.scss +1 -4
  350. package/src/components/block-canvas/style.scss +1 -3
  351. package/src/components/block-draggable/test/helpers.native.js +8 -8
  352. package/src/components/block-inspector/index.js +1 -2
  353. package/src/components/block-list/block.js +2 -13
  354. package/src/components/block-list/content.scss +9 -1
  355. package/src/components/block-list/index.js +4 -4
  356. package/src/components/block-list/index.native.js +1 -6
  357. package/src/components/block-list/use-block-props/index.js +12 -4
  358. package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
  359. package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
  360. package/src/components/block-mover/index.native.js +3 -1
  361. package/src/components/block-patterns-list/style.scss +1 -3
  362. package/src/components/block-preview/style.scss +13 -15
  363. package/src/components/block-settings-menu/block-settings-dropdown.js +1 -51
  364. package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
  365. package/src/components/block-switcher/use-transformed-patterns.js +6 -2
  366. package/src/components/block-switcher/utils.js +14 -5
  367. package/src/components/block-toolbar/style.scss +8 -11
  368. package/src/components/block-toolbar/use-has-block-toolbar.js +21 -16
  369. package/src/components/block-tools/index.js +3 -1
  370. package/src/components/block-tools/use-show-block-tools.js +36 -48
  371. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -1
  372. package/src/components/block-variation-picker/content.scss +22 -72
  373. package/src/components/block-variation-picker/index.js +3 -2
  374. package/src/components/block-variation-transforms/index.js +3 -1
  375. package/src/components/floating-toolbar/index.native.js +5 -2
  376. package/src/components/global-styles/background-panel.js +1 -3
  377. package/src/components/global-styles/color-panel.js +3 -1
  378. package/src/components/global-styles/dimensions-panel.js +18 -1
  379. package/src/components/global-styles/hooks.js +2 -0
  380. package/src/components/global-styles/test/utils.js +21 -0
  381. package/src/components/global-styles/typography-panel.js +27 -23
  382. package/src/components/global-styles/use-global-styles-output.js +211 -187
  383. package/src/components/global-styles/utils.js +55 -0
  384. package/src/components/inner-blocks/index.js +14 -1
  385. package/src/components/inserter/block-patterns-tab/index.js +15 -65
  386. package/src/components/inserter/block-types-tab.js +5 -0
  387. package/src/components/inserter/category-tabs/index.js +74 -0
  388. package/src/components/inserter/media-tab/index.js +1 -1
  389. package/src/components/inserter/media-tab/media-panel.js +0 -22
  390. package/src/components/inserter/media-tab/media-preview.js +15 -7
  391. package/src/components/inserter/media-tab/media-tab.js +44 -83
  392. package/src/components/inserter/menu.js +139 -117
  393. package/src/components/inserter/style.scss +90 -170
  394. package/src/components/inserter/tabs.js +5 -13
  395. package/src/components/line-height-control/index.js +6 -2
  396. package/src/components/link-control/search-item.js +9 -3
  397. package/src/components/list-view/block-select-button.js +73 -266
  398. package/src/components/list-view/block.js +218 -28
  399. package/src/components/list-view/index.js +1 -1
  400. package/src/components/list-view/style.scss +20 -28
  401. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  402. package/src/components/list-view/utils.js +3 -1
  403. package/src/components/media-placeholder/content.scss +0 -11
  404. package/src/components/media-placeholder/index.js +3 -3
  405. package/src/components/navigable-toolbar/index.js +3 -1
  406. package/src/components/provider/block-refs-provider.js +3 -8
  407. package/src/components/provider/test/use-block-sync.js +7 -0
  408. package/src/components/provider/use-block-sync.js +3 -20
  409. package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
  410. package/src/components/rich-text/event-listeners/delete.js +53 -0
  411. package/src/components/rich-text/event-listeners/enter.js +104 -0
  412. package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
  413. package/src/components/rich-text/event-listeners/index.js +56 -0
  414. package/src/components/rich-text/event-listeners/input-events.js +13 -0
  415. package/src/components/rich-text/event-listeners/input-rules.js +146 -0
  416. package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
  417. package/src/components/rich-text/event-listeners/paste-handler.js +169 -0
  418. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
  419. package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
  420. package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  421. package/src/components/rich-text/index.js +7 -34
  422. package/src/components/rich-text/index.native.js +11 -0
  423. package/src/components/rich-text/multiline.js +6 -2
  424. package/src/components/rich-text/native/index.native.js +11 -0
  425. package/src/components/rich-text/use-format-types.js +6 -2
  426. package/src/components/segmented-text-control/index.js +63 -0
  427. package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
  428. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
  429. package/src/components/text-alignment-control/index.js +91 -0
  430. package/src/components/text-alignment-control/stories/index.story.js +39 -0
  431. package/src/components/text-decoration-control/index.js +20 -33
  432. package/src/components/text-transform-control/index.js +17 -30
  433. package/src/components/use-block-display-information/index.js +9 -3
  434. package/src/components/use-on-block-drop/index.js +3 -1
  435. package/src/components/writing-flow/use-drag-selection.js +3 -1
  436. package/src/components/writing-flow/use-tab-nav.js +3 -1
  437. package/src/components/writing-mode-control/index.js +15 -28
  438. package/src/hooks/duotone.js +3 -1
  439. package/src/hooks/utils.js +16 -2
  440. package/src/private-apis.js +4 -2
  441. package/src/store/actions.js +36 -12
  442. package/src/store/private-selectors.js +28 -4
  443. package/src/store/reducer.js +13 -23
  444. package/src/store/selectors.js +20 -7
  445. package/src/style.scss +1 -2
  446. package/src/utils/object.js +16 -0
  447. package/src/utils/order-inserter-block-items.js +6 -2
  448. package/src/utils/pasting.js +6 -2
  449. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
  450. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  451. package/build/components/rich-text/use-before-input-rules.js +0 -98
  452. package/build/components/rich-text/use-before-input-rules.js.map +0 -1
  453. package/build/components/rich-text/use-delete.js +0 -64
  454. package/build/components/rich-text/use-delete.js.map +0 -1
  455. package/build/components/rich-text/use-enter.js +0 -109
  456. package/build/components/rich-text/use-enter.js.map +0 -1
  457. package/build/components/rich-text/use-firefox-compat.js +0 -44
  458. package/build/components/rich-text/use-firefox-compat.js.map +0 -1
  459. package/build/components/rich-text/use-input-events.js +0 -25
  460. package/build/components/rich-text/use-input-events.js.map +0 -1
  461. package/build/components/rich-text/use-input-rules.js +0 -139
  462. package/build/components/rich-text/use-input-rules.js.map +0 -1
  463. package/build/components/rich-text/use-insert-replacement-text.js +0 -38
  464. package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
  465. package/build/components/rich-text/use-paste-handler.js +0 -158
  466. package/build/components/rich-text/use-paste-handler.js.map +0 -1
  467. package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
  468. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  469. package/build/components/rich-text/use-shortcuts.js +0 -25
  470. package/build/components/rich-text/use-shortcuts.js.map +0 -1
  471. package/build/components/rich-text/use-undo-automatic-change.js +0 -53
  472. package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
  473. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
  474. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  475. package/build-module/components/rich-text/use-before-input-rules.js +0 -92
  476. package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
  477. package/build-module/components/rich-text/use-delete.js +0 -57
  478. package/build-module/components/rich-text/use-delete.js.map +0 -1
  479. package/build-module/components/rich-text/use-enter.js +0 -102
  480. package/build-module/components/rich-text/use-enter.js.map +0 -1
  481. package/build-module/components/rich-text/use-firefox-compat.js +0 -37
  482. package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
  483. package/build-module/components/rich-text/use-input-events.js +0 -18
  484. package/build-module/components/rich-text/use-input-events.js.map +0 -1
  485. package/build-module/components/rich-text/use-input-rules.js +0 -132
  486. package/build-module/components/rich-text/use-input-rules.js.map +0 -1
  487. package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
  488. package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
  489. package/build-module/components/rich-text/use-paste-handler.js +0 -152
  490. package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
  491. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
  492. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  493. package/build-module/components/rich-text/use-shortcuts.js +0 -18
  494. package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
  495. package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
  496. package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
  497. package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
  498. package/src/components/rich-text/use-before-input-rules.js +0 -99
  499. package/src/components/rich-text/use-delete.js +0 -59
  500. package/src/components/rich-text/use-enter.js +0 -110
  501. package/src/components/rich-text/use-firefox-compat.js +0 -39
  502. package/src/components/rich-text/use-input-events.js +0 -19
  503. package/src/components/rich-text/use-input-rules.js +0 -150
  504. package/src/components/rich-text/use-insert-replacement-text.js +0 -31
  505. package/src/components/rich-text/use-paste-handler.js +0 -180
  506. package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
  507. package/src/components/rich-text/use-shortcuts.js +0 -19
  508. package/src/components/rich-text/use-undo-automatic-change.js +0 -46
  509. package/src/components/text-decoration-control/style.scss +0 -18
  510. package/src/components/text-transform-control/style.scss +0 -18
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_memize","_interopRequireDefault","_colord","_reactNativeAztec","_reactNativeBridge","_blockEditor","_components","_element","_compose","_data","_blocks","_htmlEntities","_keycodes","_url","_icons","_i18n","_richText","_useFormatTypes","_formatEdit","_getFormatColors","_style","_toolbarButtonWithOptions","flatColorPalettes","memize","colorsPalettes","theme","custom","default","getSelectionColor","currentSelectionColor","defaultSelectionColor","baseGlobalStyles","isBlockBasedTheme","selectionColor","colordTextColor","colord","colordBackgroundColor","color","background","isColordTextReadable","isReadable","text","gutenbergFormatNamesToAztec","EMPTY_PARAGRAPH_TAGS","DEFAULT_FONT_SIZE","MIN_LINE_HEIGHT","RichText","Component","constructor","value","selectionStart","selectionEnd","arguments","isIOS","Platform","OS","createRecord","bind","onChangeFromAztec","onKeyDown","handleEnter","handleDelete","onPaste","onFocus","onBlur","onTextUpdate","onContentSizeChange","onFormatChange","formatToValue","maxSize","debounceCreateUndoLevel","debounce","onCreateUndoLevel","onSelectionChange","onSelectionChangeFromAztec","valueToFormat","getHtmlToRender","handleSuggestionFunc","handleUserSuggestion","showUserSuggestions","handleXpostSuggestion","showXpostSuggestions","suggestionOptions","insertString","manipulateEventCounterToForceNativeToRefresh","shouldDropEventFromAztec","state","activeFormats","selectedFormat","height","currentFontSize","getFontSize","needsSelectionUpdate","savedContent","isTouched","lastAztecEventType","lastHistoryValue","getRecord","start","end","colorPalette","props","currentValue","formats","replacements","newFormats","getFormatColors","preserveWhiteSpace","create","html","range","Math","min","length","removeRootTagsProducedByAztec","toHTMLString","getActiveFormatNames","record","formatTypes","map","name","filter","getActiveFormat","undefined","Boolean","changeHandlers","Object","fromEntries","entries","key","startsWith","values","forEach","changeHandler","onChange","setState","string","toInsert","insert","__unstableOnCreateUndoLevel","toString","result","removeRootTag","tagName","tagsToEliminate","element","removeTag","tag","openingTagRegexp","RegExp","closingTagRegexp","replace","event","contentWithoutRootTag","nativeEvent","lastEventCount","eventCount","comesFromAztec","firedAfterTextChanged","refresh","contentSize","defaultPrevented","customEditableOnKeyDown","preventDefault","RCTAztecView","KeyCodes","keyCode","handleTriggerKeyCodes","ENTER","onEnter","shiftKey","DELETE","BACKSPACE","isReverse","onDelete","newValue","remove","isCollapsed","triggeredOption","find","option","triggeredKeyCode","triggerChar","charCodeAt","getTextContent","useTrigger","charAt","onClick","areMentionsSupported","areXPostsSupported","allOptions","supported","title","__","label","icon","atSymbol","plus","op","suggestionFunction","prefix","then","suggestion","catch","pastedText","pastedHtml","files","currentRecord","trimmedText","trim","isURL","linkedRecord","applyFormat","type","attributes","href","decodeEntities","window","console","log","plainText","unstableOnFocus","hasChanged","isManual","getActiveFormats","logText","shouldDrop","shouldFocusTextInputAfterMerge","prevProps","__unstableIsSelected","isSelected","blockIsSelected","__unstableMobileNoFocusOnMount","prevIsSelected","prevBlockIsSelected","noSelectionValues","textInputWasNotFocused","realStart","realEnd","max","isEmpty","Array","isArray","childrenBlock","toHTML","format","shouldComponentUpdate","nextProps","nextState","reversed","fontSize","style","lineHeight","componentDidMount","_editor","focus","componentDidUpdate","_this$value$toString$","lastCharacterPosition","blur","currentFontSizeStyle","getParsedFontSize","prevFontSizeStyle","isDifferentTag","extraAttributes","getEditableProps","className","_getPxFromCssUnit","width","Dimensions","get","cssUnitOptions","selectedPxValue","getPxFromCssUnit","parseFloat","tagNameFontSize","elements","typography","newFontSize","getLineHeight","tagNameLineHeight","newLineHeight","getIsBlockBasedTheme","isNaN","getBlockUseDefaultFont","tagsToMatch","test","getLinkTextColor","defaultColor","customColor","linkColor","isValid","toHex","getPlaceholderTextColor","_ref","_ref2","getStylesFromColorScheme","placeholderTextColor","placeholderStyle","styles","richTextPlaceholder","richTextPlaceholderDark","defaultPlaceholderTextColor","placeholderOpacity","inheritPlaceholderColor","placeholderColor","globalStylesPlaceholderColor","render","children","minWidth","maxWidth","parentBlockStyles","accessibilityLabel","disableEditingMenu","disableSuggestions","containerWidth","editableProps","blockUseDefaultFont","textDecorationColor","defaultTextDecorationColor","fontFamily","defaultFontFamily","richText","richTextDark","linkTextColor","currentSelectionStart","currentSelectionEnd","selection","brBeforeParaMatches","match","warn","count","newSelectionStart","newSelectionEnd","containerStyles","padding","backgroundColor","EditableView","_react","createElement","Fragment","View","editableTagName","ref","nativeEditorRef","minHeight","placeholder","deleteEnter","triggerKeyCodes","blockType","maxImagesWidth","fontWeight","fontStyle","isMultiline","textAlign","id","disableAutocorrection","forwardedRef","BlockFormatControls","options","exports","defaultProps","withFormatTypes","WrappedComponent","clientId","identifier","withoutInteractiveFormatting","allowedFormats","useFormatTypes","_default","compose","withSelect","select","getBlockParents","getBlock","getSettings","parents","parentBlock","childrenStyles","settings","__experimentalGlobalStylesBaseStyles","colorPalettes","__experimentalFeatures","palette","colors","capabilities","mentions","xposts","withPreferredColorScheme"],"sources":["@wordpress/block-editor/src/components/rich-text/native/index.native.js"],"sourcesContent":["/* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n\n/**\n * External dependencies\n */\nimport { View, Platform, Dimensions } from 'react-native';\nimport memize from 'memize';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport RCTAztecView from '@wordpress/react-native-aztec';\nimport {\n\tshowUserSuggestions,\n\tshowXpostSuggestions,\n} from '@wordpress/react-native-bridge';\nimport { BlockFormatControls } from '@wordpress/block-editor';\nimport { getPxFromCssUnit } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport {\n\tcompose,\n\tdebounce,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { childrenBlock } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { BACKSPACE, DELETE, ENTER } from '@wordpress/keycodes';\nimport { isURL } from '@wordpress/url';\nimport { atSymbol, plus } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tapplyFormat,\n\tgetActiveFormat,\n\tgetActiveFormats,\n\tinsert,\n\tgetTextContent,\n\tisEmpty,\n\tcreate,\n\ttoHTMLString,\n\tisCollapsed,\n\tremove,\n} from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { useFormatTypes } from './use-format-types';\nimport FormatEdit from './format-edit';\nimport { getFormatColors } from './get-format-colors';\nimport styles from './style.scss';\nimport ToolbarButtonWithOptions from './toolbar-button-with-options';\n\n// The flattened color palettes array is memoized to ensure that the same array instance is\n// returned for the colors palettes. This value might be used as a prop, so having the same\n// instance will prevent unnecessary re-renders of the RichText component.\nconst flatColorPalettes = memize( ( colorsPalettes ) => [\n\t...( colorsPalettes?.theme || [] ),\n\t...( colorsPalettes?.custom || [] ),\n\t...( colorsPalettes?.default || [] ),\n] );\n\nconst getSelectionColor = memize(\n\t(\n\t\tcurrentSelectionColor,\n\t\tdefaultSelectionColor,\n\t\tbaseGlobalStyles,\n\t\tisBlockBasedTheme\n\t) => {\n\t\tlet selectionColor = defaultSelectionColor;\n\t\tif ( currentSelectionColor ) {\n\t\t\tselectionColor = currentSelectionColor;\n\t\t}\n\n\t\tif ( isBlockBasedTheme ) {\n\t\t\tconst colordTextColor = colord( selectionColor );\n\t\t\tconst colordBackgroundColor = colord(\n\t\t\t\tbaseGlobalStyles?.color?.background\n\t\t\t);\n\t\t\tconst isColordTextReadable = colordTextColor.isReadable(\n\t\t\t\tcolordBackgroundColor\n\t\t\t);\n\t\t\tif ( ! isColordTextReadable ) {\n\t\t\t\tselectionColor = baseGlobalStyles?.color?.text;\n\t\t\t}\n\t\t}\n\n\t\treturn selectionColor;\n\t}\n);\n\nconst gutenbergFormatNamesToAztec = {\n\t'core/bold': 'bold',\n\t'core/italic': 'italic',\n\t'core/strikethrough': 'strikethrough',\n\t'core/text-color': 'mark',\n};\n\nconst EMPTY_PARAGRAPH_TAGS = '<p></p>';\nconst DEFAULT_FONT_SIZE = 16;\nconst MIN_LINE_HEIGHT = 1;\n\nexport class RichText extends Component {\n\tconstructor( { value, selectionStart, selectionEnd } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.createRecord = this.createRecord.bind( this );\n\t\tthis.onChangeFromAztec = this.onChangeFromAztec.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.handleEnter = this.handleEnter.bind( this );\n\t\tthis.handleDelete = this.handleDelete.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onBlur = this.onBlur.bind( this );\n\t\tthis.onTextUpdate = this.onTextUpdate.bind( this );\n\t\tthis.onContentSizeChange = this.onContentSizeChange.bind( this );\n\t\tthis.onFormatChange = this.onFormatChange.bind( this );\n\t\tthis.formatToValue = memize( this.formatToValue.bind( this ), {\n\t\t\tmaxSize: 1,\n\t\t} );\n\t\tthis.debounceCreateUndoLevel = debounce( this.onCreateUndoLevel, 1000 );\n\t\t// This prevents a bug in Aztec which triggers onSelectionChange twice on format change.\n\t\tthis.onSelectionChange = this.onSelectionChange.bind( this );\n\t\tthis.onSelectionChangeFromAztec =\n\t\t\tthis.onSelectionChangeFromAztec.bind( this );\n\t\tthis.valueToFormat = this.valueToFormat.bind( this );\n\t\tthis.getHtmlToRender = this.getHtmlToRender.bind( this );\n\t\tthis.handleSuggestionFunc = this.handleSuggestionFunc.bind( this );\n\t\tthis.handleUserSuggestion = this.handleSuggestionFunc(\n\t\t\tshowUserSuggestions,\n\t\t\t'@'\n\t\t).bind( this );\n\t\tthis.handleXpostSuggestion = this.handleSuggestionFunc(\n\t\t\tshowXpostSuggestions,\n\t\t\t'+'\n\t\t).bind( this );\n\t\tthis.suggestionOptions = this.suggestionOptions.bind( this );\n\t\tthis.insertString = this.insertString.bind( this );\n\t\tthis.manipulateEventCounterToForceNativeToRefresh =\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh.bind( this );\n\t\tthis.shouldDropEventFromAztec =\n\t\t\tthis.shouldDropEventFromAztec.bind( this );\n\t\tthis.state = {\n\t\t\tactiveFormats: [],\n\t\t\tselectedFormat: null,\n\t\t\theight: 0,\n\t\t\tcurrentFontSize: this.getFontSize( arguments[ 0 ] ),\n\t\t};\n\t\tthis.needsSelectionUpdate = false;\n\t\tthis.savedContent = '';\n\t\tthis.isTouched = false;\n\t\tthis.lastAztecEventType = null;\n\n\t\tthis.lastHistoryValue = value;\n\n\t\t// Internal values that are update synchronously, unlike props.\n\t\tthis.value = value;\n\t\tthis.selectionStart = selectionStart;\n\t\tthis.selectionEnd = selectionEnd;\n\t}\n\n\t/**\n\t * Get the current record (value and selection) from props and state.\n\t *\n\t * @return {Object} The current record (value and selection).\n\t */\n\tgetRecord() {\n\t\tconst {\n\t\t\tselectionStart: start,\n\t\t\tselectionEnd: end,\n\t\t\tcolorPalette,\n\t\t} = this.props;\n\t\tconst { value } = this.props;\n\t\tconst currentValue = this.formatToValue( value );\n\n\t\tconst { formats, replacements, text } = currentValue;\n\t\tconst { activeFormats } = this.state;\n\t\tconst newFormats = getFormatColors( formats, colorPalette );\n\n\t\treturn {\n\t\t\tformats: newFormats,\n\t\t\treplacements,\n\t\t\ttext,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tactiveFormats,\n\t\t};\n\t}\n\n\t/**\n\t * Creates a RichText value \"record\" from the current content and selection\n\t * information\n\t *\n\t *\n\t * @return {Object} A RichText value with formats and selection.\n\t */\n\tcreateRecord() {\n\t\tconst { preserveWhiteSpace } = this.props;\n\t\tconst value = {\n\t\t\tstart: this.selectionStart,\n\t\t\tend: this.selectionEnd,\n\t\t\t...create( {\n\t\t\t\thtml: this.value,\n\t\t\t\trange: null,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} ),\n\t\t};\n\t\tconst start = Math.min( this.selectionStart, value.text.length );\n\t\tconst end = Math.min( this.selectionEnd, value.text.length );\n\t\treturn { ...value, start, end };\n\t}\n\n\tvalueToFormat( value ) {\n\t\t// Remove the outer root tags.\n\t\treturn this.removeRootTagsProducedByAztec( toHTMLString( { value } ) );\n\t}\n\n\tgetActiveFormatNames( record ) {\n\t\tconst { formatTypes } = this.props;\n\n\t\treturn formatTypes\n\t\t\t.map( ( { name } ) => name )\n\t\t\t.filter( ( name ) => {\n\t\t\t\treturn getActiveFormat( record, name ) !== undefined;\n\t\t\t} )\n\t\t\t.map( ( name ) => gutenbergFormatNamesToAztec[ name ] )\n\t\t\t.filter( Boolean );\n\t}\n\n\tonFormatChange( record ) {\n\t\tconst { start = 0, end = 0, activeFormats = [] } = record;\n\t\tconst changeHandlers = Object.fromEntries(\n\t\t\tObject.entries( this.props ).filter( ( [ key ] ) =>\n\t\t\t\tkey.startsWith( 'format_on_change_functions_' )\n\t\t\t)\n\t\t);\n\n\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\tchangeHandler( record.formats, record.text );\n\t\t} );\n\n\t\tthis.value = this.valueToFormat( record );\n\t\tthis.props.onChange( this.value );\n\t\tthis.setState( { activeFormats } );\n\t\tthis.props.onSelectionChange( start, end );\n\t\tthis.selectionStart = start;\n\t\tthis.selectionEnd = end;\n\n\t\tthis.onCreateUndoLevel();\n\n\t\tthis.lastAztecEventType = 'format change';\n\t}\n\n\tinsertString( record, string ) {\n\t\tif ( record && string ) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tconst toInsert = insert( record, string );\n\t\t\tthis.onFormatChange( toInsert );\n\t\t}\n\t}\n\n\tonCreateUndoLevel() {\n\t\tconst { __unstableOnCreateUndoLevel: onCreateUndoLevel } = this.props;\n\t\t// If the content is the same, no level needs to be created.\n\t\tif ( this.lastHistoryValue?.toString() === this.value?.toString() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonCreateUndoLevel();\n\t\tthis.lastHistoryValue = this.value;\n\t}\n\n\t/*\n\t * Cleans up any root tags produced by aztec.\n\t * TODO: This should be removed on a later version when aztec doesn't return the top tag of the text being edited\n\t */\n\tremoveRootTagsProducedByAztec( html ) {\n\t\tlet result = this.removeRootTag( this.props.tagName, html );\n\n\t\tif ( this.props.tagsToEliminate ) {\n\t\t\tthis.props.tagsToEliminate.forEach( ( element ) => {\n\t\t\t\tresult = this.removeTag( element, result );\n\t\t\t} );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tremoveRootTag( tag, html ) {\n\t\tconst openingTagRegexp = RegExp( '^<' + tag + '[^>]*>', 'gim' );\n\t\tconst closingTagRegexp = RegExp( '</' + tag + '>$', 'gim' );\n\n\t\treturn html\n\t\t\t.replace( openingTagRegexp, '' )\n\t\t\t.replace( closingTagRegexp, '' );\n\t}\n\n\tremoveTag( tag, html ) {\n\t\tconst openingTagRegexp = RegExp( '<' + tag + '>', 'gim' );\n\t\tconst closingTagRegexp = RegExp( '</' + tag + '>', 'gim' );\n\t\treturn html\n\t\t\t.replace( openingTagRegexp, '' )\n\t\t\t.replace( closingTagRegexp, '' );\n\t}\n\n\t/*\n\t * Handles any case where the content of the AztecRN instance has changed\n\t */\n\tonChangeFromAztec( event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'onChange' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\t\t// On iOS, onChange can be triggered after selection changes, even though there are no content changes.\n\t\tif ( contentWithoutRootTag === this.value?.toString() ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = true; // The onChange event always fires after the fact.\n\t\tthis.onTextUpdate( event );\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\tonTextUpdate( event ) {\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\n\t\tthis.debounceCreateUndoLevel();\n\t\tconst refresh = this.value?.toString() !== contentWithoutRootTag;\n\t\tthis.value = contentWithoutRootTag;\n\n\t\t// We don't want to refresh if our goal is just to create a record.\n\t\tif ( refresh ) {\n\t\t\tthis.props.onChange( contentWithoutRootTag );\n\t\t}\n\t}\n\n\t/*\n\t * Handles any case where the content of the AztecRN instance has changed in size\n\t */\n\tonContentSizeChange( contentSize ) {\n\t\tthis.setState( contentSize );\n\t\tthis.lastAztecEventType = 'content size change';\n\t}\n\n\tonKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add stubs for conformance in downstream autocompleters logic.\n\t\tthis.customEditableOnKeyDown?.( {\n\t\t\tpreventDefault: () => undefined,\n\t\t\t...event,\n\t\t\tkey: RCTAztecView.KeyCodes[ event?.keyCode ],\n\t\t} );\n\n\t\tthis.handleDelete( event );\n\t\tthis.handleEnter( event );\n\t\tthis.handleTriggerKeyCodes( event );\n\t}\n\n\thandleEnter( event ) {\n\t\tif ( event.keyCode !== ENTER ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { onEnter } = this.props;\n\n\t\tif ( ! onEnter ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonEnter( {\n\t\t\tvalue: this.createRecord(),\n\t\t\tonChange: this.onFormatChange,\n\t\t\tshiftKey: event.shiftKey,\n\t\t} );\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\thandleDelete( event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'handleDelete' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { keyCode } = event;\n\n\t\tif ( keyCode !== DELETE && keyCode !== BACKSPACE ) {\n\t\t\treturn;\n\t\t}\n\t\tconst isReverse = keyCode === BACKSPACE;\n\n\t\tconst { onDelete } = this.props;\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = event.nativeEvent.firedAfterTextChanged;\n\t\tconst value = this.createRecord();\n\t\tconst { start, end, text } = value;\n\t\tlet newValue;\n\n\t\t// Always handle full content deletion ourselves.\n\t\tif ( start === 0 && end !== 0 && end >= text.length ) {\n\t\t\tnewValue = remove( value );\n\t\t\tthis.onFormatChange( newValue );\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\t// Only process delete if the key press occurs at an uncollapsed edge.\n\t\tif (\n\t\t\t! onDelete ||\n\t\t\t! isCollapsed( value ) ||\n\t\t\t( isReverse && start !== 0 ) ||\n\t\t\t( ! isReverse && end !== text.length )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tonDelete( { isReverse, value } );\n\n\t\tevent.preventDefault();\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\thandleTriggerKeyCodes( event ) {\n\t\tconst { keyCode } = event;\n\t\tconst triggeredOption = this.suggestionOptions().find( ( option ) => {\n\t\t\tconst triggeredKeyCode = option.triggerChar.charCodeAt( 0 );\n\t\t\treturn triggeredKeyCode === keyCode;\n\t\t} );\n\n\t\tif ( triggeredOption ) {\n\t\t\tconst record = this.getRecord();\n\t\t\tconst text = getTextContent( record );\n\t\t\t// Only respond to the trigger if the selection is on the start of text or line\n\t\t\t// or if the character before is a space.\n\t\t\tconst useTrigger =\n\t\t\t\ttext.length === 0 ||\n\t\t\t\trecord.start === 0 ||\n\t\t\t\ttext.charAt( record.start - 1 ) === '\\n' ||\n\t\t\t\ttext.charAt( record.start - 1 ) === ' ';\n\n\t\t\tif ( useTrigger && triggeredOption.onClick ) {\n\t\t\t\ttriggeredOption.onClick();\n\t\t\t} else {\n\t\t\t\tthis.insertString( record, triggeredOption.triggerChar );\n\t\t\t}\n\t\t}\n\t}\n\n\tsuggestionOptions() {\n\t\tconst { areMentionsSupported, areXPostsSupported } = this.props;\n\t\tconst allOptions = [\n\t\t\t{\n\t\t\t\tsupported: areMentionsSupported,\n\t\t\t\ttitle: __( 'Insert mention' ),\n\t\t\t\tonClick: this.handleUserSuggestion,\n\t\t\t\ttriggerChar: '@',\n\t\t\t\tvalue: 'mention',\n\t\t\t\tlabel: __( 'Mention' ),\n\t\t\t\ticon: atSymbol,\n\t\t\t},\n\t\t\t{\n\t\t\t\tsupported: areXPostsSupported,\n\t\t\t\ttitle: __( 'Insert crosspost' ),\n\t\t\t\tonClick: this.handleXpostSuggestion,\n\t\t\t\ttriggerChar: '+',\n\t\t\t\tvalue: 'crosspost',\n\t\t\t\tlabel: __( 'Crosspost' ),\n\t\t\t\ticon: plus,\n\t\t\t},\n\t\t];\n\t\treturn allOptions.filter( ( op ) => op.supported );\n\t}\n\n\thandleSuggestionFunc( suggestionFunction, prefix ) {\n\t\treturn () => {\n\t\t\tconst record = this.getRecord();\n\t\t\tsuggestionFunction()\n\t\t\t\t.then( ( suggestion ) => {\n\t\t\t\t\tthis.insertString( record, `${ prefix }${ suggestion } ` );\n\t\t\t\t} )\n\t\t\t\t.catch( () => {} );\n\t\t};\n\t}\n\n\t/**\n\t * Handles a paste event from the native Aztec Wrapper.\n\t *\n\t * @param {Object} event The paste event which wraps `nativeEvent`.\n\t */\n\tonPaste( event ) {\n\t\tconst { onPaste, onChange } = this.props;\n\t\tconst { activeFormats = [] } = this.state;\n\n\t\tconst { pastedText, pastedHtml, files } = event.nativeEvent;\n\t\tconst currentRecord = this.createRecord();\n\n\t\tevent.preventDefault();\n\n\t\t// There is a selection, check if a URL is pasted.\n\t\tif ( ! isCollapsed( currentRecord ) ) {\n\t\t\tconst trimmedText = ( pastedHtml || pastedText )\n\t\t\t\t.replace( /<[^>]+>/g, '' )\n\t\t\t\t.trim();\n\n\t\t\t// A URL was pasted, turn the selection into a link.\n\t\t\tif ( isURL( trimmedText ) ) {\n\t\t\t\tconst linkedRecord = applyFormat( currentRecord, {\n\t\t\t\t\ttype: 'a',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\thref: decodeEntities( trimmedText ),\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\tthis.value = this.valueToFormat( linkedRecord );\n\t\t\t\tonChange( this.value );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\twindow.console.log( 'Created link:\\n\\n', trimmedText );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( onPaste ) {\n\t\t\tonPaste( {\n\t\t\t\tvalue: currentRecord,\n\t\t\t\tonChange: this.onFormatChange,\n\t\t\t\thtml: pastedHtml,\n\t\t\t\tplainText: pastedText,\n\t\t\t\tfiles,\n\t\t\t\tactiveFormats,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonFocus() {\n\t\tthis.isTouched = true;\n\n\t\tconst { unstableOnFocus, onSelectionChange } = this.props;\n\n\t\tif ( unstableOnFocus ) {\n\t\t\tunstableOnFocus();\n\t\t}\n\n\t\t// We know for certain that on focus, the old selection is invalid. It\n\t\t// will be recalculated on `selectionchange`.\n\n\t\tonSelectionChange( this.selectionStart, this.selectionEnd );\n\n\t\tthis.lastAztecEventType = 'focus';\n\t}\n\n\tonBlur( event ) {\n\t\tthis.isTouched = false;\n\n\t\t// Check if value is up to date with latest state of native AztecView.\n\t\tif (\n\t\t\tevent.nativeEvent.text &&\n\t\t\tevent.nativeEvent.text !== this.props.value?.toString()\n\t\t) {\n\t\t\tthis.onTextUpdate( event );\n\t\t}\n\n\t\tif ( this.props.onBlur ) {\n\t\t\tthis.props.onBlur( event );\n\t\t}\n\n\t\tthis.lastAztecEventType = 'blur';\n\t}\n\n\tonSelectionChange( start, end ) {\n\t\tconst hasChanged =\n\t\t\tthis.selectionStart !== start || this.selectionEnd !== end;\n\n\t\tthis.selectionStart = start;\n\t\tthis.selectionEnd = end;\n\n\t\t// This is a manual selection change event if onChange was not triggered just before\n\t\t// and we did not just trigger a text update\n\t\t// `onChange` could be the last event and could have been triggered a long time ago so\n\t\t// this approach is not perfectly reliable.\n\t\tconst isManual =\n\t\t\tthis.lastAztecEventType !== 'input' &&\n\t\t\tthis.props.value?.toString() === this.value?.toString();\n\t\tif ( hasChanged && isManual ) {\n\t\t\tconst value = this.createRecord();\n\t\t\tconst activeFormats = getActiveFormats( value );\n\t\t\tthis.setState( { activeFormats } );\n\t\t}\n\n\t\tthis.props.onSelectionChange( start, end );\n\t}\n\n\tshouldDropEventFromAztec( event, logText ) {\n\t\tconst shouldDrop =\n\t\t\t! this.isIOS && event.nativeEvent.eventCount <= this.lastEventCount;\n\t\tif ( shouldDrop ) {\n\t\t\twindow.console.log(\n\t\t\t\t`Dropping ${ logText } from Aztec as its event counter is older than latest sent to the native side. Got ${ event.nativeEvent.eventCount } but lastEventCount is ${ this.lastEventCount }.`\n\t\t\t);\n\t\t}\n\t\treturn shouldDrop;\n\t}\n\n\t/**\n\t * Determines whether the text input should receive focus after an update.\n\t * For cases where a RichText with a value is merged with an empty one.\n\t *\n\t * @param {Object} prevProps - The previous props of the component.\n\t * @return {boolean} True if the text input should receive focus, false otherwise.\n\t */\n\tshouldFocusTextInputAfterMerge( prevProps ) {\n\t\tconst {\n\t\t\t__unstableIsSelected: isSelected,\n\t\t\tblockIsSelected,\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t\t__unstableMobileNoFocusOnMount,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\t__unstableIsSelected: prevIsSelected,\n\t\t\tblockIsSelected: prevBlockIsSelected,\n\t\t} = prevProps;\n\n\t\tconst noSelectionValues =\n\t\t\tselectionStart === undefined && selectionEnd === undefined;\n\t\tconst textInputWasNotFocused = ! prevIsSelected && ! isSelected;\n\n\t\treturn (\n\t\t\t! __unstableMobileNoFocusOnMount &&\n\t\t\tnoSelectionValues &&\n\t\t\ttextInputWasNotFocused &&\n\t\t\t! prevBlockIsSelected &&\n\t\t\tblockIsSelected\n\t\t);\n\t}\n\n\tonSelectionChangeFromAztec( start, end, text, event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'onSelectionChange' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// `end` can be less than `start` on iOS\n\t\t// Let's fix that here so `rich-text/slice` can work properly.\n\t\tconst realStart = Math.min( start, end );\n\t\tconst realEnd = Math.max( start, end );\n\n\t\t// Check and dicsard stray event, where the text and selection is equal to the ones already cached.\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\t\tif (\n\t\t\tcontentWithoutRootTag === this.value?.toString() &&\n\t\t\trealStart === this.selectionStart &&\n\t\t\trealEnd === this.selectionEnd\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = true; // Selection change event always fires after the fact.\n\n\t\t// Update text before updating selection\n\t\t// Make sure there are changes made to the content before upgrading it upward.\n\t\tthis.onTextUpdate( event );\n\n\t\t// Aztec can send us selection change events after it has lost focus.\n\t\t// For instance the autocorrect feature will complete a partially written\n\t\t// word when resigning focus, causing a selection change event.\n\t\t// Forwarding this selection change could cause this RichText to regain\n\t\t// focus and start a focus loop.\n\t\t//\n\t\t// See https://github.com/wordpress-mobile/gutenberg-mobile/issues/1696\n\t\tif ( this.props.__unstableIsSelected ) {\n\t\t\tthis.onSelectionChange( realStart, realEnd );\n\t\t}\n\t\t// Update lastEventCount to prevent Aztec from re-rendering the content it just sent.\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\n\t\tthis.lastAztecEventType = 'selection change';\n\t}\n\n\tisEmpty() {\n\t\treturn isEmpty( this.formatToValue( this.props.value ) );\n\t}\n\n\tformatToValue( value ) {\n\t\tconst { preserveWhiteSpace } = this.props;\n\t\t// Handle deprecated `children` and `node` sources.\n\t\tif ( Array.isArray( value ) ) {\n\t\t\treturn create( {\n\t\t\t\thtml: childrenBlock.toHTML( value ),\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\t\t}\n\n\t\tif ( this.props.format === 'string' ) {\n\t\t\treturn create( {\n\t\t\t\thtml: value,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\t\t}\n\n\t\t// Guard for blocks passing `null` in onSplit callbacks. May be removed\n\t\t// if onSplit is revised to not pass a `null` value.\n\t\tif ( value === null ) {\n\t\t\treturn create();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tmanipulateEventCounterToForceNativeToRefresh() {\n\t\tif ( this.isIOS ) {\n\t\t\tthis.lastEventCount = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof this.lastEventCount !== 'undefined' ) {\n\t\t\tthis.lastEventCount += 100; // bump by a hundred, hopefully native hasn't bombarded the JS side in the meantime.\n\t\t} // no need to bump when 'undefined' as native side won't receive the key when the value is undefined, and that will cause force updating anyway,\n\t\t// see https://github.com/WordPress/gutenberg/blob/82e578dcc75e67891c750a41a04c1e31994192fc/packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java#L213-L215\n\t}\n\n\tshouldComponentUpdate( nextProps, nextState ) {\n\t\tif (\n\t\t\tnextProps.tagName !== this.props.tagName ||\n\t\t\tnextProps.reversed !== this.props.reversed ||\n\t\t\tnextProps.start !== this.props.start\n\t\t) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tthis.value = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\t// TODO: Please re-introduce the check to avoid updating the content right after an `onChange` call.\n\t\t// It was removed in https://github.com/WordPress/gutenberg/pull/12417 to fix undo/redo problem.\n\n\t\t// If the component is changed React side (undo/redo/merging/splitting/custom text actions)\n\t\t// we need to make sure the native is updated as well.\n\n\t\t// Also, don't trust the \"this.lastContent\" as on Android, incomplete text events arrive\n\t\t// with only some of the text, while the virtual keyboard's suggestion system does its magic.\n\t\t// ** compare with this.lastContent for optimizing performance by not forcing Aztec with text it already has\n\t\t// , but compare with props.value to not lose \"half word\" text because of Android virtual keyb autosuggestion behavior\n\t\tif (\n\t\t\ttypeof nextProps.value !== 'undefined' &&\n\t\t\ttypeof this.props.value !== 'undefined' &&\n\t\t\t( ! this.comesFromAztec || ! this.firedAfterTextChanged ) &&\n\t\t\tnextProps.value?.toString() !== this.props.value?.toString()\n\t\t) {\n\t\t\t// Gutenberg seems to try to mirror the caret state even on events that only change the content so,\n\t\t\t// let's force caret update if state has selection set.\n\t\t\tif (\n\t\t\t\ttypeof nextProps.selectionStart !== 'undefined' &&\n\t\t\t\ttypeof nextProps.selectionEnd !== 'undefined'\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t}\n\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t}\n\n\t\tif ( ! this.comesFromAztec ) {\n\t\t\tif (\n\t\t\t\ttypeof nextProps.selectionStart !== 'undefined' &&\n\t\t\t\ttypeof nextProps.selectionEnd !== 'undefined' &&\n\t\t\t\tnextProps.selectionStart !== this.props.selectionStart &&\n\t\t\t\tnextProps.selectionStart !== this.selectionStart &&\n\t\t\t\tnextProps.__unstableIsSelected\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\n\t\t\t// For font size changes from a prop value a force refresh\n\t\t\t// is needed without the selection update.\n\t\t\tif ( nextProps?.fontSize !== this.props?.fontSize ) {\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t( nextProps?.style?.fontSize !== this.props?.style?.fontSize &&\n\t\t\t\t\tnextState.currentFontSize !==\n\t\t\t\t\t\tthis.state.currentFontSize ) ||\n\t\t\t\tnextState.currentFontSize !== this.state.currentFontSize ||\n\t\t\t\tnextProps?.style?.lineHeight !== this.props?.style?.lineHeight\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tcomponentDidMount() {\n\t\t// Request focus if wrapping block is selected and parent hasn't inhibited the focus request. This method of focusing\n\t\t// is trying to implement the web-side counterpart of BlockList's `focusTabbable` where the BlockList is focusing an\n\t\t// inputbox by searching the DOM. We don't have the DOM in RN so, using the combination of blockIsSelected and __unstableMobileNoFocusOnMount\n\t\t// to determine if we should focus the RichText.\n\t\tif (\n\t\t\tthis.props.blockIsSelected &&\n\t\t\t! this.props.__unstableMobileNoFocusOnMount\n\t\t) {\n\t\t\tthis._editor.focus();\n\t\t\tthis.onSelectionChange(\n\t\t\t\tthis.props.selectionStart || 0,\n\t\t\t\tthis.props.selectionEnd || 0\n\t\t\t);\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { style, tagName } = this.props;\n\t\tconst { currentFontSize } = this.state;\n\n\t\tif ( this.props.value?.toString() !== this.value?.toString() ) {\n\t\t\tthis.value = this.props.value;\n\t\t}\n\t\tconst { __unstableIsSelected: prevIsSelected } = prevProps;\n\t\tconst { __unstableIsSelected: isSelected } = this.props;\n\n\t\tif ( isSelected && ! prevIsSelected ) {\n\t\t\tthis._editor.focus();\n\t\t\t// Update selection props explicitly when component is selected as Aztec won't call onSelectionChange\n\t\t\t// if its internal value hasn't change. When created, default value is 0, 0.\n\t\t\tthis.onSelectionChange(\n\t\t\t\tthis.props.selectionStart || 0,\n\t\t\t\tthis.props.selectionEnd || 0\n\t\t\t);\n\t\t} else if ( this.shouldFocusTextInputAfterMerge( prevProps ) ) {\n\t\t\t// Since this is happening when merging blocks, the selection should be at the last character position.\n\t\t\t// As a fallback the internal selectionEnd value is used.\n\t\t\tconst lastCharacterPosition =\n\t\t\t\tthis.value?.toString().length ?? this.selectionEnd;\n\t\t\tthis._editor.focus();\n\t\t\tthis.props.onSelectionChange(\n\t\t\t\tlastCharacterPosition,\n\t\t\t\tlastCharacterPosition\n\t\t\t);\n\t\t} else if ( ! isSelected && prevIsSelected ) {\n\t\t\tthis._editor.blur();\n\t\t}\n\n\t\t// For font size values changes from the font size picker\n\t\t// we compare previous values to refresh the selected font size,\n\t\t// this is also used when the tag name changes\n\t\t// e.g Heading block and a level change like h1->h2.\n\t\tconst currentFontSizeStyle = this.getParsedFontSize( style?.fontSize );\n\t\tconst prevFontSizeStyle = this.getParsedFontSize(\n\t\t\tprevProps?.style?.fontSize\n\t\t);\n\t\tconst isDifferentTag = prevProps.tagName !== tagName;\n\t\tif (\n\t\t\t( currentFontSize &&\n\t\t\t\t( currentFontSizeStyle || prevFontSizeStyle ) &&\n\t\t\t\tcurrentFontSizeStyle !== currentFontSize ) ||\n\t\t\tisDifferentTag\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tcurrentFontSize: this.getFontSize( this.props ),\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetHtmlToRender( record, tagName ) {\n\t\t// Save back to HTML from React tree.\n\t\tlet value = this.valueToFormat( record );\n\n\t\tif ( value === undefined ) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tvalue = '';\n\t\t}\n\t\t// On android if content is empty we need to send no content or else the placeholder will not show.\n\t\tif (\n\t\t\t! this.isIOS &&\n\t\t\t( value?.toString() === '' ||\n\t\t\t\tvalue?.toString() === EMPTY_PARAGRAPH_TAGS )\n\t\t) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( tagName ) {\n\t\t\tlet extraAttributes = ``;\n\t\t\tif ( tagName === `ol` ) {\n\t\t\t\tif ( this.props.reversed ) {\n\t\t\t\t\textraAttributes += ` reversed`;\n\t\t\t\t}\n\t\t\t\tif ( this.props.start ) {\n\t\t\t\t\textraAttributes += ` start=${ this.props.start }`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = `<${ tagName }${ extraAttributes }>${ value }</${ tagName }>`;\n\t\t}\n\t\treturn value;\n\t}\n\n\tgetEditableProps() {\n\t\treturn {\n\t\t\t// Overridable props.\n\t\t\tstyle: {},\n\t\t\tclassName: 'rich-text',\n\t\t\tonKeyDown: () => null,\n\t\t};\n\t}\n\n\tgetParsedFontSize( fontSize ) {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst cssUnitOptions = { height, width, fontSize: DEFAULT_FONT_SIZE };\n\n\t\tif ( ! fontSize ) {\n\t\t\treturn fontSize;\n\t\t}\n\n\t\tconst selectedPxValue =\n\t\t\tgetPxFromCssUnit( fontSize, cssUnitOptions ) ?? DEFAULT_FONT_SIZE;\n\n\t\treturn parseFloat( selectedPxValue );\n\t}\n\n\tgetFontSize( props ) {\n\t\tconst { baseGlobalStyles, tagName, fontSize, style } = props;\n\t\tconst tagNameFontSize =\n\t\t\tbaseGlobalStyles?.elements?.[ tagName ]?.typography?.fontSize;\n\n\t\tlet newFontSize = DEFAULT_FONT_SIZE;\n\n\t\t// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.\n\t\tif ( tagName === 'pre' && ! this.isIOS ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// For block-based themes, get the default editor font size.\n\t\tif ( baseGlobalStyles?.typography?.fontSize && tagName === 'p' ) {\n\t\t\tnewFontSize = baseGlobalStyles?.typography?.fontSize;\n\t\t}\n\n\t\t// For block-based themes, get the default element font size\n\t\t// e.g h1, h2.\n\t\tif ( tagNameFontSize ) {\n\t\t\tnewFontSize = tagNameFontSize;\n\t\t}\n\n\t\t// For font size values provided from the styles,\n\t\t// usually from values set from the font size picker.\n\t\tif ( style?.fontSize ) {\n\t\t\tnewFontSize = style.fontSize;\n\t\t}\n\n\t\t// Fall-back to a font size provided from its props (if there's any)\n\t\t// and there are no other default values to use.\n\t\tif ( fontSize && ! tagNameFontSize && ! style?.fontSize ) {\n\t\t\tnewFontSize = fontSize;\n\t\t}\n\n\t\t// We need to always convert to px units because the selected value\n\t\t// could be coming from the web where it could be stored as a different unit.\n\t\tconst selectedPxValue = this.getParsedFontSize( newFontSize );\n\n\t\treturn selectedPxValue;\n\t}\n\n\tgetLineHeight() {\n\t\tconst { baseGlobalStyles, tagName, lineHeight, style } = this.props;\n\t\tconst tagNameLineHeight =\n\t\t\tbaseGlobalStyles?.elements?.[ tagName ]?.typography?.lineHeight;\n\t\tlet newLineHeight;\n\n\t\t// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.\n\t\tif ( tagName === 'pre' && ! this.isIOS ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( ! this.getIsBlockBasedTheme() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// For block-based themes, get the default editor line height.\n\t\tif ( baseGlobalStyles?.typography?.lineHeight && tagName === 'p' ) {\n\t\t\tnewLineHeight = parseFloat(\n\t\t\t\tbaseGlobalStyles?.typography?.lineHeight\n\t\t\t);\n\t\t}\n\n\t\t// For block-based themes, get the default element line height\n\t\t// e.g h1, h2.\n\t\tif ( tagNameLineHeight ) {\n\t\t\tnewLineHeight = parseFloat( tagNameLineHeight );\n\t\t}\n\n\t\t// For line height values provided from the styles,\n\t\t// usually from values set from the line height picker.\n\t\tif ( style?.lineHeight ) {\n\t\t\tnewLineHeight = parseFloat( style.lineHeight );\n\t\t}\n\n\t\t// Fall-back to a line height provided from its props (if there's any)\n\t\t// and there are no other default values to use.\n\t\tif ( lineHeight && ! tagNameLineHeight && ! style?.lineHeight ) {\n\t\t\tnewLineHeight = lineHeight;\n\t\t}\n\n\t\t// Check the final value is not over the minimum supported value.\n\t\tif ( newLineHeight && newLineHeight < MIN_LINE_HEIGHT ) {\n\t\t\tnewLineHeight = MIN_LINE_HEIGHT;\n\t\t}\n\n\t\t// Until we parse CSS values correctly, avoid passing NaN values to Aztec\n\t\tif ( isNaN( newLineHeight ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn newLineHeight;\n\t}\n\n\tgetIsBlockBasedTheme() {\n\t\tconst { baseGlobalStyles } = this.props;\n\n\t\treturn (\n\t\t\tbaseGlobalStyles && Object.entries( baseGlobalStyles ).length !== 0\n\t\t);\n\t}\n\n\tgetBlockUseDefaultFont() {\n\t\t// For block-based themes it enables using the defaultFont\n\t\t// in Aztec for iOS so it allows customizing the font size\n\t\t// for the Preformatted/Code and Heading blocks.\n\t\tif ( ! this.isIOS ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tagName } = this.props;\n\t\tconst isBlockBasedTheme = this.getIsBlockBasedTheme();\n\t\tconst tagsToMatch = /pre|h([1-6])$/gm;\n\n\t\treturn isBlockBasedTheme && tagsToMatch.test( tagName );\n\t}\n\n\tgetLinkTextColor( defaultColor ) {\n\t\tconst { style } = this.props;\n\t\tconst customColor = style?.linkColor && colord( style.linkColor );\n\n\t\treturn customColor && customColor.isValid()\n\t\t\t? customColor.toHex()\n\t\t\t: defaultColor;\n\t}\n\n\tgetPlaceholderTextColor() {\n\t\tconst {\n\t\t\tbaseGlobalStyles,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tplaceholderTextColor,\n\t\t\tstyle,\n\t\t} = this.props;\n\n\t\t// Default placeholder text color.\n\t\tconst placeholderStyle = getStylesFromColorScheme(\n\t\t\tstyles.richTextPlaceholder,\n\t\t\tstyles.richTextPlaceholderDark\n\t\t);\n\t\tconst { color: defaultPlaceholderTextColor } = placeholderStyle;\n\t\t// Custom 63% opacity for theme and inherited colors.\n\t\tconst placeholderOpacity = 'A1';\n\n\t\t// Determine inherited placeholder color if available.\n\t\tconst inheritPlaceholderColor = style?.placeholderColor\n\t\t\t? `${ style.placeholderColor }${ placeholderOpacity }`\n\t\t\t: undefined;\n\n\t\t// If using block-based themes, derive the placeholder color from global styles.\n\t\tconst globalStylesPlaceholderColor = baseGlobalStyles?.color?.text\n\t\t\t? `${ baseGlobalStyles.color.text }${ placeholderOpacity }`\n\t\t\t: undefined;\n\n\t\treturn (\n\t\t\tinheritPlaceholderColor ??\n\t\t\tplaceholderTextColor ??\n\t\t\tglobalStylesPlaceholderColor ??\n\t\t\tdefaultPlaceholderTextColor\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttagName,\n\t\t\tstyle,\n\t\t\t__unstableIsSelected: isSelected,\n\t\t\tchildren,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tminWidth,\n\t\t\tmaxWidth,\n\t\t\tformatTypes,\n\t\t\tparentBlockStyles,\n\t\t\taccessibilityLabel,\n\t\t\tdisableEditingMenu = false,\n\t\t\tbaseGlobalStyles,\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t\tdisableSuggestions,\n\t\t\tcontainerWidth,\n\t\t} = this.props;\n\t\tconst { currentFontSize } = this.state;\n\n\t\tconst record = this.getRecord();\n\t\tconst html = this.getHtmlToRender( record, tagName );\n\t\tconst editableProps = this.getEditableProps();\n\t\tconst blockUseDefaultFont = this.getBlockUseDefaultFont();\n\n\t\tconst fontSize = currentFontSize;\n\t\tconst lineHeight = this.getLineHeight();\n\n\t\tconst {\n\t\t\tcolor: defaultColor,\n\t\t\ttextDecorationColor: defaultTextDecorationColor,\n\t\t\tfontFamily: defaultFontFamily,\n\t\t} = getStylesFromColorScheme( styles.richText, styles.richTextDark );\n\t\tconst linkTextColor = this.getLinkTextColor(\n\t\t\tdefaultTextDecorationColor\n\t\t);\n\n\t\tconst currentSelectionStart = selectionStart ?? 0;\n\t\tconst currentSelectionEnd = selectionEnd ?? 0;\n\t\tlet selection = null;\n\t\tif ( this.needsSelectionUpdate ) {\n\t\t\tthis.needsSelectionUpdate = false;\n\t\t\tselection = {\n\t\t\t\tstart: currentSelectionStart,\n\t\t\t\tend: currentSelectionEnd,\n\t\t\t};\n\n\t\t\t// On AztecAndroid, setting the caret to an out-of-bounds position will crash the editor so, let's check for some cases.\n\t\t\tif ( ! this.isIOS ) {\n\t\t\t\t// The following regular expression is used in Aztec here:\n\t\t\t\t// https://github.com/wordpress-mobile/AztecEditor-Android/blob/b1fad439d56fa6d4aa0b78526fef355c59d00dd3/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt#L656\n\t\t\t\tconst brBeforeParaMatches = html.match( /(<br>)+<\\/p>$/g );\n\t\t\t\tif ( brBeforeParaMatches ) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t'Oops, BR tag(s) at the end of content. Aztec will remove them, adapting the selection...'\n\t\t\t\t\t);\n\t\t\t\t\tconst count = (\n\t\t\t\t\t\tbrBeforeParaMatches[ 0 ].match( /br/g ) || []\n\t\t\t\t\t).length;\n\t\t\t\t\tif ( count > 0 ) {\n\t\t\t\t\t\tlet newSelectionStart = currentSelectionStart - count;\n\t\t\t\t\t\tif ( newSelectionStart < 0 ) {\n\t\t\t\t\t\t\tnewSelectionStart = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet newSelectionEnd = currentSelectionEnd - count;\n\t\t\t\t\t\tif ( newSelectionEnd < 0 ) {\n\t\t\t\t\t\t\tnewSelectionEnd = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselection = {\n\t\t\t\t\t\t\tstart: newSelectionStart,\n\t\t\t\t\t\t\tend: newSelectionEnd,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.comesFromAztec ) {\n\t\t\tthis.comesFromAztec = false;\n\t\t\tthis.firedAfterTextChanged = false;\n\t\t}\n\n\t\t// Logic below assures that `RichText` width will always have equal value when container is almost fully filled.\n\t\tconst width =\n\t\t\tmaxWidth && this.state.width && maxWidth - this.state.width < 10\n\t\t\t\t? maxWidth\n\t\t\t\t: this.state.width;\n\t\tconst containerStyles = [\n\t\t\tstyle?.padding &&\n\t\t\t\tstyle?.backgroundColor && {\n\t\t\t\t\tpadding: style.padding,\n\t\t\t\t\tbackgroundColor: style.backgroundColor,\n\t\t\t\t},\n\t\t\tcontainerWidth && {\n\t\t\t\twidth: containerWidth,\n\t\t\t},\n\t\t];\n\n\t\tconst defaultSelectionColor = getStylesFromColorScheme(\n\t\t\tstyles[ 'rich-text-selection' ],\n\t\t\tstyles[ 'rich-text-selection--dark' ]\n\t\t).color;\n\t\tconst selectionColor = getSelectionColor(\n\t\t\tthis.props.selectionColor,\n\t\t\tdefaultSelectionColor,\n\t\t\tbaseGlobalStyles,\n\t\t\tthis.getIsBlockBasedTheme()\n\t\t);\n\n\t\tconst EditableView = ( props ) => {\n\t\t\tthis.customEditableOnKeyDown = props?.onKeyDown;\n\n\t\t\treturn <></>;\n\t\t};\n\n\t\treturn (\n\t\t\t<View style={ containerStyles }>\n\t\t\t\t{ children &&\n\t\t\t\t\tchildren( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tvalue: record,\n\t\t\t\t\t\tonChange: this.onFormatChange,\n\t\t\t\t\t\tonFocus: () => {},\n\t\t\t\t\t\teditableProps,\n\t\t\t\t\t\teditableTagName: EditableView,\n\t\t\t\t\t} ) }\n\t\t\t\t<RCTAztecView\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis._editor = ref;\n\n\t\t\t\t\t\tif ( this.props.nativeEditorRef ) {\n\t\t\t\t\t\t\tthis.props.nativeEditorRef( ref );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tbackgroundColor: styles.richText.backgroundColor,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t\t...( this.isIOS && minWidth && maxWidth\n\t\t\t\t\t\t\t? { width }\n\t\t\t\t\t\t\t: { maxWidth } ),\n\t\t\t\t\t\tminHeight: this.state.height,\n\t\t\t\t\t} }\n\t\t\t\t\tblockUseDefaultFont={ blockUseDefaultFont }\n\t\t\t\t\ttext={ {\n\t\t\t\t\t\ttext: html,\n\t\t\t\t\t\teventCount: this.lastEventCount,\n\t\t\t\t\t\tselection,\n\t\t\t\t\t\tlinkTextColor,\n\t\t\t\t\t\ttag: tagName,\n\t\t\t\t\t} }\n\t\t\t\t\tplaceholder={ this.props.placeholder }\n\t\t\t\t\tplaceholderTextColor={ this.getPlaceholderTextColor() }\n\t\t\t\t\tdeleteEnter={ this.props.deleteEnter }\n\t\t\t\t\tonChange={ this.onChangeFromAztec }\n\t\t\t\t\tonFocus={ this.onFocus }\n\t\t\t\t\tonBlur={ this.onBlur }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\ttriggerKeyCodes={\n\t\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: this.suggestionOptions().map(\n\t\t\t\t\t\t\t\t\t( op ) => op.triggerChar\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tactiveFormats={ this.getActiveFormatNames( record ) }\n\t\t\t\t\tonContentSizeChange={ this.onContentSizeChange }\n\t\t\t\t\tonSelectionChange={ this.onSelectionChangeFromAztec }\n\t\t\t\t\tblockType={ { tag: tagName } }\n\t\t\t\t\tcolor={\n\t\t\t\t\t\t( style && style.color ) ||\n\t\t\t\t\t\t( parentBlockStyles && parentBlockStyles.color ) ||\n\t\t\t\t\t\t( baseGlobalStyles && baseGlobalStyles?.color?.text ) ||\n\t\t\t\t\t\tdefaultColor\n\t\t\t\t\t}\n\t\t\t\t\tmaxImagesWidth={ 200 }\n\t\t\t\t\tfontFamily={ this.props.fontFamily || defaultFontFamily }\n\t\t\t\t\tfontSize={ fontSize }\n\t\t\t\t\tlineHeight={ lineHeight }\n\t\t\t\t\tfontWeight={ this.props.fontWeight }\n\t\t\t\t\tfontStyle={ this.props.fontStyle }\n\t\t\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\t\t\tisMultiline={ false }\n\t\t\t\t\ttextAlign={ this.props.textAlign }\n\t\t\t\t\t{ ...( this.isIOS ? { maxWidth } : {} ) }\n\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\tid={ this.props.id }\n\t\t\t\t\tselectionColor={ selectionColor }\n\t\t\t\t\tdisableAutocorrection={ this.props.disableAutocorrection }\n\t\t\t\t/>\n\t\t\t\t{ isSelected && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\tforwardedRef={ this._editor }\n\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\tvalue={ record }\n\t\t\t\t\t\t\tonChange={ this.onFormatChange }\n\t\t\t\t\t\t\tonFocus={ () => {} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! disableSuggestions && (\n\t\t\t\t\t\t\t<BlockFormatControls>\n\t\t\t\t\t\t\t\t<ToolbarButtonWithOptions\n\t\t\t\t\t\t\t\t\toptions={ this.suggestionOptions() }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</BlockFormatControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nRichText.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n\ttagName: 'div',\n};\n\nconst withFormatTypes = ( WrappedComponent ) => ( props ) => {\n\tconst {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats,\n\t} = props;\n\tconst { formatTypes } = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats,\n\t} );\n\n\treturn <WrappedComponent { ...props } formatTypes={ formatTypes } />;\n};\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlockParents, getBlock, getSettings } =\n\t\t\tselect( 'core/block-editor' );\n\t\tconst parents = getBlockParents( clientId, true );\n\t\tconst parentBlock = parents ? getBlock( parents[ 0 ] ) : undefined;\n\t\tconst parentBlockStyles = parentBlock?.attributes?.childrenStyles;\n\n\t\tconst settings = getSettings();\n\t\tconst baseGlobalStyles = settings?.__experimentalGlobalStylesBaseStyles;\n\n\t\tconst colorPalettes = settings?.__experimentalFeatures?.color?.palette;\n\t\tconst colorPalette = colorPalettes\n\t\t\t? flatColorPalettes( colorPalettes )\n\t\t\t: settings?.colors;\n\n\t\treturn {\n\t\t\tareMentionsSupported: settings?.capabilities?.mentions === true,\n\t\t\tareXPostsSupported: settings?.capabilities?.xposts === true,\n\t\t\tparentBlockStyles,\n\t\t\tbaseGlobalStyles,\n\t\t\tcolorPalette,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n\twithFormatTypes,\n] )( RichText );\n"],"mappings":";;;;;;;;AAKA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAIA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,SAAA,GAAAb,OAAA;AACA,IAAAc,IAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,KAAA,GAAAhB,OAAA;AACA,IAAAiB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,QAAA,GAAAT,OAAA,CAAA7U,OAAA,GAEa,IAAAuV,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAER;AAAS,CAAC,KAAM;EACvC,MAAM;IAAES,eAAe;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAC/CH,MAAM,CAAE,mBAAoB,CAAC;EAC9B,MAAMI,OAAO,GAAGH,eAAe,CAAET,QAAQ,EAAE,IAAK,CAAC;EACjD,MAAMa,WAAW,GAAGD,OAAO,GAAGF,QAAQ,CAAEE,OAAO,CAAE,CAAC,CAAG,CAAC,GAAG7P,SAAS;EAClE,MAAM4L,iBAAiB,GAAGkE,WAAW,EAAEnK,UAAU,EAAEoK,cAAc;EAEjE,MAAMC,QAAQ,GAAGJ,WAAW,CAAC,CAAC;EAC9B,MAAMxV,gBAAgB,GAAG4V,QAAQ,EAAEC,oCAAoC;EAEvE,MAAMC,aAAa,GAAGF,QAAQ,EAAEG,sBAAsB,EAAEzV,KAAK,EAAE0V,OAAO;EACtE,MAAM3R,YAAY,GAAGyR,aAAa,GAC/BvW,iBAAiB,CAAEuW,aAAc,CAAC,GAClCF,QAAQ,EAAEK,MAAM;EAEnB,OAAO;IACNpM,oBAAoB,EAAE+L,QAAQ,EAAEM,YAAY,EAAEC,QAAQ,KAAK,IAAI;IAC/DrM,kBAAkB,EAAE8L,QAAQ,EAAEM,YAAY,EAAEE,MAAM,KAAK,IAAI;IAC3D5E,iBAAiB;IACjBxR,gBAAgB;IAChBqE;EACD,CAAC;AACF,CAAE,CAAC,EACHgS,iCAAwB,EACxB1B,eAAe,CACd,CAAC,CAAE5T,QAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_memize","_interopRequireDefault","_colord","_reactNativeAztec","_reactNativeBridge","_blockEditor","_components","_element","_compose","_data","_blocks","_htmlEntities","_keycodes","_url","_icons","_i18n","_richText","_useFormatTypes","_formatEdit","_getFormatColors","_style","_toolbarButtonWithOptions","flatColorPalettes","memize","colorsPalettes","theme","custom","default","getSelectionColor","currentSelectionColor","defaultSelectionColor","baseGlobalStyles","isBlockBasedTheme","selectionColor","colordTextColor","colord","colordBackgroundColor","color","background","isColordTextReadable","isReadable","text","gutenbergFormatNamesToAztec","EMPTY_PARAGRAPH_TAGS","DEFAULT_FONT_SIZE","MIN_LINE_HEIGHT","RichText","Component","constructor","value","selectionStart","selectionEnd","arguments","isIOS","Platform","OS","createRecord","bind","onChangeFromAztec","onKeyDown","handleEnter","handleDelete","onPaste","onFocus","onBlur","onTextUpdate","onContentSizeChange","onFormatChange","formatToValue","maxSize","debounceCreateUndoLevel","debounce","onCreateUndoLevel","onSelectionChange","onSelectionChangeFromAztec","valueToFormat","getHtmlToRender","handleSuggestionFunc","handleUserSuggestion","showUserSuggestions","handleXpostSuggestion","showXpostSuggestions","suggestionOptions","insertString","manipulateEventCounterToForceNativeToRefresh","shouldDropEventFromAztec","state","activeFormats","selectedFormat","height","currentFontSize","getFontSize","needsSelectionUpdate","savedContent","isTouched","lastAztecEventType","lastHistoryValue","getRecord","start","end","colorPalette","props","currentValue","formats","replacements","newFormats","getFormatColors","preserveWhiteSpace","create","html","range","Math","min","length","removeRootTagsProducedByAztec","toHTMLString","getActiveFormatNames","record","formatTypes","map","name","filter","getActiveFormat","undefined","Boolean","changeHandlers","Object","fromEntries","entries","key","startsWith","values","forEach","changeHandler","onChange","setState","string","toInsert","insert","__unstableOnCreateUndoLevel","toString","result","removeRootTag","tagName","tagsToEliminate","element","removeTag","tag","openingTagRegexp","RegExp","closingTagRegexp","replace","event","contentWithoutRootTag","nativeEvent","lastEventCount","eventCount","comesFromAztec","firedAfterTextChanged","refresh","contentSize","defaultPrevented","customEditableOnKeyDown","preventDefault","RCTAztecView","KeyCodes","keyCode","handleTriggerKeyCodes","ENTER","onEnter","shiftKey","DELETE","BACKSPACE","isReverse","onDelete","newValue","remove","isCollapsed","triggeredOption","find","option","triggeredKeyCode","triggerChar","charCodeAt","getTextContent","useTrigger","charAt","onClick","areMentionsSupported","areXPostsSupported","allOptions","supported","title","__","label","icon","atSymbol","plus","op","suggestionFunction","prefix","then","suggestion","catch","pastedText","pastedHtml","files","currentRecord","trimmedText","trim","isURL","linkedRecord","applyFormat","type","attributes","href","decodeEntities","window","console","log","plainText","unstableOnFocus","hasChanged","isManual","getActiveFormats","logText","shouldDrop","shouldFocusTextInputAfterMerge","prevProps","__unstableIsSelected","isSelected","blockIsSelected","__unstableMobileNoFocusOnMount","prevIsSelected","prevBlockIsSelected","noSelectionValues","textInputWasNotFocused","realStart","realEnd","max","isEmpty","Array","isArray","childrenBlock","toHTML","format","shouldComponentUpdate","nextProps","nextState","reversed","fontSize","style","lineHeight","componentDidMount","_editor","focus","componentDidUpdate","_this$value$toString$","lastCharacterPosition","blur","currentFontSizeStyle","getParsedFontSize","prevFontSizeStyle","isDifferentTag","componentWillUnmount","clearCurrentSelectionOnUnmount","isFocused","extraAttributes","getEditableProps","className","_getPxFromCssUnit","width","Dimensions","get","cssUnitOptions","selectedPxValue","getPxFromCssUnit","parseFloat","tagNameFontSize","elements","typography","newFontSize","getLineHeight","tagNameLineHeight","newLineHeight","getIsBlockBasedTheme","isNaN","getBlockUseDefaultFont","tagsToMatch","test","getLinkTextColor","defaultColor","customColor","linkColor","isValid","toHex","getPlaceholderTextColor","_ref","_ref2","getStylesFromColorScheme","placeholderTextColor","placeholderStyle","styles","richTextPlaceholder","richTextPlaceholderDark","defaultPlaceholderTextColor","placeholderOpacity","inheritPlaceholderColor","placeholderColor","globalStylesPlaceholderColor","render","children","minWidth","maxWidth","parentBlockStyles","accessibilityLabel","disableEditingMenu","disableSuggestions","containerWidth","editableProps","blockUseDefaultFont","textDecorationColor","defaultTextDecorationColor","fontFamily","defaultFontFamily","richText","richTextDark","linkTextColor","currentSelectionStart","currentSelectionEnd","selection","brBeforeParaMatches","match","warn","count","newSelectionStart","newSelectionEnd","containerStyles","padding","backgroundColor","EditableView","_react","createElement","Fragment","View","editableTagName","ref","nativeEditorRef","minHeight","placeholder","deleteEnter","triggerKeyCodes","blockType","maxImagesWidth","fontWeight","fontStyle","isMultiline","textAlign","id","disableAutocorrection","forwardedRef","BlockFormatControls","options","exports","defaultProps","withFormatTypes","WrappedComponent","clientId","identifier","withoutInteractiveFormatting","allowedFormats","useFormatTypes","_default","compose","withSelect","select","getBlockParents","getBlock","getSettings","parents","parentBlock","childrenStyles","settings","__experimentalGlobalStylesBaseStyles","colorPalettes","__experimentalFeatures","palette","colors","capabilities","mentions","xposts","withPreferredColorScheme"],"sources":["@wordpress/block-editor/src/components/rich-text/native/index.native.js"],"sourcesContent":["/* eslint no-console: [\"error\", { allow: [\"warn\"] }] */\n\n/**\n * External dependencies\n */\nimport { View, Platform, Dimensions } from 'react-native';\nimport memize from 'memize';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport RCTAztecView from '@wordpress/react-native-aztec';\nimport {\n\tshowUserSuggestions,\n\tshowXpostSuggestions,\n} from '@wordpress/react-native-bridge';\nimport { BlockFormatControls } from '@wordpress/block-editor';\nimport { getPxFromCssUnit } from '@wordpress/components';\nimport { Component } from '@wordpress/element';\nimport {\n\tcompose,\n\tdebounce,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { childrenBlock } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { BACKSPACE, DELETE, ENTER } from '@wordpress/keycodes';\nimport { isURL } from '@wordpress/url';\nimport { atSymbol, plus } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tapplyFormat,\n\tgetActiveFormat,\n\tgetActiveFormats,\n\tinsert,\n\tgetTextContent,\n\tisEmpty,\n\tcreate,\n\ttoHTMLString,\n\tisCollapsed,\n\tremove,\n} from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { useFormatTypes } from './use-format-types';\nimport FormatEdit from './format-edit';\nimport { getFormatColors } from './get-format-colors';\nimport styles from './style.scss';\nimport ToolbarButtonWithOptions from './toolbar-button-with-options';\n\n// The flattened color palettes array is memoized to ensure that the same array instance is\n// returned for the colors palettes. This value might be used as a prop, so having the same\n// instance will prevent unnecessary re-renders of the RichText component.\nconst flatColorPalettes = memize( ( colorsPalettes ) => [\n\t...( colorsPalettes?.theme || [] ),\n\t...( colorsPalettes?.custom || [] ),\n\t...( colorsPalettes?.default || [] ),\n] );\n\nconst getSelectionColor = memize(\n\t(\n\t\tcurrentSelectionColor,\n\t\tdefaultSelectionColor,\n\t\tbaseGlobalStyles,\n\t\tisBlockBasedTheme\n\t) => {\n\t\tlet selectionColor = defaultSelectionColor;\n\t\tif ( currentSelectionColor ) {\n\t\t\tselectionColor = currentSelectionColor;\n\t\t}\n\n\t\tif ( isBlockBasedTheme ) {\n\t\t\tconst colordTextColor = colord( selectionColor );\n\t\t\tconst colordBackgroundColor = colord(\n\t\t\t\tbaseGlobalStyles?.color?.background\n\t\t\t);\n\t\t\tconst isColordTextReadable = colordTextColor.isReadable(\n\t\t\t\tcolordBackgroundColor\n\t\t\t);\n\t\t\tif ( ! isColordTextReadable ) {\n\t\t\t\tselectionColor = baseGlobalStyles?.color?.text;\n\t\t\t}\n\t\t}\n\n\t\treturn selectionColor;\n\t}\n);\n\nconst gutenbergFormatNamesToAztec = {\n\t'core/bold': 'bold',\n\t'core/italic': 'italic',\n\t'core/strikethrough': 'strikethrough',\n\t'core/text-color': 'mark',\n};\n\nconst EMPTY_PARAGRAPH_TAGS = '<p></p>';\nconst DEFAULT_FONT_SIZE = 16;\nconst MIN_LINE_HEIGHT = 1;\n\nexport class RichText extends Component {\n\tconstructor( { value, selectionStart, selectionEnd } ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.createRecord = this.createRecord.bind( this );\n\t\tthis.onChangeFromAztec = this.onChangeFromAztec.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.handleEnter = this.handleEnter.bind( this );\n\t\tthis.handleDelete = this.handleDelete.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onBlur = this.onBlur.bind( this );\n\t\tthis.onTextUpdate = this.onTextUpdate.bind( this );\n\t\tthis.onContentSizeChange = this.onContentSizeChange.bind( this );\n\t\tthis.onFormatChange = this.onFormatChange.bind( this );\n\t\tthis.formatToValue = memize( this.formatToValue.bind( this ), {\n\t\t\tmaxSize: 1,\n\t\t} );\n\t\tthis.debounceCreateUndoLevel = debounce( this.onCreateUndoLevel, 1000 );\n\t\t// This prevents a bug in Aztec which triggers onSelectionChange twice on format change.\n\t\tthis.onSelectionChange = this.onSelectionChange.bind( this );\n\t\tthis.onSelectionChangeFromAztec =\n\t\t\tthis.onSelectionChangeFromAztec.bind( this );\n\t\tthis.valueToFormat = this.valueToFormat.bind( this );\n\t\tthis.getHtmlToRender = this.getHtmlToRender.bind( this );\n\t\tthis.handleSuggestionFunc = this.handleSuggestionFunc.bind( this );\n\t\tthis.handleUserSuggestion = this.handleSuggestionFunc(\n\t\t\tshowUserSuggestions,\n\t\t\t'@'\n\t\t).bind( this );\n\t\tthis.handleXpostSuggestion = this.handleSuggestionFunc(\n\t\t\tshowXpostSuggestions,\n\t\t\t'+'\n\t\t).bind( this );\n\t\tthis.suggestionOptions = this.suggestionOptions.bind( this );\n\t\tthis.insertString = this.insertString.bind( this );\n\t\tthis.manipulateEventCounterToForceNativeToRefresh =\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh.bind( this );\n\t\tthis.shouldDropEventFromAztec =\n\t\t\tthis.shouldDropEventFromAztec.bind( this );\n\t\tthis.state = {\n\t\t\tactiveFormats: [],\n\t\t\tselectedFormat: null,\n\t\t\theight: 0,\n\t\t\tcurrentFontSize: this.getFontSize( arguments[ 0 ] ),\n\t\t};\n\t\tthis.needsSelectionUpdate = false;\n\t\tthis.savedContent = '';\n\t\tthis.isTouched = false;\n\t\tthis.lastAztecEventType = null;\n\n\t\tthis.lastHistoryValue = value;\n\n\t\t// Internal values that are update synchronously, unlike props.\n\t\tthis.value = value;\n\t\tthis.selectionStart = selectionStart;\n\t\tthis.selectionEnd = selectionEnd;\n\t}\n\n\t/**\n\t * Get the current record (value and selection) from props and state.\n\t *\n\t * @return {Object} The current record (value and selection).\n\t */\n\tgetRecord() {\n\t\tconst {\n\t\t\tselectionStart: start,\n\t\t\tselectionEnd: end,\n\t\t\tcolorPalette,\n\t\t} = this.props;\n\t\tconst { value } = this.props;\n\t\tconst currentValue = this.formatToValue( value );\n\n\t\tconst { formats, replacements, text } = currentValue;\n\t\tconst { activeFormats } = this.state;\n\t\tconst newFormats = getFormatColors( formats, colorPalette );\n\n\t\treturn {\n\t\t\tformats: newFormats,\n\t\t\treplacements,\n\t\t\ttext,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tactiveFormats,\n\t\t};\n\t}\n\n\t/**\n\t * Creates a RichText value \"record\" from the current content and selection\n\t * information\n\t *\n\t *\n\t * @return {Object} A RichText value with formats and selection.\n\t */\n\tcreateRecord() {\n\t\tconst { preserveWhiteSpace } = this.props;\n\t\tconst value = {\n\t\t\tstart: this.selectionStart,\n\t\t\tend: this.selectionEnd,\n\t\t\t...create( {\n\t\t\t\thtml: this.value,\n\t\t\t\trange: null,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} ),\n\t\t};\n\t\tconst start = Math.min( this.selectionStart, value.text.length );\n\t\tconst end = Math.min( this.selectionEnd, value.text.length );\n\t\treturn { ...value, start, end };\n\t}\n\n\tvalueToFormat( value ) {\n\t\t// Remove the outer root tags.\n\t\treturn this.removeRootTagsProducedByAztec( toHTMLString( { value } ) );\n\t}\n\n\tgetActiveFormatNames( record ) {\n\t\tconst { formatTypes } = this.props;\n\n\t\treturn formatTypes\n\t\t\t.map( ( { name } ) => name )\n\t\t\t.filter( ( name ) => {\n\t\t\t\treturn getActiveFormat( record, name ) !== undefined;\n\t\t\t} )\n\t\t\t.map( ( name ) => gutenbergFormatNamesToAztec[ name ] )\n\t\t\t.filter( Boolean );\n\t}\n\n\tonFormatChange( record ) {\n\t\tconst { start = 0, end = 0, activeFormats = [] } = record;\n\t\tconst changeHandlers = Object.fromEntries(\n\t\t\tObject.entries( this.props ).filter( ( [ key ] ) =>\n\t\t\t\tkey.startsWith( 'format_on_change_functions_' )\n\t\t\t)\n\t\t);\n\n\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\tchangeHandler( record.formats, record.text );\n\t\t} );\n\n\t\tthis.value = this.valueToFormat( record );\n\t\tthis.props.onChange( this.value );\n\t\tthis.setState( { activeFormats } );\n\t\tthis.props.onSelectionChange( start, end );\n\t\tthis.selectionStart = start;\n\t\tthis.selectionEnd = end;\n\n\t\tthis.onCreateUndoLevel();\n\n\t\tthis.lastAztecEventType = 'format change';\n\t}\n\n\tinsertString( record, string ) {\n\t\tif ( record && string ) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tconst toInsert = insert( record, string );\n\t\t\tthis.onFormatChange( toInsert );\n\t\t}\n\t}\n\n\tonCreateUndoLevel() {\n\t\tconst { __unstableOnCreateUndoLevel: onCreateUndoLevel } = this.props;\n\t\t// If the content is the same, no level needs to be created.\n\t\tif ( this.lastHistoryValue?.toString() === this.value?.toString() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonCreateUndoLevel();\n\t\tthis.lastHistoryValue = this.value;\n\t}\n\n\t/*\n\t * Cleans up any root tags produced by aztec.\n\t * TODO: This should be removed on a later version when aztec doesn't return the top tag of the text being edited\n\t */\n\tremoveRootTagsProducedByAztec( html ) {\n\t\tlet result = this.removeRootTag( this.props.tagName, html );\n\n\t\tif ( this.props.tagsToEliminate ) {\n\t\t\tthis.props.tagsToEliminate.forEach( ( element ) => {\n\t\t\t\tresult = this.removeTag( element, result );\n\t\t\t} );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tremoveRootTag( tag, html ) {\n\t\tconst openingTagRegexp = RegExp( '^<' + tag + '[^>]*>', 'gim' );\n\t\tconst closingTagRegexp = RegExp( '</' + tag + '>$', 'gim' );\n\n\t\treturn html\n\t\t\t.replace( openingTagRegexp, '' )\n\t\t\t.replace( closingTagRegexp, '' );\n\t}\n\n\tremoveTag( tag, html ) {\n\t\tconst openingTagRegexp = RegExp( '<' + tag + '>', 'gim' );\n\t\tconst closingTagRegexp = RegExp( '</' + tag + '>', 'gim' );\n\t\treturn html\n\t\t\t.replace( openingTagRegexp, '' )\n\t\t\t.replace( closingTagRegexp, '' );\n\t}\n\n\t/*\n\t * Handles any case where the content of the AztecRN instance has changed\n\t */\n\tonChangeFromAztec( event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'onChange' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\t\t// On iOS, onChange can be triggered after selection changes, even though there are no content changes.\n\t\tif ( contentWithoutRootTag === this.value?.toString() ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = true; // The onChange event always fires after the fact.\n\t\tthis.onTextUpdate( event );\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\tonTextUpdate( event ) {\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\n\t\tthis.debounceCreateUndoLevel();\n\t\tconst refresh = this.value?.toString() !== contentWithoutRootTag;\n\t\tthis.value = contentWithoutRootTag;\n\n\t\t// We don't want to refresh if our goal is just to create a record.\n\t\tif ( refresh ) {\n\t\t\tthis.props.onChange( contentWithoutRootTag );\n\t\t}\n\t}\n\n\t/*\n\t * Handles any case where the content of the AztecRN instance has changed in size\n\t */\n\tonContentSizeChange( contentSize ) {\n\t\tthis.setState( contentSize );\n\t\tthis.lastAztecEventType = 'content size change';\n\t}\n\n\tonKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add stubs for conformance in downstream autocompleters logic.\n\t\tthis.customEditableOnKeyDown?.( {\n\t\t\tpreventDefault: () => undefined,\n\t\t\t...event,\n\t\t\tkey: RCTAztecView.KeyCodes[ event?.keyCode ],\n\t\t} );\n\n\t\tthis.handleDelete( event );\n\t\tthis.handleEnter( event );\n\t\tthis.handleTriggerKeyCodes( event );\n\t}\n\n\thandleEnter( event ) {\n\t\tif ( event.keyCode !== ENTER ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { onEnter } = this.props;\n\n\t\tif ( ! onEnter ) {\n\t\t\treturn;\n\t\t}\n\n\t\tonEnter( {\n\t\t\tvalue: this.createRecord(),\n\t\t\tonChange: this.onFormatChange,\n\t\t\tshiftKey: event.shiftKey,\n\t\t} );\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\thandleDelete( event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'handleDelete' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { keyCode } = event;\n\n\t\tif ( keyCode !== DELETE && keyCode !== BACKSPACE ) {\n\t\t\treturn;\n\t\t}\n\t\tconst isReverse = keyCode === BACKSPACE;\n\n\t\tconst { onDelete } = this.props;\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = event.nativeEvent.firedAfterTextChanged;\n\t\tconst value = this.createRecord();\n\t\tconst { start, end, text } = value;\n\t\tlet newValue;\n\n\t\t// Always handle full content deletion ourselves.\n\t\tif ( start === 0 && end !== 0 && end >= text.length ) {\n\t\t\tnewValue = remove( value );\n\t\t\tthis.onFormatChange( newValue );\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\t// Only process delete if the key press occurs at an uncollapsed edge.\n\t\tif (\n\t\t\t! onDelete ||\n\t\t\t! isCollapsed( value ) ||\n\t\t\t( isReverse && start !== 0 ) ||\n\t\t\t( ! isReverse && end !== text.length )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tonDelete( { isReverse, value } );\n\n\t\tevent.preventDefault();\n\t\tthis.lastAztecEventType = 'input';\n\t}\n\n\thandleTriggerKeyCodes( event ) {\n\t\tconst { keyCode } = event;\n\t\tconst triggeredOption = this.suggestionOptions().find( ( option ) => {\n\t\t\tconst triggeredKeyCode = option.triggerChar.charCodeAt( 0 );\n\t\t\treturn triggeredKeyCode === keyCode;\n\t\t} );\n\n\t\tif ( triggeredOption ) {\n\t\t\tconst record = this.getRecord();\n\t\t\tconst text = getTextContent( record );\n\t\t\t// Only respond to the trigger if the selection is on the start of text or line\n\t\t\t// or if the character before is a space.\n\t\t\tconst useTrigger =\n\t\t\t\ttext.length === 0 ||\n\t\t\t\trecord.start === 0 ||\n\t\t\t\ttext.charAt( record.start - 1 ) === '\\n' ||\n\t\t\t\ttext.charAt( record.start - 1 ) === ' ';\n\n\t\t\tif ( useTrigger && triggeredOption.onClick ) {\n\t\t\t\ttriggeredOption.onClick();\n\t\t\t} else {\n\t\t\t\tthis.insertString( record, triggeredOption.triggerChar );\n\t\t\t}\n\t\t}\n\t}\n\n\tsuggestionOptions() {\n\t\tconst { areMentionsSupported, areXPostsSupported } = this.props;\n\t\tconst allOptions = [\n\t\t\t{\n\t\t\t\tsupported: areMentionsSupported,\n\t\t\t\ttitle: __( 'Insert mention' ),\n\t\t\t\tonClick: this.handleUserSuggestion,\n\t\t\t\ttriggerChar: '@',\n\t\t\t\tvalue: 'mention',\n\t\t\t\tlabel: __( 'Mention' ),\n\t\t\t\ticon: atSymbol,\n\t\t\t},\n\t\t\t{\n\t\t\t\tsupported: areXPostsSupported,\n\t\t\t\ttitle: __( 'Insert crosspost' ),\n\t\t\t\tonClick: this.handleXpostSuggestion,\n\t\t\t\ttriggerChar: '+',\n\t\t\t\tvalue: 'crosspost',\n\t\t\t\tlabel: __( 'Crosspost' ),\n\t\t\t\ticon: plus,\n\t\t\t},\n\t\t];\n\t\treturn allOptions.filter( ( op ) => op.supported );\n\t}\n\n\thandleSuggestionFunc( suggestionFunction, prefix ) {\n\t\treturn () => {\n\t\t\tconst record = this.getRecord();\n\t\t\tsuggestionFunction()\n\t\t\t\t.then( ( suggestion ) => {\n\t\t\t\t\tthis.insertString( record, `${ prefix }${ suggestion } ` );\n\t\t\t\t} )\n\t\t\t\t.catch( () => {} );\n\t\t};\n\t}\n\n\t/**\n\t * Handles a paste event from the native Aztec Wrapper.\n\t *\n\t * @param {Object} event The paste event which wraps `nativeEvent`.\n\t */\n\tonPaste( event ) {\n\t\tconst { onPaste, onChange } = this.props;\n\t\tconst { activeFormats = [] } = this.state;\n\n\t\tconst { pastedText, pastedHtml, files } = event.nativeEvent;\n\t\tconst currentRecord = this.createRecord();\n\n\t\tevent.preventDefault();\n\n\t\t// There is a selection, check if a URL is pasted.\n\t\tif ( ! isCollapsed( currentRecord ) ) {\n\t\t\tconst trimmedText = ( pastedHtml || pastedText )\n\t\t\t\t.replace( /<[^>]+>/g, '' )\n\t\t\t\t.trim();\n\n\t\t\t// A URL was pasted, turn the selection into a link.\n\t\t\tif ( isURL( trimmedText ) ) {\n\t\t\t\tconst linkedRecord = applyFormat( currentRecord, {\n\t\t\t\t\ttype: 'a',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\thref: decodeEntities( trimmedText ),\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\tthis.value = this.valueToFormat( linkedRecord );\n\t\t\t\tonChange( this.value );\n\n\t\t\t\t// Allows us to ask for this information when we get a report.\n\t\t\t\twindow.console.log( 'Created link:\\n\\n', trimmedText );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( onPaste ) {\n\t\t\tonPaste( {\n\t\t\t\tvalue: currentRecord,\n\t\t\t\tonChange: this.onFormatChange,\n\t\t\t\thtml: pastedHtml,\n\t\t\t\tplainText: pastedText,\n\t\t\t\tfiles,\n\t\t\t\tactiveFormats,\n\t\t\t} );\n\t\t}\n\t}\n\n\tonFocus() {\n\t\tthis.isTouched = true;\n\n\t\tconst { unstableOnFocus, onSelectionChange } = this.props;\n\n\t\tif ( unstableOnFocus ) {\n\t\t\tunstableOnFocus();\n\t\t}\n\n\t\t// We know for certain that on focus, the old selection is invalid. It\n\t\t// will be recalculated on `selectionchange`.\n\n\t\tonSelectionChange( this.selectionStart, this.selectionEnd );\n\n\t\tthis.lastAztecEventType = 'focus';\n\t}\n\n\tonBlur( event ) {\n\t\tthis.isTouched = false;\n\n\t\t// Check if value is up to date with latest state of native AztecView.\n\t\tif (\n\t\t\tevent.nativeEvent.text &&\n\t\t\tevent.nativeEvent.text !== this.props.value?.toString()\n\t\t) {\n\t\t\tthis.onTextUpdate( event );\n\t\t}\n\n\t\tif ( this.props.onBlur ) {\n\t\t\tthis.props.onBlur( event );\n\t\t}\n\n\t\tthis.lastAztecEventType = 'blur';\n\t}\n\n\tonSelectionChange( start, end ) {\n\t\tconst hasChanged =\n\t\t\tthis.selectionStart !== start || this.selectionEnd !== end;\n\n\t\tthis.selectionStart = start;\n\t\tthis.selectionEnd = end;\n\n\t\t// This is a manual selection change event if onChange was not triggered just before\n\t\t// and we did not just trigger a text update\n\t\t// `onChange` could be the last event and could have been triggered a long time ago so\n\t\t// this approach is not perfectly reliable.\n\t\tconst isManual =\n\t\t\tthis.lastAztecEventType !== 'input' &&\n\t\t\tthis.props.value?.toString() === this.value?.toString();\n\t\tif ( hasChanged && isManual ) {\n\t\t\tconst value = this.createRecord();\n\t\t\tconst activeFormats = getActiveFormats( value );\n\t\t\tthis.setState( { activeFormats } );\n\t\t}\n\n\t\tthis.props.onSelectionChange( start, end );\n\t}\n\n\tshouldDropEventFromAztec( event, logText ) {\n\t\tconst shouldDrop =\n\t\t\t! this.isIOS && event.nativeEvent.eventCount <= this.lastEventCount;\n\t\tif ( shouldDrop ) {\n\t\t\twindow.console.log(\n\t\t\t\t`Dropping ${ logText } from Aztec as its event counter is older than latest sent to the native side. Got ${ event.nativeEvent.eventCount } but lastEventCount is ${ this.lastEventCount }.`\n\t\t\t);\n\t\t}\n\t\treturn shouldDrop;\n\t}\n\n\t/**\n\t * Determines whether the text input should receive focus after an update.\n\t * For cases where a RichText with a value is merged with an empty one.\n\t *\n\t * @param {Object} prevProps - The previous props of the component.\n\t * @return {boolean} True if the text input should receive focus, false otherwise.\n\t */\n\tshouldFocusTextInputAfterMerge( prevProps ) {\n\t\tconst {\n\t\t\t__unstableIsSelected: isSelected,\n\t\t\tblockIsSelected,\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t\t__unstableMobileNoFocusOnMount,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\t__unstableIsSelected: prevIsSelected,\n\t\t\tblockIsSelected: prevBlockIsSelected,\n\t\t} = prevProps;\n\n\t\tconst noSelectionValues =\n\t\t\tselectionStart === undefined && selectionEnd === undefined;\n\t\tconst textInputWasNotFocused = ! prevIsSelected && ! isSelected;\n\n\t\treturn (\n\t\t\t! __unstableMobileNoFocusOnMount &&\n\t\t\tnoSelectionValues &&\n\t\t\ttextInputWasNotFocused &&\n\t\t\t! prevBlockIsSelected &&\n\t\t\tblockIsSelected\n\t\t);\n\t}\n\n\tonSelectionChangeFromAztec( start, end, text, event ) {\n\t\tif ( this.shouldDropEventFromAztec( event, 'onSelectionChange' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// `end` can be less than `start` on iOS\n\t\t// Let's fix that here so `rich-text/slice` can work properly.\n\t\tconst realStart = Math.min( start, end );\n\t\tconst realEnd = Math.max( start, end );\n\n\t\t// Check and dicsard stray event, where the text and selection is equal to the ones already cached.\n\t\tconst contentWithoutRootTag = this.removeRootTagsProducedByAztec(\n\t\t\tevent.nativeEvent.text\n\t\t);\n\t\tif (\n\t\t\tcontentWithoutRootTag === this.value?.toString() &&\n\t\t\trealStart === this.selectionStart &&\n\t\t\trealEnd === this.selectionEnd\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.comesFromAztec = true;\n\t\tthis.firedAfterTextChanged = true; // Selection change event always fires after the fact.\n\n\t\t// Update text before updating selection\n\t\t// Make sure there are changes made to the content before upgrading it upward.\n\t\tthis.onTextUpdate( event );\n\n\t\t// Aztec can send us selection change events after it has lost focus.\n\t\t// For instance the autocorrect feature will complete a partially written\n\t\t// word when resigning focus, causing a selection change event.\n\t\t// Forwarding this selection change could cause this RichText to regain\n\t\t// focus and start a focus loop.\n\t\t//\n\t\t// See https://github.com/wordpress-mobile/gutenberg-mobile/issues/1696\n\t\tif ( this.props.__unstableIsSelected ) {\n\t\t\tthis.onSelectionChange( realStart, realEnd );\n\t\t}\n\t\t// Update lastEventCount to prevent Aztec from re-rendering the content it just sent.\n\t\tthis.lastEventCount = event.nativeEvent.eventCount;\n\n\t\tthis.lastAztecEventType = 'selection change';\n\t}\n\n\tisEmpty() {\n\t\treturn isEmpty( this.formatToValue( this.props.value ) );\n\t}\n\n\tformatToValue( value ) {\n\t\tconst { preserveWhiteSpace } = this.props;\n\t\t// Handle deprecated `children` and `node` sources.\n\t\tif ( Array.isArray( value ) ) {\n\t\t\treturn create( {\n\t\t\t\thtml: childrenBlock.toHTML( value ),\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\t\t}\n\n\t\tif ( this.props.format === 'string' ) {\n\t\t\treturn create( {\n\t\t\t\thtml: value,\n\t\t\t\tpreserveWhiteSpace,\n\t\t\t} );\n\t\t}\n\n\t\t// Guard for blocks passing `null` in onSplit callbacks. May be removed\n\t\t// if onSplit is revised to not pass a `null` value.\n\t\tif ( value === null ) {\n\t\t\treturn create();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tmanipulateEventCounterToForceNativeToRefresh() {\n\t\tif ( this.isIOS ) {\n\t\t\tthis.lastEventCount = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof this.lastEventCount !== 'undefined' ) {\n\t\t\tthis.lastEventCount += 100; // bump by a hundred, hopefully native hasn't bombarded the JS side in the meantime.\n\t\t} // no need to bump when 'undefined' as native side won't receive the key when the value is undefined, and that will cause force updating anyway,\n\t\t// see https://github.com/WordPress/gutenberg/blob/82e578dcc75e67891c750a41a04c1e31994192fc/packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java#L213-L215\n\t}\n\n\tshouldComponentUpdate( nextProps, nextState ) {\n\t\tif (\n\t\t\tnextProps.tagName !== this.props.tagName ||\n\t\t\tnextProps.reversed !== this.props.reversed ||\n\t\t\tnextProps.start !== this.props.start\n\t\t) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tthis.value = undefined;\n\t\t\treturn true;\n\t\t}\n\n\t\t// TODO: Please re-introduce the check to avoid updating the content right after an `onChange` call.\n\t\t// It was removed in https://github.com/WordPress/gutenberg/pull/12417 to fix undo/redo problem.\n\n\t\t// If the component is changed React side (undo/redo/merging/splitting/custom text actions)\n\t\t// we need to make sure the native is updated as well.\n\n\t\t// Also, don't trust the \"this.lastContent\" as on Android, incomplete text events arrive\n\t\t// with only some of the text, while the virtual keyboard's suggestion system does its magic.\n\t\t// ** compare with this.lastContent for optimizing performance by not forcing Aztec with text it already has\n\t\t// , but compare with props.value to not lose \"half word\" text because of Android virtual keyb autosuggestion behavior\n\t\tif (\n\t\t\ttypeof nextProps.value !== 'undefined' &&\n\t\t\ttypeof this.props.value !== 'undefined' &&\n\t\t\t( ! this.comesFromAztec || ! this.firedAfterTextChanged ) &&\n\t\t\tnextProps.value?.toString() !== this.props.value?.toString()\n\t\t) {\n\t\t\t// Gutenberg seems to try to mirror the caret state even on events that only change the content so,\n\t\t\t// let's force caret update if state has selection set.\n\t\t\tif (\n\t\t\t\ttypeof nextProps.selectionStart !== 'undefined' &&\n\t\t\t\ttypeof nextProps.selectionEnd !== 'undefined'\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t}\n\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t}\n\n\t\tif ( ! this.comesFromAztec ) {\n\t\t\tif (\n\t\t\t\ttypeof nextProps.selectionStart !== 'undefined' &&\n\t\t\t\ttypeof nextProps.selectionEnd !== 'undefined' &&\n\t\t\t\tnextProps.selectionStart !== this.props.selectionStart &&\n\t\t\t\tnextProps.selectionStart !== this.selectionStart &&\n\t\t\t\tnextProps.__unstableIsSelected\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\n\t\t\t// For font size changes from a prop value a force refresh\n\t\t\t// is needed without the selection update.\n\t\t\tif ( nextProps?.fontSize !== this.props?.fontSize ) {\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t( nextProps?.style?.fontSize !== this.props?.style?.fontSize &&\n\t\t\t\t\tnextState.currentFontSize !==\n\t\t\t\t\t\tthis.state.currentFontSize ) ||\n\t\t\t\tnextState.currentFontSize !== this.state.currentFontSize ||\n\t\t\t\tnextProps?.style?.lineHeight !== this.props?.style?.lineHeight\n\t\t\t) {\n\t\t\t\tthis.needsSelectionUpdate = true;\n\t\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tcomponentDidMount() {\n\t\t// Request focus if wrapping block is selected and parent hasn't inhibited the focus request. This method of focusing\n\t\t// is trying to implement the web-side counterpart of BlockList's `focusTabbable` where the BlockList is focusing an\n\t\t// inputbox by searching the DOM. We don't have the DOM in RN so, using the combination of blockIsSelected and __unstableMobileNoFocusOnMount\n\t\t// to determine if we should focus the RichText.\n\t\tif (\n\t\t\tthis.props.blockIsSelected &&\n\t\t\t! this.props.__unstableMobileNoFocusOnMount\n\t\t) {\n\t\t\tthis._editor.focus();\n\t\t\tthis.onSelectionChange(\n\t\t\t\tthis.props.selectionStart || 0,\n\t\t\t\tthis.props.selectionEnd || 0\n\t\t\t);\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { style, tagName } = this.props;\n\t\tconst { currentFontSize } = this.state;\n\n\t\tif ( this.props.value?.toString() !== this.value?.toString() ) {\n\t\t\tthis.value = this.props.value;\n\t\t}\n\t\tconst { __unstableIsSelected: prevIsSelected } = prevProps;\n\t\tconst { __unstableIsSelected: isSelected } = this.props;\n\n\t\tif ( isSelected && ! prevIsSelected ) {\n\t\t\tthis._editor.focus();\n\t\t\t// Update selection props explicitly when component is selected as Aztec won't call onSelectionChange\n\t\t\t// if its internal value hasn't change. When created, default value is 0, 0.\n\t\t\tthis.onSelectionChange(\n\t\t\t\tthis.props.selectionStart || 0,\n\t\t\t\tthis.props.selectionEnd || 0\n\t\t\t);\n\t\t} else if ( this.shouldFocusTextInputAfterMerge( prevProps ) ) {\n\t\t\t// Since this is happening when merging blocks, the selection should be at the last character position.\n\t\t\t// As a fallback the internal selectionEnd value is used.\n\t\t\tconst lastCharacterPosition =\n\t\t\t\tthis.value?.toString().length ?? this.selectionEnd;\n\t\t\tthis._editor.focus();\n\t\t\tthis.props.onSelectionChange(\n\t\t\t\tlastCharacterPosition,\n\t\t\t\tlastCharacterPosition\n\t\t\t);\n\t\t} else if ( ! isSelected && prevIsSelected ) {\n\t\t\tthis._editor.blur();\n\t\t}\n\n\t\t// For font size values changes from the font size picker\n\t\t// we compare previous values to refresh the selected font size,\n\t\t// this is also used when the tag name changes\n\t\t// e.g Heading block and a level change like h1->h2.\n\t\tconst currentFontSizeStyle = this.getParsedFontSize( style?.fontSize );\n\t\tconst prevFontSizeStyle = this.getParsedFontSize(\n\t\t\tprevProps?.style?.fontSize\n\t\t);\n\t\tconst isDifferentTag = prevProps.tagName !== tagName;\n\t\tif (\n\t\t\t( currentFontSize &&\n\t\t\t\t( currentFontSizeStyle || prevFontSizeStyle ) &&\n\t\t\t\tcurrentFontSizeStyle !== currentFontSize ) ||\n\t\t\tisDifferentTag\n\t\t) {\n\t\t\tthis.setState( {\n\t\t\t\tcurrentFontSize: this.getFontSize( this.props ),\n\t\t\t} );\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tconst { clearCurrentSelectionOnUnmount } = this.props;\n\n\t\t// There are cases when the component is unmounted e.g. scrolling in a\n\t\t// long post due to virtualization, so the block selection needs to be cleared\n\t\t// so it doesn't auto-focus when it's added back.\n\t\tif ( this._editor?.isFocused() ) {\n\t\t\tclearCurrentSelectionOnUnmount?.();\n\t\t}\n\t}\n\n\tgetHtmlToRender( record, tagName ) {\n\t\t// Save back to HTML from React tree.\n\t\tlet value = this.valueToFormat( record );\n\n\t\tif ( value === undefined ) {\n\t\t\tthis.manipulateEventCounterToForceNativeToRefresh(); // force a refresh on the native side\n\t\t\tvalue = '';\n\t\t}\n\t\t// On android if content is empty we need to send no content or else the placeholder will not show.\n\t\tif (\n\t\t\t! this.isIOS &&\n\t\t\t( value?.toString() === '' ||\n\t\t\t\tvalue?.toString() === EMPTY_PARAGRAPH_TAGS )\n\t\t) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( tagName ) {\n\t\t\tlet extraAttributes = ``;\n\t\t\tif ( tagName === `ol` ) {\n\t\t\t\tif ( this.props.reversed ) {\n\t\t\t\t\textraAttributes += ` reversed`;\n\t\t\t\t}\n\t\t\t\tif ( this.props.start ) {\n\t\t\t\t\textraAttributes += ` start=${ this.props.start }`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = `<${ tagName }${ extraAttributes }>${ value }</${ tagName }>`;\n\t\t}\n\t\treturn value;\n\t}\n\n\tgetEditableProps() {\n\t\treturn {\n\t\t\t// Overridable props.\n\t\t\tstyle: {},\n\t\t\tclassName: 'rich-text',\n\t\t\tonKeyDown: () => null,\n\t\t};\n\t}\n\n\tgetParsedFontSize( fontSize ) {\n\t\tconst { height, width } = Dimensions.get( 'window' );\n\t\tconst cssUnitOptions = { height, width, fontSize: DEFAULT_FONT_SIZE };\n\n\t\tif ( ! fontSize ) {\n\t\t\treturn fontSize;\n\t\t}\n\n\t\tconst selectedPxValue =\n\t\t\tgetPxFromCssUnit( fontSize, cssUnitOptions ) ?? DEFAULT_FONT_SIZE;\n\n\t\treturn parseFloat( selectedPxValue );\n\t}\n\n\tgetFontSize( props ) {\n\t\tconst { baseGlobalStyles, tagName, fontSize, style } = props;\n\t\tconst tagNameFontSize =\n\t\t\tbaseGlobalStyles?.elements?.[ tagName ]?.typography?.fontSize;\n\n\t\tlet newFontSize = DEFAULT_FONT_SIZE;\n\n\t\t// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.\n\t\tif ( tagName === 'pre' && ! this.isIOS ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// For block-based themes, get the default editor font size.\n\t\tif ( baseGlobalStyles?.typography?.fontSize && tagName === 'p' ) {\n\t\t\tnewFontSize = baseGlobalStyles?.typography?.fontSize;\n\t\t}\n\n\t\t// For block-based themes, get the default element font size\n\t\t// e.g h1, h2.\n\t\tif ( tagNameFontSize ) {\n\t\t\tnewFontSize = tagNameFontSize;\n\t\t}\n\n\t\t// For font size values provided from the styles,\n\t\t// usually from values set from the font size picker.\n\t\tif ( style?.fontSize ) {\n\t\t\tnewFontSize = style.fontSize;\n\t\t}\n\n\t\t// Fall-back to a font size provided from its props (if there's any)\n\t\t// and there are no other default values to use.\n\t\tif ( fontSize && ! tagNameFontSize && ! style?.fontSize ) {\n\t\t\tnewFontSize = fontSize;\n\t\t}\n\n\t\t// We need to always convert to px units because the selected value\n\t\t// could be coming from the web where it could be stored as a different unit.\n\t\tconst selectedPxValue = this.getParsedFontSize( newFontSize );\n\n\t\treturn selectedPxValue;\n\t}\n\n\tgetLineHeight() {\n\t\tconst { baseGlobalStyles, tagName, lineHeight, style } = this.props;\n\t\tconst tagNameLineHeight =\n\t\t\tbaseGlobalStyles?.elements?.[ tagName ]?.typography?.lineHeight;\n\t\tlet newLineHeight;\n\n\t\t// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.\n\t\tif ( tagName === 'pre' && ! this.isIOS ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( ! this.getIsBlockBasedTheme() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// For block-based themes, get the default editor line height.\n\t\tif ( baseGlobalStyles?.typography?.lineHeight && tagName === 'p' ) {\n\t\t\tnewLineHeight = parseFloat(\n\t\t\t\tbaseGlobalStyles?.typography?.lineHeight\n\t\t\t);\n\t\t}\n\n\t\t// For block-based themes, get the default element line height\n\t\t// e.g h1, h2.\n\t\tif ( tagNameLineHeight ) {\n\t\t\tnewLineHeight = parseFloat( tagNameLineHeight );\n\t\t}\n\n\t\t// For line height values provided from the styles,\n\t\t// usually from values set from the line height picker.\n\t\tif ( style?.lineHeight ) {\n\t\t\tnewLineHeight = parseFloat( style.lineHeight );\n\t\t}\n\n\t\t// Fall-back to a line height provided from its props (if there's any)\n\t\t// and there are no other default values to use.\n\t\tif ( lineHeight && ! tagNameLineHeight && ! style?.lineHeight ) {\n\t\t\tnewLineHeight = lineHeight;\n\t\t}\n\n\t\t// Check the final value is not over the minimum supported value.\n\t\tif ( newLineHeight && newLineHeight < MIN_LINE_HEIGHT ) {\n\t\t\tnewLineHeight = MIN_LINE_HEIGHT;\n\t\t}\n\n\t\t// Until we parse CSS values correctly, avoid passing NaN values to Aztec\n\t\tif ( isNaN( newLineHeight ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn newLineHeight;\n\t}\n\n\tgetIsBlockBasedTheme() {\n\t\tconst { baseGlobalStyles } = this.props;\n\n\t\treturn (\n\t\t\tbaseGlobalStyles && Object.entries( baseGlobalStyles ).length !== 0\n\t\t);\n\t}\n\n\tgetBlockUseDefaultFont() {\n\t\t// For block-based themes it enables using the defaultFont\n\t\t// in Aztec for iOS so it allows customizing the font size\n\t\t// for the Preformatted/Code and Heading blocks.\n\t\tif ( ! this.isIOS ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { tagName } = this.props;\n\t\tconst isBlockBasedTheme = this.getIsBlockBasedTheme();\n\t\tconst tagsToMatch = /pre|h([1-6])$/gm;\n\n\t\treturn isBlockBasedTheme && tagsToMatch.test( tagName );\n\t}\n\n\tgetLinkTextColor( defaultColor ) {\n\t\tconst { style } = this.props;\n\t\tconst customColor = style?.linkColor && colord( style.linkColor );\n\n\t\treturn customColor && customColor.isValid()\n\t\t\t? customColor.toHex()\n\t\t\t: defaultColor;\n\t}\n\n\tgetPlaceholderTextColor() {\n\t\tconst {\n\t\t\tbaseGlobalStyles,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tplaceholderTextColor,\n\t\t\tstyle,\n\t\t} = this.props;\n\n\t\t// Default placeholder text color.\n\t\tconst placeholderStyle = getStylesFromColorScheme(\n\t\t\tstyles.richTextPlaceholder,\n\t\t\tstyles.richTextPlaceholderDark\n\t\t);\n\t\tconst { color: defaultPlaceholderTextColor } = placeholderStyle;\n\t\t// Custom 63% opacity for theme and inherited colors.\n\t\tconst placeholderOpacity = 'A1';\n\n\t\t// Determine inherited placeholder color if available.\n\t\tconst inheritPlaceholderColor = style?.placeholderColor\n\t\t\t? `${ style.placeholderColor }${ placeholderOpacity }`\n\t\t\t: undefined;\n\n\t\t// If using block-based themes, derive the placeholder color from global styles.\n\t\tconst globalStylesPlaceholderColor = baseGlobalStyles?.color?.text\n\t\t\t? `${ baseGlobalStyles.color.text }${ placeholderOpacity }`\n\t\t\t: undefined;\n\n\t\treturn (\n\t\t\tinheritPlaceholderColor ??\n\t\t\tplaceholderTextColor ??\n\t\t\tglobalStylesPlaceholderColor ??\n\t\t\tdefaultPlaceholderTextColor\n\t\t);\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\ttagName,\n\t\t\tstyle,\n\t\t\t__unstableIsSelected: isSelected,\n\t\t\tchildren,\n\t\t\tgetStylesFromColorScheme,\n\t\t\tminWidth,\n\t\t\tmaxWidth,\n\t\t\tformatTypes,\n\t\t\tparentBlockStyles,\n\t\t\taccessibilityLabel,\n\t\t\tdisableEditingMenu = false,\n\t\t\tbaseGlobalStyles,\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t\tdisableSuggestions,\n\t\t\tcontainerWidth,\n\t\t} = this.props;\n\t\tconst { currentFontSize } = this.state;\n\n\t\tconst record = this.getRecord();\n\t\tconst html = this.getHtmlToRender( record, tagName );\n\t\tconst editableProps = this.getEditableProps();\n\t\tconst blockUseDefaultFont = this.getBlockUseDefaultFont();\n\n\t\tconst fontSize = currentFontSize;\n\t\tconst lineHeight = this.getLineHeight();\n\n\t\tconst {\n\t\t\tcolor: defaultColor,\n\t\t\ttextDecorationColor: defaultTextDecorationColor,\n\t\t\tfontFamily: defaultFontFamily,\n\t\t} = getStylesFromColorScheme( styles.richText, styles.richTextDark );\n\t\tconst linkTextColor = this.getLinkTextColor(\n\t\t\tdefaultTextDecorationColor\n\t\t);\n\n\t\tconst currentSelectionStart = selectionStart ?? 0;\n\t\tconst currentSelectionEnd = selectionEnd ?? 0;\n\t\tlet selection = null;\n\t\tif ( this.needsSelectionUpdate ) {\n\t\t\tthis.needsSelectionUpdate = false;\n\t\t\tselection = {\n\t\t\t\tstart: currentSelectionStart,\n\t\t\t\tend: currentSelectionEnd,\n\t\t\t};\n\n\t\t\t// On AztecAndroid, setting the caret to an out-of-bounds position will crash the editor so, let's check for some cases.\n\t\t\tif ( ! this.isIOS ) {\n\t\t\t\t// The following regular expression is used in Aztec here:\n\t\t\t\t// https://github.com/wordpress-mobile/AztecEditor-Android/blob/b1fad439d56fa6d4aa0b78526fef355c59d00dd3/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt#L656\n\t\t\t\tconst brBeforeParaMatches = html.match( /(<br>)+<\\/p>$/g );\n\t\t\t\tif ( brBeforeParaMatches ) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t'Oops, BR tag(s) at the end of content. Aztec will remove them, adapting the selection...'\n\t\t\t\t\t);\n\t\t\t\t\tconst count = (\n\t\t\t\t\t\tbrBeforeParaMatches[ 0 ].match( /br/g ) || []\n\t\t\t\t\t).length;\n\t\t\t\t\tif ( count > 0 ) {\n\t\t\t\t\t\tlet newSelectionStart = currentSelectionStart - count;\n\t\t\t\t\t\tif ( newSelectionStart < 0 ) {\n\t\t\t\t\t\t\tnewSelectionStart = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet newSelectionEnd = currentSelectionEnd - count;\n\t\t\t\t\t\tif ( newSelectionEnd < 0 ) {\n\t\t\t\t\t\t\tnewSelectionEnd = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselection = {\n\t\t\t\t\t\t\tstart: newSelectionStart,\n\t\t\t\t\t\t\tend: newSelectionEnd,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.comesFromAztec ) {\n\t\t\tthis.comesFromAztec = false;\n\t\t\tthis.firedAfterTextChanged = false;\n\t\t}\n\n\t\t// Logic below assures that `RichText` width will always have equal value when container is almost fully filled.\n\t\tconst width =\n\t\t\tmaxWidth && this.state.width && maxWidth - this.state.width < 10\n\t\t\t\t? maxWidth\n\t\t\t\t: this.state.width;\n\t\tconst containerStyles = [\n\t\t\tstyle?.padding &&\n\t\t\t\tstyle?.backgroundColor && {\n\t\t\t\t\tpadding: style.padding,\n\t\t\t\t\tbackgroundColor: style.backgroundColor,\n\t\t\t\t},\n\t\t\tcontainerWidth && {\n\t\t\t\twidth: containerWidth,\n\t\t\t},\n\t\t];\n\n\t\tconst defaultSelectionColor = getStylesFromColorScheme(\n\t\t\tstyles[ 'rich-text-selection' ],\n\t\t\tstyles[ 'rich-text-selection--dark' ]\n\t\t).color;\n\t\tconst selectionColor = getSelectionColor(\n\t\t\tthis.props.selectionColor,\n\t\t\tdefaultSelectionColor,\n\t\t\tbaseGlobalStyles,\n\t\t\tthis.getIsBlockBasedTheme()\n\t\t);\n\n\t\tconst EditableView = ( props ) => {\n\t\t\tthis.customEditableOnKeyDown = props?.onKeyDown;\n\n\t\t\treturn <></>;\n\t\t};\n\n\t\treturn (\n\t\t\t<View style={ containerStyles }>\n\t\t\t\t{ children &&\n\t\t\t\t\tchildren( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tvalue: record,\n\t\t\t\t\t\tonChange: this.onFormatChange,\n\t\t\t\t\t\tonFocus: () => {},\n\t\t\t\t\t\teditableProps,\n\t\t\t\t\t\teditableTagName: EditableView,\n\t\t\t\t\t} ) }\n\t\t\t\t<RCTAztecView\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis._editor = ref;\n\n\t\t\t\t\t\tif ( this.props.nativeEditorRef ) {\n\t\t\t\t\t\t\tthis.props.nativeEditorRef( ref );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tbackgroundColor: styles.richText.backgroundColor,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t\t...( this.isIOS && minWidth && maxWidth\n\t\t\t\t\t\t\t? { width }\n\t\t\t\t\t\t\t: { maxWidth } ),\n\t\t\t\t\t\tminHeight: this.state.height,\n\t\t\t\t\t} }\n\t\t\t\t\tblockUseDefaultFont={ blockUseDefaultFont }\n\t\t\t\t\ttext={ {\n\t\t\t\t\t\ttext: html,\n\t\t\t\t\t\teventCount: this.lastEventCount,\n\t\t\t\t\t\tselection,\n\t\t\t\t\t\tlinkTextColor,\n\t\t\t\t\t\ttag: tagName,\n\t\t\t\t\t} }\n\t\t\t\t\tplaceholder={ this.props.placeholder }\n\t\t\t\t\tplaceholderTextColor={ this.getPlaceholderTextColor() }\n\t\t\t\t\tdeleteEnter={ this.props.deleteEnter }\n\t\t\t\t\tonChange={ this.onChangeFromAztec }\n\t\t\t\t\tonFocus={ this.onFocus }\n\t\t\t\t\tonBlur={ this.onBlur }\n\t\t\t\t\tonKeyDown={ this.onKeyDown }\n\t\t\t\t\ttriggerKeyCodes={\n\t\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: this.suggestionOptions().map(\n\t\t\t\t\t\t\t\t\t( op ) => op.triggerChar\n\t\t\t\t\t\t\t )\n\t\t\t\t\t}\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tactiveFormats={ this.getActiveFormatNames( record ) }\n\t\t\t\t\tonContentSizeChange={ this.onContentSizeChange }\n\t\t\t\t\tonSelectionChange={ this.onSelectionChangeFromAztec }\n\t\t\t\t\tblockType={ { tag: tagName } }\n\t\t\t\t\tcolor={\n\t\t\t\t\t\t( style && style.color ) ||\n\t\t\t\t\t\t( parentBlockStyles && parentBlockStyles.color ) ||\n\t\t\t\t\t\t( baseGlobalStyles && baseGlobalStyles?.color?.text ) ||\n\t\t\t\t\t\tdefaultColor\n\t\t\t\t\t}\n\t\t\t\t\tmaxImagesWidth={ 200 }\n\t\t\t\t\tfontFamily={ this.props.fontFamily || defaultFontFamily }\n\t\t\t\t\tfontSize={ fontSize }\n\t\t\t\t\tlineHeight={ lineHeight }\n\t\t\t\t\tfontWeight={ this.props.fontWeight }\n\t\t\t\t\tfontStyle={ this.props.fontStyle }\n\t\t\t\t\tdisableEditingMenu={ disableEditingMenu }\n\t\t\t\t\tisMultiline={ false }\n\t\t\t\t\ttextAlign={ this.props.textAlign }\n\t\t\t\t\t{ ...( this.isIOS ? { maxWidth } : {} ) }\n\t\t\t\t\tminWidth={ minWidth }\n\t\t\t\t\tid={ this.props.id }\n\t\t\t\t\tselectionColor={ selectionColor }\n\t\t\t\t\tdisableAutocorrection={ this.props.disableAutocorrection }\n\t\t\t\t/>\n\t\t\t\t{ isSelected && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\tforwardedRef={ this._editor }\n\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\tvalue={ record }\n\t\t\t\t\t\t\tonChange={ this.onFormatChange }\n\t\t\t\t\t\t\tonFocus={ () => {} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! disableSuggestions && (\n\t\t\t\t\t\t\t<BlockFormatControls>\n\t\t\t\t\t\t\t\t<ToolbarButtonWithOptions\n\t\t\t\t\t\t\t\t\toptions={ this.suggestionOptions() }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</BlockFormatControls>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nRichText.defaultProps = {\n\tformat: 'string',\n\tvalue: '',\n\ttagName: 'div',\n};\n\nconst withFormatTypes = ( WrappedComponent ) => ( props ) => {\n\tconst {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats,\n\t} = props;\n\tconst { formatTypes } = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats,\n\t} );\n\n\treturn <WrappedComponent { ...props } formatTypes={ formatTypes } />;\n};\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlockParents, getBlock, getSettings } =\n\t\t\tselect( 'core/block-editor' );\n\t\tconst parents = getBlockParents( clientId, true );\n\t\tconst parentBlock = parents ? getBlock( parents[ 0 ] ) : undefined;\n\t\tconst parentBlockStyles = parentBlock?.attributes?.childrenStyles;\n\n\t\tconst settings = getSettings();\n\t\tconst baseGlobalStyles = settings?.__experimentalGlobalStylesBaseStyles;\n\n\t\tconst colorPalettes = settings?.__experimentalFeatures?.color?.palette;\n\t\tconst colorPalette = colorPalettes\n\t\t\t? flatColorPalettes( colorPalettes )\n\t\t\t: settings?.colors;\n\n\t\treturn {\n\t\t\tareMentionsSupported: settings?.capabilities?.mentions === true,\n\t\t\tareXPostsSupported: settings?.capabilities?.xposts === true,\n\t\t\tparentBlockStyles,\n\t\t\tbaseGlobalStyles,\n\t\t\tcolorPalette,\n\t\t};\n\t}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E,MAAM+L,iBAAiB,GAAGkE,WAAW,EAAEtK,UAAU,EAAEuK,cAAc;EAEjE,MAAMC,QAAQ,GAAGJ,WAAW,CAAC,CAAC;EAC9B,MAAM3V,gBAAgB,GAAG+V,QAAQ,EAAEC,oCAAoC;EAEvE,MAAMC,aAAa,GAAGF,QAAQ,EAAEG,sBAAsB,EAAE5V,KAAK,EAAE6V,OAAO;EACtE,MAAM9R,YAAY,GAAG4R,aAAa,GAC/B1W,iBAAiB,CAAE0W,aAAc,CAAC,GAClCF,QAAQ,EAAEK,MAAM;EAEnB,OAAO;IACNvM,oBAAoB,EAAEkM,QAAQ,EAAEM,YAAY,EAAEC,QAAQ,KAAK,IAAI;IAC/DxM,kBAAkB,EAAEiM,QAAQ,EAAEM,YAAY,EAAEE,MAAM,KAAK,IAAI;IAC3D5E,iBAAiB;IACjB3R,gBAAgB;IAChBqE;EACD,CAAC;AACF,CAAE,CAAC,EACHmS,iCAAwB,EACxB1B,eAAe,CACd,CAAC,CAAE/T,QAAS,CAAC","ignoreList":[]}
@@ -22,13 +22,17 @@ function formatTypesSelector(select) {
22
22
  */
23
23
  const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
24
24
  function prefixSelectKeys(selected, prefix) {
25
- if (typeof selected !== 'object') return {
26
- [prefix]: selected
27
- };
25
+ if (typeof selected !== 'object') {
26
+ return {
27
+ [prefix]: selected
28
+ };
29
+ }
28
30
  return Object.fromEntries(Object.entries(selected).map(([key, value]) => [`${prefix}.${key}`, value]));
29
31
  }
30
32
  function getPrefixedSelectKeys(selected, prefix) {
31
- if (selected[prefix]) return selected[prefix];
33
+ if (selected[prefix]) {
34
+ return selected[prefix];
35
+ }
32
36
  return Object.keys(selected).filter(key => key.startsWith(prefix + '.')).reduce((accumulator, key) => {
33
37
  accumulator[key.slice(prefix.length + 1)] = selected[key];
34
38
  return accumulator;
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","prefixSelectKeys","selected","prefix","Object","fromEntries","entries","map","key","value","getPrefixedSelectKeys","keys","filter","startsWith","reduce","accumulator","slice","length","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","name","interactive","tagName","includes","has","keyedSelected","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","push","forEach","__experimentalCreatePrepareEditableTree","handler","__experimentalCreateOnChangeEditableValue","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\nfunction prefixSelectKeys( selected, prefix ) {\n\tif ( typeof selected !== 'object' ) return { [ prefix ]: selected };\n\treturn Object.fromEntries(\n\t\tObject.entries( selected ).map( ( [ key, value ] ) => [\n\t\t\t`${ prefix }.${ key }`,\n\t\t\tvalue,\n\t\t] )\n\t);\n}\n\nfunction getPrefixedSelectKeys( selected, prefix ) {\n\tif ( selected[ prefix ] ) return selected[ prefix ];\n\treturn Object.keys( selected )\n\t\t.filter( ( key ) => key.startsWith( prefix + '.' ) )\n\t\t.reduce( ( accumulator, key ) => {\n\t\t\taccumulator[ key.slice( prefix.length + 1 ) ] = selected[ key ];\n\t\t\treturn accumulator;\n\t\t}, {} );\n}\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, interactive, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\t( interactive || interactiveContentTags.has( tagName ) )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, withoutInteractiveFormatting ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( ! type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...accumulator,\n\t\t\t\t\t...prefixSelectKeys(\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype.name\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tfor ( const key in keyedSelected ) {\n\t\tdependencies.push( keyedSelected[ key ] );\n\t}\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tgetPrefixedSelectKeys( keyedSelected, type.name ),\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst selected = getPrefixedSelectKeys( keyedSelected, type.name );\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( typeof selected === 'object' ? selected : {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandl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A,QAAQ,GAAG,CAAC,CAAC,CAAE;QACnD,GAAG8C;MACJ,CAAC,EACD;QACCb,kBAAkB,EAAEf,UAAU;QAC9BgB,aAAa,EAAEjB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXc,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","prefixSelectKeys","selected","prefix","Object","fromEntries","entries","map","key","value","getPrefixedSelectKeys","keys","filter","startsWith","reduce","accumulator","slice","length","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","name","interactive","tagName","includes","has","keyedSelected","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","push","forEach","__experimentalCreatePrepareEditableTree","handler","__experimentalCreateOnChangeEditableValue","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\nfunction prefixSelectKeys( selected, prefix ) {\n\tif ( typeof selected !== 'object' ) {\n\t\treturn { [ prefix ]: selected };\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries( selected ).map( ( [ key, value ] ) => [\n\t\t\t`${ prefix }.${ key }`,\n\t\t\tvalue,\n\t\t] )\n\t);\n}\n\nfunction getPrefixedSelectKeys( selected, prefix ) {\n\tif ( selected[ prefix ] ) {\n\t\treturn selected[ prefix ];\n\t}\n\treturn Object.keys( selected )\n\t\t.filter( ( key ) => key.startsWith( prefix + '.' ) )\n\t\t.reduce( ( accumulator, key ) => {\n\t\t\taccumulator[ key.slice( prefix.length + 1 ) ] = selected[ key ];\n\t\t\treturn accumulator;\n\t\t}, {} );\n}\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, interactive, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\t( interactive || interactiveContentTags.has( tagName ) )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, withoutInteractiveFormatting ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( ! type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...accumulator,\n\t\t\t\t\t...prefixSelectKeys(\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype.name\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tfor ( const key in keyedSelected ) {\n\t\tdependencies.push( keyedSelected[ key ] );\n\t}\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tgetPrefixedSelectKeys( keyedSelected, type.name ),\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst selected = getPrefixedSelectKeys( keyedSelected, type.name );\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( typeof selected === 'object' ? selected : {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,mBAAmBA,CAAEC,MAAM,EAAG;EACtC,OAAOA,MAAM,CAAEC,eAAc,CAAC,CAACC,cAAc,CAAC,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAE,CACvC,GAAG,EACH,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,CACN,CAAC;AAEH,SAASC,gBAAgBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7C,IAAK,OAAOD,QAAQ,KAAK,QAAQ,EAAG;IACnC,OAAO;MAAE,CAAEC,MAAM,GAAID;IAAS,CAAC;EAChC;EACA,OAAOE,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAAEJ,QAAS,CAAC,CAACK,GAAG,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM,CACpD,GAAGN,MAAQ,IAAIK,GAAK,EAAC,EACtBC,KAAK,CACJ,CACH,CAAC;AACF;AAEA,SAASC,qBAAqBA,CAAER,QAAQ,EAAEC,MAAM,EAAG;EAClD,IAAKD,QAAQ,CAAEC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D,EAAG;QAC9DD,WAAW,GACVf,IAAI,CAACgB,kDAAkD,CACtDZ,QAAQ,EACR;UACCF,kBAAkB,EAAEf,UAAU;UAC9BgB,aAAa,EAAEjB;QAChB,CACD,CAAC;MACH;MAEA,MAAMjB,QAAQ,GAAGQ,qBAAqB,CAAEsB,aAAa,EAAEC,IAAI,CAACN,IAAK,CAAC;MAClEc,cAAc,CAACE,IAAI,CAClBV,IAAI,CAACc,yCAAyC,CAC7C;QACC,IAAK,OAAO7C,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAG,CAAC,CAAC,CAAE;QACnD,GAAG8C;MACJ,CAAC,EACD;QACCb,kBAAkB,EAAEf,UAAU;QAC9BgB,aAAa,EAAEjB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXc,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = SegmentedTextControl;
8
+ var _react = require("react");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _components = require("@wordpress/components");
11
+ /**
12
+ * External dependencies
13
+ */
14
+
15
+ /**
16
+ * WordPress dependencies
17
+ */
18
+
19
+ /**
20
+ * @typedef {Object} Option
21
+ * @property {string} label The label of the option.
22
+ * @property {string} value The value of the option.
23
+ * @property {string} icon The icon of the option.
24
+ */
25
+
26
+ /**
27
+ * Control to facilitate selecting a text style from a set of options.
28
+ *
29
+ * @param {Object} props Component props.
30
+ * @param {string} props.label A label for the option.
31
+ * @param {string} props.value Currently selected value.
32
+ * @param {Function} props.onChange Callback to handle onChange.
33
+ * @param {Option[]} props.options Array of options to display.
34
+ * @param {string} props.className Additional class name to apply.
35
+ *
36
+ * @return {Element} Element to render.
37
+ */
38
+ function SegmentedTextControl({
39
+ label,
40
+ value,
41
+ options,
42
+ onChange,
43
+ className
44
+ }) {
45
+ return (0, _react.createElement)("fieldset", {
46
+ className: (0, _classnames.default)('block-editor-segmented-text-control', className)
47
+ }, (0, _react.createElement)(_components.BaseControl.VisualLabel, {
48
+ as: "legend"
49
+ }, label), (0, _react.createElement)("div", {
50
+ className: "block-editor-segmented-text-control__buttons"
51
+ }, options.map(option => {
52
+ return (0, _react.createElement)(_components.Button, {
53
+ size: "compact",
54
+ key: option.value,
55
+ icon: option.icon,
56
+ label: option.label,
57
+ isPressed: option.value === value,
58
+ onClick: () => onChange(option.value)
59
+ });
60
+ })));
61
+ }
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","SegmentedTextControl","label","value","options","onChange","className","_react","createElement","classnames","BaseControl","VisualLabel","as","map","option","Button","size","key","icon","isPressed","onClick"],"sources":["@wordpress/block-editor/src/components/segmented-text-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { BaseControl, Button } from '@wordpress/components';\n\n/**\n * @typedef {Object} Option\n * @property {string} label The label of the option.\n * @property {string} value The value of the option.\n * @property {string} icon The icon of the option.\n */\n\n/**\n * Control to facilitate selecting a text style from a set of options.\n *\n * @param {Object} props Component props.\n * @param {string} props.label A label for the option.\n * @param {string} props.value Currently selected value.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Option[]} props.options Array of options to display.\n * @param {string} props.className Additional class name to apply.\n *\n * @return {Element} Element to render.\n */\nexport default function SegmentedTextControl( {\n\tlabel,\n\tvalue,\n\toptions,\n\tonChange,\n\tclassName,\n} ) {\n\treturn (\n\t\t<fieldset\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-segmented-text-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"block-editor-segmented-text-control__buttons\">\n\t\t\t\t{ options.map( ( option ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t\t\tisPressed={ option.value === value }\n\t\t\t\t\t\t\tonClick={ () => onChange( option.value ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,oBAAoBA,CAAE;EAC7CC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA;IACCF,SAAS,EAAG,IAAAG,mBAAU,EACrB,qCAAqC,EACrCH,SACD;EAAG,GAEH,IAAAC,MAAA,CAAAC,aAAA,EAACR,WAAA,CAAAU,WAAW,CAACC,WAAW;IAACC,EAAE,EAAC;EAAQ,GACjCV,KACsB,CAAC,EAC1B,IAAAK,MAAA,CAAAC,aAAA;IAAKF,SAAS,EAAC;EAA8C,GAC1DF,OAAO,CAACS,GAAG,CAAIC,MAAM,IAAM;IAC5B,OACC,IAAAP,MAAA,CAAAC,aAAA,EAACR,WAAA,CAAAe,MAAM;MACNC,IAAI,EAAC,SAAS;MACdC,GAAG,EAAGH,MAAM,CAACX,KAAO;MACpBe,IAAI,EAAGJ,MAAM,CAACI,IAAM;MACpBhB,KAAK,EAAGY,MAAM,CAACZ,KAAO;MACtBiB,SAAS,EAAGL,MAAM,CAACX,KAAK,KAAKA,KAAO;MACpCiB,OAAO,EAAGA,CAAA,KAAMf,QAAQ,CAAES,MAAM,CAACX,KAAM;IAAG,CAC1C,CAAC;EAEJ,CAAE,CACE,CACI,CAAC;AAEb","ignoreList":[]}
@@ -159,6 +159,7 @@ function SpacingInputControl({
159
159
  return editorSettings?.disableCustomSpacingSizes;
160
160
  });
161
161
  const [showCustomValueControl, setShowCustomValueControl] = (0, _element.useState)(!disableCustomSpacingSizes && value !== undefined && !(0, _utils.isValueSpacingPreset)(value));
162
+ const [minValue, setMinValue] = (0, _element.useState)(minimumCustomValue);
162
163
  const previousValue = (0, _compose.usePrevious)(value);
163
164
  if (!!value && previousValue !== value && !(0, _utils.isValueSpacingPreset)(value) && showCustomValueControl !== true) {
164
165
  setShowCustomValueControl(true);
@@ -239,13 +240,26 @@ function SpacingInputControl({
239
240
  onChange: newSize => onChange(getNewCustomValue(newSize)),
240
241
  value: currentValue,
241
242
  units: units,
242
- min: minimumCustomValue,
243
+ min: minValue,
243
244
  placeholder: allPlaceholder,
244
245
  disableUnits: isMixed,
245
246
  label: ariaLabel,
246
247
  hideLabelFromVision: true,
247
248
  className: "spacing-sizes-control__custom-value-input",
248
- size: '__unstable-large'
249
+ size: '__unstable-large',
250
+ onDragStart: () => {
251
+ if (value?.charAt(0) === '-') {
252
+ setMinValue(0);
253
+ }
254
+ },
255
+ onDrag: () => {
256
+ if (value?.charAt(0) === '-') {
257
+ setMinValue(0);
258
+ }
259
+ },
260
+ onDragEnd: () => {
261
+ setMinValue(minimumCustomValue);
262
+ }
249
263
  }), (0, _react.createElement)(_components.RangeControl, {
250
264
  onMouseOver: onMouseOver,
251
265
  onMouseOut: onMouseOut,