@wordpress/block-editor 12.14.0 → 12.16.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 (664) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +10 -5
  3. package/build/components/block-canvas/index.js +22 -6
  4. package/build/components/block-canvas/index.js.map +1 -1
  5. package/build/components/block-card/index.js +1 -1
  6. package/build/components/block-card/index.js.map +1 -1
  7. package/build/components/block-controls/hook.js +3 -23
  8. package/build/components/block-controls/hook.js.map +1 -1
  9. package/build/components/block-edit/context.js +5 -1
  10. package/build/components/block-edit/context.js.map +1 -1
  11. package/build/components/block-edit/index.js +18 -9
  12. package/build/components/block-edit/index.js.map +1 -1
  13. package/build/components/block-info-slot-fill/index.js +3 -4
  14. package/build/components/block-info-slot-fill/index.js.map +1 -1
  15. package/build/components/block-list/block.js +28 -9
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js +16 -5
  18. package/build/components/block-list/block.native.js.map +1 -1
  19. package/build/components/block-list/use-block-props/index.js +61 -18
  20. package/build/components/block-list/use-block-props/index.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  22. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  23. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  24. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  27. package/build/components/block-parent-selector/index.js +1 -1
  28. package/build/components/block-parent-selector/index.js.map +1 -1
  29. package/build/components/block-pattern-setup/index.js +25 -16
  30. package/build/components/block-pattern-setup/index.js.map +1 -1
  31. package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
  32. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  33. package/build/components/block-patterns-list/index.js +37 -20
  34. package/build/components/block-patterns-list/index.js.map +1 -1
  35. package/build/components/block-removal-warning-modal/index.js +2 -9
  36. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  37. package/build/components/block-rename/index.js +28 -0
  38. package/build/components/block-rename/index.js.map +1 -0
  39. package/build/components/block-rename/is-empty-string.js +10 -0
  40. package/build/components/block-rename/is-empty-string.js.map +1 -0
  41. package/build/components/block-rename/modal.js +90 -0
  42. package/build/components/block-rename/modal.js.map +1 -0
  43. package/build/components/block-rename/rename-control.js +74 -0
  44. package/build/components/block-rename/rename-control.js.map +1 -0
  45. package/build/components/block-rename/use-block-rename.js +17 -0
  46. package/build/components/block-rename/use-block-rename.js.map +1 -0
  47. package/build/components/block-settings/container.native.js +6 -4
  48. package/build/components/block-settings/container.native.js.map +1 -1
  49. package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
  50. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  51. package/build/components/block-settings-menu-controls/index.js +7 -0
  52. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  53. package/build/components/block-styles/index.js +1 -1
  54. package/build/components/block-styles/index.js.map +1 -1
  55. package/build/components/block-styles/index.native.js +3 -2
  56. package/build/components/block-styles/index.native.js.map +1 -1
  57. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  58. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  59. package/build/components/block-toolbar/index.js +89 -27
  60. package/build/components/block-toolbar/index.js.map +1 -1
  61. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  62. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  63. package/build/components/block-tools/block-toolbar-popover.js +86 -0
  64. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  65. package/build/components/block-tools/index.js +27 -24
  66. package/build/components/block-tools/index.js.map +1 -1
  67. package/build/components/block-types-list/index.js +6 -2
  68. package/build/components/block-types-list/index.js.map +1 -1
  69. package/build/components/block-types-list/index.native.js +4 -3
  70. package/build/components/block-types-list/index.native.js.map +1 -1
  71. package/build/components/block-variation-picker/index.native.js +2 -1
  72. package/build/components/block-variation-picker/index.native.js.map +1 -1
  73. package/build/components/colors-gradients/control.js +28 -17
  74. package/build/components/colors-gradients/control.js.map +1 -1
  75. package/build/components/date-format-picker/index.js +8 -1
  76. package/build/components/date-format-picker/index.js.map +1 -1
  77. package/build/components/duotone-control/index.js +1 -4
  78. package/build/components/duotone-control/index.js.map +1 -1
  79. package/build/components/global-styles/advanced-panel.js +1 -1
  80. package/build/components/global-styles/advanced-panel.js.map +1 -1
  81. package/build/components/global-styles/color-panel.js +22 -20
  82. package/build/components/global-styles/color-panel.js.map +1 -1
  83. package/build/components/global-styles/filters-panel.js +9 -3
  84. package/build/components/global-styles/filters-panel.js.map +1 -1
  85. package/build/components/global-styles/typography-panel.js +20 -31
  86. package/build/components/global-styles/typography-panel.js.map +1 -1
  87. package/build/components/image-link-destinations/index.native.js +118 -0
  88. package/build/components/image-link-destinations/index.native.js.map +1 -0
  89. package/build/components/image-size-control/index.js +0 -5
  90. package/build/components/image-size-control/index.js.map +1 -1
  91. package/build/components/index.native.js +8 -0
  92. package/build/components/index.native.js.map +1 -1
  93. package/build/components/inner-blocks/index.js +3 -1
  94. package/build/components/inner-blocks/index.js.map +1 -1
  95. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
  96. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  97. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  98. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  100. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  101. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  102. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  103. package/build/components/inserter/block-patterns-tab/utils.js +3 -4
  104. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  105. package/build/components/inserter/hooks/use-patterns-state.js +2 -1
  106. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  107. package/build/components/inserter/media-tab/media-panel.js +2 -2
  108. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  109. package/build/components/inserter/menu.js +14 -7
  110. package/build/components/inserter/menu.js.map +1 -1
  111. package/build/components/inserter/preview-panel.js +2 -2
  112. package/build/components/inserter/preview-panel.js.map +1 -1
  113. package/build/components/inserter-button/index.native.js +98 -0
  114. package/build/components/inserter-button/index.native.js.map +1 -0
  115. package/build/components/inserter-button/sparkles.js +23 -0
  116. package/build/components/inserter-button/sparkles.js.map +1 -0
  117. package/build/components/inserter-draggable-blocks/index.js +8 -4
  118. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  119. package/build/components/inserter-listbox/index.js +11 -6
  120. package/build/components/inserter-listbox/index.js.map +1 -1
  121. package/build/components/inserter-listbox/item.js +24 -23
  122. package/build/components/inserter-listbox/item.js.map +1 -1
  123. package/build/components/inserter-listbox/row.js +5 -5
  124. package/build/components/inserter-listbox/row.js.map +1 -1
  125. package/build/components/inspector-controls/fill.js +3 -3
  126. package/build/components/inspector-controls/fill.js.map +1 -1
  127. package/build/components/inspector-controls/fill.native.js +3 -3
  128. package/build/components/inspector-controls/fill.native.js.map +1 -1
  129. package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
  130. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  131. package/build/components/navigable-toolbar/index.js +2 -2
  132. package/build/components/navigable-toolbar/index.js.map +1 -1
  133. package/build/components/preview-options/index.js +6 -60
  134. package/build/components/preview-options/index.js.map +1 -1
  135. package/build/components/rich-text/content.js +26 -23
  136. package/build/components/rich-text/content.js.map +1 -1
  137. package/build/components/rich-text/get-rich-text-values.js +2 -1
  138. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  139. package/build/components/rich-text/index.js +2 -30
  140. package/build/components/rich-text/index.js.map +1 -1
  141. package/build/components/rich-text/index.native.js +10 -17
  142. package/build/components/rich-text/index.native.js.map +1 -1
  143. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  144. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  145. package/build/components/rich-text/native/index.native.js +41 -37
  146. package/build/components/rich-text/native/index.native.js.map +1 -1
  147. package/build/components/rich-text/use-input-rules.js +35 -2
  148. package/build/components/rich-text/use-input-rules.js.map +1 -1
  149. package/build/components/rich-text/with-deprecations.js +50 -0
  150. package/build/components/rich-text/with-deprecations.js.map +1 -0
  151. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  152. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  153. package/build/components/use-block-drop-zone/index.js +74 -9
  154. package/build/components/use-block-drop-zone/index.js.map +1 -1
  155. package/build/components/use-moving-animation/index.js +2 -1
  156. package/build/components/use-moving-animation/index.js.map +1 -1
  157. package/build/components/use-on-block-drop/index.js +1 -1
  158. package/build/components/use-on-block-drop/index.js.map +1 -1
  159. package/build/components/use-resize-canvas/index.js +4 -1
  160. package/build/components/use-resize-canvas/index.js.map +1 -1
  161. package/build/components/use-settings/index.js +16 -2
  162. package/build/components/use-settings/index.js.map +1 -1
  163. package/build/hooks/align.js +20 -68
  164. package/build/hooks/align.js.map +1 -1
  165. package/build/hooks/align.native.js +11 -1
  166. package/build/hooks/align.native.js.map +1 -1
  167. package/build/hooks/anchor.js +13 -29
  168. package/build/hooks/anchor.js.map +1 -1
  169. package/build/hooks/background.js +28 -31
  170. package/build/hooks/background.js.map +1 -1
  171. package/build/hooks/block-hooks.js +24 -32
  172. package/build/hooks/block-hooks.js.map +1 -1
  173. package/build/hooks/block-renaming.js +38 -0
  174. package/build/hooks/block-renaming.js.map +1 -1
  175. package/build/hooks/border.js +58 -80
  176. package/build/hooks/border.js.map +1 -1
  177. package/build/hooks/color.js +76 -89
  178. package/build/hooks/color.js.map +1 -1
  179. package/build/hooks/content-lock-ui.js +29 -29
  180. package/build/hooks/content-lock-ui.js.map +1 -1
  181. package/build/hooks/custom-class-name.js +12 -29
  182. package/build/hooks/custom-class-name.js.map +1 -1
  183. package/build/hooks/custom-fields.js +64 -73
  184. package/build/hooks/custom-fields.js.map +1 -1
  185. package/build/hooks/dimensions.js +21 -17
  186. package/build/hooks/dimensions.js.map +1 -1
  187. package/build/hooks/duotone.js +31 -61
  188. package/build/hooks/duotone.js.map +1 -1
  189. package/build/hooks/font-family.js +16 -25
  190. package/build/hooks/font-family.js.map +1 -1
  191. package/build/hooks/font-size.js +51 -119
  192. package/build/hooks/font-size.js.map +1 -1
  193. package/build/hooks/index.js +25 -15
  194. package/build/hooks/index.js.map +1 -1
  195. package/build/hooks/index.native.js +10 -3
  196. package/build/hooks/index.native.js.map +1 -1
  197. package/build/hooks/layout-child.js +68 -0
  198. package/build/hooks/layout-child.js.map +1 -0
  199. package/build/hooks/layout.js +29 -108
  200. package/build/hooks/layout.js.map +1 -1
  201. package/build/hooks/padding.js +2 -2
  202. package/build/hooks/padding.js.map +1 -1
  203. package/build/hooks/position.js +40 -62
  204. package/build/hooks/position.js.map +1 -1
  205. package/build/hooks/style.js +51 -88
  206. package/build/hooks/style.js.map +1 -1
  207. package/build/hooks/typography.js +34 -14
  208. package/build/hooks/typography.js.map +1 -1
  209. package/build/hooks/utils.js +154 -7
  210. package/build/hooks/utils.js.map +1 -1
  211. package/build/layouts/constrained.js +4 -3
  212. package/build/layouts/constrained.js.map +1 -1
  213. package/build/private-apis.js +0 -2
  214. package/build/private-apis.js.map +1 -1
  215. package/build/store/private-actions.js +8 -0
  216. package/build/store/private-actions.js.map +1 -1
  217. package/build/store/private-selectors.js +34 -0
  218. package/build/store/private-selectors.js.map +1 -1
  219. package/build/store/reducer.js +8 -0
  220. package/build/store/reducer.js.map +1 -1
  221. package/build/store/selectors.js +10 -58
  222. package/build/store/selectors.js.map +1 -1
  223. package/build/store/utils.js +66 -0
  224. package/build/store/utils.js.map +1 -0
  225. package/build/utils/object.js +21 -61
  226. package/build/utils/object.js.map +1 -1
  227. package/build/utils/selection.js +9 -1
  228. package/build/utils/selection.js.map +1 -1
  229. package/build/utils/transform-styles/index.js +26 -6
  230. package/build/utils/transform-styles/index.js.map +1 -1
  231. package/build-module/components/block-canvas/index.js +23 -7
  232. package/build-module/components/block-canvas/index.js.map +1 -1
  233. package/build-module/components/block-card/index.js +1 -1
  234. package/build-module/components/block-card/index.js.map +1 -1
  235. package/build-module/components/block-controls/hook.js +4 -24
  236. package/build-module/components/block-controls/hook.js.map +1 -1
  237. package/build-module/components/block-edit/context.js +2 -0
  238. package/build-module/components/block-edit/context.js.map +1 -1
  239. package/build-module/components/block-edit/index.js +19 -10
  240. package/build-module/components/block-edit/index.js.map +1 -1
  241. package/build-module/components/block-info-slot-fill/index.js +3 -3
  242. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  243. package/build-module/components/block-list/block.js +29 -10
  244. package/build-module/components/block-list/block.js.map +1 -1
  245. package/build-module/components/block-list/block.native.js +16 -5
  246. package/build-module/components/block-list/block.native.js.map +1 -1
  247. package/build-module/components/block-list/use-block-props/index.js +62 -19
  248. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  249. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  250. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  251. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  252. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  253. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  254. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  255. package/build-module/components/block-parent-selector/index.js +1 -1
  256. package/build-module/components/block-parent-selector/index.js.map +1 -1
  257. package/build-module/components/block-pattern-setup/index.js +24 -15
  258. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  259. package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
  260. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  261. package/build-module/components/block-patterns-list/index.js +37 -20
  262. package/build-module/components/block-patterns-list/index.js.map +1 -1
  263. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  264. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  265. package/build-module/components/block-rename/index.js +4 -0
  266. package/build-module/components/block-rename/index.js.map +1 -0
  267. package/build-module/components/block-rename/is-empty-string.js +4 -0
  268. package/build-module/components/block-rename/is-empty-string.js.map +1 -0
  269. package/build-module/components/block-rename/modal.js +82 -0
  270. package/build-module/components/block-rename/modal.js.map +1 -0
  271. package/build-module/components/block-rename/rename-control.js +66 -0
  272. package/build-module/components/block-rename/rename-control.js.map +1 -0
  273. package/build-module/components/block-rename/use-block-rename.js +10 -0
  274. package/build-module/components/block-rename/use-block-rename.js.map +1 -0
  275. package/build-module/components/block-settings/container.native.js +4 -2
  276. package/build-module/components/block-settings/container.native.js.map +1 -1
  277. package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
  278. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  279. package/build-module/components/block-settings-menu-controls/index.js +7 -0
  280. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  281. package/build-module/components/block-styles/index.js +1 -1
  282. package/build-module/components/block-styles/index.js.map +1 -1
  283. package/build-module/components/block-styles/index.native.js +3 -2
  284. package/build-module/components/block-styles/index.native.js.map +1 -1
  285. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  286. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  287. package/build-module/components/block-toolbar/index.js +88 -25
  288. package/build-module/components/block-toolbar/index.js.map +1 -1
  289. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  290. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  291. package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
  292. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  293. package/build-module/components/block-tools/index.js +27 -24
  294. package/build-module/components/block-tools/index.js.map +1 -1
  295. package/build-module/components/block-types-list/index.js +6 -2
  296. package/build-module/components/block-types-list/index.js.map +1 -1
  297. package/build-module/components/block-types-list/index.native.js +2 -1
  298. package/build-module/components/block-types-list/index.native.js.map +1 -1
  299. package/build-module/components/block-variation-picker/index.native.js +2 -1
  300. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  301. package/build-module/components/colors-gradients/control.js +29 -18
  302. package/build-module/components/colors-gradients/control.js.map +1 -1
  303. package/build-module/components/date-format-picker/index.js +8 -1
  304. package/build-module/components/date-format-picker/index.js.map +1 -1
  305. package/build-module/components/duotone-control/index.js +1 -4
  306. package/build-module/components/duotone-control/index.js.map +1 -1
  307. package/build-module/components/global-styles/advanced-panel.js +1 -1
  308. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  309. package/build-module/components/global-styles/color-panel.js +23 -21
  310. package/build-module/components/global-styles/color-panel.js.map +1 -1
  311. package/build-module/components/global-styles/filters-panel.js +10 -4
  312. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  313. package/build-module/components/global-styles/typography-panel.js +20 -31
  314. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  315. package/build-module/components/image-link-destinations/index.native.js +109 -0
  316. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  317. package/build-module/components/image-size-control/index.js +0 -5
  318. package/build-module/components/image-size-control/index.js.map +1 -1
  319. package/build-module/components/index.native.js +1 -0
  320. package/build-module/components/index.native.js.map +1 -1
  321. package/build-module/components/inner-blocks/index.js +3 -1
  322. package/build-module/components/inner-blocks/index.js.map +1 -1
  323. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
  324. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  325. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  326. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  327. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  328. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  329. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +2 -2
  330. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  331. package/build-module/components/inserter/block-patterns-tab/utils.js +3 -4
  332. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  333. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
  334. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  335. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  336. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  337. package/build-module/components/inserter/menu.js +14 -7
  338. package/build-module/components/inserter/menu.js.map +1 -1
  339. package/build-module/components/inserter/preview-panel.js +2 -2
  340. package/build-module/components/inserter/preview-panel.js.map +1 -1
  341. package/build-module/components/inserter-button/index.native.js +89 -0
  342. package/build-module/components/inserter-button/index.native.js.map +1 -0
  343. package/build-module/components/inserter-button/sparkles.js +15 -0
  344. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  345. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  346. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  347. package/build-module/components/inserter-listbox/index.js +13 -8
  348. package/build-module/components/inserter-listbox/index.js.map +1 -1
  349. package/build-module/components/inserter-listbox/item.js +25 -23
  350. package/build-module/components/inserter-listbox/item.js.map +1 -1
  351. package/build-module/components/inserter-listbox/row.js +6 -5
  352. package/build-module/components/inserter-listbox/row.js.map +1 -1
  353. package/build-module/components/inspector-controls/fill.js +3 -3
  354. package/build-module/components/inspector-controls/fill.js.map +1 -1
  355. package/build-module/components/inspector-controls/fill.native.js +3 -3
  356. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  357. package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
  358. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  359. package/build-module/components/navigable-toolbar/index.js +2 -2
  360. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  361. package/build-module/components/preview-options/index.js +6 -60
  362. package/build-module/components/preview-options/index.js.map +1 -1
  363. package/build-module/components/rich-text/content.js +25 -21
  364. package/build-module/components/rich-text/content.js.map +1 -1
  365. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  366. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  367. package/build-module/components/rich-text/index.js +4 -32
  368. package/build-module/components/rich-text/index.js.map +1 -1
  369. package/build-module/components/rich-text/index.native.js +11 -19
  370. package/build-module/components/rich-text/index.native.js.map +1 -1
  371. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  372. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  373. package/build-module/components/rich-text/native/index.native.js +41 -37
  374. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  375. package/build-module/components/rich-text/use-input-rules.js +36 -3
  376. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  377. package/build-module/components/rich-text/with-deprecations.js +42 -0
  378. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  379. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  380. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  381. package/build-module/components/use-block-drop-zone/index.js +73 -9
  382. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  383. package/build-module/components/use-moving-animation/index.js +2 -1
  384. package/build-module/components/use-moving-animation/index.js.map +1 -1
  385. package/build-module/components/use-on-block-drop/index.js +1 -1
  386. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  387. package/build-module/components/use-resize-canvas/index.js +4 -1
  388. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  389. package/build-module/components/use-settings/index.js +15 -3
  390. package/build-module/components/use-settings/index.js.map +1 -1
  391. package/build-module/hooks/align.js +19 -66
  392. package/build-module/hooks/align.js.map +1 -1
  393. package/build-module/hooks/align.native.js +1 -0
  394. package/build-module/hooks/align.native.js.map +1 -1
  395. package/build-module/hooks/anchor.js +11 -26
  396. package/build-module/hooks/anchor.js.map +1 -1
  397. package/build-module/hooks/background.js +26 -28
  398. package/build-module/hooks/background.js.map +1 -1
  399. package/build-module/hooks/block-hooks.js +22 -30
  400. package/build-module/hooks/block-hooks.js.map +1 -1
  401. package/build-module/hooks/block-renaming.js +36 -0
  402. package/build-module/hooks/block-renaming.js.map +1 -1
  403. package/build-module/hooks/border.js +57 -78
  404. package/build-module/hooks/border.js.map +1 -1
  405. package/build-module/hooks/color.js +74 -86
  406. package/build-module/hooks/color.js.map +1 -1
  407. package/build-module/hooks/content-lock-ui.js +27 -27
  408. package/build-module/hooks/content-lock-ui.js.map +1 -1
  409. package/build-module/hooks/custom-class-name.js +11 -27
  410. package/build-module/hooks/custom-class-name.js.map +1 -1
  411. package/build-module/hooks/custom-fields.js +60 -74
  412. package/build-module/hooks/custom-fields.js.map +1 -1
  413. package/build-module/hooks/dimensions.js +21 -16
  414. package/build-module/hooks/dimensions.js.map +1 -1
  415. package/build-module/hooks/duotone.js +30 -61
  416. package/build-module/hooks/duotone.js.map +1 -1
  417. package/build-module/hooks/font-family.js +14 -23
  418. package/build-module/hooks/font-family.js.map +1 -1
  419. package/build-module/hooks/font-size.js +49 -119
  420. package/build-module/hooks/font-size.js.map +1 -1
  421. package/build-module/hooks/index.js +18 -15
  422. package/build-module/hooks/index.js.map +1 -1
  423. package/build-module/hooks/index.native.js +5 -3
  424. package/build-module/hooks/index.native.js.map +1 -1
  425. package/build-module/hooks/layout-child.js +60 -0
  426. package/build-module/hooks/layout-child.js.map +1 -0
  427. package/build-module/hooks/layout.js +26 -105
  428. package/build-module/hooks/layout.js.map +1 -1
  429. package/build-module/hooks/padding.js +2 -2
  430. package/build-module/hooks/padding.js.map +1 -1
  431. package/build-module/hooks/position.js +38 -59
  432. package/build-module/hooks/position.js.map +1 -1
  433. package/build-module/hooks/style.js +51 -84
  434. package/build-module/hooks/style.js.map +1 -1
  435. package/build-module/hooks/typography.js +33 -12
  436. package/build-module/hooks/typography.js.map +1 -1
  437. package/build-module/hooks/utils.js +149 -6
  438. package/build-module/hooks/utils.js.map +1 -1
  439. package/build-module/layouts/constrained.js +4 -3
  440. package/build-module/layouts/constrained.js.map +1 -1
  441. package/build-module/private-apis.js +0 -2
  442. package/build-module/private-apis.js.map +1 -1
  443. package/build-module/store/private-actions.js +7 -0
  444. package/build-module/store/private-actions.js.map +1 -1
  445. package/build-module/store/private-selectors.js +33 -1
  446. package/build-module/store/private-selectors.js.map +1 -1
  447. package/build-module/store/reducer.js +8 -0
  448. package/build-module/store/reducer.js.map +1 -1
  449. package/build-module/store/selectors.js +3 -51
  450. package/build-module/store/selectors.js.map +1 -1
  451. package/build-module/store/utils.js +56 -0
  452. package/build-module/store/utils.js.map +1 -0
  453. package/build-module/utils/object.js +21 -60
  454. package/build-module/utils/object.js.map +1 -1
  455. package/build-module/utils/selection.js +9 -1
  456. package/build-module/utils/selection.js.map +1 -1
  457. package/build-module/utils/transform-styles/index.js +24 -7
  458. package/build-module/utils/transform-styles/index.js.map +1 -1
  459. package/build-style/content-rtl.css +6 -6
  460. package/build-style/content.css +6 -6
  461. package/build-style/style-rtl.css +123 -298
  462. package/build-style/style.css +123 -298
  463. package/package.json +31 -31
  464. package/src/components/block-canvas/index.js +31 -17
  465. package/src/components/block-caption/README.md +2 -2
  466. package/src/components/block-card/index.js +5 -3
  467. package/src/components/block-card/style.scss +7 -3
  468. package/src/components/block-controls/hook.js +8 -30
  469. package/src/components/block-controls/test/index.js +3 -3
  470. package/src/components/block-edit/context.js +3 -0
  471. package/src/components/block-edit/index.js +36 -10
  472. package/src/components/block-info-slot-fill/index.js +6 -3
  473. package/src/components/block-inspector/style.scss +0 -4
  474. package/src/components/block-list/block.js +39 -5
  475. package/src/components/block-list/block.native.js +20 -4
  476. package/src/components/block-list/use-block-props/index.js +74 -21
  477. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  478. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  479. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  480. package/src/components/block-parent-selector/index.js +1 -1
  481. package/src/components/block-pattern-setup/index.js +38 -22
  482. package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
  483. package/src/components/block-pattern-setup/style.scss +4 -1
  484. package/src/components/block-patterns-list/README.md +4 -4
  485. package/src/components/block-patterns-list/index.js +61 -35
  486. package/src/components/block-patterns-list/style.scss +7 -0
  487. package/src/components/block-removal-warning-modal/index.js +7 -14
  488. package/src/components/block-rename/index.js +3 -0
  489. package/src/components/block-rename/is-empty-string.js +3 -0
  490. package/src/components/block-rename/modal.js +121 -0
  491. package/src/components/block-rename/rename-control.js +80 -0
  492. package/src/components/block-rename/use-block-rename.js +10 -0
  493. package/src/components/block-settings/container.native.js +3 -5
  494. package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
  495. package/src/components/block-settings-menu-controls/index.js +9 -0
  496. package/src/components/block-styles/index.js +1 -1
  497. package/src/components/block-styles/index.native.js +4 -2
  498. package/src/components/block-styles/style.scss +0 -11
  499. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  500. package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
  501. package/src/components/block-toolbar/index.js +180 -95
  502. package/src/components/block-toolbar/style.scss +50 -66
  503. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  504. package/src/components/block-tools/block-toolbar-popover.js +90 -0
  505. package/src/components/block-tools/index.js +42 -29
  506. package/src/components/block-tools/style.scss +60 -172
  507. package/src/components/block-types-list/index.js +5 -4
  508. package/src/components/block-types-list/index.native.js +2 -1
  509. package/src/components/block-variation-picker/index.native.js +1 -1
  510. package/src/components/button-block-appender/content.scss +2 -2
  511. package/src/components/colors-gradients/control.js +49 -30
  512. package/src/components/colors-gradients/style.scss +0 -7
  513. package/src/components/date-format-picker/index.js +7 -0
  514. package/src/components/duotone-control/index.js +2 -5
  515. package/src/components/duotone-control/style.scss +1 -6
  516. package/src/components/editable-text/README.md +0 -36
  517. package/src/components/global-styles/advanced-panel.js +1 -1
  518. package/src/components/global-styles/color-panel.js +34 -25
  519. package/src/components/global-styles/filters-panel.js +8 -4
  520. package/src/components/global-styles/typography-panel.js +23 -43
  521. package/src/components/image-link-destinations/index.native.js +152 -0
  522. package/src/components/image-link-destinations/style.native.scss +16 -0
  523. package/src/components/image-size-control/index.js +0 -6
  524. package/src/components/index.native.js +1 -0
  525. package/src/components/inner-blocks/README.md +13 -2
  526. package/src/components/inner-blocks/index.js +6 -2
  527. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
  528. package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
  529. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
  530. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
  531. package/src/components/inserter/block-patterns-tab/utils.js +6 -4
  532. package/src/components/inserter/hooks/use-patterns-state.js +3 -1
  533. package/src/components/inserter/media-tab/media-panel.js +1 -1
  534. package/src/components/inserter/menu.js +16 -8
  535. package/src/components/inserter/preview-panel.js +2 -2
  536. package/src/components/inserter/style.scss +15 -17
  537. package/src/components/inserter-button/README.md +62 -0
  538. package/src/components/inserter-button/index.native.js +116 -0
  539. package/src/components/inserter-button/sparkles.js +15 -0
  540. package/src/components/inserter-button/style.native.scss +72 -0
  541. package/src/components/inserter-draggable-blocks/index.js +18 -5
  542. package/src/components/inserter-listbox/index.js +11 -7
  543. package/src/components/inserter-listbox/item.js +11 -12
  544. package/src/components/inserter-listbox/row.js +6 -12
  545. package/src/components/inspector-controls/fill.js +6 -3
  546. package/src/components/inspector-controls/fill.native.js +6 -3
  547. package/src/components/link-control/style.scss +1 -1
  548. package/src/components/link-control/test/index.js +1 -1
  549. package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
  550. package/src/components/navigable-toolbar/README.md +2 -0
  551. package/src/components/navigable-toolbar/index.js +2 -2
  552. package/src/components/plain-text/README.md +0 -28
  553. package/src/components/preview-options/index.js +6 -84
  554. package/src/components/rich-text/README.md +0 -58
  555. package/src/components/rich-text/content.js +27 -20
  556. package/src/components/rich-text/get-rich-text-values.js +6 -1
  557. package/src/components/rich-text/index.js +5 -46
  558. package/src/components/rich-text/index.native.js +9 -26
  559. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  560. package/src/components/rich-text/native/index.native.js +52 -50
  561. package/src/components/rich-text/use-input-rules.js +36 -3
  562. package/src/components/rich-text/with-deprecations.js +51 -0
  563. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  564. package/src/components/url-input/README.md +1 -74
  565. package/src/components/use-block-drop-zone/index.js +118 -15
  566. package/src/components/use-moving-animation/index.js +1 -1
  567. package/src/components/use-on-block-drop/index.js +2 -1
  568. package/src/components/use-resize-canvas/README.md +3 -3
  569. package/src/components/use-resize-canvas/index.js +4 -1
  570. package/src/components/use-settings/index.js +17 -3
  571. package/src/components/use-settings/test/index.js +1 -1
  572. package/src/hooks/align.js +15 -76
  573. package/src/hooks/align.native.js +1 -0
  574. package/src/hooks/anchor.js +13 -33
  575. package/src/hooks/background.js +28 -23
  576. package/src/hooks/block-hooks.js +22 -51
  577. package/src/hooks/block-renaming.js +33 -0
  578. package/src/hooks/border.js +67 -118
  579. package/src/hooks/color.js +100 -132
  580. package/src/hooks/content-lock-ui.js +110 -122
  581. package/src/hooks/custom-class-name.js +8 -40
  582. package/src/hooks/custom-fields.js +70 -94
  583. package/src/hooks/dimensions.js +20 -16
  584. package/src/hooks/duotone.js +70 -127
  585. package/src/hooks/font-family.js +10 -29
  586. package/src/hooks/font-size.js +66 -162
  587. package/src/hooks/index.js +42 -15
  588. package/src/hooks/index.native.js +6 -3
  589. package/src/hooks/layout-child.js +53 -0
  590. package/src/hooks/layout.js +25 -110
  591. package/src/hooks/padding.js +2 -2
  592. package/src/hooks/position.js +50 -90
  593. package/src/hooks/style.js +117 -187
  594. package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
  595. package/src/hooks/test/align.js +1 -178
  596. package/src/hooks/typography.js +20 -16
  597. package/src/hooks/utils.js +187 -6
  598. package/src/layouts/constrained.js +57 -50
  599. package/src/private-apis.js +0 -2
  600. package/src/store/private-actions.js +8 -0
  601. package/src/store/private-selectors.js +45 -0
  602. package/src/store/reducer.js +8 -0
  603. package/src/store/selectors.js +5 -67
  604. package/src/store/utils.js +74 -0
  605. package/src/style.scss +1 -3
  606. package/src/utils/object.js +18 -69
  607. package/src/utils/selection.js +9 -2
  608. package/src/utils/test/transform-styles.js +49 -0
  609. package/src/utils/transform-styles/index.js +39 -13
  610. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  611. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  612. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  613. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  614. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  615. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  616. package/build/components/block-tools/back-compat.js +0 -45
  617. package/build/components/block-tools/back-compat.js.map +0 -1
  618. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  619. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  620. package/build/components/block-tools/selected-block-tools.js +0 -113
  621. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  622. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  623. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  624. package/build/components/use-display-block-controls/index.js +0 -39
  625. package/build/components/use-display-block-controls/index.js.map +0 -1
  626. package/build/components/use-display-block-controls/index.native.js +0 -39
  627. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  628. package/build/hooks/block-rename-ui.js +0 -167
  629. package/build/hooks/block-rename-ui.js.map +0 -1
  630. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  631. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  632. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  633. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  634. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  635. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  636. package/build-module/components/block-tools/back-compat.js +0 -35
  637. package/build-module/components/block-tools/back-compat.js.map +0 -1
  638. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  639. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  640. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  641. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  642. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  643. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  644. package/build-module/components/use-display-block-controls/index.js +0 -32
  645. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  646. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  647. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  648. package/build-module/hooks/block-rename-ui.js +0 -159
  649. package/build-module/hooks/block-rename-ui.js.map +0 -1
  650. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  651. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  652. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  653. package/src/components/block-parent-selector/style.scss +0 -11
  654. package/src/components/block-tools/back-compat.js +0 -35
  655. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  656. package/src/components/block-tools/selected-block-tools.js +0 -127
  657. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  658. package/src/components/preview-options/README.md +0 -94
  659. package/src/components/preview-options/style.scss +0 -64
  660. package/src/components/use-display-block-controls/index.js +0 -36
  661. package/src/components/use-display-block-controls/index.native.js +0 -37
  662. package/src/hooks/block-rename-ui.js +0 -228
  663. package/src/hooks/test/color.js +0 -112
  664. /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
@@ -4,11 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.Content = void 0;
7
+ exports.Content = Content;
8
8
  var _react = require("react");
9
9
  var _element = require("@wordpress/element");
10
10
  var _blocks = require("@wordpress/blocks");
11
11
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
12
+ var _ = _interopRequireDefault(require("./"));
12
13
  var _utils = require("./utils");
13
14
  /**
14
15
  * WordPress dependencies
@@ -18,37 +19,39 @@ var _utils = require("./utils");
18
19
  * Internal dependencies
19
20
  */
20
21
 
21
- const Content = ({
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+
26
+ function Content({
22
27
  value,
23
28
  tagName: Tag,
24
29
  multiline,
30
+ format,
25
31
  ...props
26
- }) => {
27
- // Handle deprecated `children` and `node` sources.
28
- if (Array.isArray(value)) {
32
+ }) {
33
+ if (_.default.isEmpty(value)) {
34
+ const MultilineTag = (0, _utils.getMultilineTag)(multiline);
35
+ value = MultilineTag ? (0, _react.createElement)(MultilineTag, null) : null;
36
+ } else if (Array.isArray(value)) {
29
37
  (0, _deprecated.default)('wp.blockEditor.RichText value prop as children type', {
30
38
  since: '6.1',
31
39
  version: '6.3',
32
40
  alternative: 'value prop as string',
33
41
  link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
34
42
  });
35
- value = _blocks.children.toHTML(value);
36
- }
37
- const MultilineTag = (0, _utils.getMultilineTag)(multiline);
38
- if (!value && MultilineTag) {
39
- value = `<${MultilineTag}></${MultilineTag}>`;
43
+ value = (0, _react.createElement)(_element.RawHTML, null, _blocks.children.toHTML(value));
44
+ } else if (typeof value === 'string') {
45
+ // To do: deprecate.
46
+ value = (0, _react.createElement)(_element.RawHTML, null, value);
47
+ } else {
48
+ // To do: create a toReactComponent method on RichTextData, which we
49
+ // might in the future also use for the editable tree. See
50
+ // https://github.com/WordPress/gutenberg/pull/41655.
51
+ value = (0, _react.createElement)(_element.RawHTML, null, value.toHTMLString());
40
52
  }
41
- const content = (0, _react.createElement)(_element.RawHTML, null, value);
42
- if (Tag) {
43
- const {
44
- format,
45
- ...restProps
46
- } = props;
47
- return (0, _react.createElement)(Tag, {
48
- ...restProps
49
- }, content);
50
- }
51
- return content;
52
- };
53
- exports.Content = Content;
53
+ return Tag ? (0, _react.createElement)(Tag, {
54
+ ...props
55
+ }, value) : value;
56
+ }
54
57
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blocks","_deprecated","_interopRequireDefault","_utils","Content","value","tagName","Tag","multiline","props","Array","isArray","deprecated","since","version","alternative","link","childrenSource","toHTML","MultilineTag","getMultilineTag","content","_react","createElement","RawHTML","format","restProps","exports"],"sources":["@wordpress/block-editor/src/components/rich-text/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML } from '@wordpress/element';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { getMultilineTag } from './utils';\n\nexport const Content = ( { value, tagName: Tag, multiline, ...props } ) => {\n\t// Handle deprecated `children` and `node` sources.\n\tif ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\n\t\tvalue = childrenSource.toHTML( value );\n\t}\n\n\tconst MultilineTag = getMultilineTag( multiline );\n\n\tif ( ! value && MultilineTag ) {\n\t\tvalue = `<${ MultilineTag }></${ MultilineTag }>`;\n\t}\n\n\tconst content = <RawHTML>{ value }</RawHTML>;\n\n\tif ( Tag ) {\n\t\tconst { format, ...restProps } = props;\n\t\treturn <Tag { ...restProps }>{ content }</Tag>;\n\t}\n\n\treturn content;\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGO,MAAMK,OAAO,GAAGA,CAAE;EAAEC,KAAK;EAAEC,OAAO,EAAEC,GAAG;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC1E;EACA,IAAKC,KAAK,CAACC,OAAO,CAAEN,KAAM,CAAC,EAAG;IAC7B,IAAAO,mBAAU,EAAE,qDAAqD,EAAE;MAClEC,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE,sBAAsB;MACnCC,IAAI,EAAE;IACP,CAAE,CAAC;IAEHX,KAAK,GAAGY,gBAAc,CAACC,MAAM,CAAEb,KAAM,CAAC;EACvC;EAEA,MAAMc,YAAY,GAAG,IAAAC,sBAAe,EAAEZ,SAAU,CAAC;EAEjD,IAAK,CAAEH,KAAK,IAAIc,YAAY,EAAG;IAC9Bd,KAAK,GAAI,IAAIc,YAAc,MAAMA,YAAc,GAAE;EAClD;EAEA,MAAME,OAAO,GAAG,IAAAC,MAAA,CAAAC,aAAA,EAACzB,QAAA,CAAA0B,OAAO,QAAGnB,KAAgB,CAAC;EAE5C,IAAKE,GAAG,EAAG;IACV,MAAM;MAAEkB,MAAM;MAAE,GAAGC;IAAU,CAAC,GAAGjB,KAAK;IACtC,OAAO,IAAAa,MAAA,CAAAC,aAAA,EAAChB,GAAG;MAAA,GAAMmB;IAAS,GAAKL,OAAc,CAAC;EAC/C;EAEA,OAAOA,OAAO;AACf,CAAC;AAACM,OAAA,CAAAvB,OAAA,GAAAA,OAAA"}
1
+ {"version":3,"names":["_element","require","_blocks","_deprecated","_interopRequireDefault","_","_utils","Content","value","tagName","Tag","multiline","format","props","RichText","isEmpty","MultilineTag","getMultilineTag","_react","createElement","Array","isArray","deprecated","since","version","alternative","link","RawHTML","childrenSource","toHTML","toHTMLString"],"sources":["@wordpress/block-editor/src/components/rich-text/content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML } from '@wordpress/element';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport RichText from './';\n\n/**\n * Internal dependencies\n */\nimport { getMultilineTag } from './utils';\n\nexport function Content( {\n\tvalue,\n\ttagName: Tag,\n\tmultiline,\n\tformat,\n\t...props\n} ) {\n\tif ( RichText.isEmpty( value ) ) {\n\t\tconst MultilineTag = getMultilineTag( multiline );\n\t\tvalue = MultilineTag ? <MultilineTag /> : null;\n\t} else if ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\t\tvalue = <RawHTML>{ childrenSource.toHTML( value ) }</RawHTML>;\n\t} else if ( typeof value === 'string' ) {\n\t\t// To do: deprecate.\n\t\tvalue = <RawHTML>{ value }</RawHTML>;\n\t} else {\n\t\t// To do: create a toReactComponent method on RichTextData, which we\n\t\t// might in the future also use for the editable tree. See\n\t\t// https://github.com/WordPress/gutenberg/pull/41655.\n\t\tvalue = <RawHTML>{ value.toHTMLString() }</RawHTML>;\n\t}\n\n\treturn Tag ? <Tag { ...props }>{ value }</Tag> : value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,CAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA,IAAAK,M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
8
  var _react = require("react");
9
9
  var _element = require("@wordpress/element");
10
10
  var _blocks = require("@wordpress/blocks");
11
+ var _richText = require("@wordpress/rich-text");
11
12
  var _innerBlocks = _interopRequireDefault(require("../inner-blocks"));
12
13
  var _content = require("./content");
13
14
  /**
@@ -88,6 +89,6 @@ function getRichTextValues(blocks = []) {
88
89
  const values = [];
89
90
  addValuesForBlocks(values, blocks);
90
91
  _blocks.__unstableGetBlockProps.skipFilters = false;
91
- return values;
92
+ return values.map(value => value instanceof _richText.RichTextData ? value : _richText.RichTextData.fromHTMLString(value));
92
93
  }
93
94
  //# sourceMappingURL=get-rich-text-values.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blocks","_innerBlocks","_interopRequireDefault","_content","addValuesForElement","element","values","innerBlocks","undefined","Array","isArray","addValuesForElements","type","props","StrictMode","Fragment","children","RawHTML","InnerBlocks","Content","addValuesForBlocks","push","value","el","prototype","render","args","i","length","blocks","name","attributes","saveElement","getSaveElement","_react","createElement","default","getRichTextValues","getBlockProps","skipFilters"],"sources":["@wordpress/block-editor/src/components/rich-text/get-rich-text-values.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML, StrictMode, Fragment } from '@wordpress/element';\nimport {\n\tgetSaveElement,\n\t__unstableGetBlockProps as getBlockProps,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport InnerBlocks from '../inner-blocks';\nimport { Content } from './content';\n\n/*\n * This function is similar to `@wordpress/element`'s `renderToString` function,\n * except that it does not render the elements to a string, but instead collects\n * the values of all rich text `Content` elements.\n */\nfunction addValuesForElement( element, values, innerBlocks ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn;\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn addValuesForElements( element, values, innerBlocks );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn;\n\t}\n\n\tconst { type, props } = element;\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn addValuesForElements( props.children, values, innerBlocks );\n\t\tcase RawHTML:\n\t\t\treturn;\n\t\tcase InnerBlocks.Content:\n\t\t\treturn addValuesForBlocks( values, innerBlocks );\n\t\tcase Content:\n\t\t\tvalues.push( props.value );\n\t\t\treturn;\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\tif ( typeof props.children !== 'undefined' ) {\n\t\t\t\treturn addValuesForElements(\n\t\t\t\t\tprops.children,\n\t\t\t\t\tvalues,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\tcase 'function':\n\t\t\tconst el =\n\t\t\t\ttype.prototype && typeof type.prototype.render === 'function'\n\t\t\t\t\t? new type( props ).render()\n\t\t\t\t\t: type( props );\n\t\t\treturn addValuesForElement( el, values, innerBlocks );\n\t}\n}\n\nfunction addValuesForElements( children, ...args ) {\n\tchildren = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\taddValuesForElement( children[ i ], ...args );\n\t}\n}\n\nfunction addValuesForBlocks( values, blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tconst { name, attributes, innerBlocks } = blocks[ i ];\n\t\tconst saveElement = getSaveElement(\n\t\t\tname,\n\t\t\tattributes,\n\t\t\t// Instead of letting save elements use `useInnerBlocksProps.save`,\n\t\t\t// force them to use InnerBlocks.Content instead so we can intercept\n\t\t\t// a single component.\n\t\t\t<InnerBlocks.Content />\n\t\t);\n\t\taddValuesForElement( saveElement, values, innerBlocks );\n\t}\n}\n\nexport function getRichTextValues( blocks = [] ) {\n\tgetBlockProps.skipFilters = true;\n\tconst values = [];\n\taddValuesForBlocks( values, blocks );\n\tgetBlockProps.skipFilters = false;\n\treturn values;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAA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ACd"}
1
+ {"version":3,"names":["_element","require","_blocks","_richText","_innerBlocks","_interopRequireDefault","_content","addValuesForElement","element","values","innerBlocks","undefined","Array","isArray","addValuesForElements","type","props","StrictMode","Fragment","children","RawHTML","InnerBlocks","Content","addValuesForBlocks","push","value","el","prototype","render","args","i","length","blocks","name","attributes","saveElement","getSaveElement","_react","createElement","default","getRichTextValues","getBlockProps","skipFilters","map","RichTextData","fromHTMLString"],"sources":["@wordpress/block-editor/src/components/rich-text/get-rich-text-values.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RawHTML, StrictMode, Fragment } from '@wordpress/element';\nimport {\n\tgetSaveElement,\n\t__unstableGetBlockProps as getBlockProps,\n} from '@wordpress/blocks';\nimport { RichTextData } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport InnerBlocks from '../inner-blocks';\nimport { Content } from './content';\n\n/*\n * This function is similar to `@wordpress/element`'s `renderToString` function,\n * except that it does not render the elements to a string, but instead collects\n * the values of all rich text `Content` elements.\n */\nfunction addValuesForElement( element, values, innerBlocks ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn;\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn addValuesForElements( element, values, innerBlocks );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn;\n\t}\n\n\tconst { type, props } = element;\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn addValuesForElements( props.children, values, innerBlocks );\n\t\tcase RawHTML:\n\t\t\treturn;\n\t\tcase InnerBlocks.Content:\n\t\t\treturn addValuesForBlocks( values, innerBlocks );\n\t\tcase Content:\n\t\t\tvalues.push( props.value );\n\t\t\treturn;\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\tif ( typeof props.children !== 'undefined' ) {\n\t\t\t\treturn addValuesForElements(\n\t\t\t\t\tprops.children,\n\t\t\t\t\tvalues,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\tcase 'function':\n\t\t\tconst el =\n\t\t\t\ttype.prototype && typeof type.prototype.render === 'function'\n\t\t\t\t\t? new type( props ).render()\n\t\t\t\t\t: type( props );\n\t\t\treturn addValuesForElement( el, values, innerBlocks );\n\t}\n}\n\nfunction addValuesForElements( children, ...args ) {\n\tchildren = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\taddValuesForElement( children[ i ], ...args );\n\t}\n}\n\nfunction addValuesForBlocks( values, blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tconst { name, attributes, innerBlocks } = blocks[ i ];\n\t\tconst saveElement = getSaveElement(\n\t\t\tname,\n\t\t\tattributes,\n\t\t\t// Instead of letting save elements use `useInnerBlocksProps.save`,\n\t\t\t// force them to use InnerBlocks.Content instead so we can intercept\n\t\t\t// a single component.\n\t\t\t<InnerBlocks.Content />\n\t\t);\n\t\taddValuesForElement( saveElement, values, innerBlocks );\n\t}\n}\n\nexport function getRichTextValues( blocks = [] ) {\n\tgetBlockProps.skipFilters = true;\n\tconst values = [];\n\taddValuesForBlocks( values, blocks );\n\tgetBlockProps.skipFilters = false;\n\treturn values.map( ( value ) =>\n\t\tvalue instanceof RichTextData\n\t\t\t? value\n\t\t\t: RichTextData.fromHTMLString( value )\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAIA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA,SAASM,mBAAmBA,CAAEC,OAAO,EAAEC,MAAM,EAAEC,WAAW,EAAG;EAC5D,IAAK,IAAI,KAAKF,OAAO,IAAIG,SA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KAAK,CAACC,OAAO,CAAEM,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE;EAE9D,KAAM,IAAIW,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGX,QAAQ,CAACY,MAAM,EAAED,CAAC,EAAE,EAAG;IAC3CvB,mBAAmB,CAAEY,QAAQ,CAAEW,CAAC,CAAE,EAAE,GAAGD,IAAK,CAAC;EAC9C;AACD;AAEA,SAASN,kBAAkBA,CAAEd,MAAM,EAAEuB,MAAM,EAAG;EAC7C,KAAM,IAAIF,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGE,MAAM,CAACD,MAAM,EAAED,CAAC,EAAE,EAAG;IACzC,MAAM;MAAEG,IAAI;MAAEC,UAAU;MAAExB;IAAY,CAAC,GAAGsB,MAAM,CAAEF,CAAC,CAAE;IACrD,MAAMK,WAAW,GAAG,IAAAC,sBAAc,EACjCH,IAAI,EACJC,UAAU;IACV;IACA;IACA;IACA,IAAAG,MAAA,CAAAC,aAAA,EAAClC,YAAA,CAAAmC,OAAW,CAACjB,OAAO,MAAE,CACvB,CAAC;IACDf,mBAAmB,CAAE4B,WAAW,EAAE1B,MAAM,EAAEC,WAAY,CAAC;EACxD;AACD;AAEO,SAAS8B,iBAAiBA,CAAER,MAAM,GAAG,EAAE,EAAG;EAChDS,+BAAa,CAACC,WAAW,GAAG,IAAI;EAChC,MAAMjC,MAAM,GAAG,EAAE;EACjBc,kBAAkB,CAAEd,MAAM,EAAEuB,MAAO,CAAC;EACpCS,+BAAa,CAACC,WAAW,GAAG,KAAK;EACjC,OAAOjC,MAAM,CAACkC,GAAG,CAAIlB,KAAK,IACzBA,KAAK,YAAYmB,sBAAY,GAC1BnB,KAAK,GACLmB,sBAAY,CAACC,cAAc,CAAEpB,KAAM,CACvC,CAAC;AACF"}
@@ -28,10 +28,8 @@ var _react = require("react");
28
28
  var _classnames = _interopRequireDefault(require("classnames"));
29
29
  var _element = require("@wordpress/element");
30
30
  var _data = require("@wordpress/data");
31
- var _blocks = require("@wordpress/blocks");
32
31
  var _compose = require("@wordpress/compose");
33
32
  var _richText = require("@wordpress/rich-text");
34
- var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
35
33
  var _components = require("@wordpress/components");
36
34
  var _autocomplete = require("../autocomplete");
37
35
  var _blockEdit = require("../block-edit");
@@ -53,7 +51,7 @@ var _useFirefoxCompat = require("./use-firefox-compat");
53
51
  var _formatEdit = _interopRequireDefault(require("./format-edit"));
54
52
  var _utils = require("./utils");
55
53
  var _content = require("./content");
56
- var _multiline = _interopRequireDefault(require("./multiline"));
54
+ var _withDeprecations = require("./with-deprecations");
57
55
  var _shortcut = require("./shortcut");
58
56
  var _toolbarButton = require("./toolbar-button");
59
57
  var _inputEvent = require("./input-event");
@@ -353,33 +351,7 @@ function RichTextWrapper({
353
351
  tabIndex: props.tabIndex === 0 ? null : props.tabIndex
354
352
  }));
355
353
  }
356
- const ForwardedRichTextWrapper = (0, _element.forwardRef)(RichTextWrapper);
357
- function RichTextSwitcher(props, ref) {
358
- let value = props.value;
359
- let onChange = props.onChange;
360
-
361
- // Handle deprecated format.
362
- if (Array.isArray(value)) {
363
- (0, _deprecated.default)('wp.blockEditor.RichText value prop as children type', {
364
- since: '6.1',
365
- version: '6.3',
366
- alternative: 'value prop as string',
367
- link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/'
368
- });
369
- value = _blocks.children.toHTML(props.value);
370
- onChange = newValue => props.onChange(_blocks.children.fromDOM((0, _richText.__unstableCreateElement)(document, newValue).childNodes));
371
- }
372
- const Component = props.multiline ? _multiline.default : ForwardedRichTextWrapper;
373
- const instanceId = (0, _compose.useInstanceId)(RichTextSwitcher);
374
- return (0, _react.createElement)(Component, {
375
- ...props,
376
- identifier: props.identifier || instanceId,
377
- value: value,
378
- onChange: onChange,
379
- ref: ref
380
- });
381
- }
382
- const ForwardedRichTextContainer = (0, _element.forwardRef)(RichTextSwitcher);
354
+ const ForwardedRichTextContainer = (0, _withDeprecations.withDeprecations)((0, _element.forwardRef)(RichTextWrapper));
383
355
  ForwardedRichTextContainer.Content = _content.Content;
384
356
  ForwardedRichTextContainer.isEmpty = value => {
385
357
  return !value || value.length === 0;
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_data","_blocks","_compose","_richText","_deprecated","_components","_autocomplete","_blockEdit","_formatToolbarContainer","_store","_useUndoAutomaticChange","_useMarkPersistent","_usePasteHandler","_useBeforeInputRules","_useInputRules","_useDelete","_useEnter","_useFormatTypes","_useRemoveBrowserShortcuts","_useShortcuts","_useInputEvents","_useInsertReplacementText","_useFirefoxCompat","_formatEdit","_utils","_content","_multiline","_shortcut","_toolbarButton","_inputEvent","keyboardShortcutContext","createContext","exports","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","useRef","clientId","useBlockEditContext","selector","select","getSelectionStart","getSelectionEnd","blockEditorStore","selectionStart","selectionEnd","undefined","attributeKey","offset","useSelect","getBlockRootClientId","selectionChange","useDispatch","adjustedAllowedFormats","getAllowedFormats","hasFormats","length","onSelectionChange","useCallback","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","useFormatTypes","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","removeFormat","name","addInvisibleFormats","getValue","ref","richTextRef","useRichText","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","useBlockEditorAutocompleteProps","completers","record","useMarkPersistent","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","_react","createElement","Fragment","Provider","Popover","__unstableSlotNameProvider","default","inline","editableContentElement","role","useMergeRefs","useBeforeInputRules","useInputRules","useInsertReplacementText","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useUndoAutomaticChange","usePasteHandler","useDelete","useEnter","useFirefoxCompat","contentEditable","suppressContentEditableWarning","className","classnames","tabIndex","ForwardedRichTextWrapper","forwardRef","RichTextSwitcher","Array","isArray","deprecated","since","version","alternative","link","childrenSource","toHTML","newValue","fromDOM","__unstableCreateElement","document","childNodes","Component","RichTextMultiline","instanceId","useInstanceId","ForwardedRichTextContainer","Content","isEmpty","_default"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { children as childrenSource } from '@wordpress/blocks';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\t__unstableCreateElement,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport deprecated from '@wordpress/deprecated';\nimport { Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport RichTextMultiline from './multiline';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ true }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={ props.tabIndex === 0 ? null : props.tabIndex }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextWrapper = forwardRef( RichTextWrapper );\n\nfunction RichTextSwitcher( props, ref ) {\n\tlet value = props.value;\n\tlet onChange = props.onChange;\n\n\t// Handle deprecated format.\n\tif ( Array.isArray( value ) ) {\n\t\tdeprecated( 'wp.blockEditor.RichText value prop as children type', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: 'value prop as string',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/',\n\t\t} );\n\n\t\tvalue = childrenSource.toHTML( props.value );\n\t\tonChange = ( newValue ) =>\n\t\t\tprops.onChange(\n\t\t\t\tchildrenSource.fromDOM(\n\t\t\t\t\t__unstableCreateElement( document, newValue ).childNodes\n\t\t\t\t)\n\t\t\t);\n\t}\n\n\tconst Component = props.multiline\n\t\t? RichTextMultiline\n\t\t: ForwardedRichTextWrapper;\n\tconst instanceId = useInstanceId( RichTextSwitcher );\n\n\treturn (\n\t\t<Component\n\t\t\t{ ...props }\n\t\t\tidentifier={ props.identifier || instanceId }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nconst ForwardedRichTextContainer = forwardRef( RichTextSwitcher );\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GA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,UAAY;IAC7CvJ,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrB6E,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;AAEA,MAAM0E,0BAA0B,GAAG,IAAApB,mBAAU,EAAEC,gBAAiB,CAAC;AAEjEmB,0BAA0B,CAACC,OAAO,GAAGA,gBAAO;AAC5CD,0BAA0B,CAACE,OAAO,GAAK3J,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAACoD,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AAFA,IAAAwG,QAAA,GAGeH,0BAA0B;AAAAjL,OAAA,CAAAuI,OAAA,GAAA6C,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_data","_compose","_richText","_components","_autocomplete","_blockEdit","_formatToolbarContainer","_store","_useUndoAutomaticChange","_useMarkPersistent","_usePasteHandler","_useBeforeInputRules","_useInputRules","_useDelete","_useEnter","_useFormatTypes","_useRemoveBrowserShortcuts","_useShortcuts","_useInputEvents","_useInsertReplacementText","_useFirefoxCompat","_formatEdit","_utils","_content","_withDeprecations","_shortcut","_toolbarButton","_inputEvent","keyboardShortcutContext","createContext","exports","inputEventContext","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","forwardedRef","anchorRef","useRef","clientId","useBlockEditContext","selector","select","getSelectionStart","getSelectionEnd","blockEditorStore","selectionStart","selectionEnd","undefined","attributeKey","offset","useSelect","getBlockRootClientId","selectionChange","useDispatch","adjustedAllowedFormats","getAllowedFormats","hasFormats","length","onSelectionChange","useCallback","start","end","selection","unset","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","useFormatTypes","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","removeFormat","name","addInvisibleFormats","getValue","ref","richTextRef","useRichText","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","useBlockEditorAutocompleteProps","completers","record","useMarkPersistent","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","_react","createElement","Fragment","Provider","Popover","__unstableSlotNameProvider","default","inline","editableContentElement","role","useMergeRefs","useBeforeInputRules","useInputRules","useInsertReplacementText","useRemoveBrowserShortcuts","useShortcuts","useInputEvents","useUndoAutomaticChange","usePasteHandler","useDelete","useEnter","useFirefoxCompat","contentEditable","suppressContentEditableWarning","className","classnames","tabIndex","ForwardedRichTextContainer","withDeprecations","forwardRef","Content","isEmpty","_default"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMergeRefs } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useUndoAutomaticChange } from './use-undo-automatic-change';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { usePasteHandler } from './use-paste-handler';\nimport { useBeforeInputRules } from './use-before-input-rules';\nimport { useInputRules } from './use-input-rules';\nimport { useDelete } from './use-delete';\nimport { useEnter } from './use-enter';\nimport { useFormatTypes } from './use-format-types';\nimport { useRemoveBrowserShortcuts } from './use-remove-browser-shortcuts';\nimport { useShortcuts } from './use-shortcuts';\nimport { useInputEvents } from './use-input-events';\nimport { useInsertReplacementText } from './use-insert-replacement-text';\nimport { useFirefoxCompat } from './use-firefox-compat';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content } from './content';\nimport { withDeprecations } from './with-deprecations';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tsetRef,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tconst anchorRef = useRef();\n\tconst { clientId } = useBlockEditContext();\n\tconst selector = ( select ) => {\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\tselectionStart.attributeKey === identifier;\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\t// This selector must run on every render so the right selection state is\n\t// retrieved from the store on merge.\n\t// To do: fix this somehow.\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector );\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\tclientId,\n\t\t\t\t\tattributeKey: identifier,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[ clientId, identifier ]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-label={ placeholder }\n\t\t\t\t{ ...props }\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tuseBeforeInputRules( { value, onChange } ),\n\t\t\t\t\tuseInputRules( {\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseInsertReplacementText(),\n\t\t\t\t\tuseRemoveBrowserShortcuts(),\n\t\t\t\t\tuseShortcuts( keyboardShortcuts ),\n\t\t\t\t\tuseInputEvents( inputEvents ),\n\t\t\t\t\tuseUndoAutomaticChange(),\n\t\t\t\t\tusePasteHandler( {\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseDelete( {\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseEnter( {\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t} ),\n\t\t\t\t\tuseFirefoxCompat(),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ true }\n\t\t\t\tsuppressContentEditableWarning={ true }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={ props.tabIndex === 0 ? null : props.tabIndex }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst ForwardedRichTextContainer = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nForwardedRichTextContainer.Content = Content;\nForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nexport default ForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAIA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,uBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,uBAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAAAa,oBAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,SAAA,GAAAhB,OAAA;AACA,IAAAiB,eAAA,GAAAjB,OAAA;AACA,IAAAkB,0BAAA,GAAAlB,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AACA,IAAAoB,eAAA,GAAApB,OAAA;AACA,IAAAqB,yBAAA,GAAArB,OAAA;AACA,IAAAsB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AAC,EACxB,IAAAC,gCAAe,EAAE;MAChBvH,UAAU;MACVuB,cAAc;MACdzB,QAAQ;MACRF,KAAK;MACL2D,WAAW;MACX5D,OAAO;MACPW,SAAS;MACTM,OAAO;MACPS,yBAAyB;MACzBD;IACD,CAAE,CAAC,EACH,IAAAoG,oBAAS,EAAE;MACV5H,KAAK;MACLe,OAAO;MACPD;IACD,CAAE,CAAC,EACH,IAAA+G,kBAAQ,EAAE;MACTtD,uBAAuB;MACvBvE,KAAK;MACLU,SAAS;MACTM,OAAO;MACPd,QAAQ;MACR0B,iBAAiB;MACjBV,YAAY;MACZE;IACD,CAAE,CAAC,EACH,IAAA0G,kCAAgB,EAAC,CAAC,EAClB/F,SAAS,CACR,CAAG;IACLgG,eAAe,EAAG,IAAM;IACxBC,8BAA8B,EAAG,IAAM;IACvCC,SAAS,EAAG,IAAAC,mBAAU,EACrB,kCAAkC,EAClCvJ,KAAK,CAACsJ,SAAS,EACf,WACD;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACAE,QAAQ,EAAGxJ,KAAK,CAACwJ,QAAQ,KAAK,CAAC,GAAG,IAAI,GAAGxJ,KAAK,CAACwJ;EAAU,CACzD,CACA,CAAC;AAEL;AAEA,MAAMC,0BAA0B,GAAG,IAAAC,kCAAgB,EAClD,IAAAC,mBAAU,EAAEzI,eAAgB,CAC7B,CAAC;AAEDuI,0BAA0B,CAACG,OAAO,GAAGA,gBAAO;AAC5CH,0BAA0B,CAACI,OAAO,GAAKxI,KAAK,IAAM;EACjD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAACoD,MAAM,KAAK,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AAFA,IAAAqF,QAAA,GAGeL,0BAA0B;AAAA5J,OAAA,CAAAuI,OAAA,GAAA0B,QAAA"}
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "RichTextToolbarButton", {
16
16
  return _toolbarButton.RichTextToolbarButton;
17
17
  }
18
18
  });
19
+ exports.RichTextWrapper = RichTextWrapper;
19
20
  Object.defineProperty(exports, "__unstableRichTextInputEvent", {
20
21
  enumerable: true,
21
22
  get: function () {
@@ -41,6 +42,7 @@ var _utils = require("./utils");
41
42
  var _embedHandlerPicker = _interopRequireDefault(require("./embed-handler-picker"));
42
43
  var _content = require("./content");
43
44
  var _native = _interopRequireDefault(require("./native"));
45
+ var _withDeprecations = require("./with-deprecations");
44
46
  var _shortcut = require("./shortcut");
45
47
  var _toolbarButton = require("./toolbar-button");
46
48
  var _inputEvent = require("./input-event");
@@ -65,7 +67,6 @@ function RichTextWrapper({
65
67
  value: originalValue,
66
68
  onChange: originalOnChange,
67
69
  isSelected: originalIsSelected,
68
- multiline,
69
70
  inlineToolbar,
70
71
  wrapperClassName,
71
72
  autocompleters,
@@ -87,7 +88,6 @@ function RichTextWrapper({
87
88
  disableLineBreaks,
88
89
  unstableOnFocus,
89
90
  __unstableAllowPrefixTransformations,
90
- __unstableMultilineRootTag,
91
91
  // Native props.
92
92
  __unstableMobileNoFocusOnMount,
93
93
  deleteEnter,
@@ -179,7 +179,6 @@ function RichTextWrapper({
179
179
  selectionChange,
180
180
  __unstableMarkAutomaticChange
181
181
  } = (0, _data.useDispatch)(_store.store);
182
- const multilineTag = (0, _utils.getMultilineTag)(multiline);
183
182
  const adjustedAllowedFormats = (0, _utils.getAllowedFormats)({
184
183
  allowedFormats,
185
184
  disableFormats
@@ -210,7 +209,7 @@ function RichTextWrapper({
210
209
  // an intentional user interaction distinguishing between Backspace and
211
210
  // Delete to remove the empty field, but also to avoid merge & remove
212
211
  // causing destruction of two fields (merge, then removed merged).
213
- if (onRemove && (0, _richText.isEmpty)(value) && isReverse) {
212
+ else if (onRemove && (0, _richText.isEmpty)(value) && isReverse) {
214
213
  onRemove(!isReverse);
215
214
  }
216
215
  }, [onMerge, onRemove]);
@@ -243,8 +242,7 @@ function RichTextWrapper({
243
242
  // with e.g. the enter key.
244
243
  if (!hasPastedBlocks || !(0, _richText.isEmpty)(before)) {
245
244
  blocks.push(onSplit((0, _richText.toHTMLString)({
246
- value: before,
247
- multilineTag
245
+ value: before
248
246
  }), !isAfterOriginal));
249
247
  lastPastedBlockIndex += 1;
250
248
  }
@@ -261,8 +259,7 @@ function RichTextWrapper({
261
259
  // empty, the middle block is enough to set focus in.
262
260
  if (hasPastedBlocks ? !(0, _richText.isEmpty)(after) : !onSplitMiddle || !(0, _richText.isEmpty)(after)) {
263
261
  blocks.push(onSplit((0, _richText.toHTMLString)({
264
- value: after,
265
- multilineTag
262
+ value: after
266
263
  }), isAfterOriginal));
267
264
  }
268
265
 
@@ -274,7 +271,7 @@ function RichTextWrapper({
274
271
  // Otherwise, retain the default value.
275
272
  const initialPosition = hasPastedBlocks ? -1 : 0;
276
273
  onReplace(blocks, indexToSelect, initialPosition);
277
- }, [onReplace, onSplit, multilineTag, onSplitMiddle]);
274
+ }, [onReplace, onSplit, onSplitMiddle]);
278
275
  const onEnter = (0, _element.useCallback)(({
279
276
  value,
280
277
  onChange,
@@ -325,7 +322,7 @@ function RichTextWrapper({
325
322
  }
326
323
  },
327
324
  // eslint-disable-next-line react-hooks/exhaustive-deps
328
- [onReplace, onSplit, __unstableMarkAutomaticChange, multiline, splitValue, onSplitAtEnd]);
325
+ [onReplace, onSplit, __unstableMarkAutomaticChange, splitValue, onSplitAtEnd]);
329
326
  const onPaste = (0, _element.useCallback)(({
330
327
  value,
331
328
  onChange,
@@ -341,8 +338,6 @@ function RichTextWrapper({
341
338
  if (isInternal) {
342
339
  const pastedValue = (0, _richText.create)({
343
340
  html,
344
- multilineTag,
345
- multilineWrapperTags: multilineTag === 'li' ? ['ul', 'ol'] : undefined,
346
341
  preserveWhiteSpace
347
342
  });
348
343
  (0, _utils.addActiveFormats)(pastedValue, activeFormats);
@@ -423,7 +418,7 @@ function RichTextWrapper({
423
418
  splitValue(value, content);
424
419
  }
425
420
  }
426
- }, [tagName, onReplace, onSplit, splitValue, __unstableEmbedURLOnPaste, multilineTag, preserveWhiteSpace, pastePlainText]);
421
+ }, [tagName, onReplace, onSplit, splitValue, __unstableEmbedURLOnPaste, preserveWhiteSpace, pastePlainText]);
427
422
  const inputRule = (0, _element.useCallback)((value, valueToFormat) => {
428
423
  if (!onReplace) {
429
424
  return;
@@ -476,7 +471,6 @@ function RichTextWrapper({
476
471
  onPaste: onPaste,
477
472
  __unstableIsSelected: isSelected,
478
473
  __unstableInputRule: inputRule,
479
- __unstableMultilineTag: multilineTag,
480
474
  __unstableOnEnterFormattedText: enterFormattedText,
481
475
  __unstableOnExitFormattedText: exitFormattedText,
482
476
  __unstableOnCreateUndoLevel: __unstableMarkLastChangeAsPersistent,
@@ -487,8 +481,7 @@ function RichTextWrapper({
487
481
  preserveWhiteSpace: preserveWhiteSpace,
488
482
  disabled: disabled,
489
483
  unstableOnFocus: unstableOnFocus,
490
- __unstableAllowPrefixTransformations: __unstableAllowPrefixTransformations,
491
- __unstableMultilineRootTag: __unstableMultilineRootTag
484
+ __unstableAllowPrefixTransformations: __unstableAllowPrefixTransformations
492
485
  // Native props.
493
486
  ,
494
487
  blockIsSelected: originalIsSelected !== undefined ? originalIsSelected : blockIsSelected,
@@ -561,7 +554,7 @@ function RichTextWrapper({
561
554
  ref: embedHandlerPickerRef
562
555
  })));
563
556
  }
564
- const ForwardedRichTextContainer = (0, _element.forwardRef)(RichTextWrapper);
557
+ const ForwardedRichTextContainer = (0, _withDeprecations.withDeprecations)((0, _element.forwardRef)(RichTextWrapper));
565
558
  ForwardedRichTextContainer.Content = _content.Content;
566
559
  ForwardedRichTextContainer.isEmpty = value => {
567
560
  return !value || value.length === 0;