@atlaskit/editor-core 150.0.2 → 151.1.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 (244) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/actions/index.js +5 -23
  3. package/dist/cjs/create-editor/ErrorBoundary.js +113 -79
  4. package/dist/cjs/create-editor/ReactEditorView.js +145 -31
  5. package/dist/cjs/create-editor/create-plugins-list.js +8 -2
  6. package/dist/cjs/editor.js +101 -40
  7. package/dist/cjs/labs/next/presets/cxhtml.js +2 -1
  8. package/dist/cjs/plugins/analytics/types/enums.js +3 -1
  9. package/dist/cjs/plugins/base/index.js +4 -3
  10. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +66 -36
  11. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  12. package/dist/cjs/plugins/card/index.js +13 -2
  13. package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -0
  14. package/dist/cjs/plugins/card/pm-plugins/main.js +7 -2
  15. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +10 -3
  16. package/dist/cjs/plugins/code-bidi-warning/index.js +25 -0
  17. package/dist/cjs/plugins/code-bidi-warning/plugin-key.js +11 -0
  18. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +43 -0
  19. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +118 -0
  20. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/reducer.js +12 -0
  21. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/types.js +5 -0
  22. package/dist/cjs/plugins/code-block/index.js +10 -6
  23. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  24. package/dist/cjs/plugins/code-block/pm-plugins/main.js +12 -3
  25. package/dist/cjs/plugins/code-block/toolbar.js +1 -1
  26. package/dist/cjs/plugins/emoji/styles.js +1 -1
  27. package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
  28. package/dist/cjs/plugins/extension/toolbar.js +28 -23
  29. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +9 -3
  30. package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
  31. package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
  32. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
  33. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  34. package/dist/cjs/plugins/hyperlink/utils.js +6 -69
  35. package/dist/cjs/plugins/index.js +8 -0
  36. package/dist/cjs/plugins/media/index.js +14 -3
  37. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
  38. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
  39. package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
  40. package/dist/cjs/plugins/media/toolbar/index.js +49 -17
  41. package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
  42. package/dist/cjs/plugins/media/utils/media-files.js +67 -1
  43. package/dist/cjs/plugins/mentions/type-ahead/index.js +39 -3
  44. package/dist/cjs/plugins/panel/index.js +2 -3
  45. package/dist/cjs/plugins/panel/message.js +47 -0
  46. package/dist/cjs/plugins/panel/toolbar.js +64 -84
  47. package/dist/cjs/plugins/panel/utils.js +2 -2
  48. package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
  49. package/dist/cjs/plugins/rank.js +1 -1
  50. package/dist/cjs/plugins/status/styles.js +1 -1
  51. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  52. package/dist/cjs/profiler/render-count.js +82 -0
  53. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
  54. package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
  55. package/dist/cjs/version-wrapper.js +1 -1
  56. package/dist/cjs/version.json +1 -1
  57. package/dist/es2019/actions/index.js +6 -28
  58. package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
  59. package/dist/es2019/create-editor/ReactEditorView.js +130 -23
  60. package/dist/es2019/create-editor/create-plugins-list.js +9 -3
  61. package/dist/es2019/editor.js +74 -35
  62. package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
  63. package/dist/es2019/plugins/analytics/types/enums.js +3 -1
  64. package/dist/es2019/plugins/base/index.js +4 -3
  65. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
  66. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
  67. package/dist/es2019/plugins/card/index.js +7 -2
  68. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
  69. package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
  70. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
  71. package/dist/es2019/plugins/code-bidi-warning/index.js +15 -0
  72. package/dist/es2019/plugins/code-bidi-warning/plugin-key.js +2 -0
  73. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +31 -0
  74. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +88 -0
  75. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  76. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  77. package/dist/es2019/plugins/code-block/index.js +6 -1
  78. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +16 -4
  79. package/dist/es2019/plugins/code-block/pm-plugins/main.js +50 -39
  80. package/dist/es2019/plugins/code-block/toolbar.js +1 -1
  81. package/dist/es2019/plugins/emoji/styles.js +2 -0
  82. package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
  83. package/dist/es2019/plugins/extension/toolbar.js +30 -25
  84. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  85. package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
  86. package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
  87. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  88. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  89. package/dist/es2019/plugins/hyperlink/utils.js +3 -59
  90. package/dist/es2019/plugins/index.js +2 -1
  91. package/dist/es2019/plugins/media/index.js +13 -4
  92. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
  93. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
  94. package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
  95. package/dist/es2019/plugins/media/toolbar/index.js +44 -15
  96. package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
  97. package/dist/es2019/plugins/media/utils/media-files.js +68 -2
  98. package/dist/es2019/plugins/mentions/type-ahead/index.js +21 -2
  99. package/dist/es2019/plugins/panel/index.js +3 -4
  100. package/dist/es2019/plugins/panel/message.js +38 -0
  101. package/dist/es2019/plugins/panel/toolbar.js +52 -71
  102. package/dist/es2019/plugins/panel/utils.js +2 -2
  103. package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
  104. package/dist/es2019/plugins/rank.js +1 -1
  105. package/dist/es2019/plugins/status/styles.js +2 -0
  106. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  107. package/dist/es2019/profiler/render-count.js +60 -0
  108. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
  109. package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
  110. package/dist/es2019/version-wrapper.js +1 -1
  111. package/dist/es2019/version.json +1 -1
  112. package/dist/esm/actions/index.js +6 -24
  113. package/dist/esm/create-editor/ErrorBoundary.js +113 -78
  114. package/dist/esm/create-editor/ReactEditorView.js +146 -31
  115. package/dist/esm/create-editor/create-plugins-list.js +9 -3
  116. package/dist/esm/editor.js +100 -40
  117. package/dist/esm/labs/next/presets/cxhtml.js +2 -1
  118. package/dist/esm/plugins/analytics/types/enums.js +3 -1
  119. package/dist/esm/plugins/base/index.js +4 -3
  120. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
  121. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  122. package/dist/esm/plugins/card/index.js +13 -2
  123. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
  124. package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
  125. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
  126. package/dist/esm/plugins/code-bidi-warning/index.js +17 -0
  127. package/dist/esm/plugins/code-bidi-warning/plugin-key.js +2 -0
  128. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +30 -0
  129. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +96 -0
  130. package/dist/esm/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  131. package/dist/esm/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  132. package/dist/esm/plugins/code-block/index.js +10 -6
  133. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  134. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  135. package/dist/esm/plugins/code-block/toolbar.js +1 -1
  136. package/dist/esm/plugins/emoji/styles.js +1 -1
  137. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
  138. package/dist/esm/plugins/extension/toolbar.js +28 -23
  139. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  140. package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
  141. package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +2 -2
  142. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  143. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  144. package/dist/esm/plugins/hyperlink/utils.js +3 -59
  145. package/dist/esm/plugins/index.js +2 -1
  146. package/dist/esm/plugins/media/index.js +14 -4
  147. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
  148. package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
  149. package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
  150. package/dist/esm/plugins/media/toolbar/index.js +47 -19
  151. package/dist/esm/plugins/media/toolbar/utils.js +15 -1
  152. package/dist/esm/plugins/media/utils/media-files.js +60 -2
  153. package/dist/esm/plugins/mentions/type-ahead/index.js +39 -3
  154. package/dist/esm/plugins/panel/index.js +3 -4
  155. package/dist/esm/plugins/panel/message.js +38 -0
  156. package/dist/esm/plugins/panel/toolbar.js +57 -77
  157. package/dist/esm/plugins/panel/utils.js +2 -2
  158. package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
  159. package/dist/esm/plugins/rank.js +1 -1
  160. package/dist/esm/plugins/status/styles.js +1 -1
  161. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  162. package/dist/esm/profiler/render-count.js +57 -0
  163. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
  164. package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
  165. package/dist/esm/version-wrapper.js +1 -1
  166. package/dist/esm/version.json +1 -1
  167. package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
  168. package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
  169. package/dist/types/editor.d.ts +2 -0
  170. package/dist/types/plugins/analytics/index.d.ts +1 -1
  171. package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
  172. package/dist/types/plugins/analytics/types/events.d.ts +7 -2
  173. package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
  174. package/dist/types/plugins/analytics/types/index.d.ts +1 -1
  175. package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
  176. package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
  177. package/dist/types/plugins/base/index.d.ts +1 -0
  178. package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
  179. package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
  180. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
  181. package/dist/types/plugins/card/types.d.ts +6 -0
  182. package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -0
  183. package/dist/types/plugins/code-bidi-warning/plugin-key.d.ts +2 -0
  184. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +3 -0
  185. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +7 -0
  186. package/dist/types/plugins/code-bidi-warning/pm-plugins/reducer.d.ts +3 -0
  187. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +5 -0
  188. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +11 -2
  189. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +5 -1
  190. package/dist/types/plugins/extension/types.d.ts +0 -2
  191. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  192. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
  193. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  194. package/dist/types/plugins/hyperlink/HyperlinkToolbarAppearance.d.ts +1 -1
  195. package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
  196. package/dist/types/plugins/index.d.ts +1 -0
  197. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
  198. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
  199. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
  200. package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
  201. package/dist/types/plugins/panel/message.d.ts +37 -0
  202. package/dist/types/plugins/panel/toolbar.d.ts +4 -37
  203. package/dist/types/plugins/panel/types.d.ts +1 -0
  204. package/dist/types/profiler/render-count.d.ts +14 -0
  205. package/dist/types/types/feature-flags.d.ts +17 -0
  206. package/dist/types/ui/LinkSearch/types.d.ts +1 -0
  207. package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
  208. package/package.json +21 -18
  209. package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
  210. package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
  211. package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
  212. package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
  213. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
  214. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
  215. package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
  216. package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
  217. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
  218. package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
  219. package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
  220. package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
  221. package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
  222. package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
  223. package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
  224. package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
  225. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
  226. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  227. package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
  228. package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
  229. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  230. package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
  231. package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
  232. package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
  233. package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
  234. package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
  235. package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
  236. package/dist/esm/plugins/code-block/language-list.test.js +0 -71
  237. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
  238. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  239. package/dist/esm/plugins/media/commands/captions.test.js +0 -135
  240. package/dist/esm/plugins/media/commands/linking.test.js +0 -268
  241. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  242. package/dist/esm/plugins/panel/toolbar.test.js +0 -230
  243. package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
  244. package/dist/esm/ui/PortalProvider/index.test.js +0 -129
@@ -1,296 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
8
-
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
-
11
- var _docBuilder = require("@atlaskit/editor-test-helpers/doc-builder");
12
-
13
- var _mediaTestHelpers = require("@atlaskit/media-test-helpers");
14
-
15
- var _createProsemirrorEditor = require("@atlaskit/editor-test-helpers/create-prosemirror-editor");
16
-
17
- var _sendKeyToPm = _interopRequireDefault(require("@atlaskit/editor-test-helpers/send-key-to-pm"));
18
-
19
- var _editorCommon = require("@atlaskit/editor-common");
20
-
21
- var _hyperlink = _interopRequireDefault(require("../../hyperlink"));
22
-
23
- var _ = _interopRequireDefault(require("../"));
24
-
25
- var _actions = require("../pm-plugins/linking/actions");
26
-
27
- var _checkMediaType = require("../utils/check-media-type");
28
-
29
- var _linking = require("../pm-plugins/linking");
30
-
31
- var linking = _interopRequireWildcard(require("./linking"));
32
-
33
- var _types = require("../../analytics/types");
34
-
35
- var analyticUtils = _interopRequireWildcard(require("../../analytics/utils"));
36
-
37
- var commands = _interopRequireWildcard(require("../../../commands"));
38
-
39
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
40
-
41
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
-
43
- var setUrlToMedia = linking.setUrlToMedia,
44
- showLinkingToolbarWithMediaTypeCheck = linking.showLinkingToolbarWithMediaTypeCheck,
45
- unlink = linking.unlink;
46
- jest.mock('../utils/check-media-type', function () {
47
- return {
48
- checkMediaType: jest.fn()
49
- };
50
- });
51
- describe('image linking', function () {
52
- var createEditor = (0, _createProsemirrorEditor.createProsemirrorEditorFactory)();
53
- var preset = new _createProsemirrorEditor.Preset();
54
- var mediaProvider = Promise.resolve({
55
- viewMediaClientConfig: (0, _mediaTestHelpers.getDefaultMediaClientConfig)()
56
- });
57
-
58
- var providerFactory = _editorCommon.ProviderFactory.create({
59
- mediaProvider: mediaProvider
60
- });
61
-
62
- preset.add([_.default, {
63
- allowMediaSingle: true,
64
- allowLinking: true
65
- }]).add(_hyperlink.default);
66
-
67
- var editor = function editor(doc) {
68
- return createEditor({
69
- doc: doc,
70
- preset: preset,
71
- providerFactory: providerFactory
72
- });
73
- };
74
-
75
- var document = (0, _docBuilder.doc)('{<node>}', (0, _docBuilder.mediaSingle)()((0, _docBuilder.media)({
76
- id: 'a559980d-cd47-43e2-8377-27359fcb905f',
77
- type: 'file',
78
- collection: 'MediaServicesSample'
79
- })()), (0, _docBuilder.mediaSingle)()((0, _docBuilder.media)({
80
- id: 'a559980d-cd47-43e2-8377-27359fcb905f',
81
- type: 'file',
82
- collection: 'MediaServicesSample'
83
- })()));
84
- var mockDispatch = jest.fn();
85
- afterEach(function () {
86
- mockDispatch.mockClear();
87
- });
88
- describe('analytics', function () {
89
- var FIRST_CALL = 0;
90
- var ANALYTIC_PAYLOAD = 2;
91
- var analyticUtilsSpy = jest.spyOn(analyticUtils, 'addAnalytics');
92
- beforeEach(function () {
93
- analyticUtilsSpy.mockReset();
94
- });
95
- afterAll(function () {
96
- jest.resetAllMocks();
97
- });
98
- it('should call analytic when creating a link', function () {
99
- var _editor = editor(document),
100
- editorView = _editor.editorView;
101
-
102
- setUrlToMedia('http://google.com', _types.INPUT_METHOD.MANUAL)(editorView.state, mockDispatch, editorView);
103
- expect(analyticUtilsSpy).toBeCalled();
104
- expect(analyticUtilsSpy.mock.calls[FIRST_CALL][ANALYTIC_PAYLOAD]).toEqual({
105
- action: 'added',
106
- actionSubject: 'media',
107
- actionSubjectId: 'link',
108
- attributes: expect.objectContaining({
109
- inputMethod: 'manual'
110
- }),
111
- eventType: 'track'
112
- });
113
- });
114
- describe('existing links', function () {
115
- var googleUrl = 'http://google.com';
116
- var documentWithMediaWithLink = (0, _docBuilder.doc)('{<node>}', (0, _docBuilder.mediaSingle)()((0, _docBuilder.a)({
117
- href: googleUrl
118
- })((0, _docBuilder.media)({
119
- id: 'a559980d-cd47-43e2-8377-27359fcb905f',
120
- type: 'file',
121
- collection: 'MediaServicesSample'
122
- })())));
123
- it('should add edit analytic when modifying link', function () {
124
- var _editor2 = editor(documentWithMediaWithLink),
125
- editorView = _editor2.editorView;
126
-
127
- setUrlToMedia('http://random-url.com', _types.INPUT_METHOD.MANUAL)(editorView.state, editorView.dispatch, editorView);
128
- expect(analyticUtilsSpy).toHaveBeenCalledTimes(1);
129
- expect(analyticUtilsSpy.mock.calls[FIRST_CALL][ANALYTIC_PAYLOAD]).toEqual({
130
- action: 'edited',
131
- actionSubject: 'media',
132
- actionSubjectId: 'link',
133
- eventType: 'track'
134
- });
135
- });
136
- it('should delete analytic when removing a link', function () {
137
- var _editor3 = editor(documentWithMediaWithLink),
138
- editorView = _editor3.editorView;
139
-
140
- unlink(editorView.state, editorView.dispatch, editorView);
141
- expect(analyticUtilsSpy).toBeCalledTimes(1);
142
- expect(analyticUtilsSpy.mock.calls[FIRST_CALL][ANALYTIC_PAYLOAD]).toEqual({
143
- action: 'deleted',
144
- actionSubject: 'media',
145
- actionSubjectId: 'link',
146
- eventType: 'track'
147
- });
148
- });
149
- it("shouldn't call an analytic if the url was modified to the same url", function () {
150
- var _editor4 = editor(documentWithMediaWithLink),
151
- editorView = _editor4.editorView;
152
-
153
- setUrlToMedia(googleUrl, _types.INPUT_METHOD.MANUAL)(editorView.state, mockDispatch, editorView);
154
- expect(analyticUtilsSpy).not.toBeCalled();
155
- });
156
- });
157
- describe('errors', function () {
158
- beforeAll(function () {
159
- jest.spyOn(commands, 'createToggleBlockMarkOnRange').mockImplementation(function () {
160
- throw new Error('This error should be caught');
161
- });
162
- });
163
- it("should call analytic if there's an error creating a link", function () {
164
- var _editor5 = editor(document),
165
- editorView = _editor5.editorView;
166
-
167
- try {
168
- setUrlToMedia('http://google.com', _types.INPUT_METHOD.MANUAL)(editorView.state, mockDispatch, editorView);
169
- } catch (e) {// noop
170
- }
171
-
172
- expect(analyticUtilsSpy.mock.calls[FIRST_CALL][ANALYTIC_PAYLOAD]).toEqual({
173
- action: 'errored',
174
- actionSubject: 'media',
175
- actionSubjectId: 'link',
176
- attributes: {
177
- action: 'added'
178
- },
179
- eventType: 'track'
180
- });
181
- });
182
- });
183
- });
184
- describe('show linking toolbar', function () {
185
- describe('selected media is an image', function () {
186
- beforeAll(function () {
187
- _checkMediaType.checkMediaType.mockReturnValue(Promise.resolve('image'));
188
- });
189
- it('call dispatch with correct param with a media is selected', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
190
- var _editor6, editorView, result, expectTransaction;
191
-
192
- return _regenerator.default.wrap(function _callee$(_context) {
193
- while (1) {
194
- switch (_context.prev = _context.next) {
195
- case 0:
196
- _editor6 = editor(document), editorView = _editor6.editorView;
197
- _context.next = 3;
198
- return (0, _mediaTestHelpers.flushPromises)();
199
-
200
- case 3:
201
- result = showLinkingToolbarWithMediaTypeCheck(editorView.state, mockDispatch, editorView);
202
- expectTransaction = editorView.state.tr.setMeta(_linking.mediaLinkingPluginKey, {
203
- type: _actions.MediaLinkingActionsTypes.showToolbar
204
- });
205
- _context.next = 7;
206
- return (0, _mediaTestHelpers.flushPromises)();
207
-
208
- case 7:
209
- expect(result).toEqual(true);
210
- expect(mockDispatch).toHaveBeenCalledWith(expectTransaction);
211
-
212
- case 9:
213
- case "end":
214
- return _context.stop();
215
- }
216
- }
217
- }, _callee);
218
- })));
219
- it('does not call dispatch when selection is not a media single node', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
220
- var _editor7, editorView, result;
221
-
222
- return _regenerator.default.wrap(function _callee2$(_context2) {
223
- while (1) {
224
- switch (_context2.prev = _context2.next) {
225
- case 0:
226
- _editor7 = editor(document), editorView = _editor7.editorView;
227
- result = showLinkingToolbarWithMediaTypeCheck(editorView.state, mockDispatch, editorView);
228
- _context2.next = 4;
229
- return (0, _mediaTestHelpers.flushPromises)();
230
-
231
- case 4:
232
- expect(result).toEqual(false);
233
- expect(mockDispatch).not.toHaveBeenCalled();
234
-
235
- case 6:
236
- case "end":
237
- return _context2.stop();
238
- }
239
- }
240
- }, _callee2);
241
- })));
242
- it('does not call dispatch when selection has changed', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
243
- var _editor8, editorView, result;
244
-
245
- return _regenerator.default.wrap(function _callee3$(_context3) {
246
- while (1) {
247
- switch (_context3.prev = _context3.next) {
248
- case 0:
249
- _editor8 = editor(document), editorView = _editor8.editorView;
250
- result = showLinkingToolbarWithMediaTypeCheck(editorView.state, mockDispatch, editorView);
251
- (0, _sendKeyToPm.default)(editorView, 'ArrowDown');
252
- _context3.next = 5;
253
- return (0, _mediaTestHelpers.flushPromises)();
254
-
255
- case 5:
256
- expect(result).toEqual(false);
257
- expect(mockDispatch).not.toHaveBeenCalled();
258
-
259
- case 7:
260
- case "end":
261
- return _context3.stop();
262
- }
263
- }
264
- }, _callee3);
265
- })));
266
- });
267
- describe('selected media is a video', function () {
268
- beforeAll(function () {
269
- _checkMediaType.checkMediaType.mockReturnValue(Promise.resolve('video'));
270
- });
271
- it('does not call dispatch', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
272
- var _editor9, editorView, result;
273
-
274
- return _regenerator.default.wrap(function _callee4$(_context4) {
275
- while (1) {
276
- switch (_context4.prev = _context4.next) {
277
- case 0:
278
- _editor9 = editor(document), editorView = _editor9.editorView;
279
- result = showLinkingToolbarWithMediaTypeCheck(editorView.state, mockDispatch, editorView);
280
- _context4.next = 4;
281
- return (0, _mediaTestHelpers.flushPromises)();
282
-
283
- case 4:
284
- expect(result).toEqual(false);
285
- expect(mockDispatch).not.toHaveBeenCalled();
286
-
287
- case 6:
288
- case "end":
289
- return _context4.stop();
290
- }
291
- }
292
- }, _callee4);
293
- })));
294
- });
295
- });
296
- });
@@ -1,50 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _react = _interopRequireDefault(require("react"));
6
-
7
- var _react2 = require("@testing-library/react");
8
-
9
- var _reactIntl = require("react-intl");
10
-
11
- var _colors = require("@atlaskit/theme/colors");
12
-
13
- var _messages = require("./messages");
14
-
15
- var _index = _interopRequireDefault(require("./index"));
16
-
17
- var renderWithIntl = function renderWithIntl(component) {
18
- return (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
19
- locale: "en"
20
- }, component));
21
- };
22
-
23
- var onClick = function onClick() {};
24
-
25
- describe('CaptionComponent', function () {
26
- it('should show a placeholder by default', function () {
27
- var _renderWithIntl = renderWithIntl( /*#__PURE__*/_react.default.createElement(_index.default, {
28
- onClick: onClick
29
- })),
30
- getByText = _renderWithIntl.getByText;
31
-
32
- expect(getByText(_messages.messages.placeholder.defaultMessage)).not.toBeNull();
33
- });
34
- it('should have the placeholder colour as N200', function () {
35
- var _renderWithIntl2 = renderWithIntl( /*#__PURE__*/_react.default.createElement(_index.default, {
36
- onClick: onClick
37
- })),
38
- container = _renderWithIntl2.container;
39
-
40
- expect(container.firstChild).toHaveStyle("color: ".concat(_colors.N200));
41
- });
42
- it('placeholder should be centered', function () {
43
- var _renderWithIntl3 = renderWithIntl( /*#__PURE__*/_react.default.createElement(_index.default, {
44
- onClick: onClick
45
- })),
46
- container = _renderWithIntl3.container;
47
-
48
- expect(container.firstChild).toHaveStyle("text-align: center");
49
- });
50
- });
@@ -1,250 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- var _schema = _interopRequireDefault(require("@atlaskit/editor-test-helpers/schema"));
8
-
9
- var _editorCommon = require("@atlaskit/editor-common");
10
-
11
- var _getTestEmojiResource = require("@atlaskit/util-data-test/get-test-emoji-resource");
12
-
13
- var _toolbar = require("./toolbar");
14
-
15
- var actions = _interopRequireWildcard(require("../panel/actions"));
16
-
17
- var _Palettes = require("../../ui/ColorPalette/Palettes");
18
-
19
- var _createProsemirrorEditor = require("@atlaskit/editor-test-helpers/create-prosemirror-editor");
20
-
21
- var _ = _interopRequireDefault(require("."));
22
-
23
- var _docBuilder = require("@atlaskit/editor-test-helpers/doc-builder");
24
-
25
- var _adfSchema = require("@atlaskit/adf-schema");
26
-
27
- var _analytics = _interopRequireWildcard(require("../analytics"));
28
-
29
- var _emoji = require("../emoji");
30
-
31
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
-
33
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
34
-
35
- var dummyFormatMessage = function dummyFormatMessage(messageDescriptor) {
36
- return messageDescriptor.defaultMessage || '';
37
- };
38
-
39
- var changePanelTypespy = jest.spyOn(actions, 'changePanelType');
40
- describe('getToolbarItems', function () {
41
- var providerFactory = new _editorCommon.ProviderFactory();
42
- providerFactory.setProvider('emojiProvider', Promise.resolve((0, _getTestEmojiResource.getTestEmojiResource)()));
43
- var panelPreset = new _createProsemirrorEditor.Preset().add([_.default, {
44
- UNSAFE_allowCustomPanel: true
45
- }]);
46
- var itemsWithCustomPanelEnabled = (0, _toolbar.getToolbarItems)(dummyFormatMessage, _schema.default.nodes.panel, true, providerFactory, _adfSchema.PanelType.INFO);
47
- afterEach(function () {
48
- jest.clearAllMocks();
49
- });
50
- it('should return 7 items when isCustomPanelEnabled is false', function () {
51
- var items = (0, _toolbar.getToolbarItems)(dummyFormatMessage, _schema.default.nodes.panel, false, providerFactory);
52
- expect(items).toHaveLength(7);
53
- });
54
- describe('if isCustomPanelEnabled is true', function () {
55
- it('should return 11 items', function () {
56
- expect(itemsWithCustomPanelEnabled).toHaveLength(11);
57
- });
58
- it('should contain emoji and color picker button', function () {
59
- var emojiButton = itemsWithCustomPanelEnabled.find(function (item) {
60
- return item.type === 'select' && item.selectType === 'emoji';
61
- });
62
- var colorButton = itemsWithCustomPanelEnabled.find(function (item) {
63
- return item.type === 'select' && item.selectType === 'color';
64
- });
65
- expect(emojiButton).not.toBeUndefined();
66
- expect(colorButton).not.toBeUndefined();
67
- });
68
- });
69
- describe('custom panel toolbar items', function () {
70
- var createEditor = (0, _createProsemirrorEditor.createProsemirrorEditorFactory)();
71
-
72
- var _createEditor = createEditor({
73
- doc: (0, _docBuilder.doc)((0, _docBuilder.panel)({
74
- panelType: 'info'
75
- })((0, _docBuilder.p)('{<>}'))),
76
- preset: panelPreset,
77
- providerFactory: providerFactory
78
- }),
79
- editorView = _createEditor.editorView;
80
-
81
- it("should call changePanelType when clicked on emoji picker\n with changed emoji", function () {
82
- var emojiPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
83
- return item.type === 'select' && item.selectType === 'emoji';
84
- });
85
- emojiPickerConfig.onChange(':smiley:')(editorView.state);
86
- expect(changePanelTypespy).toBeCalledWith(_adfSchema.PanelType.CUSTOM, {
87
- emoji: ':smiley:'
88
- }, true);
89
- });
90
- it("should call changePanelType when clicked on color picker\n with changed color", function () {
91
- var colorPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
92
- return item.type === 'select' && item.selectType === 'color';
93
- });
94
- colorPickerConfig.onChange({
95
- label: 'Mintie',
96
- value: '#ABF5D1',
97
- border: _Palettes.DEFAULT_BORDER_COLOR
98
- })(editorView.state);
99
- expect(changePanelTypespy).toBeCalledWith(_adfSchema.PanelType.CUSTOM, {
100
- color: '#ABF5D1'
101
- }, true);
102
- });
103
- it("should call changePanelType when clicked on remove emoji", function () {
104
- var removeEmojiButton = itemsWithCustomPanelEnabled.find(function (item) {
105
- return item.type === 'button' && item.id === 'editor.panel.removeEmoji';
106
- });
107
- removeEmojiButton.onClick(editorView.state);
108
- expect(changePanelTypespy).toBeCalledWith(_adfSchema.PanelType.CUSTOM, {
109
- emoji: undefined
110
- }, true);
111
- });
112
- it("should not call changePanelType when clicked on remove emoji when no emoji in panel", function () {
113
- var _createEditor2 = createEditor({
114
- doc: (0, _docBuilder.doc)((0, _docBuilder.panel)({
115
- panelType: 'custom'
116
- })((0, _docBuilder.p)('{<>}'))),
117
- preset: panelPreset,
118
- providerFactory: providerFactory
119
- }),
120
- editorView = _createEditor2.editorView;
121
-
122
- var toolbarItems = (0, _toolbar.getToolbarItems)(dummyFormatMessage, _schema.default.nodes.panel, true, providerFactory, _adfSchema.PanelType.CUSTOM);
123
- var removeEmojiButton = toolbarItems.find(function (item) {
124
- return item.type === 'button' && item.id === 'editor.panel.removeEmoji';
125
- });
126
- changePanelTypespy.mockClear();
127
- removeEmojiButton.onClick(editorView.state);
128
- expect(changePanelTypespy).not.toBeCalled();
129
- });
130
- it("should have remove emoji button disabled when focus on panel without emoji", function () {
131
- var toolbarItems = (0, _toolbar.getToolbarItems)(dummyFormatMessage, _schema.default.nodes.panel, true, providerFactory, _adfSchema.PanelType.CUSTOM, '#ABF5D1', '');
132
- var removeEmojiButton = toolbarItems.find(function (item) {
133
- return item.type === 'button' && item.id === 'editor.panel.removeEmoji';
134
- });
135
- expect(removeEmojiButton.disabled).toBe(true);
136
- });
137
- it("should have remove emoji button enabled when focus on panel with emoji", function () {
138
- var toolbarItems = (0, _toolbar.getToolbarItems)(dummyFormatMessage, _schema.default.nodes.panel, true, providerFactory, _adfSchema.PanelType.CUSTOM, '#ABF5D1', ':smiley:');
139
- var removeEmojiButton = toolbarItems.find(function (item) {
140
- return item.type === 'button' && item.id === 'editor.panel.removeEmoji';
141
- });
142
- expect(removeEmojiButton.disabled).toBe(false);
143
- });
144
- });
145
- describe('analytics for custom panels', function () {
146
- var createEditor = (0, _createProsemirrorEditor.createProsemirrorEditorFactory)();
147
- var createAnalyticsEvent = jest.fn(function () {
148
- return {
149
- fire: function fire() {}
150
- };
151
- });
152
- var editorView;
153
- beforeEach(function () {
154
- var _createEditor3 = createEditor({
155
- doc: (0, _docBuilder.doc)((0, _docBuilder.panel)({
156
- panelType: 'info'
157
- })((0, _docBuilder.p)('{<>}'))),
158
- preset: panelPreset.add([_analytics.default, {
159
- createAnalyticsEvent: createAnalyticsEvent
160
- }]),
161
- providerFactory: providerFactory,
162
- pluginKey: _emoji.emojiPluginKey
163
- });
164
-
165
- editorView = _createEditor3.editorView;
166
- });
167
- it('Should trigger analytics when background color is changed', function () {
168
- var colorPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
169
- return item.type === 'select' && item.selectType === 'color';
170
- });
171
- colorPickerConfig.onChange({
172
- label: 'Mintie',
173
- value: '#ABF5D1',
174
- border: _Palettes.DEFAULT_BORDER_COLOR
175
- })(editorView.state, editorView.dispatch);
176
- var payload = {
177
- action: _analytics.ACTION.CHANGED_BACKGROUND_COLOR,
178
- actionSubject: _analytics.ACTION_SUBJECT.PANEL,
179
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.PANEL,
180
- attributes: expect.objectContaining({
181
- newColor: '#ABF5D1',
182
- previousColor: '#DEEBFF'
183
- }),
184
- eventType: _analytics.EVENT_TYPE.TRACK
185
- };
186
- expect(createAnalyticsEvent).toHaveBeenCalledWith(payload);
187
- });
188
- it('Should trigger analytics when Icon is changed', function () {
189
- var emojiPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
190
- return item.type === 'select' && item.selectType === 'emoji';
191
- });
192
- emojiPickerConfig.onChange(':smiley:')(editorView.state, editorView.dispatch);
193
- var payload = {
194
- action: _analytics.ACTION.CHANGED_ICON,
195
- actionSubject: _analytics.ACTION_SUBJECT.PANEL,
196
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.PANEL,
197
- attributes: expect.objectContaining({
198
- newIcon: ':smiley:',
199
- previousIcon: ''
200
- }),
201
- eventType: _analytics.EVENT_TYPE.TRACK
202
- };
203
- expect(createAnalyticsEvent).toHaveBeenCalledWith(payload);
204
- });
205
- it('Should trigger analytics when Icon is removed', function () {
206
- var removeEmojiButton = itemsWithCustomPanelEnabled.find(function (item) {
207
- return item.type === 'button' && item.id === 'editor.panel.removeEmoji';
208
- });
209
- var emojiPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
210
- return item.type === 'select' && item.selectType === 'emoji';
211
- });
212
- emojiPickerConfig.onChange(':smiley:')(editorView.state, editorView.dispatch);
213
- removeEmojiButton.onClick(editorView.state, editorView.dispatch);
214
- var payload = {
215
- action: _analytics.ACTION.REMOVE_ICON,
216
- actionSubject: _analytics.ACTION_SUBJECT.PANEL,
217
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.PANEL,
218
- attributes: expect.objectContaining({
219
- icon: ':smiley:'
220
- }),
221
- eventType: _analytics.EVENT_TYPE.TRACK
222
- };
223
- expect(createAnalyticsEvent).nthCalledWith(4, payload);
224
- });
225
- it('Should not fire analytics when the same background color is selected', function () {
226
- var colorPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
227
- return item.type === 'select' && item.selectType === 'color';
228
- });
229
- colorPickerConfig.onChange({
230
- label: 'Mintie',
231
- value: '#ABF5D1',
232
- border: _Palettes.DEFAULT_BORDER_COLOR
233
- })(editorView.state, editorView.dispatch);
234
- colorPickerConfig.onChange({
235
- label: 'Mintie',
236
- value: '#ABF5D1',
237
- border: _Palettes.DEFAULT_BORDER_COLOR
238
- })(editorView.state, editorView.dispatch);
239
- expect(createAnalyticsEvent).toHaveBeenCalledTimes(3);
240
- });
241
- it('Should not fire analtyics when same emoji is selected', function () {
242
- var emojiPickerConfig = itemsWithCustomPanelEnabled.find(function (item) {
243
- return item.type === 'select' && item.selectType === 'emoji';
244
- });
245
- emojiPickerConfig.onChange(':smiley:')(editorView.state, editorView.dispatch);
246
- emojiPickerConfig.onChange(':smiley:')(editorView.state, editorView.dispatch);
247
- expect(createAnalyticsEvent).toHaveBeenCalledTimes(3);
248
- });
249
- });
250
- });