@contentful/field-editor-rich-text 3.14.3 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/dist/cjs/ContentfulEditorProvider.js +8 -8
  2. package/dist/cjs/RichTextEditor.js +22 -20
  3. package/dist/cjs/RichTextEditor.styles.js +2 -1
  4. package/dist/cjs/SdkProvider.js +7 -5
  5. package/dist/cjs/SyncEditorChanges.js +15 -6
  6. package/dist/cjs/Toolbar/_tests_/toolbar.test.js +17 -15
  7. package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +14 -10
  8. package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +10 -8
  9. package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +2 -2
  10. package/dist/cjs/Toolbar/index.js +33 -30
  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 +8 -6
  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 +1 -0
  19. package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +43 -38
  20. package/dist/cjs/dialogs/openRichTextDialog.js +6 -4
  21. package/dist/cjs/dialogs/renderRichTextDialog.js +6 -4
  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 +53 -44
  26. package/dist/cjs/helpers/environment.js +3 -3
  27. package/dist/cjs/helpers/formatDateAndTime.js +5 -4
  28. package/dist/cjs/helpers/getAllowedResourcesForNodeType.js +22 -5
  29. package/dist/cjs/helpers/getLinkedContentTypeIdsForNodeType.js +29 -5
  30. package/dist/cjs/helpers/nodeFactory.js +6 -6
  31. package/dist/cjs/helpers/sdkNavigatorSlideIn.js +14 -6
  32. package/dist/cjs/helpers/sdkNavigatorSlideIn.spec.js +3 -2
  33. package/dist/cjs/helpers/toSlateValue.js +14 -3
  34. package/dist/cjs/helpers/transformers.js +5 -5
  35. package/dist/cjs/helpers/validations.js +12 -9
  36. package/dist/cjs/index.js +7 -5
  37. package/dist/cjs/internal/constants.js +4 -2
  38. package/dist/cjs/internal/hooks.js +8 -6
  39. package/dist/cjs/internal/misc.js +15 -12
  40. package/dist/cjs/internal/queries.js +115 -108
  41. package/dist/cjs/internal/transforms.js +51 -48
  42. package/dist/cjs/internal/types/editor.js +3 -1
  43. package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +4 -3
  44. package/dist/cjs/plugins/Break/createResetNodePlugin.js +1 -0
  45. package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +3 -3
  46. package/dist/cjs/plugins/CommandPalette/components/CommandList.js +35 -33
  47. package/dist/cjs/plugins/CommandPalette/components/CommandList.styles.js +1 -1
  48. package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +7 -5
  49. package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +7 -3
  50. package/dist/cjs/plugins/CommandPalette/onKeyDown.js +6 -1
  51. package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +6 -4
  52. package/dist/cjs/plugins/CommandPalette/useCommands.js +3 -3
  53. package/dist/cjs/plugins/CommandPalette/utils/fetchEntries.js +2 -0
  54. package/dist/cjs/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -1
  55. package/dist/cjs/plugins/DragAndDrop/index.js +9 -1
  56. package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +10 -8
  57. package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +3 -3
  58. package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +19 -17
  59. package/dist/cjs/plugins/EmbeddedEntityInline/LinkedEntityInline.js +9 -7
  60. package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +5 -5
  61. package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +17 -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 +13 -10
  65. package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +19 -11
  66. package/dist/cjs/plugins/Heading/createHeadingPlugin.js +7 -2
  67. package/dist/cjs/plugins/Hr/index.js +19 -14
  68. package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +32 -28
  69. package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
  70. package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +8 -6
  71. package/dist/cjs/plugins/Hyperlink/components/ResourceHyperlink.js +8 -6
  72. package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +6 -4
  73. package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +7 -5
  74. package/dist/cjs/plugins/Hyperlink/components/styles.js +1 -1
  75. package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +10 -4
  76. package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +6 -3
  77. package/dist/cjs/plugins/Hyperlink/useResourceEntityInfo.js +7 -5
  78. package/dist/cjs/plugins/Hyperlink/utils.js +6 -14
  79. package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +13 -13
  80. package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +29 -25
  81. package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +22 -22
  82. package/dist/cjs/plugins/List/components/List.js +9 -7
  83. package/dist/cjs/plugins/List/components/ListItem.js +6 -4
  84. package/dist/cjs/plugins/List/components/ToolbarListButton.js +7 -5
  85. package/dist/cjs/plugins/List/createListPlugin.js +4 -0
  86. package/dist/cjs/plugins/List/insertListBreak.js +13 -4
  87. package/dist/cjs/plugins/List/insertListFragment.js +18 -5
  88. package/dist/cjs/plugins/List/onKeyDownList.js +7 -4
  89. package/dist/cjs/plugins/List/transforms/insertListItem.js +17 -2
  90. package/dist/cjs/plugins/List/transforms/moveListItemDown.js +8 -2
  91. package/dist/cjs/plugins/List/transforms/moveListItems.js +7 -2
  92. package/dist/cjs/plugins/List/transforms/moveListItems.test.js +15 -14
  93. package/dist/cjs/plugins/List/transforms/toggleList.js +8 -3
  94. package/dist/cjs/plugins/List/transforms/toggleList.spec.js +28 -28
  95. package/dist/cjs/plugins/List/transforms/unwrapList.js +7 -2
  96. package/dist/cjs/plugins/List/utils.js +12 -11
  97. package/dist/cjs/plugins/List/withList.js +6 -2
  98. package/dist/cjs/plugins/Marks/Bold.js +9 -7
  99. package/dist/cjs/plugins/Marks/Code.js +15 -7
  100. package/dist/cjs/plugins/Marks/Italic.js +9 -7
  101. package/dist/cjs/plugins/Marks/Subscript.js +10 -8
  102. package/dist/cjs/plugins/Marks/Superscript.js +10 -8
  103. package/dist/cjs/plugins/Marks/Underline.js +6 -4
  104. package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +9 -7
  105. package/dist/cjs/plugins/Marks/helpers.js +5 -5
  106. package/dist/cjs/plugins/Normalizer/baseRules.js +2 -0
  107. package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
  108. package/dist/cjs/plugins/Normalizer/utils.js +4 -3
  109. package/dist/cjs/plugins/Normalizer/withNormalizer.js +23 -3
  110. package/dist/cjs/plugins/Paragraph/Paragraph.js +6 -4
  111. package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
  112. package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +3 -2
  113. package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +9 -6
  114. package/dist/cjs/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +2 -0
  115. package/dist/cjs/plugins/PasteHTML/utils/sanitizeAnchors.js +9 -0
  116. package/dist/cjs/plugins/PasteHTML/utils/sanitizeHTML.js +17 -2
  117. package/dist/cjs/plugins/PasteHTML/utils/sanitizeSheets.js +13 -1
  118. package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
  119. package/dist/cjs/plugins/Quote/components/Quote.js +6 -4
  120. package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +6 -4
  121. package/dist/cjs/plugins/Quote/createQuotePlugin.js +1 -0
  122. package/dist/cjs/plugins/Quote/toggleQuote.js +5 -5
  123. package/dist/cjs/plugins/Quote/withQuote.js +4 -2
  124. package/dist/cjs/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +1 -0
  125. package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
  126. package/dist/cjs/plugins/Table/__tests__/helpers.test.js +4 -4
  127. package/dist/cjs/plugins/Table/actions/addColumn.js +5 -4
  128. package/dist/cjs/plugins/Table/actions/addRow.js +6 -3
  129. package/dist/cjs/plugins/Table/components/Cell.js +7 -5
  130. package/dist/cjs/plugins/Table/components/HeaderCell.js +7 -5
  131. package/dist/cjs/plugins/Table/components/Row.js +6 -4
  132. package/dist/cjs/plugins/Table/components/Table.js +8 -6
  133. package/dist/cjs/plugins/Table/components/TableActions.js +19 -16
  134. package/dist/cjs/plugins/Table/components/ToolbarButton.js +7 -4
  135. package/dist/cjs/plugins/Table/createTablePlugin.js +11 -1
  136. package/dist/cjs/plugins/Table/helpers.js +16 -12
  137. package/dist/cjs/plugins/Table/insertTableFragment.js +15 -2
  138. package/dist/cjs/plugins/Table/onKeyDownTable.js +10 -2
  139. package/dist/cjs/plugins/Table/tableTracking.js +6 -6
  140. package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +19 -17
  141. package/dist/cjs/plugins/Text/createTextPlugin.js +22 -5
  142. package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +5 -4
  143. package/dist/cjs/plugins/Tracking/utils.js +6 -3
  144. package/dist/cjs/plugins/Voids/createVoidsPlugin.js +5 -0
  145. package/dist/cjs/plugins/Voids/transformVoid.js +1 -0
  146. package/dist/cjs/plugins/index.js +15 -3
  147. package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +12 -10
  148. package/dist/cjs/plugins/shared/EmbeddedBlockUtil.js +16 -6
  149. package/dist/cjs/plugins/shared/EmbeddedInlineToolbarIcon.js +10 -8
  150. package/dist/cjs/plugins/shared/EmbeddedInlineUtil.js +9 -5
  151. package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +13 -11
  152. package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +14 -12
  153. package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +14 -11
  154. package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +8 -4
  155. package/dist/cjs/plugins/shared/LinkedInlineWrapper.js +10 -6
  156. package/dist/cjs/plugins/shared/ResourceNewBadge.js +5 -3
  157. package/dist/cjs/plugins/shared/ToolbarButton.js +8 -6
  158. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +10 -5
  159. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +11 -6
  160. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +15 -13
  161. package/dist/cjs/plugins/shared/utils.js +20 -3
  162. package/dist/cjs/test-utils/assertOutput.js +1 -0
  163. package/dist/cjs/test-utils/hyperscript.d.js +1 -0
  164. package/dist/cjs/test-utils/randomId.js +3 -1
  165. package/dist/cjs/test-utils/validation.js +8 -5
  166. package/dist/esm/ContentfulEditorProvider.js +4 -1
  167. package/dist/esm/RichTextEditor.js +13 -13
  168. package/dist/esm/RichTextEditor.styles.js +1 -0
  169. package/dist/esm/SdkProvider.js +2 -2
  170. package/dist/esm/SyncEditorChanges.js +18 -3
  171. package/dist/esm/Toolbar/_tests_/toolbar.test.js +12 -12
  172. package/dist/esm/Toolbar/components/EmbedEntityWidget.js +10 -8
  173. package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +6 -6
  174. package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +1 -1
  175. package/dist/esm/Toolbar/index.js +28 -27
  176. package/dist/esm/__fixtures__/FakeSdk.js +3 -3
  177. package/dist/esm/constants/Schema.js +1 -0
  178. package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +34 -31
  179. package/dist/esm/dialogs/openRichTextDialog.js +2 -2
  180. package/dist/esm/dialogs/renderRichTextDialog.js +2 -2
  181. package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +10 -10
  182. package/dist/esm/helpers/callbacks.js +1 -1
  183. package/dist/esm/helpers/config.js +9 -1
  184. package/dist/esm/helpers/editor.js +22 -6
  185. package/dist/esm/helpers/extractNodes.js +3 -1
  186. package/dist/esm/helpers/formatDateAndTime.js +11 -2
  187. package/dist/esm/helpers/getAllowedResourcesForNodeType.js +19 -2
  188. package/dist/esm/helpers/getLinkedContentTypeIdsForNodeType.js +26 -2
  189. package/dist/esm/helpers/sdkNavigatorSlideIn.js +20 -6
  190. package/dist/esm/helpers/sdkNavigatorSlideIn.spec.js +1 -0
  191. package/dist/esm/helpers/toSlateValue.js +17 -3
  192. package/dist/esm/helpers/validations.js +5 -1
  193. package/dist/esm/internal/misc.js +23 -2
  194. package/dist/esm/internal/queries.js +11 -2
  195. package/dist/esm/internal/transforms.js +14 -3
  196. package/dist/esm/internal/types/editor.js +3 -1
  197. package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +4 -3
  198. package/dist/esm/plugins/Break/createResetNodePlugin.js +1 -0
  199. package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +3 -3
  200. package/dist/esm/plugins/CommandPalette/components/CommandList.js +30 -30
  201. package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +2 -2
  202. package/dist/esm/plugins/CommandPalette/createCommandPalettePlugin.js +11 -1
  203. package/dist/esm/plugins/CommandPalette/hooks/useCommandList.js +2 -0
  204. package/dist/esm/plugins/CommandPalette/onKeyDown.js +5 -0
  205. package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +2 -2
  206. package/dist/esm/plugins/CommandPalette/useCommands.js +3 -3
  207. package/dist/esm/plugins/CommandPalette/utils/fetchEntries.js +2 -0
  208. package/dist/esm/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -1
  209. package/dist/esm/plugins/DragAndDrop/index.js +9 -1
  210. package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +6 -6
  211. package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +14 -14
  212. package/dist/esm/plugins/EmbeddedEntityInline/LinkedEntityInline.js +5 -5
  213. package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +4 -4
  214. package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +13 -11
  215. package/dist/esm/plugins/EmbeddedResourceInline/LinkedResourceInline.js +4 -4
  216. package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +32 -32
  217. package/dist/esm/plugins/Heading/components/Heading.js +8 -7
  218. package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +14 -8
  219. package/dist/esm/plugins/Heading/createHeadingPlugin.js +6 -1
  220. package/dist/esm/plugins/Hr/index.js +8 -5
  221. package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +25 -23
  222. package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +8 -8
  223. package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +4 -4
  224. package/dist/esm/plugins/Hyperlink/components/ResourceHyperlink.js +4 -4
  225. package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +2 -2
  226. package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +3 -3
  227. package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +5 -1
  228. package/dist/esm/plugins/Hyperlink/useEntityInfo.js +6 -3
  229. package/dist/esm/plugins/Hyperlink/useResourceEntityInfo.js +3 -3
  230. package/dist/esm/plugins/Hyperlink/utils.js +2 -7
  231. package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +13 -13
  232. package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +29 -25
  233. package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +22 -22
  234. package/dist/esm/plugins/List/components/List.js +1 -1
  235. package/dist/esm/plugins/List/components/ListItem.js +1 -1
  236. package/dist/esm/plugins/List/components/ToolbarListButton.js +3 -3
  237. package/dist/esm/plugins/List/createListPlugin.js +4 -0
  238. package/dist/esm/plugins/List/insertListBreak.js +13 -4
  239. package/dist/esm/plugins/List/insertListFragment.js +18 -5
  240. package/dist/esm/plugins/List/onKeyDownList.js +5 -2
  241. package/dist/esm/plugins/List/transforms/insertListItem.js +20 -3
  242. package/dist/esm/plugins/List/transforms/moveListItemDown.js +8 -2
  243. package/dist/esm/plugins/List/transforms/moveListItems.js +7 -2
  244. package/dist/esm/plugins/List/transforms/moveListItems.test.js +15 -14
  245. package/dist/esm/plugins/List/transforms/toggleList.js +8 -3
  246. package/dist/esm/plugins/List/transforms/toggleList.spec.js +28 -28
  247. package/dist/esm/plugins/List/transforms/unwrapList.js +7 -2
  248. package/dist/esm/plugins/List/utils.js +7 -2
  249. package/dist/esm/plugins/List/withList.js +6 -2
  250. package/dist/esm/plugins/Marks/Bold.js +2 -2
  251. package/dist/esm/plugins/Marks/Code.js +8 -2
  252. package/dist/esm/plugins/Marks/Italic.js +2 -2
  253. package/dist/esm/plugins/Marks/Subscript.js +2 -2
  254. package/dist/esm/plugins/Marks/Superscript.js +2 -2
  255. package/dist/esm/plugins/Marks/Underline.js +2 -2
  256. package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +4 -4
  257. package/dist/esm/plugins/Marks/helpers.js +1 -1
  258. package/dist/esm/plugins/Normalizer/baseRules.js +4 -0
  259. package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +12 -12
  260. package/dist/esm/plugins/Normalizer/utils.js +1 -0
  261. package/dist/esm/plugins/Normalizer/withNormalizer.js +22 -2
  262. package/dist/esm/plugins/Paragraph/Paragraph.js +1 -1
  263. package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +32 -32
  264. package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +2 -1
  265. package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +9 -3
  266. package/dist/esm/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +2 -0
  267. package/dist/esm/plugins/PasteHTML/utils/sanitizeAnchors.js +27 -1
  268. package/dist/esm/plugins/PasteHTML/utils/sanitizeHTML.js +17 -2
  269. package/dist/esm/plugins/PasteHTML/utils/sanitizeSheets.js +13 -1
  270. package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +21 -21
  271. package/dist/esm/plugins/Quote/components/Quote.js +1 -1
  272. package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +2 -2
  273. package/dist/esm/plugins/Quote/createQuotePlugin.js +1 -0
  274. package/dist/esm/plugins/Quote/shouldResetQuote.js +6 -1
  275. package/dist/esm/plugins/Quote/toggleQuote.js +1 -1
  276. package/dist/esm/plugins/Quote/withQuote.js +4 -2
  277. package/dist/esm/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +1 -0
  278. package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +22 -22
  279. package/dist/esm/plugins/Table/__tests__/helpers.test.js +4 -4
  280. package/dist/esm/plugins/Table/actions/addColumn.js +2 -1
  281. package/dist/esm/plugins/Table/actions/addRow.js +3 -0
  282. package/dist/esm/plugins/Table/components/Cell.js +2 -2
  283. package/dist/esm/plugins/Table/components/HeaderCell.js +2 -2
  284. package/dist/esm/plugins/Table/components/Row.js +1 -1
  285. package/dist/esm/plugins/Table/components/Table.js +3 -3
  286. package/dist/esm/plugins/Table/components/TableActions.js +12 -11
  287. package/dist/esm/plugins/Table/components/ToolbarButton.js +3 -2
  288. package/dist/esm/plugins/Table/createTablePlugin.js +11 -1
  289. package/dist/esm/plugins/Table/helpers.js +10 -1
  290. package/dist/esm/plugins/Table/insertTableFragment.js +15 -2
  291. package/dist/esm/plugins/Table/onKeyDownTable.js +10 -2
  292. package/dist/esm/plugins/Table/tableTracking.js +6 -6
  293. package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +19 -17
  294. package/dist/esm/plugins/Text/createTextPlugin.js +22 -5
  295. package/dist/esm/plugins/Tracking/createTrackingPlugin.js +2 -1
  296. package/dist/esm/plugins/Tracking/utils.js +1 -0
  297. package/dist/esm/plugins/Voids/createVoidsPlugin.js +5 -0
  298. package/dist/esm/plugins/Voids/transformVoid.js +4 -1
  299. package/dist/esm/plugins/index.js +12 -0
  300. package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +5 -5
  301. package/dist/esm/plugins/shared/EmbeddedBlockUtil.js +15 -5
  302. package/dist/esm/plugins/shared/EmbeddedInlineToolbarIcon.js +5 -5
  303. package/dist/esm/plugins/shared/EmbeddedInlineUtil.js +8 -4
  304. package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +8 -8
  305. package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +9 -9
  306. package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +9 -8
  307. package/dist/esm/plugins/shared/LinkedBlockWrapper.js +7 -3
  308. package/dist/esm/plugins/shared/LinkedInlineWrapper.js +5 -3
  309. package/dist/esm/plugins/shared/ResourceNewBadge.js +1 -1
  310. package/dist/esm/plugins/shared/ToolbarButton.js +3 -3
  311. package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +5 -2
  312. package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +5 -2
  313. package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +8 -8
  314. package/dist/esm/plugins/shared/utils.js +9 -0
  315. package/dist/esm/test-utils/assertOutput.js +1 -0
  316. package/dist/esm/test-utils/hyperscript.d.js +1 -0
  317. package/dist/esm/test-utils/jsx.js +5 -1
  318. package/dist/esm/test-utils/randomId.js +3 -1
  319. package/dist/esm/test-utils/setEmptyDataAttribute.js +4 -1
  320. package/dist/esm/test-utils/validation.js +7 -4
  321. package/dist/types/plugins/Hyperlink/utils.d.ts +0 -1
  322. package/dist/types/plugins/shared/utils.d.ts +1 -0
  323. package/package.json +2 -2
@@ -12,24 +12,24 @@ _export(exports, {
12
12
  changed: function() {
13
13
  return _changed_assetjson.default;
14
14
  },
15
+ created: function() {
16
+ return _created_assetjson.default;
17
+ },
15
18
  empty: function() {
16
19
  return _empty_assetjson.default;
17
20
  },
18
- published: function() {
19
- return _published_assetjson.default;
20
- },
21
21
  invalid: function() {
22
22
  return _invalid_assetjson.default;
23
23
  },
24
- created: function() {
25
- return _created_assetjson.default;
24
+ published: function() {
25
+ return _published_assetjson.default;
26
26
  }
27
27
  });
28
- const _changed_assetjson = _interop_require_default(require("./changed_asset.json"));
29
- const _created_assetjson = _interop_require_default(require("./created_asset.json"));
30
- const _empty_assetjson = _interop_require_default(require("./empty_asset.json"));
31
- const _invalid_assetjson = _interop_require_default(require("./invalid_asset.json"));
32
- const _published_assetjson = _interop_require_default(require("./published_asset.json"));
28
+ const _changed_assetjson = /*#__PURE__*/ _interop_require_default(require("./changed_asset.json"));
29
+ const _created_assetjson = /*#__PURE__*/ _interop_require_default(require("./created_asset.json"));
30
+ const _empty_assetjson = /*#__PURE__*/ _interop_require_default(require("./empty_asset.json"));
31
+ const _invalid_assetjson = /*#__PURE__*/ _interop_require_default(require("./invalid_asset.json"));
32
+ const _published_assetjson = /*#__PURE__*/ _interop_require_default(require("./published_asset.json"));
33
33
  function _interop_require_default(obj) {
34
34
  return obj && obj.__esModule ? obj : {
35
35
  default: obj
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "published", {
8
8
  return _published_content_typejson.default;
9
9
  }
10
10
  });
11
- const _published_content_typejson = _interop_require_default(require("./published_content_type.json"));
11
+ const _published_content_typejson = /*#__PURE__*/ _interop_require_default(require("./published_content_type.json"));
12
12
  function _interop_require_default(obj) {
13
13
  return obj && obj.__esModule ? obj : {
14
14
  default: obj
@@ -15,17 +15,17 @@ _export(exports, {
15
15
  empty: function() {
16
16
  return _empty_entryjson.default;
17
17
  },
18
- published: function() {
19
- return _published_entryjson.default;
20
- },
21
18
  invalid: function() {
22
19
  return _invalid_entryjson.default;
20
+ },
21
+ published: function() {
22
+ return _published_entryjson.default;
23
23
  }
24
24
  });
25
- const _changed_entryjson = _interop_require_default(require("./changed_entry.json"));
26
- const _empty_entryjson = _interop_require_default(require("./empty_entry.json"));
27
- const _invalid_entryjson = _interop_require_default(require("./invalid_entry.json"));
28
- const _published_entryjson = _interop_require_default(require("./published_entry.json"));
25
+ const _changed_entryjson = /*#__PURE__*/ _interop_require_default(require("./changed_entry.json"));
26
+ const _empty_entryjson = /*#__PURE__*/ _interop_require_default(require("./empty_entry.json"));
27
+ const _invalid_entryjson = /*#__PURE__*/ _interop_require_default(require("./invalid_entry.json"));
28
+ const _published_entryjson = /*#__PURE__*/ _interop_require_default(require("./published_entry.json"));
29
29
  function _interop_require_default(obj) {
30
30
  return obj && obj.__esModule ? obj : {
31
31
  default: obj
@@ -25,11 +25,11 @@ _export(exports, {
25
25
  return _space;
26
26
  }
27
27
  });
28
- const _asset = _interop_require_wildcard(require("./asset"));
29
- const _contenttype = _interop_require_wildcard(require("./content-type"));
30
- const _entry = _interop_require_wildcard(require("./entry"));
31
- const _locale = _interop_require_wildcard(require("./locale"));
32
- const _space = _interop_require_wildcard(require("./space"));
28
+ const _asset = /*#__PURE__*/ _interop_require_wildcard(require("./asset"));
29
+ const _contenttype = /*#__PURE__*/ _interop_require_wildcard(require("./content-type"));
30
+ const _entry = /*#__PURE__*/ _interop_require_wildcard(require("./entry"));
31
+ const _locale = /*#__PURE__*/ _interop_require_wildcard(require("./locale"));
32
+ const _space = /*#__PURE__*/ _interop_require_wildcard(require("./space"));
33
33
  function _getRequireWildcardCache(nodeInterop) {
34
34
  if (typeof WeakMap !== "function") return null;
35
35
  var cacheBabelInterop = new WeakMap();
@@ -51,7 +51,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
51
51
  if (cache && cache.has(obj)) {
52
52
  return cache.get(obj);
53
53
  }
54
- var newObj = {};
54
+ var newObj = {
55
+ __proto__: null
56
+ };
55
57
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
56
58
  for(var key in obj){
57
59
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -19,8 +19,8 @@ _export(exports, {
19
19
  return list;
20
20
  }
21
21
  });
22
- const _english_default_localejson = _interop_require_default(require("./english_default_locale.json"));
23
- const _german_localejson = _interop_require_default(require("./german_locale.json"));
22
+ const _english_default_localejson = /*#__PURE__*/ _interop_require_default(require("./english_default_locale.json"));
23
+ const _german_localejson = /*#__PURE__*/ _interop_require_default(require("./german_locale.json"));
24
24
  function _interop_require_default(obj) {
25
25
  return obj && obj.__esModule ? obj : {
26
26
  default: obj
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "indifferent", {
8
8
  return _indifferent_spacejson.default;
9
9
  }
10
10
  });
11
- const _indifferent_spacejson = _interop_require_default(require("./indifferent_space.json"));
11
+ const _indifferent_spacejson = /*#__PURE__*/ _interop_require_default(require("./indifferent_space.json"));
12
12
  function _interop_require_default(obj) {
13
13
  return obj && obj.__esModule ? obj : {
14
14
  default: obj
@@ -113,6 +113,7 @@ const _default = {
113
113
  isVoid: true
114
114
  }
115
115
  }), {}),
116
+ // TODO: add list schema
116
117
  [_richtexttypes.BLOCKS.QUOTE]: {
117
118
  nodes: [
118
119
  {
@@ -9,22 +9,22 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- LINK_TYPES: function() {
13
- return LINK_TYPES;
14
- },
15
12
  HyperlinkDialog: function() {
16
13
  return HyperlinkDialog;
17
14
  },
15
+ LINK_TYPES: function() {
16
+ return LINK_TYPES;
17
+ },
18
18
  openHyperlinkDialog: function() {
19
19
  return openHyperlinkDialog;
20
20
  }
21
21
  });
22
- const _react = _interop_require_wildcard(require("react"));
22
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
23
23
  const _f36components = require("@contentful/f36-components");
24
- const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
24
+ const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
25
25
  const _fieldeditorreference = require("@contentful/field-editor-reference");
26
26
  const _emotion = require("emotion");
27
- const _proptypes = _interop_require_default(require("prop-types"));
27
+ const _proptypes = /*#__PURE__*/ _interop_require_default(require("prop-types"));
28
28
  const _FetchingWrappedAssetCard = require("../../plugins/shared/FetchingWrappedAssetCard");
29
29
  const _FetchingWrappedEntryCard = require("../../plugins/shared/FetchingWrappedEntryCard");
30
30
  function _define_property(obj, key, value) {
@@ -66,7 +66,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
66
66
  if (cache && cache.has(obj)) {
67
67
  return cache.get(obj);
68
68
  }
69
- var newObj = {};
69
+ var newObj = {
70
+ __proto__: null
71
+ };
70
72
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
71
73
  for(var key in obj){
72
74
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -93,7 +95,7 @@ function isFeaturingEntitySelector(entitySelectorConfigs = {}) {
93
95
  return !!entitySelectorConfigs.Entry || !!entitySelectorConfigs.Asset;
94
96
  }
95
97
  function entityToLink(entity) {
96
- const { id , type } = entity.sys;
98
+ const { id, type } = entity.sys;
97
99
  return {
98
100
  sys: {
99
101
  id,
@@ -113,7 +115,7 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
113
115
  }));
114
116
  }
115
117
  getValue() {
116
- const { text , type , uri } = this.state;
118
+ const { text, type, uri } = this.state;
117
119
  const value = {
118
120
  type
119
121
  };
@@ -128,7 +130,7 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
128
130
  return value;
129
131
  }
130
132
  isLinkComplete() {
131
- const { text , type , uri , target } = this.getValue();
133
+ const { text, type, uri, target } = this.getValue();
132
134
  const requiresText = !this.props.hideText;
133
135
  if (requiresText && !text) {
134
136
  return false;
@@ -136,16 +138,16 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
136
138
  return type === LINK_TYPES.URI && uri || target;
137
139
  }
138
140
  render() {
139
- const { labels } = this.props;
140
- return _react.createElement(_fieldeditorreference.EntityProvider, {
141
+ const { labels } = this.props;
142
+ return /*#__PURE__*/ _react.createElement(_fieldeditorreference.EntityProvider, {
141
143
  sdk: this.props.sdk
142
- }, _react.createElement(_react.Fragment, null, _react.createElement(_f36components.ModalContent, null, this.renderFields()), _react.createElement(_f36components.ModalControls, null, _react.createElement(_f36components.Button, {
144
+ }, /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement(_f36components.ModalContent, null, this.renderFields()), /*#__PURE__*/ _react.createElement(_f36components.ModalControls, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
143
145
  type: "button",
144
146
  onClick: ()=>this.props.onClose(null),
145
147
  variant: "secondary",
146
148
  testId: "cancel-cta",
147
149
  size: "small"
148
- }, "Cancel"), _react.createElement(_f36components.Button, {
150
+ }, "Cancel"), /*#__PURE__*/ _react.createElement(_f36components.Button, {
149
151
  type: "submit",
150
152
  variant: "positive",
151
153
  onClick: this.handleSubmit,
@@ -155,39 +157,40 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
155
157
  }, labels.confirm))));
156
158
  }
157
159
  renderFields() {
158
- const { hideText , allowedHyperlinkTypes , entitySelectorConfigs } = this.props;
159
- const { uri , text , type } = this.state;
160
+ const { hideText, allowedHyperlinkTypes, entitySelectorConfigs } = this.props;
161
+ const { uri, text, type } = this.state;
160
162
  const isUriInputAutoFocused = type === LINK_TYPES.URI && (hideText || !!text);
161
- return _react.createElement(_f36components.Form, null, hideText ? null : _react.createElement(_f36components.FormControl, {
163
+ return /*#__PURE__*/ _react.createElement(_f36components.Form, null, hideText ? null : /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
162
164
  id: "link-text",
163
165
  isRequired: true
164
- }, _react.createElement(_f36components.FormControl.Label, null, "Link text"), _react.createElement(_f36components.TextInput, {
166
+ }, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link text"), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
165
167
  testId: "link-text-input",
166
168
  name: "link-text",
167
169
  value: text || '',
168
170
  onChange: (e)=>this.setState({
169
171
  text: e.target.value
170
172
  }),
173
+ // eslint-disable-next-line -- TODO: describe this disable jsx-a11y/no-autofocus
171
174
  autoFocus: !isUriInputAutoFocused
172
- })), isFeaturingEntitySelector(entitySelectorConfigs) && _react.createElement(_f36components.FormControl, {
175
+ })), isFeaturingEntitySelector(entitySelectorConfigs) && /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
173
176
  id: "link-type",
174
177
  name: "link-type"
175
- }, _react.createElement(_f36components.FormControl.Label, null, "Link type"), _react.createElement(_f36components.Select, {
178
+ }, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link type"), /*#__PURE__*/ _react.createElement(_f36components.Select, {
176
179
  value: type,
177
180
  onChange: (e)=>this.setState({
178
181
  type: e.target.value
179
182
  }),
180
183
  testId: "link-type-select"
181
- }, allowedHyperlinkTypes.includes(LINK_TYPES.URI) || type === LINK_TYPES.URI ? _react.createElement(_f36components.Select.Option, {
184
+ }, allowedHyperlinkTypes.includes(LINK_TYPES.URI) || type === LINK_TYPES.URI ? /*#__PURE__*/ _react.createElement(_f36components.Select.Option, {
182
185
  value: LINK_TYPES.URI
183
- }, "URL") : null, allowedHyperlinkTypes.includes(LINK_TYPES.ENTRY) || type === LINK_TYPES.ENTRY ? _react.createElement(_f36components.Select.Option, {
186
+ }, "URL") : null, allowedHyperlinkTypes.includes(LINK_TYPES.ENTRY) || type === LINK_TYPES.ENTRY ? /*#__PURE__*/ _react.createElement(_f36components.Select.Option, {
184
187
  value: LINK_TYPES.ENTRY
185
- }, "Entry") : null, allowedHyperlinkTypes.includes(LINK_TYPES.ASSET) || type === LINK_TYPES.ASSET ? _react.createElement(_f36components.Select.Option, {
188
+ }, "Entry") : null, allowedHyperlinkTypes.includes(LINK_TYPES.ASSET) || type === LINK_TYPES.ASSET ? /*#__PURE__*/ _react.createElement(_f36components.Select.Option, {
186
189
  value: LINK_TYPES.ASSET
187
- }, "Asset") : null)), type === LINK_TYPES.URI ? _react.createElement(_f36components.FormControl, {
190
+ }, "Asset") : null)), type === LINK_TYPES.URI ? /*#__PURE__*/ _react.createElement(_f36components.FormControl, {
188
191
  id: "link-uri",
189
192
  isRequired: true
190
- }, _react.createElement(_f36components.FormControl.Label, null, "Link target"), _react.createElement(_f36components.TextInput, {
193
+ }, /*#__PURE__*/ _react.createElement(_f36components.FormControl.Label, null, "Link target"), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
191
194
  testId: "link-target-input",
192
195
  name: "link-uri",
193
196
  value: uri || '',
@@ -195,30 +198,31 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
195
198
  onChange: (e)=>this.setState({
196
199
  uri: e.target.value
197
200
  }),
201
+ // eslint-disable-next-line -- TODO: describe this disable jsx-a11y/no-autofocus
198
202
  autoFocus: isUriInputAutoFocused
199
- }), _react.createElement(_f36components.FormControl.HelpText, null, "A protocol may be required, e.g. https://")) : this.renderEntityField());
203
+ }), /*#__PURE__*/ _react.createElement(_f36components.FormControl.HelpText, null, "A protocol may be required, e.g. https://")) : this.renderEntityField());
200
204
  }
201
205
  renderEntityField() {
202
- const { type , entityLinks } = this.state;
206
+ const { type, entityLinks } = this.state;
203
207
  const resetEntity = ()=>this.setTargetEntity(type, null);
204
208
  const entityLink = entityLinks[type];
205
209
  const isEntitySelectorVisible = !entityLink;
206
- return _react.createElement("div", null, _react.createElement(_f36components.FormLabel, {
210
+ return /*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement(_f36components.FormLabel, {
207
211
  required: true,
208
212
  htmlFor: ""
209
- }, "Link target"), !isEntitySelectorVisible && _react.createElement(_f36components.TextLink, {
213
+ }, "Link target"), !isEntitySelectorVisible && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
210
214
  as: "button",
211
215
  className: (0, _emotion.css)({
212
216
  marginLeft: _f36tokens.default.spacingS
213
217
  }),
214
218
  onClick: resetEntity
215
- }, "Remove selection"), entityLink && _react.createElement("div", null, type === LINK_TYPES.ENTRY && _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
219
+ }, "Remove selection"), entityLink && /*#__PURE__*/ _react.createElement("div", null, type === LINK_TYPES.ENTRY && /*#__PURE__*/ _react.createElement(_FetchingWrappedEntryCard.FetchingWrappedEntryCard, {
216
220
  sdk: this.props.sdk,
217
221
  locale: this.props.entitySelectorConfigs.Entry.locale,
218
222
  entryId: entityLink.sys.id,
219
223
  isDisabled: true,
220
224
  isSelected: false
221
- }), type == LINK_TYPES.ASSET && _react.createElement(_FetchingWrappedAssetCard.FetchingWrappedAssetCard, {
225
+ }), type == LINK_TYPES.ASSET && /*#__PURE__*/ _react.createElement(_FetchingWrappedAssetCard.FetchingWrappedAssetCard, {
222
226
  sdk: this.props.sdk,
223
227
  locale: this.props.entitySelectorConfigs.Asset.locale,
224
228
  assetId: entityLink.sys.id,
@@ -227,14 +231,14 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
227
231
  })), isEntitySelectorVisible && this.renderEntitySelector(type, isEntitySelectorVisible));
228
232
  }
229
233
  renderEntitySelector(type) {
230
- return _react.createElement("div", {
234
+ return /*#__PURE__*/ _react.createElement("div", {
231
235
  className: (0, _emotion.css)({
232
236
  marginTop: _f36tokens.default.spacingS
233
237
  })
234
- }, type === LINK_TYPES.ENTRY && _react.createElement(_f36components.TextLink, {
238
+ }, type === LINK_TYPES.ENTRY && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
235
239
  as: "button",
236
240
  onClick: this.selectEntry
237
- }, "Select entry"), type === LINK_TYPES.ASSET && _react.createElement(_f36components.TextLink, {
241
+ }, "Select entry"), type === LINK_TYPES.ASSET && /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
238
242
  as: "button",
239
243
  onClick: this.selectAsset
240
244
  }, "Select asset"));
@@ -246,7 +250,7 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
246
250
  this.props.onClose(this.getValue());
247
251
  });
248
252
  _define_property(this, "selectEntry", async ()=>{
249
- const { locale , contentTypes } = this.props.entitySelectorConfigs.Entry;
253
+ const { locale, contentTypes } = this.props.entitySelectorConfigs.Entry;
250
254
  const entry = await this.props.sdk.dialogs.selectSingleEntry({
251
255
  locale,
252
256
  contentTypes
@@ -254,13 +258,13 @@ class HyperlinkDialog extends (_React_Component = _react.Component) {
254
258
  this.setTargetEntity(LINK_TYPES.ENTRY, entry);
255
259
  });
256
260
  _define_property(this, "selectAsset", async ()=>{
257
- const { locale } = this.props.entitySelectorConfigs.Asset;
261
+ const { locale } = this.props.entitySelectorConfigs.Asset;
258
262
  const asset = await this.props.sdk.dialogs.selectSingleAsset({
259
263
  locale
260
264
  });
261
265
  this.setTargetEntity(LINK_TYPES.ASSET, asset);
262
266
  });
263
- const { text , type , uri , target } = props.value;
267
+ const { text, type, uri, target } = props.value;
264
268
  const isEntityLink = Boolean(target);
265
269
  const entityLinks = {
266
270
  [LINK_TYPES.ENTRY]: null,
@@ -293,6 +297,7 @@ _define_property(HyperlinkDialog, "propTypes", {
293
297
  text: _proptypes.default.string,
294
298
  uri: _proptypes.default.string,
295
299
  target: _proptypes.default.object,
300
+ // Will be overwritten accordingly if `uri` or `target.sys.linkType` are set.
296
301
  type: _proptypes.default.oneOf([
297
302
  'uri',
298
303
  'Entry',
@@ -322,7 +327,7 @@ _define_property(HyperlinkDialog, "defaultProps", {
322
327
  LINK_TYPES.URI
323
328
  ]
324
329
  });
325
- const openHyperlinkDialog = (dialogs, { value , showTextInput , allowedHyperlinkTypes , entitySelectorConfigs })=>{
330
+ const openHyperlinkDialog = (dialogs, { value, showTextInput, allowedHyperlinkTypes, entitySelectorConfigs })=>{
326
331
  const isNew = !(value.uri || value.target);
327
332
  const props = {
328
333
  labels: {
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "openRichTextDialog", {
8
8
  return openRichTextDialog;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _fieldeditorshared = require("@contentful/field-editor-shared");
13
13
  const _HyperlinkDialog = require("./HypelinkDialog/HyperlinkDialog");
14
14
  function _getRequireWildcardCache(nodeInterop) {
@@ -32,7 +32,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
32
32
  if (cache && cache.has(obj)) {
33
33
  return cache.get(obj);
34
34
  }
35
- var newObj = {};
35
+ var newObj = {
36
+ __proto__: null
37
+ };
36
38
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
37
39
  for(var key in obj){
38
40
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -52,8 +54,8 @@ function _interop_require_wildcard(obj, nodeInterop) {
52
54
  }
53
55
  const openRichTextDialog = (sdk)=>(options)=>{
54
56
  if (options.parameters?.type === 'rich-text-hyperlink-dialog') {
55
- return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
56
- return _react.createElement(_HyperlinkDialog.HyperlinkDialog, {
57
+ return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
58
+ return /*#__PURE__*/ _react.createElement(_HyperlinkDialog.HyperlinkDialog, {
57
59
  ...options.parameters,
58
60
  onClose: onClose,
59
61
  sdk: sdk
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "renderRichTextDialog", {
8
8
  return renderRichTextDialog;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _HyperlinkDialog = require("./HypelinkDialog/HyperlinkDialog");
13
13
  function _getRequireWildcardCache(nodeInterop) {
14
14
  if (typeof WeakMap !== "function") return null;
@@ -31,7 +31,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
31
31
  if (cache && cache.has(obj)) {
32
32
  return cache.get(obj);
33
33
  }
34
- var newObj = {};
34
+ var newObj = {
35
+ __proto__: null
36
+ };
35
37
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
36
38
  for(var key in obj){
37
39
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -53,11 +55,11 @@ const renderRichTextDialog = (sdk)=>{
53
55
  const parameters = sdk.parameters.invocation;
54
56
  if (parameters?.type === 'rich-text-hyperlink-dialog') {
55
57
  sdk.window.startAutoResizer();
56
- return _react.createElement(_HyperlinkDialog.HyperlinkDialog, {
58
+ return /*#__PURE__*/ _react.createElement(_HyperlinkDialog.HyperlinkDialog, {
57
59
  ...parameters,
58
60
  onClose: sdk.close,
59
61
  sdk: sdk
60
62
  });
61
63
  }
62
- return _react.createElement("div", null);
64
+ return /*#__PURE__*/ _react.createElement("div", null);
63
65
  };
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /* eslint-disable react/no-unknown-property */ /** @jsx jsx */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -12,54 +12,54 @@ describe('internal mark', ()=>{
12
12
  {
13
13
  title: 'Paragraph mark is removed',
14
14
  input: (0, _contentfulslatejsadapter.toContentfulDocument)({
15
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
15
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
16
16
  [_constants.COMMAND_PROMPT]: true
17
17
  }))).children
18
18
  }),
19
19
  expected: (0, _contentfulslatejsadapter.toContentfulDocument)({
20
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null))).children
20
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null))).children
21
21
  })
22
22
  },
23
23
  {
24
24
  title: 'Heading mark is removed',
25
25
  input: (0, _contentfulslatejsadapter.toContentfulDocument)({
26
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hh1", null, (0, _testutils.jsx)("htext", {
26
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
27
27
  [_constants.COMMAND_PROMPT]: true
28
28
  }))).children
29
29
  }),
30
30
  expected: (0, _contentfulslatejsadapter.toContentfulDocument)({
31
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hh1", null, (0, _testutils.jsx)("htext", null))).children
31
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hh1", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null))).children
32
32
  })
33
33
  },
34
34
  {
35
35
  title: 'Block quote mark is removed',
36
36
  input: (0, _contentfulslatejsadapter.toContentfulDocument)({
37
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hquote", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
37
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hquote", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
38
38
  [_constants.COMMAND_PROMPT]: true
39
39
  })))).children
40
40
  }),
41
41
  expected: (0, _contentfulslatejsadapter.toContentfulDocument)({
42
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hquote", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)))).children
42
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hquote", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", null)))).children
43
43
  })
44
44
  },
45
45
  {
46
46
  title: 'Other marks are not removed',
47
47
  input: (0, _contentfulslatejsadapter.toContentfulDocument)({
48
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hquote", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
48
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hquote", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
49
49
  bold: true,
50
50
  underline: true,
51
51
  [_constants.COMMAND_PROMPT]: true
52
52
  })))).children
53
53
  }),
54
54
  expected: (0, _contentfulslatejsadapter.toContentfulDocument)({
55
- document: (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hquote", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", {
55
+ document: /*#__PURE__*/ (0, _testutils.jsx)("editor", null, /*#__PURE__*/ (0, _testutils.jsx)("hquote", null, /*#__PURE__*/ (0, _testutils.jsx)("hp", null, /*#__PURE__*/ (0, _testutils.jsx)("htext", {
56
56
  bold: true,
57
57
  underline: true
58
58
  })))).children
59
59
  })
60
60
  }
61
61
  ];
62
- for (const { input , expected , title } of data){
62
+ for (const { input, expected, title } of data){
63
63
  it(`${title}`, ()=>{
64
64
  expect((0, _removeInternalMarks.removeInternalMarks)(input)).toEqual(expected);
65
65
  });
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "createOnChangeCallback", {
9
9
  }
10
10
  });
11
11
  const _contentfulslatejsadapter = require("@contentful/contentful-slatejs-adapter");
12
- const _debounce = _interop_require_default(require("lodash/debounce"));
13
- const _Schema = _interop_require_default(require("../constants/Schema"));
12
+ const _debounce = /*#__PURE__*/ _interop_require_default(require("lodash/debounce"));
13
+ const _Schema = /*#__PURE__*/ _interop_require_default(require("../constants/Schema"));
14
14
  const _removeInternalMarks = require("./removeInternalMarks");
15
15
  function _interop_require_default(obj) {
16
16
  return obj && obj.__esModule ? obj : {
@@ -16,8 +16,8 @@ _export(exports, {
16
16
  return newResourceEntitySelectorConfigFromRichTextField;
17
17
  }
18
18
  });
19
- const _getAllowedResourcesForNodeType = _interop_require_default(require("./getAllowedResourcesForNodeType"));
20
- const _getLinkedContentTypeIdsForNodeType = _interop_require_default(require("./getLinkedContentTypeIdsForNodeType"));
19
+ const _getAllowedResourcesForNodeType = /*#__PURE__*/ _interop_require_default(require("./getAllowedResourcesForNodeType"));
20
+ const _getLinkedContentTypeIdsForNodeType = /*#__PURE__*/ _interop_require_default(require("./getLinkedContentTypeIdsForNodeType"));
21
21
  function _interop_require_default(obj) {
22
22
  return obj && obj.__esModule ? obj : {
23
23
  default: obj