@atlaskit/editor-core 187.14.9 → 187.14.11

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 (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/plugins/media/commands/captions.js +29 -27
  3. package/dist/cjs/plugins/media/commands/linking.js +21 -17
  4. package/dist/cjs/plugins/media/index.js +4 -3
  5. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +4 -2
  6. package/dist/cjs/plugins/media/pm-plugins/keymap.js +17 -15
  7. package/dist/cjs/plugins/media/pm-plugins/main.js +7 -5
  8. package/dist/cjs/plugins/media/toolbar/commands.js +149 -141
  9. package/dist/cjs/plugins/media/toolbar/index.js +20 -16
  10. package/dist/cjs/plugins/media/toolbar/linking.js +4 -3
  11. package/dist/cjs/plugins/media/utils/media-files.js +78 -75
  12. package/dist/cjs/version-wrapper.js +1 -1
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/plugins/media/commands/captions.js +4 -4
  15. package/dist/es2019/plugins/media/commands/linking.js +12 -11
  16. package/dist/es2019/plugins/media/index.js +6 -3
  17. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +4 -2
  18. package/dist/es2019/plugins/media/pm-plugins/keymap.js +5 -5
  19. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -5
  20. package/dist/es2019/plugins/media/toolbar/commands.js +15 -15
  21. package/dist/es2019/plugins/media/toolbar/index.js +20 -16
  22. package/dist/es2019/plugins/media/toolbar/linking.js +6 -3
  23. package/dist/es2019/plugins/media/utils/media-files.js +5 -6
  24. package/dist/es2019/version-wrapper.js +1 -1
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/plugins/media/commands/captions.js +29 -27
  27. package/dist/esm/plugins/media/commands/linking.js +21 -17
  28. package/dist/esm/plugins/media/index.js +4 -3
  29. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +4 -2
  30. package/dist/esm/plugins/media/pm-plugins/keymap.js +17 -15
  31. package/dist/esm/plugins/media/pm-plugins/main.js +7 -5
  32. package/dist/esm/plugins/media/toolbar/commands.js +148 -140
  33. package/dist/esm/plugins/media/toolbar/index.js +20 -16
  34. package/dist/esm/plugins/media/toolbar/linking.js +4 -3
  35. package/dist/esm/plugins/media/utils/media-files.js +78 -75
  36. package/dist/esm/version-wrapper.js +1 -1
  37. package/dist/esm/version.json +1 -1
  38. package/dist/types/plugins/media/commands/captions.d.ts +2 -1
  39. package/dist/types/plugins/media/commands/linking.d.ts +3 -3
  40. package/dist/types/plugins/media/pm-plugins/keymap.d.ts +2 -1
  41. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -1
  42. package/dist/types/plugins/media/toolbar/commands.d.ts +5 -4
  43. package/dist/types/plugins/media/utils/media-files.d.ts +3 -2
  44. package/dist/types-ts4.5/plugins/media/commands/captions.d.ts +2 -1
  45. package/dist/types-ts4.5/plugins/media/commands/linking.d.ts +3 -3
  46. package/dist/types-ts4.5/plugins/media/pm-plugins/keymap.d.ts +2 -1
  47. package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +1 -1
  48. package/dist/types-ts4.5/plugins/media/toolbar/commands.d.ts +5 -4
  49. package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +3 -2
  50. package/package.json +4 -4
@@ -5,7 +5,6 @@ import { posOfPrecedingMediaGroup, posOfMediaGroupNearby, posOfParentMediaGroup,
5
5
  import { canInsert, safeInsert, hasParentNode } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { atTheBeginningOfBlock, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, startPositionOfParent } from '../../../utils/prosemirror/position';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
8
- import { addAnalytics } from '../../analytics';
9
8
  export var canInsertMediaInline = function canInsertMediaInline(state) {
10
9
  var node = state.schema.nodes.mediaInline.create({});
11
10
  return canInsert(state.selection.$to, Fragment.from(node));
@@ -72,41 +71,43 @@ function shouldAppendParagraph(state, node) {
72
71
  * @param mediaState Media file to be added to the editor
73
72
  * @param collection Collection for the media to be added
74
73
  */
75
- export var insertMediaInlineNode = function insertMediaInlineNode(view, mediaState, collection, inputMethod) {
76
- var state = view.state,
77
- dispatch = view.dispatch;
78
- var schema = state.schema,
79
- tr = state.tr;
80
- var mediaInline = schema.nodes.mediaInline;
74
+ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalyticsAPI) {
75
+ return function (view, mediaState, collection, inputMethod) {
76
+ var state = view.state,
77
+ dispatch = view.dispatch;
78
+ var schema = state.schema,
79
+ tr = state.tr;
80
+ var mediaInline = schema.nodes.mediaInline;
81
81
 
82
- // Do nothing if no media found
83
- if (!mediaInline || !mediaState || collection === undefined) {
84
- return false;
85
- }
86
- var id = mediaState.id;
87
- var mediaInlineNode = mediaInline.create({
88
- id: id,
89
- collection: collection
90
- });
91
- var space = state.schema.text(' ');
92
- var pos = state.selection.$to.pos;
82
+ // Do nothing if no media found
83
+ if (!mediaInline || !mediaState || collection === undefined) {
84
+ return false;
85
+ }
86
+ var id = mediaState.id;
87
+ var mediaInlineNode = mediaInline.create({
88
+ id: id,
89
+ collection: collection
90
+ });
91
+ var space = state.schema.text(' ');
92
+ var pos = state.selection.$to.pos;
93
93
 
94
- // If the selection is inside an empty list item set pos inside paragraph
95
- if (isInListItem(state) && isInsidePotentialEmptyParagraph(state)) {
96
- pos = pos + 1;
97
- }
98
- var content = Fragment.from([mediaInlineNode, space]);
94
+ // If the selection is inside an empty list item set pos inside paragraph
95
+ if (isInListItem(state) && isInsidePotentialEmptyParagraph(state)) {
96
+ pos = pos + 1;
97
+ }
98
+ var content = Fragment.from([mediaInlineNode, space]);
99
99
 
100
- // Delete the selection if a selection is made
101
- var deleteRange = findDeleteRange(state);
102
- if (!deleteRange) {
103
- tr.insert(pos, content);
104
- } else {
105
- tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
106
- }
107
- addAnalytics(state, tr, getInsertMediaInlineAnalytics(mediaState, inputMethod));
108
- dispatch(tr);
109
- return true;
100
+ // Delete the selection if a selection is made
101
+ var deleteRange = findDeleteRange(state);
102
+ if (!deleteRange) {
103
+ tr.insert(pos, content);
104
+ } else {
105
+ tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
106
+ }
107
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getInsertMediaInlineAnalytics(mediaState, inputMethod))(tr);
108
+ dispatch(tr);
109
+ return true;
110
+ };
110
111
  };
111
112
 
112
113
  /**
@@ -116,51 +117,53 @@ export var insertMediaInlineNode = function insertMediaInlineNode(view, mediaSta
116
117
  * @param mediaStates Media files to be added to the editor
117
118
  * @param collection Collection for the media to be added
118
119
  */
119
- export var insertMediaGroupNode = function insertMediaGroupNode(view, mediaStates, collection, inputMethod) {
120
- var state = view.state,
121
- dispatch = view.dispatch;
122
- var tr = state.tr,
123
- schema = state.schema;
124
- var _schema$nodes = schema.nodes,
125
- media = _schema$nodes.media,
126
- paragraph = _schema$nodes.paragraph;
120
+ export var insertMediaGroupNode = function insertMediaGroupNode(editorAnalyticsAPI) {
121
+ return function (view, mediaStates, collection, inputMethod) {
122
+ var state = view.state,
123
+ dispatch = view.dispatch;
124
+ var tr = state.tr,
125
+ schema = state.schema;
126
+ var _schema$nodes = schema.nodes,
127
+ media = _schema$nodes.media,
128
+ paragraph = _schema$nodes.paragraph;
127
129
 
128
- // Do nothing if no media found
129
- if (!media || !mediaStates.length) {
130
- return;
131
- }
132
- var mediaNodes = createMediaFileNodes(mediaStates, collection, media);
133
- var mediaInsertPos = findMediaInsertPos(state);
134
- var resolvedInsertPos = tr.doc.resolve(mediaInsertPos);
135
- var parent = resolvedInsertPos.parent;
136
- var nodeAtInsertionPoint = tr.doc.nodeAt(mediaInsertPos);
137
- var shouldSplit = !isSelectionMediaGroup(state) && isSupportedInParent(state, Fragment.from(state.schema.nodes.mediaGroup.createChecked({}, mediaNodes)));
138
- var withParagraph = shouldAppendParagraph(state, nodeAtInsertionPoint);
139
- var content = parent.type === schema.nodes.mediaGroup ? mediaNodes // If parent is a mediaGroup do not wrap items again.
140
- : [schema.nodes.mediaGroup.createChecked({}, mediaNodes)];
141
- if (shouldSplit) {
142
- content = withParagraph ? content.concat(paragraph.create()) : content;
143
- // delete the selection or empty paragraph
144
- var deleteRange = findDeleteRange(state);
145
- if (!deleteRange) {
146
- tr.insert(mediaInsertPos, content);
147
- } else if (mediaInsertPos <= deleteRange.start) {
148
- tr.deleteRange(deleteRange.start, deleteRange.end).insert(mediaInsertPos, content);
149
- } else {
150
- tr.insert(mediaInsertPos, content).deleteRange(deleteRange.start, deleteRange.end);
130
+ // Do nothing if no media found
131
+ if (!media || !mediaStates.length) {
132
+ return;
133
+ }
134
+ var mediaNodes = createMediaFileNodes(mediaStates, collection, media);
135
+ var mediaInsertPos = findMediaInsertPos(state);
136
+ var resolvedInsertPos = tr.doc.resolve(mediaInsertPos);
137
+ var parent = resolvedInsertPos.parent;
138
+ var nodeAtInsertionPoint = tr.doc.nodeAt(mediaInsertPos);
139
+ var shouldSplit = !isSelectionMediaGroup(state) && isSupportedInParent(state, Fragment.from(state.schema.nodes.mediaGroup.createChecked({}, mediaNodes)));
140
+ var withParagraph = shouldAppendParagraph(state, nodeAtInsertionPoint);
141
+ var content = parent.type === schema.nodes.mediaGroup ? mediaNodes // If parent is a mediaGroup do not wrap items again.
142
+ : [schema.nodes.mediaGroup.createChecked({}, mediaNodes)];
143
+ if (shouldSplit) {
144
+ content = withParagraph ? content.concat(paragraph.create()) : content;
145
+ // delete the selection or empty paragraph
146
+ var deleteRange = findDeleteRange(state);
147
+ if (!deleteRange) {
148
+ tr.insert(mediaInsertPos, content);
149
+ } else if (mediaInsertPos <= deleteRange.start) {
150
+ tr.deleteRange(deleteRange.start, deleteRange.end).insert(mediaInsertPos, content);
151
+ } else {
152
+ tr.insert(mediaInsertPos, content).deleteRange(deleteRange.start, deleteRange.end);
153
+ }
154
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getInsertMediaGroupAnalytics(mediaStates, inputMethod))(tr);
155
+ dispatch(tr);
156
+ setSelectionAfterMediaInsertion(view);
157
+ return;
151
158
  }
152
- addAnalytics(state, tr, getInsertMediaGroupAnalytics(mediaStates, inputMethod));
153
- dispatch(tr);
154
- setSelectionAfterMediaInsertion(view);
155
- return;
156
- }
157
159
 
158
- // Don't append new paragraph when adding media to a existing mediaGroup
159
- if (withParagraph && parent.type !== schema.nodes.mediaGroup) {
160
- content.push(paragraph.create());
161
- }
162
- addAnalytics(state, tr, getInsertMediaGroupAnalytics(mediaStates, inputMethod));
163
- dispatch(safeInsert(Fragment.fromArray(content), mediaInsertPos)(tr));
160
+ // Don't append new paragraph when adding media to a existing mediaGroup
161
+ if (withParagraph && parent.type !== schema.nodes.mediaGroup) {
162
+ content.push(paragraph.create());
163
+ }
164
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getInsertMediaGroupAnalytics(mediaStates, inputMethod))(tr);
165
+ dispatch(safeInsert(Fragment.fromArray(content), mediaInsertPos)(tr));
166
+ };
164
167
  };
165
168
  var createMediaFileNodes = function createMediaFileNodes(mediaStates, collection, media) {
166
169
  var nodes = mediaStates.map(function (mediaState) {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.14.9";
2
+ export var version = "187.14.11";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.14.9",
3
+ "version": "187.14.11",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,5 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Command } from '../../../types';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  export declare const selectCaptionFromMediaSinglePos: (mediaSingleNodePos: number, mediaSingleNode: PMNode) => Command;
4
- export declare const insertAndSelectCaptionFromMediaSinglePos: (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
5
+ export declare const insertAndSelectCaptionFromMediaSinglePos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
@@ -1,10 +1,10 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { CommandDispatch } from '../../../types/command';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { INPUT_METHOD } from '../../analytics';
5
4
  import type { Command } from '../../../types';
5
+ import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
6
  export declare const showLinkingToolbar: import("@atlaskit/editor-common/types").Command;
7
7
  export declare const showLinkingToolbarWithMediaTypeCheck: Command;
8
8
  export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
9
- export declare const unlink: import("@atlaskit/editor-common/types").Command;
10
- export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const unlink: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
10
+ export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
@@ -1,4 +1,5 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { MediaOptions } from '../types';
3
- export declare function keymapPlugin(options?: MediaOptions): SafePlugin;
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export declare function keymapPlugin(options?: MediaOptions, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): SafePlugin;
4
5
  export default keymapPlugin;
@@ -65,7 +65,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
65
65
  *
66
66
  * called when we insert a new file via the picker (connected via pickerfacade)
67
67
  */
68
- insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
68
+ insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin> | undefined) => void;
69
69
  addPendingTask: (task: Promise<any>) => void;
70
70
  splitMediaGroup: () => boolean;
71
71
  onPopupPickerClose: () => void;
@@ -1,9 +1,10 @@
1
1
  import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
2
  import type { Command } from '../../../types';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  export declare const DEFAULT_BORDER_COLOR = "#091e4224";
4
5
  export declare const DEFAULT_BORDER_SIZE = 2;
5
- export declare const changeInlineToMediaCard: Command;
6
- export declare const changeMediaCardToInline: Command;
6
+ export declare const changeInlineToMediaCard: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
7
+ export declare const changeMediaCardToInline: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
7
8
  export declare const removeInlineCard: Command;
8
- export declare const toggleBorderMark: Command;
9
- export declare const setBorderMark: (attrs: Partial<BorderMarkAttributes>) => Command;
9
+ export declare const toggleBorderMark: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
10
+ export declare const setBorderMark: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
@@ -2,6 +2,7 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { MediaState } from '../types';
4
4
  import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
5
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
6
  export interface Range {
6
7
  start: number;
7
8
  end: number;
@@ -13,7 +14,7 @@ export declare const canInsertMediaInline: (state: EditorState) => boolean;
13
14
  * @param mediaState Media file to be added to the editor
14
15
  * @param collection Collection for the media to be added
15
16
  */
16
- export declare const insertMediaInlineNode: (view: EditorView, mediaState: MediaState, collection: string, inputMethod?: InputMethodInsertMedia) => boolean;
17
+ export declare const insertMediaInlineNode: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaState: MediaState, collection: string, inputMethod?: InputMethodInsertMedia) => boolean;
17
18
  /**
18
19
  * Insert a media into an existing media group
19
20
  * or create a new media group to insert the new media.
@@ -21,7 +22,7 @@ export declare const insertMediaInlineNode: (view: EditorView, mediaState: Media
21
22
  * @param mediaStates Media files to be added to the editor
22
23
  * @param collection Collection for the media to be added
23
24
  */
24
- export declare const insertMediaGroupNode: (view: EditorView, mediaStates: MediaState[], collection: string, inputMethod?: InputMethodInsertMedia) => void;
25
+ export declare const insertMediaGroupNode: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaStates: MediaState[], collection: string, inputMethod?: InputMethodInsertMedia) => void;
25
26
  /**
26
27
  * Return position of media to be inserted, if it is inside a list
27
28
  * @param content Content to be inserted
@@ -1,4 +1,5 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Command } from '../../../types';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  export declare const selectCaptionFromMediaSinglePos: (mediaSingleNodePos: number, mediaSingleNode: PMNode) => Command;
4
- export declare const insertAndSelectCaptionFromMediaSinglePos: (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
5
+ export declare const insertAndSelectCaptionFromMediaSinglePos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
@@ -1,10 +1,10 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { CommandDispatch } from '../../../types/command';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { INPUT_METHOD } from '../../analytics';
5
4
  import type { Command } from '../../../types';
5
+ import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
6
  export declare const showLinkingToolbar: import("@atlaskit/editor-common/types").Command;
7
7
  export declare const showLinkingToolbarWithMediaTypeCheck: Command;
8
8
  export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
9
- export declare const unlink: import("@atlaskit/editor-common/types").Command;
10
- export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const unlink: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
10
+ export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
@@ -1,4 +1,5 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { MediaOptions } from '../types';
3
- export declare function keymapPlugin(options?: MediaOptions): SafePlugin;
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ export declare function keymapPlugin(options?: MediaOptions, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined): SafePlugin;
4
5
  export default keymapPlugin;
@@ -65,7 +65,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
65
65
  *
66
66
  * called when we insert a new file via the picker (connected via pickerfacade)
67
67
  */
68
- insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
68
+ insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string, pluginInjectionApi?: ExtractInjectionAPI<typeof mediaPlugin> | undefined) => void;
69
69
  addPendingTask: (task: Promise<any>) => void;
70
70
  splitMediaGroup: () => boolean;
71
71
  onPopupPickerClose: () => void;
@@ -1,9 +1,10 @@
1
1
  import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
2
  import type { Command } from '../../../types';
3
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
4
  export declare const DEFAULT_BORDER_COLOR = "#091e4224";
4
5
  export declare const DEFAULT_BORDER_SIZE = 2;
5
- export declare const changeInlineToMediaCard: Command;
6
- export declare const changeMediaCardToInline: Command;
6
+ export declare const changeInlineToMediaCard: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
7
+ export declare const changeMediaCardToInline: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
7
8
  export declare const removeInlineCard: Command;
8
- export declare const toggleBorderMark: Command;
9
- export declare const setBorderMark: (attrs: Partial<BorderMarkAttributes>) => Command;
9
+ export declare const toggleBorderMark: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Command;
10
+ export declare const setBorderMark: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
@@ -2,6 +2,7 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { MediaState } from '../types';
4
4
  import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
5
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
6
  export interface Range {
6
7
  start: number;
7
8
  end: number;
@@ -13,7 +14,7 @@ export declare const canInsertMediaInline: (state: EditorState) => boolean;
13
14
  * @param mediaState Media file to be added to the editor
14
15
  * @param collection Collection for the media to be added
15
16
  */
16
- export declare const insertMediaInlineNode: (view: EditorView, mediaState: MediaState, collection: string, inputMethod?: InputMethodInsertMedia) => boolean;
17
+ export declare const insertMediaInlineNode: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaState: MediaState, collection: string, inputMethod?: InputMethodInsertMedia) => boolean;
17
18
  /**
18
19
  * Insert a media into an existing media group
19
20
  * or create a new media group to insert the new media.
@@ -21,7 +22,7 @@ export declare const insertMediaInlineNode: (view: EditorView, mediaState: Media
21
22
  * @param mediaStates Media files to be added to the editor
22
23
  * @param collection Collection for the media to be added
23
24
  */
24
- export declare const insertMediaGroupNode: (view: EditorView, mediaStates: MediaState[], collection: string, inputMethod?: InputMethodInsertMedia) => void;
25
+ export declare const insertMediaGroupNode: (editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaStates: MediaState[], collection: string, inputMethod?: InputMethodInsertMedia) => void;
25
26
  /**
26
27
  * Return position of media to be inserted, if it is inside a list
27
28
  * @param content Content to be inserted
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.14.9",
3
+ "version": "187.14.11",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/code": "^14.6.0",
56
56
  "@atlaskit/date": "^0.10.0",
57
57
  "@atlaskit/datetime-picker": "^12.7.0",
58
- "@atlaskit/editor-common": "^74.39.0",
58
+ "@atlaskit/editor-common": "^74.40.0",
59
59
  "@atlaskit/editor-json-transformer": "^8.10.0",
60
60
  "@atlaskit/editor-markdown-transformer": "^5.2.5",
61
61
  "@atlaskit/editor-palette": "1.5.1",
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/editor-plugin-grid": "^0.1.0",
71
71
  "@atlaskit/editor-plugin-guideline": "^0.3.4",
72
72
  "@atlaskit/editor-plugin-hyperlink": "^0.3.0",
73
- "@atlaskit/editor-plugin-table": "^2.6.0",
73
+ "@atlaskit/editor-plugin-table": "^2.7.0",
74
74
  "@atlaskit/editor-plugin-width": "^0.1.0",
75
75
  "@atlaskit/editor-prosemirror": "1.0.2",
76
76
  "@atlaskit/editor-shared-styles": "^2.6.0",
@@ -143,7 +143,7 @@
143
143
  "@atlaskit/collab-provider": "9.9.0",
144
144
  "@atlaskit/dropdown-menu": "^11.11.0",
145
145
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
146
- "@atlaskit/editor-plugin-table": "^2.6.0",
146
+ "@atlaskit/editor-plugin-table": "^2.7.0",
147
147
  "@atlaskit/editor-test-helpers": "^18.10.0",
148
148
  "@atlaskit/flag": "^15.2.0",
149
149
  "@atlaskit/icon-object": "^6.3.0",