@contentful/field-editor-rich-text 3.16.8 → 3.16.10

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 (376) hide show
  1. package/dist/cjs/ContentfulEditorProvider.js +8 -8
  2. package/dist/cjs/RichTextEditor.js +20 -22
  3. package/dist/cjs/RichTextEditor.styles.js +1 -2
  4. package/dist/cjs/SdkProvider.js +5 -7
  5. package/dist/cjs/SyncEditorChanges.js +6 -15
  6. package/dist/cjs/Toolbar/_tests_/toolbar.test.js +15 -17
  7. package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +9 -13
  8. package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +8 -10
  9. package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +2 -2
  10. package/dist/cjs/Toolbar/index.js +30 -33
  11. package/dist/cjs/__fixtures__/FakeSdk.js +3 -3
  12. package/dist/cjs/__fixtures__/asset/index.js +10 -10
  13. package/dist/cjs/__fixtures__/content-type/index.js +1 -1
  14. package/dist/cjs/__fixtures__/entry/index.js +7 -7
  15. package/dist/cjs/__fixtures__/fixtures.js +6 -8
  16. package/dist/cjs/__fixtures__/locale/index.js +2 -2
  17. package/dist/cjs/__fixtures__/space/index.js +1 -1
  18. package/dist/cjs/constants/Schema.js +0 -1
  19. package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +38 -43
  20. package/dist/cjs/dialogs/openRichTextDialog.js +4 -6
  21. package/dist/cjs/dialogs/renderRichTextDialog.js +4 -6
  22. package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +10 -10
  23. package/dist/cjs/helpers/callbacks.js +3 -3
  24. package/dist/cjs/helpers/config.js +2 -2
  25. package/dist/cjs/helpers/editor.js +44 -53
  26. package/dist/cjs/helpers/environment.js +3 -3
  27. package/dist/cjs/helpers/formatDateAndTime.js +4 -5
  28. package/dist/cjs/helpers/getAllowedResourcesForNodeType.js +5 -22
  29. package/dist/cjs/helpers/getLinkedContentTypeIdsForNodeType.js +5 -29
  30. package/dist/cjs/helpers/nodeFactory.js +6 -6
  31. package/dist/cjs/helpers/sdkNavigatorSlideIn.js +6 -14
  32. package/dist/cjs/helpers/sdkNavigatorSlideIn.spec.js +2 -3
  33. package/dist/cjs/helpers/toSlateValue.js +3 -14
  34. package/dist/cjs/helpers/transformers.js +5 -5
  35. package/dist/cjs/helpers/validations.js +9 -12
  36. package/dist/cjs/index.js +5 -7
  37. package/dist/cjs/internal/constants.js +2 -4
  38. package/dist/cjs/internal/hooks.js +7 -9
  39. package/dist/cjs/internal/misc.js +12 -15
  40. package/dist/cjs/internal/queries.js +108 -115
  41. package/dist/cjs/internal/transforms.js +48 -51
  42. package/dist/cjs/internal/types/editor.js +1 -3
  43. package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +3 -4
  44. package/dist/cjs/plugins/Break/createResetNodePlugin.js +0 -1
  45. package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +3 -3
  46. package/dist/cjs/plugins/CommandPalette/components/CommandList.js +33 -35
  47. package/dist/cjs/plugins/CommandPalette/components/CommandList.styles.js +1 -1
  48. package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +5 -7
  49. package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +3 -7
  50. package/dist/cjs/plugins/CommandPalette/onKeyDown.js +1 -6
  51. package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +4 -6
  52. package/dist/cjs/plugins/CommandPalette/useCommands.js +3 -3
  53. package/dist/cjs/plugins/CommandPalette/utils/fetchEntries.js +0 -2
  54. package/dist/cjs/plugins/CommandPalette/utils/trimLeadingSlash.js +1 -6
  55. package/dist/cjs/plugins/DragAndDrop/index.js +1 -9
  56. package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +8 -10
  57. package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +3 -3
  58. package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +17 -19
  59. package/dist/cjs/plugins/EmbeddedEntityInline/LinkedEntityInline.js +7 -9
  60. package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +5 -5
  61. package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +11 -13
  62. package/dist/cjs/plugins/EmbeddedResourceInline/LinkedResourceInline.js +5 -5
  63. package/dist/cjs/plugins/Heading/__tests__/createHeadingPlugin.test.js +32 -32
  64. package/dist/cjs/plugins/Heading/components/Heading.js +10 -13
  65. package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +29 -23
  66. package/dist/cjs/plugins/Heading/createHeadingPlugin.js +2 -7
  67. package/dist/cjs/plugins/Hr/index.js +14 -19
  68. package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +28 -32
  69. package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
  70. package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +8 -10
  71. package/dist/cjs/plugins/Hyperlink/components/LinkPopover.js +17 -23
  72. package/dist/cjs/plugins/Hyperlink/components/ResourceHyperlink.js +8 -10
  73. package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +4 -6
  74. package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +6 -8
  75. package/dist/cjs/plugins/Hyperlink/components/linkHandlers.js +3 -3
  76. package/dist/cjs/plugins/Hyperlink/components/styles.js +1 -1
  77. package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +4 -10
  78. package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +3 -6
  79. package/dist/cjs/plugins/Hyperlink/useResourceEntityInfo.js +4 -6
  80. package/dist/cjs/plugins/Hyperlink/utils.js +4 -4
  81. package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +13 -13
  82. package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +25 -29
  83. package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +22 -22
  84. package/dist/cjs/plugins/List/components/List.js +7 -9
  85. package/dist/cjs/plugins/List/components/ListItem.js +4 -6
  86. package/dist/cjs/plugins/List/components/ToolbarListButton.js +5 -7
  87. package/dist/cjs/plugins/List/createListPlugin.js +0 -4
  88. package/dist/cjs/plugins/List/insertListBreak.js +4 -13
  89. package/dist/cjs/plugins/List/insertListFragment.js +5 -18
  90. package/dist/cjs/plugins/List/onKeyDownList.js +6 -8
  91. package/dist/cjs/plugins/List/transforms/insertListItem.js +2 -17
  92. package/dist/cjs/plugins/List/transforms/moveListItemDown.js +2 -8
  93. package/dist/cjs/plugins/List/transforms/moveListItems.js +2 -7
  94. package/dist/cjs/plugins/List/transforms/moveListItems.test.js +14 -15
  95. package/dist/cjs/plugins/List/transforms/toggleList.js +3 -8
  96. package/dist/cjs/plugins/List/transforms/toggleList.spec.js +28 -28
  97. package/dist/cjs/plugins/List/transforms/unwrapList.js +2 -7
  98. package/dist/cjs/plugins/List/utils.js +11 -12
  99. package/dist/cjs/plugins/List/withList.js +2 -6
  100. package/dist/cjs/plugins/Marks/Bold.js +7 -9
  101. package/dist/cjs/plugins/Marks/Code.js +7 -15
  102. package/dist/cjs/plugins/Marks/Italic.js +7 -9
  103. package/dist/cjs/plugins/Marks/Subscript.js +8 -10
  104. package/dist/cjs/plugins/Marks/Superscript.js +8 -10
  105. package/dist/cjs/plugins/Marks/Underline.js +4 -6
  106. package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +7 -9
  107. package/dist/cjs/plugins/Marks/helpers.js +5 -5
  108. package/dist/cjs/plugins/Normalizer/baseRules.js +0 -2
  109. package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
  110. package/dist/cjs/plugins/Normalizer/utils.js +3 -4
  111. package/dist/cjs/plugins/Normalizer/withNormalizer.js +3 -23
  112. package/dist/cjs/plugins/Paragraph/Paragraph.js +4 -6
  113. package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
  114. package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +2 -3
  115. package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +6 -9
  116. package/dist/cjs/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +0 -2
  117. package/dist/cjs/plugins/PasteHTML/utils/sanitizeAnchors.js +0 -9
  118. package/dist/cjs/plugins/PasteHTML/utils/sanitizeHTML.js +2 -17
  119. package/dist/cjs/plugins/PasteHTML/utils/sanitizeSheets.js +1 -13
  120. package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
  121. package/dist/cjs/plugins/Quote/components/Quote.js +4 -6
  122. package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +4 -6
  123. package/dist/cjs/plugins/Quote/createQuotePlugin.js +0 -1
  124. package/dist/cjs/plugins/Quote/toggleQuote.js +5 -5
  125. package/dist/cjs/plugins/Quote/withQuote.js +2 -4
  126. package/dist/cjs/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +0 -1
  127. package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
  128. package/dist/cjs/plugins/Table/__tests__/helpers.test.js +4 -4
  129. package/dist/cjs/plugins/Table/actions/addColumn.js +4 -5
  130. package/dist/cjs/plugins/Table/actions/addRow.js +3 -6
  131. package/dist/cjs/plugins/Table/components/Cell.js +5 -7
  132. package/dist/cjs/plugins/Table/components/HeaderCell.js +5 -7
  133. package/dist/cjs/plugins/Table/components/Row.js +4 -6
  134. package/dist/cjs/plugins/Table/components/Table.js +6 -8
  135. package/dist/cjs/plugins/Table/components/TableActions.js +16 -19
  136. package/dist/cjs/plugins/Table/components/ToolbarButton.js +4 -7
  137. package/dist/cjs/plugins/Table/createTablePlugin.js +1 -11
  138. package/dist/cjs/plugins/Table/helpers.js +12 -16
  139. package/dist/cjs/plugins/Table/insertTableFragment.js +2 -15
  140. package/dist/cjs/plugins/Table/onKeyDownTable.js +2 -11
  141. package/dist/cjs/plugins/Table/tableTracking.js +6 -6
  142. package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +17 -19
  143. package/dist/cjs/plugins/Text/createTextPlugin.js +5 -22
  144. package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +4 -5
  145. package/dist/cjs/plugins/Tracking/utils.js +3 -6
  146. package/dist/cjs/plugins/Voids/createVoidsPlugin.js +0 -5
  147. package/dist/cjs/plugins/Voids/transformVoid.js +0 -1
  148. package/dist/cjs/plugins/index.js +3 -15
  149. package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +10 -12
  150. package/dist/cjs/plugins/shared/EmbeddedBlockUtil.js +6 -16
  151. package/dist/cjs/plugins/shared/EmbeddedInlineToolbarIcon.js +8 -10
  152. package/dist/cjs/plugins/shared/EmbeddedInlineUtil.js +5 -9
  153. package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +11 -13
  154. package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +12 -14
  155. package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +11 -14
  156. package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +4 -8
  157. package/dist/cjs/plugins/shared/LinkedInlineWrapper.js +6 -10
  158. package/dist/cjs/plugins/shared/ResourceNewBadge.js +3 -5
  159. package/dist/cjs/plugins/shared/ToolbarButton.js +6 -8
  160. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +5 -10
  161. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +6 -11
  162. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +13 -15
  163. package/dist/cjs/plugins/shared/utils.js +1 -4
  164. package/dist/cjs/test-utils/assertOutput.js +0 -1
  165. package/dist/cjs/test-utils/hyperscript.d.js +0 -1
  166. package/dist/cjs/test-utils/randomId.js +1 -3
  167. package/dist/cjs/test-utils/validation.js +5 -8
  168. package/dist/esm/ContentfulEditorProvider.js +1 -4
  169. package/dist/esm/RichTextEditor.js +13 -13
  170. package/dist/esm/RichTextEditor.styles.js +0 -1
  171. package/dist/esm/SdkProvider.js +2 -2
  172. package/dist/esm/SyncEditorChanges.js +3 -18
  173. package/dist/esm/Toolbar/_tests_/toolbar.test.js +12 -12
  174. package/dist/esm/Toolbar/components/EmbedEntityWidget.js +7 -9
  175. package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +6 -6
  176. package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +1 -1
  177. package/dist/esm/Toolbar/index.js +27 -28
  178. package/dist/esm/__fixtures__/FakeSdk.js +3 -3
  179. package/dist/esm/constants/Schema.js +0 -1
  180. package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +31 -34
  181. package/dist/esm/dialogs/openRichTextDialog.js +2 -2
  182. package/dist/esm/dialogs/renderRichTextDialog.js +2 -2
  183. package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +10 -10
  184. package/dist/esm/helpers/callbacks.js +1 -1
  185. package/dist/esm/helpers/config.js +1 -9
  186. package/dist/esm/helpers/editor.js +6 -22
  187. package/dist/esm/helpers/extractNodes.js +1 -3
  188. package/dist/esm/helpers/formatDateAndTime.js +2 -11
  189. package/dist/esm/helpers/getAllowedResourcesForNodeType.js +2 -19
  190. package/dist/esm/helpers/getLinkedContentTypeIdsForNodeType.js +2 -26
  191. package/dist/esm/helpers/sdkNavigatorSlideIn.js +6 -20
  192. package/dist/esm/helpers/sdkNavigatorSlideIn.spec.js +0 -1
  193. package/dist/esm/helpers/toSlateValue.js +3 -17
  194. package/dist/esm/helpers/validations.js +1 -5
  195. package/dist/esm/internal/misc.js +2 -23
  196. package/dist/esm/internal/queries.js +2 -11
  197. package/dist/esm/internal/transforms.js +3 -14
  198. package/dist/esm/internal/types/editor.js +1 -3
  199. package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +3 -4
  200. package/dist/esm/plugins/Break/createResetNodePlugin.js +0 -1
  201. package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +3 -3
  202. package/dist/esm/plugins/CommandPalette/components/CommandList.js +30 -30
  203. package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +2 -2
  204. package/dist/esm/plugins/CommandPalette/createCommandPalettePlugin.js +1 -11
  205. package/dist/esm/plugins/CommandPalette/hooks/useCommandList.js +0 -2
  206. package/dist/esm/plugins/CommandPalette/onKeyDown.js +0 -5
  207. package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +2 -2
  208. package/dist/esm/plugins/CommandPalette/useCommands.js +3 -3
  209. package/dist/esm/plugins/CommandPalette/utils/fetchEntries.js +0 -2
  210. package/dist/esm/plugins/CommandPalette/utils/trimLeadingSlash.js +1 -6
  211. package/dist/esm/plugins/DragAndDrop/index.js +1 -9
  212. package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +6 -6
  213. package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +14 -14
  214. package/dist/esm/plugins/EmbeddedEntityInline/LinkedEntityInline.js +5 -5
  215. package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +4 -4
  216. package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +9 -9
  217. package/dist/esm/plugins/EmbeddedResourceInline/LinkedResourceInline.js +4 -4
  218. package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +32 -32
  219. package/dist/esm/plugins/Heading/components/Heading.js +7 -8
  220. package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +26 -18
  221. package/dist/esm/plugins/Heading/createHeadingPlugin.js +1 -6
  222. package/dist/esm/plugins/Hr/index.js +5 -8
  223. package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +23 -25
  224. package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
  225. package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +6 -6
  226. package/dist/esm/plugins/Hyperlink/components/LinkPopover.js +15 -19
  227. package/dist/esm/plugins/Hyperlink/components/ResourceHyperlink.js +6 -6
  228. package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +2 -2
  229. package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +4 -4
  230. package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +1 -5
  231. package/dist/esm/plugins/Hyperlink/useEntityInfo.js +3 -6
  232. package/dist/esm/plugins/Hyperlink/useResourceEntityInfo.js +2 -2
  233. package/dist/esm/plugins/Hyperlink/utils.js +1 -1
  234. package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +13 -13
  235. package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +25 -29
  236. package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +22 -22
  237. package/dist/esm/plugins/List/components/List.js +1 -1
  238. package/dist/esm/plugins/List/components/ListItem.js +1 -1
  239. package/dist/esm/plugins/List/components/ToolbarListButton.js +3 -3
  240. package/dist/esm/plugins/List/createListPlugin.js +0 -4
  241. package/dist/esm/plugins/List/insertListBreak.js +4 -13
  242. package/dist/esm/plugins/List/insertListFragment.js +5 -18
  243. package/dist/esm/plugins/List/onKeyDownList.js +5 -7
  244. package/dist/esm/plugins/List/transforms/insertListItem.js +3 -20
  245. package/dist/esm/plugins/List/transforms/moveListItemDown.js +2 -8
  246. package/dist/esm/plugins/List/transforms/moveListItems.js +2 -7
  247. package/dist/esm/plugins/List/transforms/moveListItems.test.js +14 -15
  248. package/dist/esm/plugins/List/transforms/toggleList.js +3 -8
  249. package/dist/esm/plugins/List/transforms/toggleList.spec.js +28 -28
  250. package/dist/esm/plugins/List/transforms/unwrapList.js +2 -7
  251. package/dist/esm/plugins/List/utils.js +2 -7
  252. package/dist/esm/plugins/List/withList.js +2 -6
  253. package/dist/esm/plugins/Marks/Bold.js +2 -2
  254. package/dist/esm/plugins/Marks/Code.js +2 -8
  255. package/dist/esm/plugins/Marks/Italic.js +2 -2
  256. package/dist/esm/plugins/Marks/Subscript.js +2 -2
  257. package/dist/esm/plugins/Marks/Superscript.js +2 -2
  258. package/dist/esm/plugins/Marks/Underline.js +2 -2
  259. package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +4 -4
  260. package/dist/esm/plugins/Marks/helpers.js +1 -1
  261. package/dist/esm/plugins/Normalizer/baseRules.js +0 -4
  262. package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
  263. package/dist/esm/plugins/Normalizer/utils.js +0 -1
  264. package/dist/esm/plugins/Normalizer/withNormalizer.js +2 -22
  265. package/dist/esm/plugins/Paragraph/Paragraph.js +1 -1
  266. package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
  267. package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +1 -2
  268. package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +3 -9
  269. package/dist/esm/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +0 -2
  270. package/dist/esm/plugins/PasteHTML/utils/sanitizeAnchors.js +1 -27
  271. package/dist/esm/plugins/PasteHTML/utils/sanitizeHTML.js +2 -17
  272. package/dist/esm/plugins/PasteHTML/utils/sanitizeSheets.js +1 -13
  273. package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
  274. package/dist/esm/plugins/Quote/components/Quote.js +1 -1
  275. package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +2 -2
  276. package/dist/esm/plugins/Quote/createQuotePlugin.js +0 -1
  277. package/dist/esm/plugins/Quote/shouldResetQuote.js +1 -6
  278. package/dist/esm/plugins/Quote/toggleQuote.js +1 -1
  279. package/dist/esm/plugins/Quote/withQuote.js +2 -4
  280. package/dist/esm/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +0 -1
  281. package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
  282. package/dist/esm/plugins/Table/__tests__/helpers.test.js +4 -4
  283. package/dist/esm/plugins/Table/actions/addColumn.js +1 -2
  284. package/dist/esm/plugins/Table/actions/addRow.js +0 -3
  285. package/dist/esm/plugins/Table/components/Cell.js +2 -2
  286. package/dist/esm/plugins/Table/components/HeaderCell.js +2 -2
  287. package/dist/esm/plugins/Table/components/Row.js +1 -1
  288. package/dist/esm/plugins/Table/components/Table.js +3 -3
  289. package/dist/esm/plugins/Table/components/TableActions.js +11 -12
  290. package/dist/esm/plugins/Table/components/ToolbarButton.js +2 -3
  291. package/dist/esm/plugins/Table/createTablePlugin.js +1 -11
  292. package/dist/esm/plugins/Table/helpers.js +1 -10
  293. package/dist/esm/plugins/Table/insertTableFragment.js +2 -15
  294. package/dist/esm/plugins/Table/onKeyDownTable.js +2 -11
  295. package/dist/esm/plugins/Table/tableTracking.js +6 -6
  296. package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +17 -19
  297. package/dist/esm/plugins/Text/createTextPlugin.js +5 -22
  298. package/dist/esm/plugins/Tracking/createTrackingPlugin.js +1 -2
  299. package/dist/esm/plugins/Tracking/utils.js +0 -1
  300. package/dist/esm/plugins/Voids/createVoidsPlugin.js +0 -5
  301. package/dist/esm/plugins/Voids/transformVoid.js +1 -4
  302. package/dist/esm/plugins/index.js +0 -12
  303. package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +5 -5
  304. package/dist/esm/plugins/shared/EmbeddedBlockUtil.js +5 -15
  305. package/dist/esm/plugins/shared/EmbeddedInlineToolbarIcon.js +5 -5
  306. package/dist/esm/plugins/shared/EmbeddedInlineUtil.js +4 -8
  307. package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +8 -8
  308. package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +9 -9
  309. package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +8 -9
  310. package/dist/esm/plugins/shared/LinkedBlockWrapper.js +3 -7
  311. package/dist/esm/plugins/shared/LinkedInlineWrapper.js +3 -5
  312. package/dist/esm/plugins/shared/ResourceNewBadge.js +1 -1
  313. package/dist/esm/plugins/shared/ToolbarButton.js +3 -3
  314. package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +2 -5
  315. package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +2 -5
  316. package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +8 -8
  317. package/dist/esm/plugins/shared/utils.js +1 -4
  318. package/dist/esm/test-utils/assertOutput.js +0 -1
  319. package/dist/esm/test-utils/hyperscript.d.js +0 -1
  320. package/dist/esm/test-utils/jsx.js +1 -5
  321. package/dist/esm/test-utils/randomId.js +1 -3
  322. package/dist/esm/test-utils/setEmptyDataAttribute.js +1 -4
  323. package/dist/esm/test-utils/validation.js +4 -7
  324. package/dist/types/RichTextEditor.d.ts +2 -3
  325. package/dist/types/Toolbar/components/EmbedEntityWidget.d.ts +1 -2
  326. package/dist/types/Toolbar/components/EmbeddedEntityDropdownButton.d.ts +1 -1
  327. package/dist/types/Toolbar/components/StickyToolbarWrapper.d.ts +2 -2
  328. package/dist/types/Toolbar/index.d.ts +1 -2
  329. package/dist/types/dialogs/HypelinkDialog/HyperlinkDialog.d.ts +4 -4
  330. package/dist/types/dialogs/renderRichTextDialog.d.ts +1 -2
  331. package/dist/types/plugins/CommandPalette/components/CommandList.d.ts +1 -2
  332. package/dist/types/plugins/CommandPalette/components/CommandPrompt.d.ts +1 -2
  333. package/dist/types/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +1 -2
  334. package/dist/types/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +1 -1
  335. package/dist/types/plugins/EmbeddedEntityInline/LinkedEntityInline.d.ts +1 -2
  336. package/dist/types/plugins/EmbeddedResourceBlock/LinkedResourceBlock.d.ts +1 -2
  337. package/dist/types/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.d.ts +1 -1
  338. package/dist/types/plugins/EmbeddedResourceInline/LinkedResourceInline.d.ts +1 -2
  339. package/dist/types/plugins/Heading/components/Heading.d.ts +6 -6
  340. package/dist/types/plugins/Heading/components/ToolbarHeadingButton.d.ts +1 -2
  341. package/dist/types/plugins/Hr/index.d.ts +2 -2
  342. package/dist/types/plugins/Hyperlink/HyperlinkModal.d.ts +1 -2
  343. package/dist/types/plugins/Hyperlink/components/EntityHyperlink.d.ts +1 -2
  344. package/dist/types/plugins/Hyperlink/components/LinkPopover.d.ts +1 -1
  345. package/dist/types/plugins/Hyperlink/components/ResourceHyperlink.d.ts +1 -2
  346. package/dist/types/plugins/Hyperlink/components/ToolbarHyperlinkButton.d.ts +1 -2
  347. package/dist/types/plugins/Hyperlink/components/UrlHyperlink.d.ts +1 -2
  348. package/dist/types/plugins/List/components/List.d.ts +2 -3
  349. package/dist/types/plugins/List/components/ListItem.d.ts +1 -2
  350. package/dist/types/plugins/List/components/ToolbarListButton.d.ts +1 -2
  351. package/dist/types/plugins/Marks/Bold.d.ts +2 -3
  352. package/dist/types/plugins/Marks/Code.d.ts +3 -4
  353. package/dist/types/plugins/Marks/Italic.d.ts +2 -3
  354. package/dist/types/plugins/Marks/Subscript.d.ts +3 -4
  355. package/dist/types/plugins/Marks/Superscript.d.ts +3 -4
  356. package/dist/types/plugins/Marks/Underline.d.ts +2 -3
  357. package/dist/types/plugins/Marks/components/MarkToolbarButton.d.ts +1 -1
  358. package/dist/types/plugins/Paragraph/Paragraph.d.ts +1 -2
  359. package/dist/types/plugins/Quote/components/Quote.d.ts +1 -2
  360. package/dist/types/plugins/Quote/components/ToolbarQuoteButton.d.ts +1 -2
  361. package/dist/types/plugins/Table/components/Cell.d.ts +1 -2
  362. package/dist/types/plugins/Table/components/HeaderCell.d.ts +1 -2
  363. package/dist/types/plugins/Table/components/Row.d.ts +1 -2
  364. package/dist/types/plugins/Table/components/Table.d.ts +1 -2
  365. package/dist/types/plugins/Table/components/TableActions.d.ts +1 -2
  366. package/dist/types/plugins/Table/components/ToolbarButton.d.ts +1 -2
  367. package/dist/types/plugins/shared/EmbeddedBlockToolbarIcon.d.ts +1 -2
  368. package/dist/types/plugins/shared/EmbeddedInlineToolbarIcon.d.ts +1 -2
  369. package/dist/types/plugins/shared/FetchingWrappedAssetCard.d.ts +1 -2
  370. package/dist/types/plugins/shared/FetchingWrappedEntryCard.d.ts +1 -2
  371. package/dist/types/plugins/shared/FetchingWrappedResourceCard.d.ts +1 -2
  372. package/dist/types/plugins/shared/LinkedBlockWrapper.d.ts +1 -1
  373. package/dist/types/plugins/shared/LinkedInlineWrapper.d.ts +1 -1
  374. package/dist/types/plugins/shared/ResourceNewBadge.d.ts +1 -2
  375. package/dist/types/plugins/shared/ToolbarButton.d.ts +1 -2
  376. package/package.json +8 -5
@@ -1,20 +1,20 @@
1
- /* eslint-disable react/no-unknown-property */ /** @jsx jsx */ import { assertOutput, jsx } from '../../../test-utils';
1
+ import { assertOutput, jsx } from '../../../test-utils';
2
2
  describe('normalization', ()=>{
3
3
  it('removes empty links from the document structure', ()=>{
4
- const input = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "link"), /*#__PURE__*/ jsx("hlink", {
4
+ const input = jsx("editor", null, jsx("hp", null, jsx("htext", null, "link"), jsx("hlink", {
5
5
  uri: "https://link.com"
6
- })), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "asset"), /*#__PURE__*/ jsx("hlink", {
6
+ })), jsx("hp", null, jsx("htext", null, "asset"), jsx("hlink", {
7
7
  asset: "asset-id"
8
- })), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "entry"), /*#__PURE__*/ jsx("hlink", {
8
+ })), jsx("hp", null, jsx("htext", null, "entry"), jsx("hlink", {
9
9
  entry: "entry-id"
10
- })), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "resource"), /*#__PURE__*/ jsx("hlink", {
10
+ })), jsx("hp", null, jsx("htext", null, "resource"), jsx("hlink", {
11
11
  resource: "resource-urn"
12
- })), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "explicit empty link"), /*#__PURE__*/ jsx("hlink", {
12
+ })), jsx("hp", null, jsx("htext", null, "explicit empty link"), jsx("hlink", {
13
13
  uri: "https://link.com"
14
- }, '')), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "link with empty space"), /*#__PURE__*/ jsx("hlink", {
14
+ }, '')), jsx("hp", null, jsx("htext", null, "link with empty space"), jsx("hlink", {
15
15
  uri: "https://link.com"
16
16
  }, " ")));
17
- const expected = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "link")), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "asset")), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "entry")), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "resource")), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "explicit empty link")), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null, "link with empty space")));
17
+ const expected = jsx("editor", null, jsx("hp", null, jsx("htext", null, "link")), jsx("hp", null, jsx("htext", null, "asset")), jsx("hp", null, jsx("htext", null, "entry")), jsx("hp", null, jsx("htext", null, "resource")), jsx("hp", null, jsx("htext", null, "explicit empty link")), jsx("hp", null, jsx("htext", null, "link with empty space")));
18
18
  assertOutput({
19
19
  input,
20
20
  expected
@@ -7,9 +7,9 @@ import { LinkPopover } from './LinkPopover';
7
7
  import { styles } from './styles';
8
8
  import { useHyperlinkCommon } from './useHyperlinkCommon';
9
9
  export function EntityHyperlink(props) {
10
- const { editor, sdk, isLinkFocused, pathToElement } = useHyperlinkCommon(props.element);
11
- const { onEntityFetchComplete } = useLinkTracking();
12
- const { target } = props.element.data;
10
+ const { editor , sdk , isLinkFocused , pathToElement } = useHyperlinkCommon(props.element);
11
+ const { onEntityFetchComplete } = useLinkTracking();
12
+ const { target } = props.element.data;
13
13
  const tooltipContent = useEntityInfo({
14
14
  target,
15
15
  sdk,
@@ -18,17 +18,17 @@ export function EntityHyperlink(props) {
18
18
  if (!target) {
19
19
  return null;
20
20
  }
21
- const popoverText = /*#__PURE__*/ React.createElement(Text, {
21
+ const popoverText = React.createElement(Text, {
22
22
  fontColor: "blue600",
23
23
  fontWeight: "fontWeightMedium",
24
24
  className: styles.openLink
25
25
  }, tooltipContent);
26
- return /*#__PURE__*/ React.createElement(LinkPopover, {
26
+ return React.createElement(LinkPopover, {
27
27
  isLinkFocused: isLinkFocused,
28
28
  handleEditLink: ()=>handleEditLink(editor, sdk, pathToElement),
29
29
  handleRemoveLink: ()=>handleRemoveLink(editor),
30
30
  popoverText: popoverText
31
- }, /*#__PURE__*/ React.createElement(Text, {
31
+ }, React.createElement(Text, {
32
32
  testId: "cf-ui-text-link",
33
33
  fontColor: "blue600",
34
34
  fontWeight: "fontWeightMedium",
@@ -3,7 +3,7 @@ import { Popover, IconButton, Tooltip, Flex } from '@contentful/f36-components';
3
3
  import { EditIcon, CopyIcon } from '@contentful/f36-icons';
4
4
  import { useFocused } from '../../../internal/hooks';
5
5
  import { styles } from './styles';
6
- export const LinkPopover = ({ isLinkFocused, popoverText, handleEditLink, handleRemoveLink, children, handleCopyLink })=>{
6
+ export const LinkPopover = ({ isLinkFocused , popoverText , handleEditLink , handleRemoveLink , children , handleCopyLink })=>{
7
7
  const isEditorFocused = useFocused();
8
8
  const popoverContent = React.useRef(null);
9
9
  const [isPopoverContentClicked, setIsPopoverContentClicked] = React.useState(false);
@@ -21,69 +21,65 @@ export const LinkPopover = ({ isLinkFocused, popoverText, handleEditLink, handle
21
21
  };
22
22
  }, []);
23
23
  const isOpen = isLinkFocused && isEditorFocused || isPopoverContentClicked;
24
- // Important to render this component in a portal
25
- // Otherwise the content of the popover will get copied over when users copy text from the rich text editor
26
- return(// eslint-disable-next-line jsx-a11y/no-autofocus -- we don't want to autofocus the popover
27
- /*#__PURE__*/ React.createElement(Popover, {
24
+ return React.createElement(Popover, {
28
25
  renderOnlyWhenOpen: false,
29
26
  usePortal: true,
30
27
  autoFocus: false,
31
28
  isOpen: isOpen
32
- }, /*#__PURE__*/ React.createElement(Popover.Trigger, null, children), /*#__PURE__*/ React.createElement(Popover.Content, {
29
+ }, React.createElement(Popover.Trigger, null, children), React.createElement(Popover.Content, {
33
30
  className: styles.popover
34
- }, /*#__PURE__*/ React.createElement(Flex, {
31
+ }, React.createElement(Flex, {
35
32
  ref: popoverContent,
36
33
  alignItems: "center",
37
34
  paddingTop: "spacing2Xs",
38
35
  paddingBottom: "spacing2Xs",
39
36
  paddingRight: "spacing2Xs",
40
37
  paddingLeft: "spacingXs"
41
- }, popoverText, handleCopyLink && /*#__PURE__*/ React.createElement(Tooltip, {
38
+ }, popoverText, handleCopyLink && React.createElement(Tooltip, {
42
39
  placement: "bottom",
43
40
  content: "Copy link",
44
41
  usePortal: true
45
- }, /*#__PURE__*/ React.createElement(IconButton, {
42
+ }, React.createElement(IconButton, {
46
43
  className: styles.iconButton,
47
44
  onClick: handleCopyLink,
48
45
  size: "small",
49
46
  variant: "transparent",
50
47
  "aria-label": "Copy link",
51
- icon: /*#__PURE__*/ React.createElement(CopyIcon, {
48
+ icon: React.createElement(CopyIcon, {
52
49
  size: "tiny"
53
50
  })
54
- })), /*#__PURE__*/ React.createElement(Tooltip, {
51
+ })), React.createElement(Tooltip, {
55
52
  placement: "bottom",
56
53
  content: "Edit link",
57
54
  usePortal: true
58
- }, /*#__PURE__*/ React.createElement(IconButton, {
55
+ }, React.createElement(IconButton, {
59
56
  className: styles.iconButton,
60
57
  onClick: handleEditLink,
61
58
  size: "small",
62
59
  variant: "transparent",
63
60
  "aria-label": "Edit link",
64
- icon: /*#__PURE__*/ React.createElement(EditIcon, {
61
+ icon: React.createElement(EditIcon, {
65
62
  size: "tiny"
66
63
  })
67
- })), /*#__PURE__*/ React.createElement(Tooltip, {
64
+ })), React.createElement(Tooltip, {
68
65
  placement: "bottom",
69
66
  content: "Remove link",
70
67
  usePortal: true
71
- }, /*#__PURE__*/ React.createElement(IconButton, {
68
+ }, React.createElement(IconButton, {
72
69
  onClick: handleRemoveLink,
73
70
  className: styles.iconButton,
74
71
  size: "small",
75
72
  variant: "transparent",
76
73
  "aria-label": "Remove link",
77
- icon: //@TODO: Replace icon when available in f36
78
- /*#__PURE__*/ React.createElement("svg", {
74
+ icon: React.createElement("svg", {
79
75
  width: "16",
80
76
  height: "16",
81
77
  viewBox: "0 0 16 16",
82
78
  fill: "none",
83
79
  xmlns: "http://www.w3.org/2000/svg"
84
- }, /*#__PURE__*/ React.createElement("path", {
80
+ }, React.createElement("path", {
85
81
  d: "M1.75 8C1.75 8.59674 1.98705 9.16903 2.40901 9.59099C2.83097 10.0129 3.40326 10.25 4 10.25H6.5C6.69891 10.25 6.88968 10.329 7.03033 10.4697C7.17098 10.6103 7.25 10.8011 7.25 11C7.25 11.1989 7.17098 11.3897 7.03033 11.5303C6.88968 11.671 6.69891 11.75 6.5 11.75H4C3.00544 11.75 2.05161 11.3549 1.34835 10.6517C0.645088 9.94839 0.25 8.99456 0.25 8C0.25 7.00544 0.645088 6.05161 1.34835 5.34835C2.05161 4.64509 3.00544 4.25 4 4.25H6.5C6.69891 4.25 6.88968 4.32902 7.03033 4.46967C7.17098 4.61032 7.25 4.80109 7.25 5C7.25 5.19891 7.17098 5.38968 7.03033 5.53033C6.88968 5.67098 6.69891 5.75 6.5 5.75H4C3.40326 5.75 2.83097 5.98705 2.40901 6.40901C1.98705 6.83097 1.75 7.40326 1.75 8ZM12 4.25H9.5C9.30109 4.25 9.11032 4.32902 8.96967 4.46967C8.82902 4.61032 8.75 4.80109 8.75 5C8.75 5.19891 8.82902 5.38968 8.96967 5.53033C9.11032 5.67098 9.30109 5.75 9.5 5.75H12C12.5967 5.75 13.169 5.98705 13.591 6.40901C14.0129 6.83097 14.25 7.40326 14.25 8C14.25 8.59674 14.0129 9.16903 13.591 9.59099C13.169 10.0129 12.5967 10.25 12 10.25H9.5C9.30109 10.25 9.11032 10.329 8.96967 10.4697C8.82902 10.6103 8.75 10.8011 8.75 11C8.75 11.1989 8.82902 11.3897 8.96967 11.5303C9.11032 11.671 9.30109 11.75 9.5 11.75H12C12.9946 11.75 13.9484 11.3549 14.6517 10.6517C15.3549 9.94839 15.75 8.99456 15.75 8C15.75 7.00544 15.3549 6.05161 14.6517 5.34835C13.9484 4.64509 12.9946 4.25 12 4.25Z",
86
82
  fill: "black"
87
83
  }))
88
- }))))));
84
+ })))));
89
85
  };
@@ -7,9 +7,9 @@ import { LinkPopover } from './LinkPopover';
7
7
  import { styles } from './styles';
8
8
  import { useHyperlinkCommon } from './useHyperlinkCommon';
9
9
  export function ResourceHyperlink(props) {
10
- const { editor, sdk, isLinkFocused, pathToElement } = useHyperlinkCommon(props.element);
11
- const { onEntityFetchComplete } = useLinkTracking();
12
- const { target } = props.element.data;
10
+ const { editor , sdk , isLinkFocused , pathToElement } = useHyperlinkCommon(props.element);
11
+ const { onEntityFetchComplete } = useLinkTracking();
12
+ const { target } = props.element.data;
13
13
  const tooltipContent = useResourceEntityInfo({
14
14
  target,
15
15
  onEntityFetchComplete
@@ -17,17 +17,17 @@ export function ResourceHyperlink(props) {
17
17
  if (!target) {
18
18
  return null;
19
19
  }
20
- const popoverText = /*#__PURE__*/ React.createElement(Text, {
20
+ const popoverText = React.createElement(Text, {
21
21
  fontColor: "blue600",
22
22
  fontWeight: "fontWeightMedium",
23
23
  className: styles.openLink
24
24
  }, tooltipContent);
25
- return /*#__PURE__*/ React.createElement(LinkPopover, {
25
+ return React.createElement(LinkPopover, {
26
26
  isLinkFocused: isLinkFocused,
27
27
  handleEditLink: ()=>handleEditLink(editor, sdk, pathToElement),
28
28
  handleRemoveLink: ()=>handleRemoveLink(editor),
29
29
  popoverText: popoverText
30
- }, /*#__PURE__*/ React.createElement(Text, {
30
+ }, React.createElement(Text, {
31
31
  testId: "cf-ui-text-link",
32
32
  fontColor: "blue600",
33
33
  fontWeight: "fontWeightMedium",
@@ -19,11 +19,11 @@ export function ToolbarHyperlinkButton(props) {
19
19
  }
20
20
  }
21
21
  if (!editor) return null;
22
- return /*#__PURE__*/ React.createElement(ToolbarButton, {
22
+ return React.createElement(ToolbarButton, {
23
23
  title: "Hyperlink",
24
24
  testId: "hyperlink-toolbar-button",
25
25
  onClick: handleClick,
26
26
  isActive: isActive,
27
27
  isDisabled: props.isDisabled
28
- }, /*#__PURE__*/ React.createElement(LinkIcon, null));
28
+ }, React.createElement(LinkIcon, null));
29
29
  }
@@ -5,21 +5,21 @@ import { LinkPopover } from './LinkPopover';
5
5
  import { styles } from './styles';
6
6
  import { useHyperlinkCommon } from './useHyperlinkCommon';
7
7
  export function UrlHyperlink(props) {
8
- const { editor, sdk, isLinkFocused, pathToElement } = useHyperlinkCommon(props.element);
8
+ const { editor , sdk , isLinkFocused , pathToElement } = useHyperlinkCommon(props.element);
9
9
  const uri = props.element.data?.uri;
10
- const popoverText = /*#__PURE__*/ React.createElement(TextLink, {
10
+ const popoverText = React.createElement(TextLink, {
11
11
  className: styles.openLink,
12
12
  href: uri,
13
13
  rel: "noopener noreferrer",
14
14
  target: "_blank"
15
15
  }, uri);
16
- return /*#__PURE__*/ React.createElement(LinkPopover, {
16
+ return React.createElement(LinkPopover, {
17
17
  isLinkFocused: isLinkFocused,
18
18
  handleEditLink: ()=>handleEditLink(editor, sdk, pathToElement),
19
19
  handleRemoveLink: ()=>handleRemoveLink(editor),
20
20
  handleCopyLink: ()=>handleCopyLink(uri),
21
21
  popoverText: popoverText
22
- }, /*#__PURE__*/ React.createElement(TextLink, {
22
+ }, React.createElement(TextLink, {
23
23
  testId: "cf-ui-text-link",
24
24
  href: uri,
25
25
  onClick: (e)=>e.preventDefault(),
@@ -12,7 +12,7 @@ const isAnchor = (element)=>element.nodeName === 'A' && !!element.getAttribute('
12
12
  const isEntryAnchor = (element)=>element.nodeName === 'A' && element.getAttribute('data-link-type') === 'Entry';
13
13
  const isAssetAnchor = (element)=>element.nodeName === 'A' && element.getAttribute('data-link-type') === 'Asset';
14
14
  const isResourceAnchor = (element)=>element.nodeName === 'A' && element.getAttribute('data-resource-link-type') === 'Contentful:Entry';
15
- const buildHyperlinkEventHandler = (sdk)=>(editor, { options: { hotkey } })=>{
15
+ const buildHyperlinkEventHandler = (sdk)=>(editor, { options: { hotkey } })=>{
16
16
  return (event)=>{
17
17
  if (!editor.selection) {
18
18
  return;
@@ -65,7 +65,6 @@ export const createHyperlinkPlugin = (sdk)=>{
65
65
  onKeyDown: buildHyperlinkEventHandler(sdk)
66
66
  },
67
67
  plugins: [
68
- // URL Hyperlink
69
68
  {
70
69
  ...common,
71
70
  key: INLINES.HYPERLINK,
@@ -83,7 +82,6 @@ export const createHyperlinkPlugin = (sdk)=>{
83
82
  getNode: getNodeOfType(INLINES.HYPERLINK)
84
83
  }
85
84
  },
86
- // Entry Hyperlink
87
85
  {
88
86
  ...common,
89
87
  key: INLINES.ENTRY_HYPERLINK,
@@ -101,7 +99,6 @@ export const createHyperlinkPlugin = (sdk)=>{
101
99
  getNode: getNodeOfType(INLINES.ENTRY_HYPERLINK)
102
100
  }
103
101
  },
104
- // Resource Hyperlink
105
102
  {
106
103
  ...common,
107
104
  key: INLINES.RESOURCE_HYPERLINK,
@@ -119,7 +116,6 @@ export const createHyperlinkPlugin = (sdk)=>{
119
116
  getNode: getNodeOfType(INLINES.RESOURCE_HYPERLINK)
120
117
  }
121
118
  },
122
- // Asset Hyperlink
123
119
  {
124
120
  ...common,
125
121
  key: INLINES.ASSET_HYPERLINK,
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { entityHelpers } from '@contentful/field-editor-shared';
3
3
  import { getEntityInfo } from './utils';
4
- async function fetchAllData({ sdk, entityId, entityType, localeCode, defaultLocaleCode }) {
4
+ async function fetchAllData({ sdk , entityId , entityType , localeCode , defaultLocaleCode }) {
5
5
  let contentType;
6
6
  const getEntity = entityType === 'Entry' ? sdk.space.getEntry : sdk.space.getAsset;
7
7
  const entity = await getEntity(entityId);
@@ -10,7 +10,6 @@ async function fetchAllData({ sdk, entityId, entityType, localeCode, defaultLoca
10
10
  contentType = sdk.space.getCachedContentTypes().find((ct)=>ct.sys.id === contentTypeId);
11
11
  }
12
12
  const entityTitle = entityType === 'Entry' ? entityHelpers.getEntryTitle({
13
- //@ts-expect-error
14
13
  entry: entity,
15
14
  contentType,
16
15
  localeCode,
@@ -23,14 +22,12 @@ async function fetchAllData({ sdk, entityId, entityType, localeCode, defaultLoca
23
22
  defaultTitle: 'Untitled'
24
23
  });
25
24
  const entityDescription = entityHelpers.getEntityDescription({
26
- // @ts-expect-error
27
25
  entity,
28
26
  contentType,
29
27
  localeCode,
30
28
  defaultLocaleCode
31
29
  });
32
30
  const jobs = await sdk.space.getEntityScheduledActions(entityType, entityId);
33
- // @ts-expect-error
34
31
  const entityStatus = entityHelpers.getEntryStatus(entity.sys);
35
32
  return {
36
33
  jobs,
@@ -41,7 +38,7 @@ async function fetchAllData({ sdk, entityId, entityType, localeCode, defaultLoca
41
38
  contentTypeName: contentType ? contentType.name : ''
42
39
  };
43
40
  }
44
- function useRequestStatus({ sdk, target, onEntityFetchComplete }) {
41
+ function useRequestStatus({ sdk , target , onEntityFetchComplete }) {
45
42
  const [requestStatus, setRequestStatus] = useState({
46
43
  type: 'loading'
47
44
  });
@@ -77,7 +74,7 @@ function useRequestStatus({ sdk, target, onEntityFetchComplete }) {
77
74
  }
78
75
  export function useEntityInfo(props) {
79
76
  const status = useRequestStatus(props);
80
- const { linkType } = props.target.sys;
77
+ const { linkType } = props.target.sys;
81
78
  if (status.type === 'loading') {
82
79
  return `Loading ${linkType.toLowerCase()}...`;
83
80
  }
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { useResource } from '@contentful/field-editor-reference';
3
3
  import { truncateTitle } from '../../plugins/shared/utils';
4
- export function useResourceEntityInfo({ onEntityFetchComplete, target }) {
5
- const { data, error, status } = useResource(target.sys.linkType, target.sys.urn);
4
+ export function useResourceEntityInfo({ onEntityFetchComplete , target }) {
5
+ const { data , error , status } = useResource(target.sys.linkType, target.sys.urn);
6
6
  React.useEffect(()=>{
7
7
  if (status === 'success') {
8
8
  onEntityFetchComplete?.();
@@ -10,7 +10,7 @@ export function getEntityInfo(data) {
10
10
  if (!data) {
11
11
  return '';
12
12
  }
13
- const { entityTitle, contentTypeName, entityStatus, jobs } = data;
13
+ const { entityTitle , contentTypeName , entityStatus , jobs } = data;
14
14
  const title = truncateTitle(entityTitle, 60) || 'Untitled';
15
15
  const scheduledActions = jobs.length > 0 ? getScheduleTooltipContent({
16
16
  job: jobs[0],
@@ -1,40 +1,40 @@
1
- /* eslint-disable react/no-unknown-property */ /** @jsx jsx */ import { assertOutput, jsx } from '../../../test-utils';
1
+ import { assertOutput, jsx } from '../../../test-utils';
2
2
  describe('normalization', ()=>{
3
3
  it('wraps orphaned list items in a list', ()=>{
4
- const input = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item")), /*#__PURE__*/ jsx("hp", null));
5
- const expected = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item"))), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
4
+ const input = jsx("editor", null, jsx("hli", null, jsx("hp", null, "Item")), jsx("hp", null));
5
+ const expected = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item"))), jsx("hp", null, jsx("htext", null)));
6
6
  assertOutput({
7
7
  input,
8
8
  expected
9
9
  });
10
10
  });
11
11
  it('adds empty paragraph to empty list items', ()=>{
12
- const input = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null)), /*#__PURE__*/ jsx("hp", null));
13
- const expected = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)))), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
12
+ const input = jsx("editor", null, jsx("hul", null, jsx("hli", null)), jsx("hp", null));
13
+ const expected = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("htext", null)))), jsx("hp", null, jsx("htext", null)));
14
14
  assertOutput({
15
15
  input,
16
16
  expected
17
17
  });
18
18
  });
19
19
  it('replaces invalid list items with text', ()=>{
20
- const input = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item"), /*#__PURE__*/ jsx("htd", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", {
20
+ const input = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item"), jsx("htd", null, jsx("hp", null, jsx("htext", {
21
21
  bold: true
22
- }, "bold text"))), /*#__PURE__*/ jsx("htd", null, /*#__PURE__*/ jsx("hp", null, "Take a look at this ", /*#__PURE__*/ jsx("hlink", {
22
+ }, "bold text"))), jsx("htd", null, jsx("hp", null, "Take a look at this ", jsx("hlink", {
23
23
  uri: "https://google.com"
24
- }, "link"))))), /*#__PURE__*/ jsx("hp", null));
25
- const expected = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item"), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", {
24
+ }, "link"))))), jsx("hp", null));
25
+ const expected = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item"), jsx("hp", null, jsx("htext", {
26
26
  bold: true
27
- }, "bold text")), /*#__PURE__*/ jsx("hp", null, "Take a look at this ", /*#__PURE__*/ jsx("hlink", {
27
+ }, "bold text")), jsx("hp", null, "Take a look at this ", jsx("hlink", {
28
28
  uri: "https://google.com"
29
- }, "link"), /*#__PURE__*/ jsx("htext", null)))), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
29
+ }, "link"), jsx("htext", null)))), jsx("hp", null, jsx("htext", null)));
30
30
  assertOutput({
31
31
  input,
32
32
  expected
33
33
  });
34
34
  });
35
35
  it('replaces list items with nested lists as a first child', ()=>{
36
- const input = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 1"), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 1.1")))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.1"), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.1.1")))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.2"))))), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
37
- const expected = /*#__PURE__*/ jsx("editor", null, /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 1"), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 1.1")))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.1"), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.1.1")))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "Item 2.2"))), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
36
+ const input = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 1"), jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 1.1")))), jsx("hli", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 2.1"), jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 2.1.1")))), jsx("hli", null, jsx("hp", null, "Item 2.2"))))), jsx("hp", null, jsx("htext", null)));
37
+ const expected = jsx("editor", null, jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 1"), jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 1.1")))), jsx("hli", null, jsx("hp", null, "Item 2.1"), jsx("hul", null, jsx("hli", null, jsx("hp", null, "Item 2.1.1")))), jsx("hli", null, jsx("hp", null, "Item 2.2"))), jsx("hp", null, jsx("htext", null)));
38
38
  assertOutput({
39
39
  input,
40
40
  expected
@@ -1,72 +1,68 @@
1
- /** @jsx jsx */ import { jsx, assertOutput, createTestEditor } from '../../../test-utils';
1
+ import { jsx, assertOutput, createTestEditor } from '../../../test-utils';
2
2
  describe('insert line break', ()=>{
3
3
  const tests = [
4
- // single p
5
4
  {
6
5
  title: 'at the start of a li',
7
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null), "p1"))),
8
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1")))
6
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("cursor", null), "p1"))),
7
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("cursor", null))), jsx("hli", null, jsx("hp", null, "p1")))
9
8
  },
10
9
  {
11
10
  title: 'at the end of a li',
12
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1", /*#__PURE__*/ jsx("cursor", null)))),
13
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))))
11
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1", jsx("cursor", null)))),
12
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1")), jsx("hli", null, jsx("hp", null, jsx("cursor", null))))
14
13
  },
15
14
  {
16
15
  title: 'at the middle of a li',
17
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "split ", /*#__PURE__*/ jsx("cursor", null), "me"))),
18
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "split ")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null), "me")))
16
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "split ", jsx("cursor", null), "me"))),
17
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "split ")), jsx("hli", null, jsx("hp", null, jsx("cursor", null), "me")))
19
18
  },
20
- // multi p
21
19
  {
22
20
  title: 'at the start of a li with multiple p',
23
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null), "p1"), /*#__PURE__*/ jsx("hp", null, "p2"))),
24
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1"), /*#__PURE__*/ jsx("hp", null, "p2")))
21
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("cursor", null), "p1"), jsx("hp", null, "p2"))),
22
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("cursor", null))), jsx("hli", null, jsx("hp", null, "p1"), jsx("hp", null, "p2")))
25
23
  },
26
24
  {
27
25
  title: 'at the start of the second p of a li',
28
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1"), /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null), "p2"))),
29
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null)), /*#__PURE__*/ jsx("hp", null, "p2")))
26
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1"), jsx("hp", null, jsx("cursor", null), "p2"))),
27
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1")), jsx("hli", null, jsx("hp", null, jsx("cursor", null)), jsx("hp", null, "p2")))
30
28
  },
31
29
  {
32
30
  title: 'at the end of a li with multiple p',
33
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1"), /*#__PURE__*/ jsx("hp", null, "p2", /*#__PURE__*/ jsx("cursor", null)))),
34
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "p1"), /*#__PURE__*/ jsx("hp", null, "p2")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))))
31
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1"), jsx("hp", null, "p2", jsx("cursor", null)))),
32
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "p1"), jsx("hp", null, "p2")), jsx("hli", null, jsx("hp", null, jsx("cursor", null))))
35
33
  },
36
34
  {
37
35
  title: 'at the middle of a li with multiple p',
38
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "split ", /*#__PURE__*/ jsx("cursor", null), "me"), /*#__PURE__*/ jsx("hp", null, "move me"))),
39
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "split ")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null), "me"), /*#__PURE__*/ jsx("hp", null, "move me")))
36
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "split ", jsx("cursor", null), "me"), jsx("hp", null, "move me"))),
37
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "split ")), jsx("hli", null, jsx("hp", null, jsx("cursor", null), "me"), jsx("hp", null, "move me")))
40
38
  },
41
- // with headings
42
39
  {
43
40
  title: 'at the start of a li with heading',
44
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, /*#__PURE__*/ jsx("cursor", null), "p1"))),
45
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "p1")))
41
+ input: jsx("hul", null, jsx("hli", null, jsx("hh1", null, jsx("cursor", null), "p1"))),
42
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, jsx("cursor", null))), jsx("hli", null, jsx("hh1", null, "p1")))
46
43
  },
47
44
  {
48
45
  title: 'at the end of a li with heading',
49
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "p1", /*#__PURE__*/ jsx("cursor", null)))),
50
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "p1")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null))))
46
+ input: jsx("hul", null, jsx("hli", null, jsx("hh1", null, "p1", jsx("cursor", null)))),
47
+ expected: jsx("hul", null, jsx("hli", null, jsx("hh1", null, "p1")), jsx("hli", null, jsx("hp", null, jsx("cursor", null))))
51
48
  },
52
49
  {
53
50
  title: 'at the middle of a li with heading',
54
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "split ", /*#__PURE__*/ jsx("cursor", null), "me"))),
55
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "split ")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, /*#__PURE__*/ jsx("cursor", null), "me")))
51
+ input: jsx("hul", null, jsx("hli", null, jsx("hh1", null, "split ", jsx("cursor", null), "me"))),
52
+ expected: jsx("hul", null, jsx("hli", null, jsx("hh1", null, "split ")), jsx("hli", null, jsx("hh1", null, jsx("cursor", null), "me")))
56
53
  },
57
54
  {
58
55
  title: 'at a li with nested list',
59
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "item 1")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "item 2", /*#__PURE__*/ jsx("cursor", null)), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "sub list"))))),
60
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "item 1")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "item 2")), /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("cursor", null)), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "sub list")))))
56
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "item 1")), jsx("hli", null, jsx("hp", null, "item 2", jsx("cursor", null)), jsx("hul", null, jsx("hli", null, jsx("hp", null, "sub list"))))),
57
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "item 1")), jsx("hli", null, jsx("hp", null, "item 2")), jsx("hli", null, jsx("hp", null, jsx("cursor", null)), jsx("hul", null, jsx("hli", null, jsx("hp", null, "sub list")))))
61
58
  }
62
59
  ];
63
- const render = (children)=>/*#__PURE__*/ jsx("editor", null, children, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
60
+ const render = (children)=>jsx("editor", null, children, jsx("hp", null, jsx("htext", null)));
64
61
  for (const t of tests){
65
62
  test(t.title, ()=>{
66
- const { editor } = createTestEditor({
63
+ const { editor } = createTestEditor({
67
64
  input: render(t.input)
68
65
  });
69
- // Equivalent of pressing ENTER
70
66
  editor.insertBreak();
71
67
  assertOutput({
72
68
  editor,
@@ -1,53 +1,53 @@
1
- /** @jsx jsx */ import { jsx, assertOutput, createTestEditor } from '../../../test-utils';
1
+ import { jsx, assertOutput, createTestEditor } from '../../../test-utils';
2
2
  describe('insert fragment', ()=>{
3
3
  const tests = [
4
4
  {
5
5
  title: 'text wrapped in li > p',
6
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello ", /*#__PURE__*/ jsx("cursor", null)))),
7
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "world"))),
8
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello world")))
6
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello ", jsx("cursor", null)))),
7
+ fragment: jsx("fragment", null, jsx("hli", null, jsx("hp", null, "world"))),
8
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello world")))
9
9
  },
10
10
  {
11
11
  title: 'text wrapped in li > h*',
12
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello ", /*#__PURE__*/ jsx("cursor", null)))),
13
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hh1", null, "world"))),
14
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello world")))
12
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello ", jsx("cursor", null)))),
13
+ fragment: jsx("fragment", null, jsx("hli", null, jsx("hh1", null, "world"))),
14
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello world")))
15
15
  },
16
16
  {
17
17
  title: 'single li with only asset card',
18
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello", /*#__PURE__*/ jsx("cursor", null), "world"))),
19
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hembed", {
18
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello", jsx("cursor", null), "world"))),
19
+ fragment: jsx("fragment", null, jsx("hli", null, jsx("hembed", {
20
20
  type: "Asset",
21
21
  id: "asset-id"
22
22
  }))),
23
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello"), /*#__PURE__*/ jsx("hembed", {
23
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello"), jsx("hembed", {
24
24
  type: "Asset",
25
25
  id: "asset-id"
26
- }), /*#__PURE__*/ jsx("hp", null, "world")))
26
+ }), jsx("hp", null, "world")))
27
27
  },
28
28
  {
29
29
  title: 'two paragraphs',
30
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello ", /*#__PURE__*/ jsx("cursor", null)))),
31
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hp", null, "world"), /*#__PURE__*/ jsx("hp", null, "line 2")),
32
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello world"), /*#__PURE__*/ jsx("hp", null, "line 2")))
30
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello ", jsx("cursor", null)))),
31
+ fragment: jsx("fragment", null, jsx("hp", null, "world"), jsx("hp", null, "line 2")),
32
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello world"), jsx("hp", null, "line 2")))
33
33
  },
34
34
  {
35
35
  title: 'two headings',
36
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello ", /*#__PURE__*/ jsx("cursor", null)))),
37
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hh1", null, "world"), /*#__PURE__*/ jsx("hh1", null, "line 2")),
38
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello world"), /*#__PURE__*/ jsx("hh1", null, "line 2")))
36
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello ", jsx("cursor", null)))),
37
+ fragment: jsx("fragment", null, jsx("hh1", null, "world"), jsx("hh1", null, "line 2")),
38
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello world"), jsx("hh1", null, "line 2")))
39
39
  },
40
40
  {
41
41
  title: 'two paragraphs wrapped in a li',
42
- input: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello ", /*#__PURE__*/ jsx("cursor", null)))),
43
- fragment: /*#__PURE__*/ jsx("fragment", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "world"), /*#__PURE__*/ jsx("hp", null, "line 2"))),
44
- expected: /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "hello "), /*#__PURE__*/ jsx("hul", null, /*#__PURE__*/ jsx("hli", null, /*#__PURE__*/ jsx("hp", null, "world"), /*#__PURE__*/ jsx("hp", null, "line 2")))))
42
+ input: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello ", jsx("cursor", null)))),
43
+ fragment: jsx("fragment", null, jsx("hli", null, jsx("hp", null, "world"), jsx("hp", null, "line 2"))),
44
+ expected: jsx("hul", null, jsx("hli", null, jsx("hp", null, "hello "), jsx("hul", null, jsx("hli", null, jsx("hp", null, "world"), jsx("hp", null, "line 2")))))
45
45
  }
46
46
  ];
47
- const render = (children)=>/*#__PURE__*/ jsx("editor", null, children, /*#__PURE__*/ jsx("hp", null, /*#__PURE__*/ jsx("htext", null)));
47
+ const render = (children)=>jsx("editor", null, children, jsx("hp", null, jsx("htext", null)));
48
48
  for (const t of tests){
49
49
  test(t.title, ()=>{
50
- const { editor } = createTestEditor({
50
+ const { editor } = createTestEditor({
51
51
  input: render(t.input)
52
52
  });
53
53
  editor.insertFragment(t.fragment);