@atlaskit/editor-core 189.0.4 → 189.0.6

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.
@@ -28,6 +28,8 @@ export { pluginKey as stateKey } from './plugin-factory';
28
28
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
29
29
  import { PastePluginActionTypes } from '../actions';
30
30
  export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
31
+ var _pluginInjectionApi$a;
32
+ var editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
31
33
  var atlassianMarkDownParser = new MarkdownTransformer(schema, md);
32
34
  function getMarkdownSlice(text, openStart, openEnd) {
33
35
  var textInput = text;
@@ -223,7 +225,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
223
225
  };
224
226
  slice = handleParagraphBlockMarks(state, slice);
225
227
  var plainTextPasteSlice = linkifyContent(state.schema)(slice);
226
- if (handlePasteAsPlainTextWithAnalytics(view, event, plainTextPasteSlice)(state, dispatch, view)) {
228
+ if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
227
229
  return true;
228
230
  }
229
231
 
@@ -243,14 +245,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
243
245
  if (markdownSlice) {
244
246
  var _pluginInjectionApi$c;
245
247
  // linkify text prior to converting to macro
246
- if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
248
+ if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
247
249
  return true;
248
250
  }
249
251
 
250
252
  // run macro autoconvert prior to other conversions
251
253
  if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
252
254
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
253
- sendPasteAnalyticsEvent(view, event, markdownSlice, {
255
+ sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, markdownSlice, {
254
256
  type: PasteTypes.markdown
255
257
  });
256
258
  return true;
@@ -277,13 +279,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
277
279
  }
278
280
 
279
281
  // If we're in a code block, append the text contents of clipboard inside it
280
- if (handleCodeBlockWithAnalytics(view, event, slice, text)(state, dispatch)) {
282
+ if (handleCodeBlockWithAnalytics(editorAnalyticsAPI)(view, event, slice, text)(state, dispatch)) {
281
283
  return true;
282
284
  }
283
- if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.media) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.actions.insertMediaAsMediaSingle)(state, dispatch, view)) {
285
+ if (handleMediaSingleWithAnalytics(editorAnalyticsAPI)(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.media) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.actions.insertMediaAsMediaSingle)(state, dispatch, view)) {
284
286
  return true;
285
287
  }
286
- if (handleSelectedTableWithAnalytics(view, event, slice)(state, dispatch)) {
288
+ if (handleSelectedTableWithAnalytics(editorAnalyticsAPI)(view, event, slice)(state, dispatch)) {
287
289
  return true;
288
290
  }
289
291
 
@@ -316,14 +318,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
316
318
  var _pluginInjectionApi$c2, _pluginInjectionApi$l;
317
319
  // linkify the text where possible
318
320
  slice = linkifyContent(state.schema)(slice);
319
- if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
321
+ if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, slice, PasteTypes.richText)(state, dispatch)) {
320
322
  return true;
321
323
  }
322
324
 
323
325
  // run macro autoconvert prior to other conversions
324
326
  if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.card) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
325
327
  // TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
326
- sendPasteAnalyticsEvent(view, event, slice, {
328
+ sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, slice, {
327
329
  type: PasteTypes.richText
328
330
  });
329
331
  return true;
@@ -332,7 +334,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
332
334
  // get editor-tables to handle pasting tables if it can
333
335
  // otherwise, just the replace the selection with the content
334
336
  if (handlePasteTable(view, null, slice)) {
335
- sendPasteAnalyticsEvent(view, event, slice, {
337
+ sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, slice, {
336
338
  type: PasteTypes.richText
337
339
  });
338
340
  return true;
@@ -365,7 +367,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
365
367
  });
366
368
  slice = sliceCopy;
367
369
  }
368
- if (handleExpandWithAnalytics(view, event, slice)(state, dispatch)) {
370
+ if (handleExpandWithAnalytics(editorAnalyticsAPI)(view, event, slice)(state, dispatch)) {
369
371
  return true;
370
372
  }
371
373
  if (!insideTable(state)) {
@@ -375,13 +377,13 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
375
377
  // Create a custom handler to avoid handling with handleRichText method
376
378
  // As SafeInsert is used inside handleRichText which caused some bad UX like this:
377
379
  // https://product-fabric.atlassian.net/browse/MEX-1520
378
- if (handlePasteIntoCaptionWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
380
+ if (handlePasteIntoCaptionWithAnalytics(editorAnalyticsAPI)(view, event, slice, PasteTypes.richText)(state, dispatch)) {
379
381
  return true;
380
382
  }
381
- if (handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.list) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.findRootParentListNode)(state, dispatch)) {
383
+ if (handlePastePanelOrDecisionIntoListWithAnalytics(editorAnalyticsAPI)(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.list) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.findRootParentListNode)(state, dispatch)) {
382
384
  return true;
383
385
  }
384
- if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && handlePasteNonNestableBlockNodesIntoListWithAnalytics(view, event, slice)(state, dispatch)) {
386
+ if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && handlePasteNonNestableBlockNodesIntoListWithAnalytics(editorAnalyticsAPI)(view, event, slice)(state, dispatch)) {
385
387
  return true;
386
388
  }
387
389
  return handleRichTextWithAnalytics(view, event, slice, pluginInjectionApi)(state, dispatch);
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { Slice, Mark, Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import { isMediaBlobUrl } from '@atlaskit/media-client';
4
- import { ACTION_SUBJECT, addAnalytics, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '../../analytics';
4
+ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
5
5
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
@@ -148,12 +148,12 @@ export var removeDuplicateInvalidLinks = function removeDuplicateInvalidLinks(ht
148
148
  }
149
149
  return html;
150
150
  };
151
- export var addReplaceSelectedTableAnalytics = function addReplaceSelectedTableAnalytics(state, tr) {
151
+ export var addReplaceSelectedTableAnalytics = function addReplaceSelectedTableAnalytics(state, tr, editorAnalyticsAPI) {
152
152
  if (isTableSelected(state.selection)) {
153
153
  var _getSelectedTableInfo = getSelectedTableInfo(state.selection),
154
154
  totalRowCount = _getSelectedTableInfo.totalRowCount,
155
155
  totalColumnCount = _getSelectedTableInfo.totalColumnCount;
156
- addAnalytics(state, tr, {
156
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
157
157
  action: TABLE_ACTION.REPLACED,
158
158
  actionSubject: ACTION_SUBJECT.TABLE,
159
159
  attributes: {
@@ -162,7 +162,7 @@ export var addReplaceSelectedTableAnalytics = function addReplaceSelectedTableAn
162
162
  inputMethod: INPUT_METHOD.CLIPBOARD
163
163
  },
164
164
  eventType: EVENT_TYPE.TRACK
165
- });
165
+ })(tr);
166
166
  return tr;
167
167
  }
168
168
  return state.tr;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "189.0.4";
2
+ export var version = "189.0.6";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -3,7 +3,7 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
5
  import type { Command } from '@atlaskit/editor-common/types';
6
- import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
6
+ import type { InputMethodInsertMedia, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { InsertMediaAsMediaSingle } from '@atlaskit/editor-plugin-media/types';
8
8
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
9
9
  import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
@@ -13,7 +13,7 @@ export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice):
13
13
  export declare const doesSelectionWhichStartsOrEndsInListContainEntireList: (selection: Selection, findRootParentListNode: FindRootParentListNode | undefined) => boolean;
14
14
  export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice, findRootParentListNode: FindRootParentListNode | undefined): Command;
15
15
  export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
16
- export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
16
+ export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): Command;
17
17
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
18
18
  export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
19
19
  export declare function handleCodeBlock(text: string): Command;
@@ -51,4 +51,4 @@ export declare function handleParagraphBlockMarks(state: EditorState, slice: Sli
51
51
  export declare function flattenNestedListInSlice(slice: Slice): Slice;
52
52
  export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
53
53
  export declare function handlePasteIntoCaption(slice: Slice): Command;
54
- export declare const handleSelectedTable: (slice: Slice) => Command;
54
+ export declare const handleSelectedTable: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (slice: Slice) => Command;
@@ -1,4 +1,4 @@
1
- import type { AnalyticsEventPayload, PasteType, PasteContent } from '@atlaskit/editor-common/analytics';
1
+ import type { AnalyticsEventPayload, PasteType, PasteContent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
@@ -20,20 +20,20 @@ type GetContentProps = {
20
20
  export declare function getContent({ schema, slice }: GetContentProps): PasteContent;
21
21
  export declare function getMediaTraceId(slice: Slice): undefined;
22
22
  export declare function createPasteAnalyticsPayload(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): AnalyticsEventPayload;
23
- export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
24
- export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
23
+ export declare const sendPasteAnalyticsEvent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext) => void;
24
+ export declare const handlePasteAsPlainTextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
25
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
26
- export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
27
- export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
28
- export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, insertMediaAsMediaSingle: InsertMediaAsMediaSingle | undefined) => Command;
26
+ export declare const handlePasteIntoCaptionWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
27
+ export declare const handleCodeBlockWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
28
+ export declare const handleMediaSingleWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, insertMediaAsMediaSingle: InsertMediaAsMediaSingle | undefined) => Command;
29
29
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
30
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
31
31
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
32
- export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
- export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
- export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
- export declare const handleSelectedTableWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
36
- export declare const handlePasteLinkOnSelectedTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
32
+ export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
+ export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
+ export declare const handleExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
+ export declare const handleSelectedTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
36
+ export declare const handlePasteLinkOnSelectedTextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
37
37
  export declare const createPasteMeasurePayload: ({ view, duration, content, distortedDuration, }: {
38
38
  view: EditorView;
39
39
  duration: number;
@@ -2,6 +2,7 @@ import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemir
2
2
  import { Slice, Mark } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { PasteSource } from '../../analytics';
5
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
6
  import type { CardOptions } from '@atlaskit/editor-common/card';
6
7
  export declare function isPastedFromWord(html?: string): boolean;
7
8
  export declare function isPastedFromExcel(html?: string): boolean;
@@ -17,5 +18,5 @@ export declare function isPanelNode(node: PMNode | null | undefined): boolean;
17
18
  export declare function isSelectionInsidePanel(selection: Selection): PMNode | null;
18
19
  export declare const htmlHasInvalidLinkTags: (html?: string) => boolean;
19
20
  export declare const removeDuplicateInvalidLinks: (html: string) => string;
20
- export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction) => Transaction;
21
+ export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Transaction;
21
22
  export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
@@ -3,7 +3,7 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
5
  import type { Command } from '@atlaskit/editor-common/types';
6
- import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
6
+ import type { InputMethodInsertMedia, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
7
  import type { InsertMediaAsMediaSingle } from '@atlaskit/editor-plugin-media/types';
8
8
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
9
9
  import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
@@ -13,7 +13,7 @@ export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice):
13
13
  export declare const doesSelectionWhichStartsOrEndsInListContainEntireList: (selection: Selection, findRootParentListNode: FindRootParentListNode | undefined) => boolean;
14
14
  export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice, findRootParentListNode: FindRootParentListNode | undefined): Command;
15
15
  export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
16
- export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
16
+ export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): Command;
17
17
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
18
18
  export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
19
19
  export declare function handleCodeBlock(text: string): Command;
@@ -51,4 +51,4 @@ export declare function handleParagraphBlockMarks(state: EditorState, slice: Sli
51
51
  export declare function flattenNestedListInSlice(slice: Slice): Slice;
52
52
  export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
53
53
  export declare function handlePasteIntoCaption(slice: Slice): Command;
54
- export declare const handleSelectedTable: (slice: Slice) => Command;
54
+ export declare const handleSelectedTable: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (slice: Slice) => Command;
@@ -1,4 +1,4 @@
1
- import type { AnalyticsEventPayload, PasteType, PasteContent } from '@atlaskit/editor-common/analytics';
1
+ import type { AnalyticsEventPayload, PasteType, PasteContent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
@@ -20,20 +20,20 @@ type GetContentProps = {
20
20
  export declare function getContent({ schema, slice }: GetContentProps): PasteContent;
21
21
  export declare function getMediaTraceId(slice: Slice): undefined;
22
22
  export declare function createPasteAnalyticsPayload(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): AnalyticsEventPayload;
23
- export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
24
- export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
23
+ export declare const sendPasteAnalyticsEvent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext) => void;
24
+ export declare const handlePasteAsPlainTextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
25
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
26
- export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
27
- export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
28
- export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, insertMediaAsMediaSingle: InsertMediaAsMediaSingle | undefined) => Command;
26
+ export declare const handlePasteIntoCaptionWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
27
+ export declare const handleCodeBlockWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
28
+ export declare const handleMediaSingleWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, insertMediaAsMediaSingle: InsertMediaAsMediaSingle | undefined) => Command;
29
29
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
30
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
31
31
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
32
- export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
- export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
- export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
- export declare const handleSelectedTableWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
36
- export declare const handlePasteLinkOnSelectedTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
32
+ export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
+ export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
+ export declare const handleExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
+ export declare const handleSelectedTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
36
+ export declare const handlePasteLinkOnSelectedTextWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
37
37
  export declare const createPasteMeasurePayload: ({ view, duration, content, distortedDuration, }: {
38
38
  view: EditorView;
39
39
  duration: number;
@@ -2,6 +2,7 @@ import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemir
2
2
  import { Slice, Mark } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { PasteSource } from '../../analytics';
5
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
6
  import type { CardOptions } from '@atlaskit/editor-common/card';
6
7
  export declare function isPastedFromWord(html?: string): boolean;
7
8
  export declare function isPastedFromExcel(html?: string): boolean;
@@ -17,5 +18,5 @@ export declare function isPanelNode(node: PMNode | null | undefined): boolean;
17
18
  export declare function isSelectionInsidePanel(selection: Selection): PMNode | null;
18
19
  export declare const htmlHasInvalidLinkTags: (html?: string) => boolean;
19
20
  export declare const removeDuplicateInvalidLinks: (html: string) => string;
20
- export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction) => Transaction;
21
+ export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Transaction;
21
22
  export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "189.0.4",
3
+ "version": "189.0.6",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -329,6 +329,9 @@
329
329
  },
330
330
  "platform.editor.paste-options-toolbar": {
331
331
  "type": "boolean"
332
+ },
333
+ "platform.editor.multi-bodied-extension_0rygg": {
334
+ "type": "boolean"
332
335
  }
333
336
  }
334
337
  }