@contentful/field-editor-rich-text 3.4.22 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (617) hide show
  1. package/dist/cjs/ContentfulEditorProvider.js +59 -0
  2. package/dist/cjs/RichTextEditor.js +170 -0
  3. package/dist/cjs/RichTextEditor.styles.js +66 -0
  4. package/dist/cjs/SdkProvider.js +69 -0
  5. package/dist/cjs/Toolbar/_tests_/toolbar.test.js +152 -0
  6. package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +92 -0
  7. package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +69 -0
  8. package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +29 -0
  9. package/dist/cjs/Toolbar/index.js +222 -0
  10. package/dist/cjs/__fixtures__/FakeSdk.js +183 -0
  11. package/dist/cjs/__fixtures__/asset/index.js +37 -0
  12. package/dist/cjs/__fixtures__/content-type/index.js +16 -0
  13. package/dist/cjs/__fixtures__/entry/index.js +33 -0
  14. package/dist/cjs/__fixtures__/fixtures.js +71 -0
  15. package/dist/cjs/__fixtures__/locale/index.js +40 -0
  16. package/dist/cjs/__fixtures__/space/index.js +16 -0
  17. package/dist/cjs/constants/Schema.js +172 -0
  18. package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +348 -0
  19. package/dist/cjs/dialogs/openRichTextDialog.js +64 -0
  20. package/dist/cjs/dialogs/renderRichTextDialog.js +63 -0
  21. package/dist/cjs/helpers/__tests__/extractNodes.test.js +299 -0
  22. package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +68 -0
  23. package/dist/cjs/helpers/__tests__/validations.test.js +49 -0
  24. package/dist/cjs/helpers/editor.js +276 -0
  25. package/dist/cjs/helpers/environment.js +20 -0
  26. package/dist/cjs/helpers/extractNodes.js +27 -0
  27. package/dist/cjs/helpers/formatDateAndTime.js +45 -0
  28. package/dist/cjs/helpers/getAllowedResourcesForNodeType.js +25 -0
  29. package/dist/cjs/helpers/getLinkedContentTypeIdsForNodeType.js +24 -0
  30. package/dist/cjs/helpers/newEntitySelectorConfigFromRichTextField.js +33 -0
  31. package/dist/cjs/helpers/newResourceEntitySelectorConfigFromRichTextField.js +21 -0
  32. package/dist/cjs/helpers/nodeFactory.js +51 -0
  33. package/dist/cjs/helpers/removeInternalMarks.js +26 -0
  34. package/dist/cjs/helpers/sanitizeIncomingSlateDoc.js +33 -0
  35. package/dist/cjs/helpers/sdkNavigatorSlideIn.js +57 -0
  36. package/dist/cjs/helpers/sdkNavigatorSlideIn.spec.js +209 -0
  37. package/dist/cjs/helpers/transformers.js +61 -0
  38. package/dist/cjs/helpers/validations.js +56 -0
  39. package/dist/cjs/index.js +66 -0
  40. package/dist/cjs/internal/constants.js +51 -0
  41. package/dist/cjs/internal/hooks.js +65 -0
  42. package/dist/cjs/internal/index.js +21 -0
  43. package/dist/cjs/internal/misc.js +103 -0
  44. package/dist/cjs/internal/queries.js +407 -0
  45. package/dist/cjs/internal/transforms.js +195 -0
  46. package/dist/cjs/internal/types/editor.js +4 -0
  47. package/dist/cjs/internal/types/index.js +19 -0
  48. package/dist/cjs/internal/types/plugins.js +4 -0
  49. package/dist/cjs/plugins/Break/createExitBreakPlugin.js +26 -0
  50. package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +36 -0
  51. package/dist/cjs/plugins/Break/createResetNodePlugin.js +32 -0
  52. package/dist/cjs/plugins/Break/createSoftBreakPlugin.js +23 -0
  53. package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +47 -0
  54. package/dist/cjs/plugins/Break/index.js +20 -0
  55. package/dist/cjs/plugins/CommandPalette/components/CommandList.js +167 -0
  56. package/dist/cjs/plugins/CommandPalette/components/CommandList.styles.js +103 -0
  57. package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +69 -0
  58. package/dist/cjs/plugins/CommandPalette/constants.js +11 -0
  59. package/dist/cjs/plugins/CommandPalette/createCommandPalettePlugin.js +24 -0
  60. package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +138 -0
  61. package/dist/cjs/plugins/CommandPalette/index.js +11 -0
  62. package/dist/cjs/plugins/CommandPalette/onKeyDown.js +51 -0
  63. package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +83 -0
  64. package/dist/cjs/plugins/CommandPalette/useCommands.js +222 -0
  65. package/dist/cjs/plugins/CommandPalette/utils/createInlineEntryNode.js +30 -0
  66. package/dist/cjs/plugins/CommandPalette/utils/fetchAssets.js +31 -0
  67. package/dist/cjs/plugins/CommandPalette/utils/fetchEntries.js +39 -0
  68. package/dist/cjs/plugins/CommandPalette/utils/insertBlock.js +42 -0
  69. package/dist/cjs/plugins/CommandPalette/utils/trimLeadingSlash.js +16 -0
  70. package/dist/cjs/plugins/DragAndDrop/index.js +55 -0
  71. package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +111 -0
  72. package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +68 -0
  73. package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +158 -0
  74. package/dist/cjs/plugins/EmbeddedEntityInline/Util.js +30 -0
  75. package/dist/cjs/plugins/EmbeddedEntityInline/index.js +222 -0
  76. package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +54 -0
  77. package/dist/cjs/plugins/EmbeddedResourceBlock/index.js +55 -0
  78. package/dist/cjs/plugins/Heading/__tests__/createHeadingPlugin.test.js +117 -0
  79. package/dist/cjs/plugins/Heading/components/Heading.js +127 -0
  80. package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +173 -0
  81. package/dist/cjs/plugins/Heading/createHeadingPlugin.js +102 -0
  82. package/dist/cjs/plugins/Heading/index.js +19 -0
  83. package/dist/cjs/plugins/Hr/index.js +193 -0
  84. package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +282 -0
  85. package/dist/cjs/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +25 -0
  86. package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +94 -0
  87. package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +78 -0
  88. package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +86 -0
  89. package/dist/cjs/plugins/Hyperlink/components/styles.js +36 -0
  90. package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +178 -0
  91. package/dist/cjs/plugins/Hyperlink/index.js +20 -0
  92. package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +95 -0
  93. package/dist/cjs/plugins/Hyperlink/utils.js +43 -0
  94. package/dist/cjs/plugins/List/__tests__/createListPlugin.test.js +47 -0
  95. package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +77 -0
  96. package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +64 -0
  97. package/dist/cjs/plugins/List/components/List.js +108 -0
  98. package/dist/cjs/plugins/List/components/ListItem.js +73 -0
  99. package/dist/cjs/plugins/List/components/ToolbarListButton.js +86 -0
  100. package/dist/cjs/plugins/List/createListPlugin.js +76 -0
  101. package/dist/cjs/plugins/List/index.js +19 -0
  102. package/dist/cjs/plugins/List/insertListBreak.js +60 -0
  103. package/dist/cjs/plugins/List/insertListFragment.js +98 -0
  104. package/dist/cjs/plugins/List/onKeyDownList.js +46 -0
  105. package/dist/cjs/plugins/List/transforms/insertListItem.js +92 -0
  106. package/dist/cjs/plugins/List/transforms/moveListItemDown.js +47 -0
  107. package/dist/cjs/plugins/List/transforms/moveListItems.js +56 -0
  108. package/dist/cjs/plugins/List/transforms/moveListItems.test.js +72 -0
  109. package/dist/cjs/plugins/List/transforms/toggleList.js +141 -0
  110. package/dist/cjs/plugins/List/transforms/toggleList.spec.js +139 -0
  111. package/dist/cjs/plugins/List/transforms/unwrapList.js +38 -0
  112. package/dist/cjs/plugins/List/utils.js +122 -0
  113. package/dist/cjs/plugins/List/withList.js +32 -0
  114. package/dist/cjs/plugins/Marks/Bold.js +119 -0
  115. package/dist/cjs/plugins/Marks/Code.js +122 -0
  116. package/dist/cjs/plugins/Marks/Italic.js +114 -0
  117. package/dist/cjs/plugins/Marks/Subscript.js +109 -0
  118. package/dist/cjs/plugins/Marks/Superscript.js +107 -0
  119. package/dist/cjs/plugins/Marks/Underline.js +106 -0
  120. package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +105 -0
  121. package/dist/cjs/plugins/Marks/helpers.js +48 -0
  122. package/dist/cjs/plugins/Marks/index.js +27 -0
  123. package/dist/cjs/plugins/Normalizer/baseRules.js +38 -0
  124. package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.js +15 -0
  125. package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +117 -0
  126. package/dist/cjs/plugins/Normalizer/index.js +19 -0
  127. package/dist/cjs/plugins/Normalizer/types.js +4 -0
  128. package/dist/cjs/plugins/Normalizer/utils.js +39 -0
  129. package/dist/cjs/plugins/Normalizer/withNormalizer.js +88 -0
  130. package/dist/cjs/plugins/Paragraph/Paragraph.js +70 -0
  131. package/dist/cjs/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +125 -0
  132. package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +73 -0
  133. package/dist/cjs/plugins/Paragraph/index.js +18 -0
  134. package/dist/cjs/plugins/Paragraph/utils.js +24 -0
  135. package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +63 -0
  136. package/dist/cjs/plugins/PasteHTML/index.js +18 -0
  137. package/dist/cjs/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +54 -0
  138. package/dist/cjs/plugins/PasteHTML/utils/sanitizeAnchors.js +43 -0
  139. package/dist/cjs/plugins/PasteHTML/utils/sanitizeHTML.js +50 -0
  140. package/dist/cjs/plugins/PasteHTML/utils/sanitizeSheets.js +44 -0
  141. package/dist/cjs/plugins/Quote/__test__/createQuotePlugin.test.js +78 -0
  142. package/dist/cjs/plugins/Quote/components/Quote.js +69 -0
  143. package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +72 -0
  144. package/dist/cjs/plugins/Quote/createQuotePlugin.js +57 -0
  145. package/dist/cjs/plugins/Quote/index.js +19 -0
  146. package/dist/cjs/plugins/Quote/shouldResetQuote.js +40 -0
  147. package/dist/cjs/plugins/Quote/toggleQuote.js +56 -0
  148. package/dist/cjs/plugins/Quote/withQuote.js +48 -0
  149. package/dist/cjs/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +21 -0
  150. package/dist/cjs/plugins/SelectOnBackspace/index.js +18 -0
  151. package/dist/cjs/plugins/Table/__tests__/createTablePlugin.test.js +92 -0
  152. package/dist/cjs/plugins/Table/__tests__/helpers.test.js +18 -0
  153. package/dist/cjs/plugins/Table/actions/addColumn.js +63 -0
  154. package/dist/cjs/plugins/Table/actions/addRow.js +57 -0
  155. package/dist/cjs/plugins/Table/actions/index.js +20 -0
  156. package/dist/cjs/plugins/Table/actions/setHeader.js +34 -0
  157. package/dist/cjs/plugins/Table/components/Cell.js +79 -0
  158. package/dist/cjs/plugins/Table/components/HeaderCell.js +82 -0
  159. package/dist/cjs/plugins/Table/components/Row.js +69 -0
  160. package/dist/cjs/plugins/Table/components/Table.js +76 -0
  161. package/dist/cjs/plugins/Table/components/TableActions.js +175 -0
  162. package/dist/cjs/plugins/Table/components/ToolbarButton.js +73 -0
  163. package/dist/cjs/plugins/Table/createTablePlugin.js +119 -0
  164. package/dist/cjs/plugins/Table/helpers.js +152 -0
  165. package/dist/cjs/plugins/Table/index.js +19 -0
  166. package/dist/cjs/plugins/Table/insertTableFragment.js +50 -0
  167. package/dist/cjs/plugins/Table/onKeyDownTable.js +62 -0
  168. package/dist/cjs/plugins/Table/tableTracking.js +64 -0
  169. package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +79 -0
  170. package/dist/cjs/plugins/Text/createTextPlugin.js +137 -0
  171. package/dist/cjs/plugins/Text/index.js +18 -0
  172. package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +101 -0
  173. package/dist/cjs/plugins/Tracking/index.js +18 -0
  174. package/dist/cjs/plugins/Tracking/utils.js +64 -0
  175. package/dist/cjs/plugins/TrailingParagraph/index.js +20 -0
  176. package/dist/cjs/plugins/Voids/createVoidsPlugin.js +31 -0
  177. package/dist/cjs/plugins/Voids/index.js +18 -0
  178. package/dist/cjs/plugins/Voids/transformVoid.js +29 -0
  179. package/dist/cjs/plugins/index.js +78 -0
  180. package/dist/cjs/plugins/links-tracking.js +20 -0
  181. package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +114 -0
  182. package/dist/cjs/plugins/shared/EmbeddedBlockUtil.js +170 -0
  183. package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +113 -0
  184. package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +116 -0
  185. package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +110 -0
  186. package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +45 -0
  187. package/dist/cjs/plugins/shared/ToolbarButton.js +93 -0
  188. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +107 -0
  189. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +110 -0
  190. package/dist/cjs/prepareDocument.js +86 -0
  191. package/dist/cjs/test-utils/assertOutput.js +31 -0
  192. package/dist/cjs/test-utils/createEditor.js +31 -0
  193. package/dist/cjs/test-utils/hyperscript.d.js +1 -0
  194. package/dist/cjs/test-utils/index.js +21 -0
  195. package/dist/cjs/test-utils/jsx.js +159 -0
  196. package/dist/cjs/test-utils/mockPlugin.js +16 -0
  197. package/dist/cjs/test-utils/randomId.js +13 -0
  198. package/dist/cjs/test-utils/setEmptyDataAttribute.js +21 -0
  199. package/dist/cjs/test-utils/validation.js +127 -0
  200. package/dist/cjs/useOnValueChanged.js +58 -0
  201. package/dist/esm/ContentfulEditorProvider.js +29 -0
  202. package/dist/esm/RichTextEditor.js +108 -0
  203. package/dist/esm/RichTextEditor.styles.js +51 -0
  204. package/dist/esm/SdkProvider.js +7 -0
  205. package/dist/esm/Toolbar/_tests_/toolbar.test.js +104 -0
  206. package/dist/esm/Toolbar/components/EmbedEntityWidget.js +43 -0
  207. package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +20 -0
  208. package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +14 -0
  209. package/dist/esm/Toolbar/index.js +168 -0
  210. package/dist/esm/__fixtures__/FakeSdk.js +173 -0
  211. package/dist/esm/__fixtures__/asset/index.js +6 -0
  212. package/dist/esm/__fixtures__/content-type/index.js +2 -0
  213. package/dist/esm/__fixtures__/entry/index.js +5 -0
  214. package/dist/esm/__fixtures__/fixtures.js +6 -0
  215. package/dist/esm/__fixtures__/locale/index.js +15 -0
  216. package/dist/esm/__fixtures__/space/index.js +2 -0
  217. package/dist/esm/constants/Schema.js +162 -0
  218. package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +283 -0
  219. package/dist/esm/dialogs/openRichTextDialog.js +15 -0
  220. package/dist/esm/dialogs/renderRichTextDialog.js +14 -0
  221. package/dist/esm/helpers/__tests__/extractNodes.test.js +295 -0
  222. package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +64 -0
  223. package/dist/esm/helpers/__tests__/validations.test.js +45 -0
  224. package/dist/esm/helpers/editor.js +198 -0
  225. package/dist/esm/helpers/environment.js +2 -0
  226. package/dist/esm/helpers/extractNodes.js +17 -0
  227. package/dist/esm/helpers/formatDateAndTime.js +19 -0
  228. package/dist/esm/helpers/getAllowedResourcesForNodeType.js +10 -0
  229. package/dist/esm/helpers/getLinkedContentTypeIdsForNodeType.js +9 -0
  230. package/dist/esm/helpers/newEntitySelectorConfigFromRichTextField.js +18 -0
  231. package/dist/esm/helpers/newResourceEntitySelectorConfigFromRichTextField.js +6 -0
  232. package/dist/esm/helpers/nodeFactory.js +24 -0
  233. package/dist/esm/helpers/removeInternalMarks.js +16 -0
  234. package/dist/esm/helpers/sanitizeIncomingSlateDoc.js +23 -0
  235. package/dist/esm/helpers/sdkNavigatorSlideIn.js +42 -0
  236. package/dist/esm/helpers/sdkNavigatorSlideIn.spec.js +200 -0
  237. package/dist/esm/helpers/transformers.js +34 -0
  238. package/dist/esm/helpers/validations.js +24 -0
  239. package/dist/esm/index.js +4 -0
  240. package/dist/esm/internal/constants.js +2 -0
  241. package/dist/esm/internal/hooks.js +5 -0
  242. package/dist/esm/internal/index.js +4 -0
  243. package/dist/esm/internal/misc.js +28 -0
  244. package/dist/esm/internal/queries.js +182 -0
  245. package/dist/esm/internal/transforms.js +75 -0
  246. package/dist/esm/internal/types/editor.js +1 -0
  247. package/dist/esm/internal/types/index.js +2 -0
  248. package/dist/esm/internal/types/plugins.js +1 -0
  249. package/dist/esm/plugins/Break/createExitBreakPlugin.js +16 -0
  250. package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +32 -0
  251. package/dist/esm/plugins/Break/createResetNodePlugin.js +22 -0
  252. package/dist/esm/plugins/Break/createSoftBreakPlugin.js +13 -0
  253. package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +43 -0
  254. package/dist/esm/plugins/Break/index.js +3 -0
  255. package/dist/esm/plugins/CommandPalette/components/CommandList.js +113 -0
  256. package/dist/esm/plugins/CommandPalette/components/CommandList.styles.js +88 -0
  257. package/dist/esm/plugins/CommandPalette/components/CommandPrompt.js +20 -0
  258. package/dist/esm/plugins/CommandPalette/constants.js +1 -0
  259. package/dist/esm/plugins/CommandPalette/createCommandPalettePlugin.js +14 -0
  260. package/dist/esm/plugins/CommandPalette/hooks/useCommandList.js +84 -0
  261. package/dist/esm/plugins/CommandPalette/index.js +1 -0
  262. package/dist/esm/plugins/CommandPalette/onKeyDown.js +36 -0
  263. package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +40 -0
  264. package/dist/esm/plugins/CommandPalette/useCommands.js +204 -0
  265. package/dist/esm/plugins/CommandPalette/utils/createInlineEntryNode.js +20 -0
  266. package/dist/esm/plugins/CommandPalette/utils/fetchAssets.js +21 -0
  267. package/dist/esm/plugins/CommandPalette/utils/fetchEntries.js +29 -0
  268. package/dist/esm/plugins/CommandPalette/utils/insertBlock.js +32 -0
  269. package/dist/esm/plugins/CommandPalette/utils/trimLeadingSlash.js +6 -0
  270. package/dist/esm/plugins/DragAndDrop/index.js +45 -0
  271. package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +62 -0
  272. package/dist/esm/plugins/EmbeddedEntityBlock/index.js +50 -0
  273. package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +104 -0
  274. package/dist/esm/plugins/EmbeddedEntityInline/Util.js +20 -0
  275. package/dist/esm/plugins/EmbeddedEntityInline/index.js +160 -0
  276. package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +39 -0
  277. package/dist/esm/plugins/EmbeddedResourceBlock/index.js +45 -0
  278. package/dist/esm/plugins/Heading/__tests__/createHeadingPlugin.test.js +113 -0
  279. package/dist/esm/plugins/Heading/components/Heading.js +73 -0
  280. package/dist/esm/plugins/Heading/components/ToolbarHeadingButton.js +119 -0
  281. package/dist/esm/plugins/Heading/createHeadingPlugin.js +87 -0
  282. package/dist/esm/plugins/Heading/index.js +2 -0
  283. package/dist/esm/plugins/Hr/index.js +125 -0
  284. package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +220 -0
  285. package/dist/esm/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.js +21 -0
  286. package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +45 -0
  287. package/dist/esm/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +29 -0
  288. package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +37 -0
  289. package/dist/esm/plugins/Hyperlink/components/styles.js +21 -0
  290. package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +124 -0
  291. package/dist/esm/plugins/Hyperlink/index.js +2 -0
  292. package/dist/esm/plugins/Hyperlink/useEntityInfo.js +85 -0
  293. package/dist/esm/plugins/Hyperlink/utils.js +25 -0
  294. package/dist/esm/plugins/List/__tests__/createListPlugin.test.js +43 -0
  295. package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +73 -0
  296. package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +60 -0
  297. package/dist/esm/plugins/List/components/List.js +46 -0
  298. package/dist/esm/plugins/List/components/ListItem.js +19 -0
  299. package/dist/esm/plugins/List/components/ToolbarListButton.js +37 -0
  300. package/dist/esm/plugins/List/createListPlugin.js +66 -0
  301. package/dist/esm/plugins/List/index.js +2 -0
  302. package/dist/esm/plugins/List/insertListBreak.js +50 -0
  303. package/dist/esm/plugins/List/insertListFragment.js +88 -0
  304. package/dist/esm/plugins/List/onKeyDownList.js +31 -0
  305. package/dist/esm/plugins/List/transforms/insertListItem.js +82 -0
  306. package/dist/esm/plugins/List/transforms/moveListItemDown.js +37 -0
  307. package/dist/esm/plugins/List/transforms/moveListItems.js +46 -0
  308. package/dist/esm/plugins/List/transforms/moveListItems.test.js +68 -0
  309. package/dist/esm/plugins/List/transforms/toggleList.js +132 -0
  310. package/dist/esm/plugins/List/transforms/toggleList.spec.js +135 -0
  311. package/dist/esm/plugins/List/transforms/unwrapList.js +28 -0
  312. package/dist/esm/plugins/List/utils.js +89 -0
  313. package/dist/esm/plugins/List/withList.js +22 -0
  314. package/dist/esm/plugins/Marks/Bold.js +59 -0
  315. package/dist/esm/plugins/Marks/Code.js +59 -0
  316. package/dist/esm/plugins/Marks/Italic.js +54 -0
  317. package/dist/esm/plugins/Marks/Subscript.js +46 -0
  318. package/dist/esm/plugins/Marks/Superscript.js +44 -0
  319. package/dist/esm/plugins/Marks/Underline.js +46 -0
  320. package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +51 -0
  321. package/dist/esm/plugins/Marks/helpers.js +25 -0
  322. package/dist/esm/plugins/Marks/index.js +17 -0
  323. package/dist/esm/plugins/Normalizer/baseRules.js +28 -0
  324. package/dist/esm/plugins/Normalizer/createNormalizerPlugin.js +5 -0
  325. package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +113 -0
  326. package/dist/esm/plugins/Normalizer/index.js +2 -0
  327. package/dist/esm/plugins/Normalizer/types.js +1 -0
  328. package/dist/esm/plugins/Normalizer/utils.js +18 -0
  329. package/dist/esm/plugins/Normalizer/withNormalizer.js +73 -0
  330. package/dist/esm/plugins/Paragraph/Paragraph.js +16 -0
  331. package/dist/esm/plugins/Paragraph/__tests__/createParagraphPlugin.test.js +121 -0
  332. package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +58 -0
  333. package/dist/esm/plugins/Paragraph/index.js +1 -0
  334. package/dist/esm/plugins/Paragraph/utils.js +6 -0
  335. package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +42 -0
  336. package/dist/esm/plugins/PasteHTML/index.js +1 -0
  337. package/dist/esm/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.js +50 -0
  338. package/dist/esm/plugins/PasteHTML/utils/sanitizeAnchors.js +33 -0
  339. package/dist/esm/plugins/PasteHTML/utils/sanitizeHTML.js +40 -0
  340. package/dist/esm/plugins/PasteHTML/utils/sanitizeSheets.js +34 -0
  341. package/dist/esm/plugins/Quote/__test__/createQuotePlugin.test.js +74 -0
  342. package/dist/esm/plugins/Quote/components/Quote.js +15 -0
  343. package/dist/esm/plugins/Quote/components/ToolbarQuoteButton.js +23 -0
  344. package/dist/esm/plugins/Quote/createQuotePlugin.js +47 -0
  345. package/dist/esm/plugins/Quote/index.js +2 -0
  346. package/dist/esm/plugins/Quote/shouldResetQuote.js +30 -0
  347. package/dist/esm/plugins/Quote/toggleQuote.js +33 -0
  348. package/dist/esm/plugins/Quote/withQuote.js +38 -0
  349. package/dist/esm/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.js +11 -0
  350. package/dist/esm/plugins/SelectOnBackspace/index.js +1 -0
  351. package/dist/esm/plugins/Table/__tests__/createTablePlugin.test.js +88 -0
  352. package/dist/esm/plugins/Table/__tests__/helpers.test.js +14 -0
  353. package/dist/esm/plugins/Table/actions/addColumn.js +45 -0
  354. package/dist/esm/plugins/Table/actions/addRow.js +39 -0
  355. package/dist/esm/plugins/Table/actions/index.js +3 -0
  356. package/dist/esm/plugins/Table/actions/setHeader.js +24 -0
  357. package/dist/esm/plugins/Table/components/Cell.js +25 -0
  358. package/dist/esm/plugins/Table/components/HeaderCell.js +28 -0
  359. package/dist/esm/plugins/Table/components/Row.js +15 -0
  360. package/dist/esm/plugins/Table/components/Table.js +22 -0
  361. package/dist/esm/plugins/Table/components/TableActions.js +118 -0
  362. package/dist/esm/plugins/Table/components/ToolbarButton.js +24 -0
  363. package/dist/esm/plugins/Table/createTablePlugin.js +109 -0
  364. package/dist/esm/plugins/Table/helpers.js +116 -0
  365. package/dist/esm/plugins/Table/index.js +2 -0
  366. package/dist/esm/plugins/Table/insertTableFragment.js +40 -0
  367. package/dist/esm/plugins/Table/onKeyDownTable.js +52 -0
  368. package/dist/esm/plugins/Table/tableTracking.js +46 -0
  369. package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +75 -0
  370. package/dist/esm/plugins/Text/createTextPlugin.js +127 -0
  371. package/dist/esm/plugins/Text/index.js +1 -0
  372. package/dist/esm/plugins/Tracking/createTrackingPlugin.js +83 -0
  373. package/dist/esm/plugins/Tracking/index.js +1 -0
  374. package/dist/esm/plugins/Tracking/utils.js +10 -0
  375. package/dist/esm/plugins/TrailingParagraph/index.js +10 -0
  376. package/dist/esm/plugins/Voids/createVoidsPlugin.js +21 -0
  377. package/dist/esm/plugins/Voids/index.js +1 -0
  378. package/dist/esm/plugins/Voids/transformVoid.js +19 -0
  379. package/dist/esm/plugins/index.js +60 -0
  380. package/dist/esm/plugins/links-tracking.js +10 -0
  381. package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +57 -0
  382. package/dist/esm/plugins/shared/EmbeddedBlockUtil.js +144 -0
  383. package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +59 -0
  384. package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +62 -0
  385. package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +56 -0
  386. package/dist/esm/plugins/shared/LinkedBlockWrapper.js +30 -0
  387. package/dist/esm/plugins/shared/ToolbarButton.js +39 -0
  388. package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +59 -0
  389. package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +62 -0
  390. package/dist/esm/prepareDocument.js +57 -0
  391. package/dist/esm/test-utils/assertOutput.js +21 -0
  392. package/dist/esm/test-utils/createEditor.js +21 -0
  393. package/dist/esm/test-utils/hyperscript.d.js +0 -0
  394. package/dist/esm/test-utils/index.js +4 -0
  395. package/dist/esm/test-utils/jsx.js +149 -0
  396. package/dist/esm/test-utils/mockPlugin.js +6 -0
  397. package/dist/esm/test-utils/randomId.js +3 -0
  398. package/dist/esm/test-utils/setEmptyDataAttribute.js +11 -0
  399. package/dist/esm/test-utils/validation.js +112 -0
  400. package/dist/esm/useOnValueChanged.js +43 -0
  401. package/dist/{ContentfulEditorProvider.d.ts → types/ContentfulEditorProvider.d.ts} +9 -9
  402. package/dist/{RichTextEditor.d.ts → types/RichTextEditor.d.ts} +21 -20
  403. package/dist/{RichTextEditor.styles.d.ts → types/RichTextEditor.styles.d.ts} +7 -7
  404. package/dist/{SdkProvider.d.ts → types/SdkProvider.d.ts} +7 -7
  405. package/dist/types/Toolbar/_tests_/toolbar.test.d.ts +1 -0
  406. package/dist/{Toolbar → types/Toolbar}/components/EmbedEntityWidget.d.ts +6 -5
  407. package/dist/{Toolbar → types/Toolbar}/components/EmbeddedEntityDropdownButton.d.ts +9 -9
  408. package/dist/{Toolbar → types/Toolbar}/components/StickyToolbarWrapper.d.ts +7 -7
  409. package/dist/types/Toolbar/index.d.ts +6 -0
  410. package/dist/types/__fixtures__/FakeSdk.d.ts +8 -0
  411. package/dist/types/__fixtures__/asset/index.d.ts +6 -0
  412. package/dist/types/__fixtures__/content-type/index.d.ts +2 -0
  413. package/dist/types/__fixtures__/entry/index.d.ts +5 -0
  414. package/dist/types/__fixtures__/fixtures.d.ts +6 -0
  415. package/dist/types/__fixtures__/locale/index.d.ts +42 -0
  416. package/dist/types/__fixtures__/space/index.d.ts +2 -0
  417. package/dist/{constants → types/constants}/Schema.d.ts +111 -111
  418. package/dist/{dialogs → types/dialogs}/HypelinkDialog/HyperlinkDialog.d.ts +63 -54
  419. package/dist/{dialogs → types/dialogs}/openRichTextDialog.d.ts +2 -2
  420. package/dist/{dialogs → types/dialogs}/renderRichTextDialog.d.ts +3 -2
  421. package/dist/types/helpers/__tests__/extractNodes.test.d.ts +1 -0
  422. package/dist/types/helpers/__tests__/removeInternalMarks.test.d.ts +2 -0
  423. package/dist/types/helpers/__tests__/validations.test.d.ts +1 -0
  424. package/dist/{helpers → types/helpers}/editor.d.ts +40 -40
  425. package/dist/{helpers → types/helpers}/environment.d.ts +2 -2
  426. package/dist/{helpers → types/helpers}/extractNodes.d.ts +5 -5
  427. package/dist/{helpers → types/helpers}/formatDateAndTime.d.ts +15 -15
  428. package/dist/types/helpers/getAllowedResourcesForNodeType.d.ts +25 -0
  429. package/dist/{helpers → types/helpers}/getLinkedContentTypeIdsForNodeType.d.ts +26 -26
  430. package/dist/{helpers → types/helpers}/newEntitySelectorConfigFromRichTextField.d.ts +14 -14
  431. package/dist/types/helpers/newResourceEntitySelectorConfigFromRichTextField.d.ts +16 -0
  432. package/dist/{helpers → types/helpers}/nodeFactory.d.ts +24 -24
  433. package/dist/{helpers → types/helpers}/removeInternalMarks.d.ts +1 -1
  434. package/dist/{helpers → types/helpers}/sanitizeIncomingSlateDoc.d.ts +6 -6
  435. package/dist/{helpers → types/helpers}/sdkNavigatorSlideIn.d.ts +16 -16
  436. package/dist/types/helpers/sdkNavigatorSlideIn.spec.d.ts +1 -0
  437. package/dist/{helpers → types/helpers}/transformers.d.ts +7 -7
  438. package/dist/{helpers → types/helpers}/validations.d.ts +10 -10
  439. package/dist/{index.d.ts → types/index.d.ts} +4 -4
  440. package/dist/{internal → types/internal}/constants.d.ts +1 -1
  441. package/dist/{internal → types/internal}/hooks.d.ts +4 -4
  442. package/dist/{internal → types/internal}/index.d.ts +4 -4
  443. package/dist/{internal → types/internal}/misc.d.ts +37 -37
  444. package/dist/{internal → types/internal}/queries.d.ts +78 -78
  445. package/dist/{internal → types/internal}/transforms.d.ts +33 -33
  446. package/dist/types/internal/types/editor.d.ts +51 -0
  447. package/dist/{internal → types/internal}/types/index.d.ts +2 -2
  448. package/dist/{internal → types/internal}/types/plugins.d.ts +12 -12
  449. package/dist/{plugins → types/plugins}/Break/createExitBreakPlugin.d.ts +2 -2
  450. package/dist/types/plugins/Break/createExitBreakPlugin.test.d.ts +1 -0
  451. package/dist/{plugins → types/plugins}/Break/createResetNodePlugin.d.ts +2 -2
  452. package/dist/{plugins → types/plugins}/Break/createSoftBreakPlugin.d.ts +2 -2
  453. package/dist/types/plugins/Break/createSoftBreakPlugin.test.d.ts +1 -0
  454. package/dist/{plugins → types/plugins}/Break/index.d.ts +5 -5
  455. package/dist/{plugins → types/plugins}/CommandPalette/components/CommandList.d.ts +8 -7
  456. package/dist/{plugins → types/plugins}/CommandPalette/components/CommandList.styles.d.ts +14 -14
  457. package/dist/{plugins → types/plugins}/CommandPalette/components/CommandPrompt.d.ts +5 -4
  458. package/dist/{plugins → types/plugins}/CommandPalette/constants.d.ts +1 -1
  459. package/dist/{plugins → types/plugins}/CommandPalette/createCommandPalettePlugin.d.ts +13 -13
  460. package/dist/{plugins → types/plugins}/CommandPalette/hooks/useCommandList.d.ts +4 -4
  461. package/dist/{plugins → types/plugins}/CommandPalette/index.d.ts +1 -1
  462. package/dist/{plugins → types/plugins}/CommandPalette/onKeyDown.d.ts +2 -2
  463. package/dist/types/plugins/CommandPalette/onKeyDown.spec.d.ts +1 -0
  464. package/dist/{plugins → types/plugins}/CommandPalette/useCommands.d.ts +19 -19
  465. package/dist/{plugins → types/plugins}/CommandPalette/utils/createInlineEntryNode.d.ts +16 -16
  466. package/dist/{plugins → types/plugins}/CommandPalette/utils/fetchAssets.d.ts +8 -8
  467. package/dist/{plugins → types/plugins}/CommandPalette/utils/fetchEntries.d.ts +9 -9
  468. package/dist/{plugins → types/plugins}/CommandPalette/utils/insertBlock.d.ts +1 -1
  469. package/dist/{plugins → types/plugins}/CommandPalette/utils/trimLeadingSlash.d.ts +7 -7
  470. package/dist/{plugins → types/plugins}/DragAndDrop/index.d.ts +2 -2
  471. package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +19 -19
  472. package/dist/{plugins → types/plugins}/EmbeddedEntityBlock/index.d.ts +4 -5
  473. package/dist/{plugins → types/plugins}/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +13 -13
  474. package/dist/{plugins → types/plugins}/EmbeddedEntityInline/Util.d.ts +16 -16
  475. package/dist/{plugins → types/plugins}/EmbeddedEntityInline/index.d.ts +10 -9
  476. package/dist/types/plugins/EmbeddedResourceBlock/LinkedResourceBlock.d.ts +18 -0
  477. package/dist/types/plugins/EmbeddedResourceBlock/index.d.ts +3 -0
  478. package/dist/types/plugins/Heading/__tests__/createHeadingPlugin.test.d.ts +1 -0
  479. package/dist/{plugins → types/plugins}/Heading/components/Heading.d.ts +10 -10
  480. package/dist/{plugins → types/plugins}/Heading/components/ToolbarHeadingButton.d.ts +5 -4
  481. package/dist/{plugins → types/plugins}/Heading/createHeadingPlugin.d.ts +2 -2
  482. package/dist/{plugins → types/plugins}/Heading/index.d.ts +2 -2
  483. package/dist/{plugins → types/plugins}/Hr/index.d.ts +11 -11
  484. package/dist/{plugins → types/plugins}/Hyperlink/HyperlinkModal.d.ts +17 -16
  485. package/dist/types/plugins/Hyperlink/__tests__/createHyperlinkPlugin.test.d.ts +1 -0
  486. package/dist/{plugins → types/plugins}/Hyperlink/components/EntityHyperlink.d.ts +21 -20
  487. package/dist/{plugins → types/plugins}/Hyperlink/components/ToolbarHyperlinkButton.d.ts +6 -5
  488. package/dist/{plugins → types/plugins}/Hyperlink/components/UrlHyperlink.d.ts +22 -21
  489. package/dist/{plugins → types/plugins}/Hyperlink/components/styles.d.ts +4 -4
  490. package/dist/{plugins → types/plugins}/Hyperlink/createHyperlinkPlugin.d.ts +3 -3
  491. package/dist/{plugins → types/plugins}/Hyperlink/index.d.ts +2 -2
  492. package/dist/{plugins → types/plugins}/Hyperlink/useEntityInfo.d.ts +16 -16
  493. package/dist/{plugins → types/plugins}/Hyperlink/utils.d.ts +5 -5
  494. package/dist/types/plugins/List/__tests__/createListPlugin.test.d.ts +1 -0
  495. package/dist/types/plugins/List/__tests__/insertListBreak.test.d.ts +1 -0
  496. package/dist/types/plugins/List/__tests__/insertListFragment.test.d.ts +1 -0
  497. package/dist/{plugins → types/plugins}/List/components/List.d.ts +4 -3
  498. package/dist/{plugins → types/plugins}/List/components/ListItem.d.ts +3 -2
  499. package/dist/{plugins → types/plugins}/List/components/ToolbarListButton.d.ts +5 -4
  500. package/dist/{plugins → types/plugins}/List/createListPlugin.d.ts +2 -2
  501. package/dist/{plugins → types/plugins}/List/index.d.ts +2 -2
  502. package/dist/{plugins → types/plugins}/List/insertListBreak.d.ts +2 -2
  503. package/dist/{plugins → types/plugins}/List/insertListFragment.d.ts +2 -2
  504. package/dist/{plugins → types/plugins}/List/onKeyDownList.d.ts +7 -7
  505. package/dist/{plugins → types/plugins}/List/transforms/insertListItem.d.ts +5 -5
  506. package/dist/{plugins → types/plugins}/List/transforms/moveListItemDown.d.ts +6 -6
  507. package/dist/{plugins → types/plugins}/List/transforms/moveListItems.d.ts +6 -6
  508. package/dist/types/plugins/List/transforms/moveListItems.test.d.ts +1 -0
  509. package/dist/{plugins → types/plugins}/List/transforms/toggleList.d.ts +4 -4
  510. package/dist/types/plugins/List/transforms/toggleList.spec.d.ts +1 -0
  511. package/dist/{plugins → types/plugins}/List/transforms/unwrapList.d.ts +4 -4
  512. package/dist/{plugins → types/plugins}/List/utils.d.ts +14 -14
  513. package/dist/{plugins → types/plugins}/List/withList.d.ts +2 -2
  514. package/dist/{plugins → types/plugins}/Marks/Bold.d.ts +11 -10
  515. package/dist/{plugins → types/plugins}/Marks/Code.d.ts +17 -16
  516. package/dist/{plugins → types/plugins}/Marks/Italic.d.ts +11 -10
  517. package/dist/{plugins → types/plugins}/Marks/Subscript.d.ts +17 -16
  518. package/dist/{plugins → types/plugins}/Marks/Superscript.d.ts +17 -16
  519. package/dist/{plugins → types/plugins}/Marks/Underline.d.ts +11 -10
  520. package/dist/{plugins → types/plugins}/Marks/components/MarkToolbarButton.d.ts +13 -13
  521. package/dist/{plugins → types/plugins}/Marks/helpers.d.ts +4 -4
  522. package/dist/{plugins → types/plugins}/Marks/index.d.ts +2 -2
  523. package/dist/{plugins → types/plugins}/Normalizer/baseRules.d.ts +2 -2
  524. package/dist/{plugins → types/plugins}/Normalizer/createNormalizerPlugin.d.ts +2 -2
  525. package/dist/types/plugins/Normalizer/createNormalizerPlugin.test.d.ts +1 -0
  526. package/dist/{plugins → types/plugins}/Normalizer/index.d.ts +2 -2
  527. package/dist/{plugins → types/plugins}/Normalizer/types.d.ts +38 -38
  528. package/dist/{plugins → types/plugins}/Normalizer/utils.d.ts +5 -5
  529. package/dist/{plugins → types/plugins}/Normalizer/withNormalizer.d.ts +2 -2
  530. package/dist/types/plugins/Paragraph/Paragraph.d.ts +3 -0
  531. package/dist/types/plugins/Paragraph/__tests__/createParagraphPlugin.test.d.ts +1 -0
  532. package/dist/{plugins → types/plugins}/Paragraph/createParagraphPlugin.d.ts +2 -2
  533. package/dist/{plugins → types/plugins}/Paragraph/index.d.ts +1 -1
  534. package/dist/{plugins → types/plugins}/Paragraph/utils.d.ts +2 -2
  535. package/dist/{plugins → types/plugins}/PasteHTML/createPasteHTMLPlugin.d.ts +8 -8
  536. package/dist/{plugins → types/plugins}/PasteHTML/index.d.ts +1 -1
  537. package/dist/types/plugins/PasteHTML/utils/__tests__/sanitizeHTML.test.d.ts +1 -0
  538. package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeAnchors.d.ts +19 -19
  539. package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeHTML.d.ts +1 -1
  540. package/dist/{plugins → types/plugins}/PasteHTML/utils/sanitizeSheets.d.ts +4 -4
  541. package/dist/types/plugins/Quote/__test__/createQuotePlugin.test.d.ts +1 -0
  542. package/dist/types/plugins/Quote/components/Quote.d.ts +3 -0
  543. package/dist/{plugins → types/plugins}/Quote/components/ToolbarQuoteButton.d.ts +5 -4
  544. package/dist/{plugins → types/plugins}/Quote/createQuotePlugin.d.ts +2 -2
  545. package/dist/{plugins → types/plugins}/Quote/index.d.ts +2 -2
  546. package/dist/{plugins → types/plugins}/Quote/shouldResetQuote.d.ts +8 -8
  547. package/dist/{plugins → types/plugins}/Quote/toggleQuote.d.ts +4 -4
  548. package/dist/{plugins → types/plugins}/Quote/withQuote.d.ts +2 -2
  549. package/dist/{plugins → types/plugins}/SelectOnBackspace/createSelectOnBackspacePlugin.d.ts +2 -2
  550. package/dist/{plugins → types/plugins}/SelectOnBackspace/index.d.ts +1 -1
  551. package/dist/types/plugins/Table/__tests__/createTablePlugin.test.d.ts +1 -0
  552. package/dist/types/plugins/Table/__tests__/helpers.test.d.ts +1 -0
  553. package/dist/{plugins → types/plugins}/Table/actions/addColumn.d.ts +7 -7
  554. package/dist/{plugins → types/plugins}/Table/actions/addRow.d.ts +3 -3
  555. package/dist/{plugins → types/plugins}/Table/actions/index.d.ts +3 -3
  556. package/dist/{plugins → types/plugins}/Table/actions/setHeader.d.ts +2 -2
  557. package/dist/types/plugins/Table/components/Cell.d.ts +3 -0
  558. package/dist/{plugins → types/plugins}/Table/components/HeaderCell.d.ts +3 -2
  559. package/dist/types/plugins/Table/components/Row.d.ts +3 -0
  560. package/dist/{plugins → types/plugins}/Table/components/Table.d.ts +3 -2
  561. package/dist/types/plugins/Table/components/TableActions.d.ts +5 -0
  562. package/dist/{plugins → types/plugins}/Table/components/ToolbarButton.d.ts +5 -4
  563. package/dist/{plugins → types/plugins}/Table/createTablePlugin.d.ts +2 -2
  564. package/dist/{plugins → types/plugins}/Table/helpers.d.ts +15 -15
  565. package/dist/{plugins → types/plugins}/Table/index.d.ts +2 -2
  566. package/dist/{plugins → types/plugins}/Table/insertTableFragment.d.ts +3 -3
  567. package/dist/{plugins → types/plugins}/Table/onKeyDownTable.d.ts +2 -2
  568. package/dist/{plugins → types/plugins}/Table/tableTracking.d.ts +4 -4
  569. package/dist/types/plugins/Text/__tests__/createTextPlugin.test.d.ts +2 -0
  570. package/dist/{plugins → types/plugins}/Text/createTextPlugin.d.ts +2 -2
  571. package/dist/{plugins → types/plugins}/Text/index.d.ts +1 -1
  572. package/dist/{plugins → types/plugins}/Tracking/createTrackingPlugin.d.ts +12 -12
  573. package/dist/{plugins → types/plugins}/Tracking/index.d.ts +1 -1
  574. package/dist/{plugins → types/plugins}/Tracking/utils.d.ts +2 -2
  575. package/dist/{plugins → types/plugins}/TrailingParagraph/index.d.ts +2 -2
  576. package/dist/{plugins → types/plugins}/Voids/createVoidsPlugin.d.ts +2 -2
  577. package/dist/{plugins → types/plugins}/Voids/index.d.ts +1 -1
  578. package/dist/{plugins → types/plugins}/Voids/transformVoid.d.ts +5 -5
  579. package/dist/{plugins → types/plugins}/index.d.ts +6 -6
  580. package/dist/types/plugins/links-tracking.d.ts +3 -0
  581. package/dist/types/plugins/shared/EmbeddedBlockToolbarIcon.d.ts +11 -0
  582. package/dist/types/plugins/shared/EmbeddedBlockUtil.d.ts +8 -0
  583. package/dist/{plugins → types/plugins}/shared/FetchingWrappedAssetCard.d.ts +14 -13
  584. package/dist/{plugins → types/plugins}/shared/FetchingWrappedEntryCard.d.ts +14 -13
  585. package/dist/types/plugins/shared/FetchingWrappedResourceCard.d.ts +14 -0
  586. package/dist/types/plugins/shared/LinkedBlockWrapper.d.ts +25 -0
  587. package/dist/{plugins → types/plugins}/shared/ToolbarButton.d.ts +12 -11
  588. package/dist/types/plugins/shared/__tests__/FetchingWrappedAssetCard.test.d.ts +1 -0
  589. package/dist/types/plugins/shared/__tests__/FetchingWrappedEntryCard.test.d.ts +1 -0
  590. package/dist/{prepareDocument.d.ts → types/prepareDocument.d.ts} +19 -19
  591. package/dist/{test-utils → types/test-utils}/assertOutput.d.ts +7 -7
  592. package/dist/{test-utils → types/test-utils}/createEditor.d.ts +31 -31
  593. package/dist/{test-utils → types/test-utils}/index.d.ts +4 -4
  594. package/dist/{test-utils → types/test-utils}/jsx.d.ts +28 -28
  595. package/dist/{test-utils → types/test-utils}/mockPlugin.d.ts +2 -2
  596. package/dist/{test-utils → types/test-utils}/randomId.d.ts +4 -4
  597. package/dist/{test-utils → types/test-utils}/setEmptyDataAttribute.d.ts +6 -6
  598. package/dist/{test-utils → types/test-utils}/validation.d.ts +1 -1
  599. package/dist/{useOnValueChanged.d.ts → types/useOnValueChanged.d.ts} +8 -8
  600. package/package.json +30 -24
  601. package/dist/Toolbar/index.d.ts +0 -5
  602. package/dist/field-editor-rich-text.cjs.development.js +0 -7133
  603. package/dist/field-editor-rich-text.cjs.development.js.map +0 -1
  604. package/dist/field-editor-rich-text.cjs.production.min.js +0 -163
  605. package/dist/field-editor-rich-text.cjs.production.min.js.map +0 -1
  606. package/dist/field-editor-rich-text.esm.js +0 -7123
  607. package/dist/field-editor-rich-text.esm.js.map +0 -1
  608. package/dist/index.js +0 -8
  609. package/dist/internal/types/editor.d.ts +0 -51
  610. package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +0 -10
  611. package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +0 -4
  612. package/dist/plugins/Paragraph/Paragraph.d.ts +0 -2
  613. package/dist/plugins/Quote/components/Quote.d.ts +0 -2
  614. package/dist/plugins/Table/components/Cell.d.ts +0 -2
  615. package/dist/plugins/Table/components/Row.d.ts +0 -2
  616. package/dist/plugins/Table/components/TableActions.d.ts +0 -4
  617. package/dist/plugins/links-tracking.d.ts +0 -3
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _react = _interop_require_default(require("react"));
12
+ const _emotion = require("emotion");
13
+ function _interop_require_default(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ const styles = {
19
+ nativeSticky: (0, _emotion.css)`
20
+ position: -webkit-sticky;
21
+ position: sticky;
22
+ top: -1px;
23
+ z-index: 2;
24
+ `
25
+ };
26
+ const StickyToolbarWrapper = ({ isDisabled , children })=>_react.default.createElement("div", {
27
+ className: isDisabled ? '' : styles.nativeSticky
28
+ }, children);
29
+ const _default = StickyToolbarWrapper;
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _react = _interop_require_wildcard(require("react"));
12
+ const _f36components = require("@contentful/f36-components");
13
+ const _f36icons = require("@contentful/f36-icons");
14
+ const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
15
+ const _richtexttypes = require("@contentful/rich-text-types");
16
+ const _emotion = require("emotion");
17
+ const _ContentfulEditorProvider = require("../ContentfulEditorProvider");
18
+ const _editor = require("../helpers/editor");
19
+ const _validations = require("../helpers/validations");
20
+ const _queries = require("../internal/queries");
21
+ const _Heading = require("../plugins/Heading");
22
+ const _Hr = require("../plugins/Hr");
23
+ const _Hyperlink = require("../plugins/Hyperlink");
24
+ const _List = require("../plugins/List");
25
+ const _Bold = require("../plugins/Marks/Bold");
26
+ const _Code = require("../plugins/Marks/Code");
27
+ const _Italic = require("../plugins/Marks/Italic");
28
+ const _Subscript = require("../plugins/Marks/Subscript");
29
+ const _Superscript = require("../plugins/Marks/Superscript");
30
+ const _Underline = require("../plugins/Marks/Underline");
31
+ const _Quote = require("../plugins/Quote");
32
+ const _Table = require("../plugins/Table");
33
+ const _SdkProvider = require("../SdkProvider");
34
+ const _EmbedEntityWidget = require("./components/EmbedEntityWidget");
35
+ function _interop_require_default(obj) {
36
+ return obj && obj.__esModule ? obj : {
37
+ default: obj
38
+ };
39
+ }
40
+ function _getRequireWildcardCache(nodeInterop) {
41
+ if (typeof WeakMap !== "function") return null;
42
+ var cacheBabelInterop = new WeakMap();
43
+ var cacheNodeInterop = new WeakMap();
44
+ return (_getRequireWildcardCache = function(nodeInterop) {
45
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
46
+ })(nodeInterop);
47
+ }
48
+ function _interop_require_wildcard(obj, nodeInterop) {
49
+ if (!nodeInterop && obj && obj.__esModule) {
50
+ return obj;
51
+ }
52
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
53
+ return {
54
+ default: obj
55
+ };
56
+ }
57
+ var cache = _getRequireWildcardCache(nodeInterop);
58
+ if (cache && cache.has(obj)) {
59
+ return cache.get(obj);
60
+ }
61
+ var newObj = {};
62
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
63
+ for(var key in obj){
64
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
65
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
66
+ if (desc && (desc.get || desc.set)) {
67
+ Object.defineProperty(newObj, key, desc);
68
+ } else {
69
+ newObj[key] = obj[key];
70
+ }
71
+ }
72
+ }
73
+ newObj.default = obj;
74
+ if (cache) {
75
+ cache.set(obj, newObj);
76
+ }
77
+ return newObj;
78
+ }
79
+ const styles = {
80
+ toolbar: (0, _emotion.css)({
81
+ border: `1px solid ${_f36tokens.default.gray400}`,
82
+ backgroundColor: _f36tokens.default.gray100,
83
+ padding: _f36tokens.default.spacingXs,
84
+ borderRadius: `${_f36tokens.default.borderRadiusMedium} ${_f36tokens.default.borderRadiusMedium} 0 0`
85
+ }),
86
+ toolbarBtn: (0, _emotion.css)({
87
+ height: '30px',
88
+ width: '30px',
89
+ marginLeft: _f36tokens.default.spacing2Xs,
90
+ marginRight: _f36tokens.default.spacing2Xs
91
+ }),
92
+ divider: (0, _emotion.css)({
93
+ display: 'inline-block',
94
+ height: '21px',
95
+ width: '1px',
96
+ background: _f36tokens.default.gray300,
97
+ margin: `0 ${_f36tokens.default.spacing2Xs}`
98
+ }),
99
+ embedActionsWrapper: (0, _emotion.css)({
100
+ display: [
101
+ '-webkit-box',
102
+ '-ms-flexbox',
103
+ 'flex'
104
+ ],
105
+ webkitAlignSelf: 'flex-start',
106
+ alignSelf: 'flex-start',
107
+ msFlexItemAlign: 'start',
108
+ marginLeft: 'auto'
109
+ }),
110
+ formattingOptionsWrapper: (0, _emotion.css)({
111
+ display: [
112
+ '-webkit-box',
113
+ '-ms-flexbox',
114
+ 'flex'
115
+ ],
116
+ msFlexAlign: 'center',
117
+ webkitBoxAlign: 'center',
118
+ alignItems: 'center',
119
+ msFlexWrap: 'wrap',
120
+ flexWrap: 'wrap',
121
+ marginRight: '20px'
122
+ })
123
+ };
124
+ const Dropdown = ({ sdk , isDisabled })=>{
125
+ const editor = (0, _ContentfulEditorProvider.useContentfulEditor)();
126
+ const isActive = editor && ((0, _queries.isMarkActive)(editor, _richtexttypes.MARKS.SUPERSCRIPT) || (0, _queries.isMarkActive)(editor, _richtexttypes.MARKS.SUBSCRIPT) || (0, _queries.isMarkActive)(editor, _richtexttypes.MARKS.CODE));
127
+ return _react.createElement(_f36components.Menu, null, _react.createElement(_f36components.Menu.Trigger, null, _react.createElement("span", null, _react.createElement(_f36components.IconButton, {
128
+ size: "small",
129
+ className: styles.toolbarBtn,
130
+ variant: isActive ? 'secondary' : 'transparent',
131
+ icon: _react.createElement(_f36icons.MoreHorizontalIcon, null),
132
+ "aria-label": "toggle menu",
133
+ isDisabled: isDisabled,
134
+ testId: "dropdown-toolbar-button"
135
+ }))), _react.createElement(_f36components.Menu.List, null, (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUPERSCRIPT) && _react.createElement(_Superscript.ToolbarDropdownSuperscriptButton, {
136
+ isDisabled: isDisabled
137
+ }), (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUBSCRIPT) && _react.createElement(_Subscript.ToolbarDropdownSubscriptButton, {
138
+ isDisabled: isDisabled
139
+ }), (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.CODE) && _react.createElement(_Code.ToolbarDropdownCodeButton, {
140
+ isDisabled: isDisabled
141
+ })));
142
+ };
143
+ const Toolbar = ({ isDisabled })=>{
144
+ const sdk = (0, _SdkProvider.useSdkContext)();
145
+ const editor = (0, _ContentfulEditorProvider.useContentfulEditor)();
146
+ const canInsertBlocks = !(0, _editor.isNodeTypeSelected)(editor, _richtexttypes.BLOCKS.TABLE);
147
+ const validationInfo = _react.useMemo(()=>getValidationInfo(sdk.field), [
148
+ sdk.field
149
+ ]);
150
+ const isListSelected = (0, _editor.isNodeTypeSelected)(editor, _richtexttypes.BLOCKS.UL_LIST) || (0, _editor.isNodeTypeSelected)(editor, _richtexttypes.BLOCKS.OL_LIST);
151
+ const isBlockquoteSelected = (0, _editor.isNodeTypeSelected)(editor, _richtexttypes.BLOCKS.QUOTE);
152
+ const shouldDisableTables = isDisabled || !canInsertBlocks || isListSelected || isBlockquoteSelected;
153
+ const boldItalicUnderlineAvailable = (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.BOLD) || (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.ITALIC) || (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.UNDERLINE);
154
+ const dropdownItemsAvailable = (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUPERSCRIPT) || (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUBSCRIPT) || (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.CODE);
155
+ const shouldShowDropdown = boldItalicUnderlineAvailable && dropdownItemsAvailable;
156
+ return _react.createElement(_f36components.Flex, {
157
+ testId: "toolbar",
158
+ className: styles.toolbar,
159
+ alignItems: "center"
160
+ }, _react.createElement("div", {
161
+ className: styles.formattingOptionsWrapper
162
+ }, _react.createElement(_Heading.ToolbarHeadingButton, {
163
+ isDisabled: isDisabled || !canInsertBlocks
164
+ }), validationInfo.isAnyMarkEnabled && _react.createElement("span", {
165
+ className: styles.divider
166
+ }), (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.BOLD) && _react.createElement(_Bold.ToolbarBoldButton, {
167
+ isDisabled: isDisabled
168
+ }), (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.ITALIC) && _react.createElement(_Italic.ToolbarItalicButton, {
169
+ isDisabled: isDisabled
170
+ }), (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.UNDERLINE) && _react.createElement(_Underline.ToolbarUnderlineButton, {
171
+ isDisabled: isDisabled
172
+ }), !boldItalicUnderlineAvailable && (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUPERSCRIPT) && _react.createElement(_Superscript.ToolbarSuperscriptButton, {
173
+ isDisabled: isDisabled
174
+ }), !boldItalicUnderlineAvailable && (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.SUBSCRIPT) && _react.createElement(_Subscript.ToolbarSubscriptButton, {
175
+ isDisabled: isDisabled
176
+ }), !boldItalicUnderlineAvailable && (0, _validations.isMarkEnabled)(sdk.field, _richtexttypes.MARKS.CODE) && _react.createElement(_Code.ToolbarCodeButton, {
177
+ isDisabled: isDisabled
178
+ }), shouldShowDropdown && _react.createElement(Dropdown, {
179
+ sdk: sdk,
180
+ isDisabled: isDisabled
181
+ }), validationInfo.isAnyHyperlinkEnabled && _react.createElement(_react.Fragment, null, _react.createElement("span", {
182
+ className: styles.divider
183
+ }), _react.createElement(_Hyperlink.ToolbarHyperlinkButton, {
184
+ isDisabled: isDisabled
185
+ })), validationInfo.isAnyBlockFormattingEnabled && _react.createElement("span", {
186
+ className: styles.divider
187
+ }), _react.createElement(_List.ToolbarListButton, {
188
+ isDisabled: isDisabled || !canInsertBlocks
189
+ }), (0, _validations.isNodeTypeEnabled)(sdk.field, _richtexttypes.BLOCKS.QUOTE) && _react.createElement(_Quote.ToolbarQuoteButton, {
190
+ isDisabled: isDisabled || !canInsertBlocks
191
+ }), (0, _validations.isNodeTypeEnabled)(sdk.field, _richtexttypes.BLOCKS.HR) && _react.createElement(_Hr.ToolbarHrButton, {
192
+ isDisabled: isDisabled || !canInsertBlocks
193
+ }), (0, _validations.isNodeTypeEnabled)(sdk.field, _richtexttypes.BLOCKS.TABLE) && _react.createElement(_Table.ToolbarTableButton, {
194
+ isDisabled: shouldDisableTables
195
+ })), _react.createElement("div", {
196
+ className: styles.embedActionsWrapper
197
+ }, _react.createElement(_EmbedEntityWidget.EmbedEntityWidget, {
198
+ isDisabled: isDisabled,
199
+ canInsertBlocks: canInsertBlocks
200
+ })));
201
+ };
202
+ function getValidationInfo(field) {
203
+ const someWithValidation = (vals, validation)=>vals.some((val)=>validation(field, val));
204
+ const isAnyMarkEnabled = someWithValidation(Object.values(_richtexttypes.MARKS), _validations.isMarkEnabled);
205
+ const isAnyHyperlinkEnabled = someWithValidation([
206
+ _richtexttypes.INLINES.HYPERLINK,
207
+ _richtexttypes.INLINES.ASSET_HYPERLINK,
208
+ _richtexttypes.INLINES.ENTRY_HYPERLINK
209
+ ], _validations.isNodeTypeEnabled);
210
+ const isAnyBlockFormattingEnabled = someWithValidation([
211
+ _richtexttypes.BLOCKS.UL_LIST,
212
+ _richtexttypes.BLOCKS.OL_LIST,
213
+ _richtexttypes.BLOCKS.QUOTE,
214
+ _richtexttypes.BLOCKS.HR
215
+ ], _validations.isNodeTypeEnabled);
216
+ return {
217
+ isAnyMarkEnabled,
218
+ isAnyHyperlinkEnabled,
219
+ isAnyBlockFormattingEnabled
220
+ };
221
+ }
222
+ const _default = Toolbar;
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "newReferenceEditorFakeSdk", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return newReferenceEditorFakeSdk;
9
+ }
10
+ });
11
+ const _fieldeditortestutils = require("@contentful/field-editor-test-utils");
12
+ const _fixtures = require("./fixtures");
13
+ const newLink = (linkType, id)=>({
14
+ sys: {
15
+ id,
16
+ linkType,
17
+ type: 'Link'
18
+ }
19
+ });
20
+ function newReferenceEditorFakeSdk(props) {
21
+ const rawInitialValue = window.localStorage.getItem('initialValue');
22
+ const initialValue = rawInitialValue ? JSON.parse(rawInitialValue) : props?.initialValue;
23
+ const rawValidations = window.localStorage.getItem('fieldValidations');
24
+ const validations = rawValidations ? JSON.parse(rawValidations) : props?.validations;
25
+ const customizeMock = (field)=>{
26
+ return validations ? {
27
+ ...field,
28
+ validations
29
+ } : field;
30
+ };
31
+ const [field, mitt] = (0, _fieldeditortestutils.createFakeFieldAPI)(customizeMock, initialValue);
32
+ const space = (0, _fieldeditortestutils.createFakeSpaceAPI)();
33
+ const locales = (0, _fieldeditortestutils.createFakeLocalesAPI)();
34
+ const entryLinks = [
35
+ newLink('Entry', _fixtures.entries.published.sys.id),
36
+ newLink('Entry', _fixtures.entries.changed.sys.id),
37
+ newLink('Entry', _fixtures.entries.empty.sys.id)
38
+ ];
39
+ const assetLinks = [
40
+ newLink('Asset', _fixtures.assets.published.sys.id),
41
+ newLink('Asset', _fixtures.assets.changed.sys.id),
42
+ newLink('Asset', _fixtures.assets.empty.sys.id)
43
+ ];
44
+ let selectorCounter = 0;
45
+ const delay = (ms)=>{
46
+ return new Promise((resolve)=>setTimeout(resolve, ms));
47
+ };
48
+ const localizeContentTypes = (contentTypes)=>{
49
+ return contentTypes.map((contentType)=>({
50
+ ...contentType,
51
+ fields: contentType.fields.map((field)=>({
52
+ ...field,
53
+ localized: true
54
+ }))
55
+ }));
56
+ };
57
+ const sdk = {
58
+ field,
59
+ locales,
60
+ cmaAdapter: (0, _fieldeditortestutils.createFakeCMAAdapter)({
61
+ Entry: {
62
+ get: async ({ entryId })=>{
63
+ if (props?.fetchDelay) {
64
+ await delay(props.fetchDelay);
65
+ }
66
+ if (entryId === _fixtures.entries.empty.sys.id) {
67
+ return _fixtures.entries.empty;
68
+ }
69
+ if (entryId === _fixtures.entries.published.sys.id) {
70
+ return _fixtures.entries.published;
71
+ }
72
+ if (entryId === _fixtures.entries.changed.sys.id) {
73
+ return _fixtures.entries.changed;
74
+ }
75
+ return Promise.reject({});
76
+ }
77
+ },
78
+ Asset: {
79
+ get: async ({ assetId })=>{
80
+ if (props?.fetchDelay) {
81
+ await delay(props.fetchDelay);
82
+ }
83
+ if (assetId === _fixtures.assets.empty.sys.id) {
84
+ return _fixtures.assets.empty;
85
+ }
86
+ if (assetId === _fixtures.assets.published.sys.id) {
87
+ return _fixtures.assets.published;
88
+ }
89
+ if (assetId === _fixtures.assets.changed.sys.id) {
90
+ return _fixtures.assets.changed;
91
+ }
92
+ return Promise.reject({});
93
+ }
94
+ },
95
+ Space: {
96
+ get: async (params)=>{
97
+ if (params.spaceId === _fixtures.spaces.indifferent.sys.id) {
98
+ return _fixtures.spaces.indifferent;
99
+ }
100
+ return Promise.reject({});
101
+ }
102
+ },
103
+ ContentType: {
104
+ get: async ({ contentTypeId })=>{
105
+ if (contentTypeId === _fixtures.contentTypes.published.sys.id) {
106
+ return _fixtures.contentTypes.published;
107
+ }
108
+ return Promise.reject({});
109
+ }
110
+ },
111
+ Locale: {
112
+ getMany: async ()=>_fixtures.locales.list
113
+ }
114
+ }),
115
+ space: {
116
+ ...space,
117
+ getCachedContentTypes () {
118
+ return localizeContentTypes(space.getCachedContentTypes());
119
+ },
120
+ getContentTypes () {
121
+ return Promise.resolve(space.getContentTypes().then((response)=>{
122
+ return {
123
+ ...response,
124
+ items: localizeContentTypes(response.items)
125
+ };
126
+ }));
127
+ },
128
+ async getEntityScheduledActions () {
129
+ return [];
130
+ }
131
+ },
132
+ dialogs: {
133
+ selectSingleAsset: async ()=>{
134
+ selectorCounter++;
135
+ return assetLinks[selectorCounter % assetLinks.length];
136
+ },
137
+ selectMultipleAssets: async ()=>{
138
+ selectorCounter++;
139
+ return selectorCounter % 2 ? assetLinks.slice(0, 2) : [
140
+ assetLinks[2]
141
+ ];
142
+ },
143
+ selectSingleEntry: async ()=>{
144
+ selectorCounter++;
145
+ return entryLinks[selectorCounter % entryLinks.length];
146
+ },
147
+ selectMultipleEntries: async ()=>{
148
+ selectorCounter++;
149
+ return selectorCounter % 2 ? entryLinks.slice(0, 2) : [
150
+ entryLinks[2]
151
+ ];
152
+ }
153
+ },
154
+ navigator: {
155
+ openNewAsset: async ()=>({
156
+ entity: newLink('Asset', _fixtures.assets.empty.sys.id)
157
+ }),
158
+ openAsset: async ()=>{
159
+ alert('open Asset in slide in');
160
+ return {};
161
+ },
162
+ openNewEntry: async ()=>({
163
+ entity: newLink('Entry', _fixtures.entries.empty.sys.id)
164
+ }),
165
+ openEntry: async ()=>{
166
+ alert('open entry in slide in');
167
+ return {};
168
+ },
169
+ onSlideInNavigation: ()=>()=>({})
170
+ },
171
+ access: {
172
+ can: async ()=>true
173
+ },
174
+ ids: {
175
+ space: 'space-id',
176
+ environment: 'environment-id'
177
+ }
178
+ };
179
+ return [
180
+ sdk,
181
+ mitt
182
+ ];
183
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ changed: function() {
13
+ return _changed_assetjson.default;
14
+ },
15
+ empty: function() {
16
+ return _empty_assetjson.default;
17
+ },
18
+ published: function() {
19
+ return _published_assetjson.default;
20
+ },
21
+ invalid: function() {
22
+ return _invalid_assetjson.default;
23
+ },
24
+ created: function() {
25
+ return _created_assetjson.default;
26
+ }
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"));
33
+ function _interop_require_default(obj) {
34
+ return obj && obj.__esModule ? obj : {
35
+ default: obj
36
+ };
37
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "published", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _published_content_typejson.default;
9
+ }
10
+ });
11
+ const _published_content_typejson = _interop_require_default(require("./published_content_type.json"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ changed: function() {
13
+ return _changed_entryjson.default;
14
+ },
15
+ empty: function() {
16
+ return _empty_entryjson.default;
17
+ },
18
+ published: function() {
19
+ return _published_entryjson.default;
20
+ },
21
+ invalid: function() {
22
+ return _invalid_entryjson.default;
23
+ }
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"));
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ assets: function() {
13
+ return _asset;
14
+ },
15
+ contentTypes: function() {
16
+ return _contenttype;
17
+ },
18
+ entries: function() {
19
+ return _entry;
20
+ },
21
+ locales: function() {
22
+ return _locale;
23
+ },
24
+ spaces: function() {
25
+ return _space;
26
+ }
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"));
33
+ function _getRequireWildcardCache(nodeInterop) {
34
+ if (typeof WeakMap !== "function") return null;
35
+ var cacheBabelInterop = new WeakMap();
36
+ var cacheNodeInterop = new WeakMap();
37
+ return (_getRequireWildcardCache = function(nodeInterop) {
38
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
39
+ })(nodeInterop);
40
+ }
41
+ function _interop_require_wildcard(obj, nodeInterop) {
42
+ if (!nodeInterop && obj && obj.__esModule) {
43
+ return obj;
44
+ }
45
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
46
+ return {
47
+ default: obj
48
+ };
49
+ }
50
+ var cache = _getRequireWildcardCache(nodeInterop);
51
+ if (cache && cache.has(obj)) {
52
+ return cache.get(obj);
53
+ }
54
+ var newObj = {};
55
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
56
+ for(var key in obj){
57
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
58
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
59
+ if (desc && (desc.get || desc.set)) {
60
+ Object.defineProperty(newObj, key, desc);
61
+ } else {
62
+ newObj[key] = obj[key];
63
+ }
64
+ }
65
+ }
66
+ newObj.default = obj;
67
+ if (cache) {
68
+ cache.set(obj, newObj);
69
+ }
70
+ return newObj;
71
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ englishDefault: function() {
13
+ return _english_default_localejson.default;
14
+ },
15
+ german: function() {
16
+ return _german_localejson.default;
17
+ },
18
+ list: function() {
19
+ return list;
20
+ }
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"));
24
+ function _interop_require_default(obj) {
25
+ return obj && obj.__esModule ? obj : {
26
+ default: obj
27
+ };
28
+ }
29
+ const list = {
30
+ sys: {
31
+ type: 'Array'
32
+ },
33
+ total: 2,
34
+ skip: 0,
35
+ limit: 100,
36
+ items: [
37
+ _english_default_localejson.default,
38
+ _german_localejson.default
39
+ ]
40
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "indifferent", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _indifferent_spacejson.default;
9
+ }
10
+ });
11
+ const _indifferent_spacejson = _interop_require_default(require("./indifferent_space.json"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }