@atlaskit/editor-core 188.0.12 → 188.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/labs/next/presets/universal.js +2 -1
  3. package/dist/cjs/plugins/annotation/toolbar.js +5 -23
  4. package/dist/cjs/plugins/code-block/index.js +3 -3
  5. package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +2 -2
  6. package/dist/cjs/plugins/index.js +0 -7
  7. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +4 -4
  8. package/dist/cjs/plugins/media/index.js +12 -6
  9. package/dist/cjs/plugins/media/utils/media-common.js +7 -109
  10. package/dist/cjs/plugins/media/utils/media-single.js +7 -68
  11. package/dist/cjs/plugins/panel/index.js +13 -13
  12. package/dist/cjs/plugins/paste/handlers.js +4 -4
  13. package/dist/cjs/plugins/paste/plugins/media.js +181 -0
  14. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +2 -2
  15. package/dist/cjs/plugins/paste/pm-plugins/main.js +6 -7
  16. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +3 -3
  17. package/dist/cjs/ui/Alignment/index.js +1 -1
  18. package/dist/cjs/ui/WithHelpTrigger/index.js +3 -7
  19. package/dist/cjs/version-wrapper.js +1 -1
  20. package/dist/es2019/labs/next/presets/universal.js +2 -1
  21. package/dist/es2019/plugins/annotation/toolbar.js +2 -18
  22. package/dist/es2019/plugins/code-block/index.js +3 -3
  23. package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
  24. package/dist/es2019/plugins/index.js +0 -1
  25. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  26. package/dist/es2019/plugins/media/index.js +13 -6
  27. package/dist/es2019/plugins/media/utils/media-common.js +2 -107
  28. package/dist/es2019/plugins/media/utils/media-single.js +6 -72
  29. package/dist/es2019/plugins/panel/index.js +13 -13
  30. package/dist/es2019/plugins/paste/handlers.js +4 -4
  31. package/dist/es2019/plugins/paste/plugins/media.js +176 -0
  32. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  33. package/dist/es2019/plugins/paste/pm-plugins/main.js +3 -4
  34. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +3 -3
  35. package/dist/es2019/ui/Alignment/index.js +1 -1
  36. package/dist/es2019/ui/WithHelpTrigger/index.js +2 -7
  37. package/dist/es2019/version-wrapper.js +1 -1
  38. package/dist/esm/labs/next/presets/universal.js +2 -1
  39. package/dist/esm/plugins/annotation/toolbar.js +2 -18
  40. package/dist/esm/plugins/code-block/index.js +3 -3
  41. package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
  42. package/dist/esm/plugins/index.js +0 -1
  43. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
  44. package/dist/esm/plugins/media/index.js +13 -6
  45. package/dist/esm/plugins/media/utils/media-common.js +2 -106
  46. package/dist/esm/plugins/media/utils/media-single.js +6 -66
  47. package/dist/esm/plugins/panel/index.js +13 -13
  48. package/dist/esm/plugins/paste/handlers.js +4 -4
  49. package/dist/esm/plugins/paste/plugins/media.js +172 -0
  50. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  51. package/dist/esm/plugins/paste/pm-plugins/main.js +3 -4
  52. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +3 -3
  53. package/dist/esm/ui/Alignment/index.js +1 -1
  54. package/dist/esm/ui/WithHelpTrigger/index.js +2 -7
  55. package/dist/esm/version-wrapper.js +1 -1
  56. package/dist/types/labs/next/presets/default.d.ts +6 -0
  57. package/dist/types/plugins/annotation/toolbar.d.ts +0 -17
  58. package/dist/types/plugins/index.d.ts +0 -1
  59. package/dist/types/plugins/media/next-plugin-type.d.ts +4 -0
  60. package/dist/types/plugins/media/utils/media-common.d.ts +2 -10
  61. package/dist/types/plugins/media/utils/media-single.d.ts +2 -4
  62. package/dist/types/plugins/paste/handlers.d.ts +2 -2
  63. package/dist/types/plugins/paste/index.d.ts +5 -2
  64. package/dist/types/plugins/paste/plugins/media.d.ts +12 -0
  65. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -2
  66. package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -2
  67. package/dist/types/ui/Alignment/index.d.ts +2 -2
  68. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  69. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  70. package/dist/types/ui/WithHelpTrigger/index.d.ts +0 -4
  71. package/dist/types-ts4.5/labs/next/presets/default.d.ts +6 -0
  72. package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +0 -17
  73. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  74. package/dist/types-ts4.5/plugins/media/next-plugin-type.d.ts +4 -0
  75. package/dist/types-ts4.5/plugins/media/utils/media-common.d.ts +2 -10
  76. package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +2 -4
  77. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -2
  78. package/dist/types-ts4.5/plugins/paste/index.d.ts +5 -2
  79. package/dist/types-ts4.5/plugins/paste/plugins/media.d.ts +12 -0
  80. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +2 -2
  81. package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +2 -2
  82. package/dist/types-ts4.5/ui/Alignment/index.d.ts +2 -2
  83. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  84. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  85. package/dist/types-ts4.5/ui/WithHelpTrigger/index.d.ts +0 -4
  86. package/package.json +8 -7
  87. package/report.api.md +1 -1
  88. package/tmp/api-report-tmp.d.ts +1 -1
  89. package/dist/cjs/plugins/help-dialog/commands.js +0 -19
  90. package/dist/cjs/plugins/help-dialog/index.js +0 -138
  91. package/dist/cjs/plugins/help-dialog/plugin-key.js +0 -8
  92. package/dist/cjs/plugins/help-dialog/ui/HelpDialogLoader.js +0 -24
  93. package/dist/cjs/plugins/help-dialog/ui/index.js +0 -568
  94. package/dist/cjs/plugins/help-dialog/ui/styles.js +0 -50
  95. package/dist/cjs/plugins/undo-redo/messages.js +0 -19
  96. package/dist/cjs/ui/Alignment/messages.js +0 -24
  97. package/dist/es2019/plugins/help-dialog/commands.js +0 -13
  98. package/dist/es2019/plugins/help-dialog/index.js +0 -125
  99. package/dist/es2019/plugins/help-dialog/plugin-key.js +0 -2
  100. package/dist/es2019/plugins/help-dialog/ui/HelpDialogLoader.js +0 -6
  101. package/dist/es2019/plugins/help-dialog/ui/index.js +0 -446
  102. package/dist/es2019/plugins/help-dialog/ui/styles.js +0 -110
  103. package/dist/es2019/plugins/undo-redo/messages.js +0 -13
  104. package/dist/es2019/ui/Alignment/messages.js +0 -18
  105. package/dist/esm/plugins/help-dialog/commands.js +0 -13
  106. package/dist/esm/plugins/help-dialog/index.js +0 -130
  107. package/dist/esm/plugins/help-dialog/plugin-key.js +0 -2
  108. package/dist/esm/plugins/help-dialog/ui/HelpDialogLoader.js +0 -12
  109. package/dist/esm/plugins/help-dialog/ui/index.js +0 -557
  110. package/dist/esm/plugins/help-dialog/ui/styles.js +0 -40
  111. package/dist/esm/plugins/undo-redo/messages.js +0 -13
  112. package/dist/esm/ui/Alignment/messages.js +0 -18
  113. package/dist/types/plugins/help-dialog/commands.d.ts +0 -3
  114. package/dist/types/plugins/help-dialog/index.d.ts +0 -18
  115. package/dist/types/plugins/help-dialog/plugin-key.d.ts +0 -2
  116. package/dist/types/plugins/help-dialog/ui/HelpDialogLoader.d.ts +0 -4
  117. package/dist/types/plugins/help-dialog/ui/index.d.ts +0 -27
  118. package/dist/types/plugins/help-dialog/ui/styles.d.ts +0 -33
  119. package/dist/types/plugins/undo-redo/messages.d.ts +0 -12
  120. package/dist/types/ui/Alignment/messages.d.ts +0 -17
  121. package/dist/types-ts4.5/plugins/help-dialog/commands.d.ts +0 -3
  122. package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +0 -18
  123. package/dist/types-ts4.5/plugins/help-dialog/plugin-key.d.ts +0 -2
  124. package/dist/types-ts4.5/plugins/help-dialog/ui/HelpDialogLoader.d.ts +0 -4
  125. package/dist/types-ts4.5/plugins/help-dialog/ui/index.d.ts +0 -27
  126. package/dist/types-ts4.5/plugins/help-dialog/ui/styles.d.ts +0 -33
  127. package/dist/types-ts4.5/plugins/undo-redo/messages.d.ts +0 -12
  128. package/dist/types-ts4.5/ui/Alignment/messages.d.ts +0 -17
@@ -1,14 +1,13 @@
1
+ import { getMaxWidthForNestedNodeNext, getMediaSingleInitialWidth, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
2
+ import { checkNodeDown, isEmptyParagraph } from '@atlaskit/editor-common/utils';
1
3
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import { safeInsert as pmSafeInsert, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
3
- import { checkNodeDown, isEmptyParagraph, mapSlice } from '@atlaskit/editor-common/utils';
4
- import { getMediaSingleInitialWidth, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
5
- import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
6
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
4
+ import { safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
5
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
7
6
  import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
8
- import { isImage } from './is-image';
7
+ import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
9
8
  import { atTheBeginningOfBlock } from '@atlaskit/editor-common/selection';
10
- import { getRandomHex } from '@atlaskit/media-common';
11
9
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
+ import { isImage } from './is-image';
12
11
  const getInsertMediaAnalytics = (inputMethod, fileExtension) => ({
13
12
  action: ACTION.INSERTED,
14
13
  actionSubject: ACTION_SUBJECT.DOCUMENT,
@@ -164,71 +163,6 @@ export const createMediaSingleNode = (schema, collection, maxWidth, minWidth, al
164
163
  copyOptionalAttrsFromMediaState(mediaState, mediaNode);
165
164
  return mediaSingle.createChecked(extendedMediaSingleAttrs, mediaNode);
166
165
  };
167
- export function transformSliceForMedia(slice, schema) {
168
- const {
169
- mediaSingle,
170
- layoutSection,
171
- table,
172
- bulletList,
173
- orderedList,
174
- media,
175
- mediaInline,
176
- expand,
177
- nestedExpand
178
- } = schema.nodes;
179
- return selection => {
180
- let newSlice = slice;
181
- if (hasParentNodeOfType([layoutSection, table, bulletList, orderedList, expand, nestedExpand])(selection)) {
182
- newSlice = mapSlice(newSlice, node => {
183
- const extendedOrLegacyAttrs = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
184
- layout: node.attrs.layout,
185
- widthType: node.attrs.widthType,
186
- width: node.attrs.width
187
- } : {
188
- layout: node.attrs.layout
189
- };
190
- let attrs = {};
191
- if (hasParentNodeOfType([layoutSection, table])(selection)) {
192
- // Supports layouts
193
- attrs = {
194
- ...extendedOrLegacyAttrs
195
- };
196
- } else if (hasParentNodeOfType([bulletList, orderedList, expand, nestedExpand])(selection)) {
197
- // does not support other layouts
198
- attrs = {
199
- ...extendedOrLegacyAttrs,
200
- layout: 'center'
201
- };
202
- }
203
- return node.type.name === 'mediaSingle' ? mediaSingle.createChecked(attrs, node.content, node.marks) : node;
204
- });
205
- }
206
- const __mediaTraceId = getRandomHex(8);
207
- newSlice = mapSlice(newSlice, node => {
208
- // This logic is duplicated in editor-plugin-ai where external images can be inserted
209
- // from external sources through the use of AI. The editor-plugin-ai package is avoiding
210
- // sharing dependencies with editor-core to support products using it with various versions
211
- // of editor packages.
212
- // The duplication is in the following file:
213
- // packages/editor/editor-plugin-ai/src/prebuilt/content-transformers/markdown-to-pm/markdown-transformer.ts
214
- if (node.type.name === 'media') {
215
- return media.createChecked({
216
- ...node.attrs,
217
- __external: node.attrs.type === 'external',
218
- __mediaTraceId: node.attrs.type === 'external' ? null : __mediaTraceId
219
- }, node.content, node.marks);
220
- }
221
- if (node.type.name === 'mediaInline') {
222
- return mediaInline.createChecked({
223
- ...node.attrs,
224
- __mediaTraceId
225
- }, node.content, node.marks);
226
- }
227
- return node;
228
- });
229
- return newSlice;
230
- };
231
- }
232
166
  export function isCaptionNode(editorView) {
233
167
  const {
234
168
  $from
@@ -6,7 +6,7 @@ import keymap from './pm-plugins/keymaps';
6
6
  import { addAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '../analytics';
7
7
  import { IconPanel, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanelError } from '@atlaskit/editor-common/quick-insert';
8
8
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
9
- import { messages } from '@atlaskit/editor-plugin-block-type/messages';
9
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
10
10
  import { IconCustomPanel } from '@atlaskit/editor-common/quick-insert';
11
11
  import { T50 } from '@atlaskit/theme/colors';
12
12
  import { insertPanelWithAnalytics } from './actions';
@@ -46,9 +46,9 @@ const panelPlugin = ({
46
46
  }) => {
47
47
  let quickInsertOptions = [{
48
48
  id: 'infopanel',
49
- title: formatMessage(messages.infoPanel),
49
+ title: formatMessage(blockTypeMessages.infoPanel),
50
50
  keywords: ['panel'],
51
- description: formatMessage(messages.infoPanelDescription),
51
+ description: formatMessage(blockTypeMessages.infoPanelDescription),
52
52
  priority: 800,
53
53
  icon: () => /*#__PURE__*/React.createElement(IconPanel, null),
54
54
  action(insert, state) {
@@ -61,8 +61,8 @@ const panelPlugin = ({
61
61
  }
62
62
  }, {
63
63
  id: 'notepanel',
64
- title: formatMessage(messages.notePanel),
65
- description: formatMessage(messages.notePanelDescription),
64
+ title: formatMessage(blockTypeMessages.notePanel),
65
+ description: formatMessage(blockTypeMessages.notePanelDescription),
66
66
  priority: 1000,
67
67
  icon: () => /*#__PURE__*/React.createElement(IconPanelNote, null),
68
68
  action(insert, state) {
@@ -75,8 +75,8 @@ const panelPlugin = ({
75
75
  }
76
76
  }, {
77
77
  id: 'successpanel',
78
- title: formatMessage(messages.successPanel),
79
- description: formatMessage(messages.successPanelDescription),
78
+ title: formatMessage(blockTypeMessages.successPanel),
79
+ description: formatMessage(blockTypeMessages.successPanelDescription),
80
80
  keywords: ['tip'],
81
81
  priority: 1000,
82
82
  icon: () => /*#__PURE__*/React.createElement(IconPanelSuccess, null),
@@ -90,8 +90,8 @@ const panelPlugin = ({
90
90
  }
91
91
  }, {
92
92
  id: 'warningpanel',
93
- title: formatMessage(messages.warningPanel),
94
- description: formatMessage(messages.warningPanelDescription),
93
+ title: formatMessage(blockTypeMessages.warningPanel),
94
+ description: formatMessage(blockTypeMessages.warningPanelDescription),
95
95
  priority: 1000,
96
96
  icon: () => /*#__PURE__*/React.createElement(IconPanelWarning, null),
97
97
  action(insert, state) {
@@ -104,8 +104,8 @@ const panelPlugin = ({
104
104
  }
105
105
  }, {
106
106
  id: 'errorpanel',
107
- title: formatMessage(messages.errorPanel),
108
- description: formatMessage(messages.errorPanelDescription),
107
+ title: formatMessage(blockTypeMessages.errorPanel),
108
+ description: formatMessage(blockTypeMessages.errorPanelDescription),
109
109
  priority: 1000,
110
110
  icon: () => /*#__PURE__*/React.createElement(IconPanelError, null),
111
111
  action(insert, state) {
@@ -120,8 +120,8 @@ const panelPlugin = ({
120
120
  if (options.allowCustomPanel && options.allowCustomPanelEdit) {
121
121
  quickInsertOptions.push({
122
122
  id: 'custompanel',
123
- title: formatMessage(messages.customPanel),
124
- description: formatMessage(messages.customPanelDescription),
123
+ title: formatMessage(blockTypeMessages.customPanel),
124
+ description: formatMessage(blockTypeMessages.customPanelDescription),
125
125
  priority: 1000,
126
126
  icon: () => /*#__PURE__*/React.createElement(IconCustomPanel, null),
127
127
  action(insert, state) {
@@ -6,10 +6,9 @@ import uuid from 'uuid/v4';
6
6
  import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
7
7
  import { compose, insideTable, isParagraph, isText, isLinkMark, insideTableCell, isInListItem } from '../../utils';
8
8
  import { mapSlice } from '../../utils/slice';
9
- import { INPUT_METHOD } from '../analytics';
9
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
10
10
  import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
11
11
  import { runMacroAutoConvert } from '../macro';
12
- import { insertMediaAsMediaSingle } from '../media/utils/media-single';
13
12
  import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
14
13
  import { linkifyContent, isListItemNode, isListNode, canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
15
14
  import { insertSliceForLists } from './edge-cases';
@@ -555,12 +554,13 @@ function isOnlyMediaSingle(state, slice) {
555
554
  } = state.schema.nodes;
556
555
  return mediaSingle && slice.content.childCount === 1 && slice.content.firstChild.type === mediaSingle;
557
556
  }
558
- export function handleMediaSingle(inputMethod, editorAnalyticsAPI) {
557
+ export function handleMediaSingle(inputMethod, insertMediaAsMediaSingle) {
559
558
  return function (slice) {
560
559
  return (state, dispatch, view) => {
561
560
  if (view) {
562
561
  if (isOnlyMedia(state, slice)) {
563
- return insertMediaAsMediaSingle(view, slice.content.firstChild, inputMethod, editorAnalyticsAPI);
562
+ var _insertMediaAsMediaSi;
563
+ return (_insertMediaAsMediaSi = insertMediaAsMediaSingle === null || insertMediaAsMediaSingle === void 0 ? void 0 : insertMediaAsMediaSingle(view, slice.content.firstChild, inputMethod)) !== null && _insertMediaAsMediaSi !== void 0 ? _insertMediaAsMediaSi : false;
564
564
  }
565
565
  if (insideTable(state) && isOnlyMediaSingle(state, slice)) {
566
566
  const tr = state.tr.replaceSelection(slice);
@@ -0,0 +1,176 @@
1
+ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
+ import { mapSlice, unwrap, removeNestedEmptyEls, walkUpTreeUntil } from '@atlaskit/editor-common/utils';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
+ import { getRandomHex } from '@atlaskit/media-common';
5
+ export function transformSliceForMedia(slice, schema) {
6
+ const {
7
+ mediaSingle,
8
+ layoutSection,
9
+ table,
10
+ bulletList,
11
+ orderedList,
12
+ media,
13
+ mediaInline,
14
+ expand,
15
+ nestedExpand
16
+ } = schema.nodes;
17
+ return selection => {
18
+ let newSlice = slice;
19
+ if (hasParentNodeOfType([layoutSection, table, bulletList, orderedList, expand, nestedExpand])(selection)) {
20
+ newSlice = mapSlice(newSlice, node => {
21
+ const extendedOrLegacyAttrs = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
22
+ layout: node.attrs.layout,
23
+ widthType: node.attrs.widthType,
24
+ width: node.attrs.width
25
+ } : {
26
+ layout: node.attrs.layout
27
+ };
28
+ let attrs = {};
29
+ if (hasParentNodeOfType([layoutSection, table])(selection)) {
30
+ // Supports layouts
31
+ attrs = {
32
+ ...extendedOrLegacyAttrs
33
+ };
34
+ } else if (hasParentNodeOfType([bulletList, orderedList, expand, nestedExpand])(selection)) {
35
+ // does not support other layouts
36
+ attrs = {
37
+ ...extendedOrLegacyAttrs,
38
+ layout: 'center'
39
+ };
40
+ }
41
+ return node.type.name === 'mediaSingle' ? mediaSingle.createChecked(attrs, node.content, node.marks) : node;
42
+ });
43
+ }
44
+ const __mediaTraceId = getRandomHex(8);
45
+ newSlice = mapSlice(newSlice, node => {
46
+ // This logic is duplicated in editor-plugin-ai where external images can be inserted
47
+ // from external sources through the use of AI. The editor-plugin-ai package is avoiding
48
+ // sharing dependencies with editor-core to support products using it with various versions
49
+ // of editor packages.
50
+ // The duplication is in the following file:
51
+ // packages/editor/editor-plugin-ai/src/prebuilt/content-transformers/markdown-to-pm/markdown-transformer.ts
52
+ if (node.type.name === 'media') {
53
+ return media.createChecked({
54
+ ...node.attrs,
55
+ __external: node.attrs.type === 'external',
56
+ __mediaTraceId: node.attrs.type === 'external' ? null : __mediaTraceId
57
+ }, node.content, node.marks);
58
+ }
59
+ if (node.type.name === 'mediaInline') {
60
+ return mediaInline.createChecked({
61
+ ...node.attrs,
62
+ __mediaTraceId
63
+ }, node.content, node.marks);
64
+ }
65
+ return node;
66
+ });
67
+ return newSlice;
68
+ };
69
+ }
70
+
71
+ // TODO move this to editor-common
72
+ export const isImage = fileType => {
73
+ return !!fileType && (fileType.indexOf('image/') > -1 || fileType.indexOf('video/') > -1);
74
+ };
75
+ export const transformSliceToCorrectMediaWrapper = (slice, schema) => {
76
+ const {
77
+ mediaGroup,
78
+ mediaSingle,
79
+ media
80
+ } = schema.nodes;
81
+ return mapSlice(slice, (node, parent) => {
82
+ if (!parent && node.type === media) {
83
+ if (mediaSingle && (isImage(node.attrs.__fileMimeType) || node.attrs.type === 'external')) {
84
+ return mediaSingle.createChecked({}, node);
85
+ } else {
86
+ return mediaGroup.createChecked({}, [node]);
87
+ }
88
+ }
89
+ return node;
90
+ });
91
+ };
92
+
93
+ /**
94
+ * Check base styles to see if an element will be invisible when rendered in a document.
95
+ * @param element
96
+ */
97
+ const isElementInvisible = element => {
98
+ return element.style.opacity === '0' || element.style.display === 'none' || element.style.visibility === 'hidden';
99
+ };
100
+ const VALID_TAGS_CONTAINER = ['DIV', 'TD'];
101
+ function canContainImage(element) {
102
+ if (!element) {
103
+ return false;
104
+ }
105
+ return VALID_TAGS_CONTAINER.indexOf(element.tagName) !== -1;
106
+ }
107
+
108
+ /**
109
+ * Given a html string, we attempt to hoist any nested `<img>` tags,
110
+ * not directly wrapped by a `<div>` as ProseMirror no-op's
111
+ * on those scenarios.
112
+ * @param html
113
+ */
114
+ export const unwrapNestedMediaElements = html => {
115
+ const parser = new DOMParser();
116
+ let doc = parser.parseFromString(html, 'text/html');
117
+ const wrapper = doc.body;
118
+
119
+ // Remove Google Doc's wrapper <b> el
120
+ const docsWrapper = wrapper.querySelector('b[id^="docs-internal-guid-"]');
121
+ if (docsWrapper) {
122
+ unwrap(wrapper, docsWrapper);
123
+ }
124
+ const imageTags = wrapper.querySelectorAll('img');
125
+ if (!imageTags.length) {
126
+ return html;
127
+ }
128
+ imageTags.forEach(imageTag => {
129
+ // Capture the immediate parent, we may remove the media from here later.
130
+ const mediaParent = imageTag.parentElement;
131
+ if (!mediaParent) {
132
+ return;
133
+ }
134
+
135
+ // If either the parent or the image itself contains styles that would make
136
+ // them invisible on copy, dont paste them.
137
+ if (isElementInvisible(mediaParent) || isElementInvisible(imageTag)) {
138
+ mediaParent.removeChild(imageTag);
139
+ return;
140
+ }
141
+
142
+ // If its wrapped by a valid container we assume its safe to bypass.
143
+ // ProseMirror should handle these cases properly.
144
+ if (canContainImage(mediaParent) || mediaParent instanceof HTMLSpanElement && mediaParent.closest('[class*="emoji-common"]')) {
145
+ return;
146
+ }
147
+
148
+ // Find the top most element that the parent has a valid container for the image.
149
+ // Stop just before found the wrapper
150
+ const insertBeforeElement = walkUpTreeUntil(mediaParent, element => {
151
+ // If is at the top just use this element as reference
152
+ if (element.parentElement === wrapper) {
153
+ return true;
154
+ }
155
+ return canContainImage(element.parentElement);
156
+ });
157
+
158
+ // Here we try to insert the media right after its top most valid parent element
159
+ // Unless its the last element in our structure then we will insert above it.
160
+ if (insertBeforeElement && insertBeforeElement.parentElement) {
161
+ // Insert as close as possible to the most closest valid element index in the tree.
162
+ insertBeforeElement.parentElement.insertBefore(imageTag, insertBeforeElement.nextElementSibling || insertBeforeElement);
163
+
164
+ // Attempt to clean up lines left behind by the image
165
+ mediaParent.innerText = mediaParent.innerText.trim();
166
+ // Walk up and delete empty elements left over after removing the image tag
167
+ removeNestedEmptyEls(mediaParent);
168
+ }
169
+ });
170
+
171
+ // If last child is a hardbreak we don't want it
172
+ if (wrapper.lastElementChild && wrapper.lastElementChild.tagName === 'BR') {
173
+ wrapper.removeChild(wrapper.lastElementChild);
174
+ }
175
+ return wrapper.innerHTML;
176
+ };
@@ -238,9 +238,9 @@ export const handlePasteIntoCaptionWithAnalytics = (view, event, slice, type) =>
238
238
  export const handleCodeBlockWithAnalytics = (view, event, slice, text) => injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
239
239
  type: PasteTypes.plain
240
240
  }))(handleCodeBlock(text));
241
- export const handleMediaSingleWithAnalytics = (view, event, slice, type, editorAnalyticsAPI) => injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
241
+ export const handleMediaSingleWithAnalytics = (view, event, slice, type, insertMediaAsMediaSingle) => injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
242
242
  type
243
- }))(handleMediaSingle(INPUT_METHOD.CLIPBOARD, editorAnalyticsAPI)(slice));
243
+ }))(handleMediaSingle(INPUT_METHOD.CLIPBOARD, insertMediaAsMediaSingle)(slice));
244
244
  export const handlePastePreservingMarksWithAnalytics = (view, event, slice, type, pluginInjectionApi) => {
245
245
  var _pluginInjectionApi$c3, _pluginInjectionApi$c4;
246
246
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
@@ -6,7 +6,7 @@ import { addLinkMetadata } from '@atlaskit/editor-common/card';
6
6
  import { mapChildren } from '../../../utils/slice';
7
7
  import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
8
8
  import { isPastedFile as isPastedFileFromEvent } from '@atlaskit/editor-common/paste';
9
- import { transformSliceForMedia } from '../../media/utils/media-single';
9
+ import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../plugins/media';
10
10
  import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
11
11
  import { linkifyContent } from '@atlaskit/editor-common/utils';
12
12
  import { transformSliceNestedExpandToExpand } from '../../expand/utils';
@@ -16,7 +16,6 @@ import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextW
16
16
  import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../analytics';
17
17
  import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
18
18
  import { measureRender } from '@atlaskit/editor-common/utils';
19
- import { transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../../media/utils/media-common';
20
19
  import { upgradeTextToLists, splitParagraphs } from '../commands';
21
20
  import { md } from '@atlaskit/editor-common/paste';
22
21
  import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
@@ -77,7 +76,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
77
76
  }
78
77
  },
79
78
  handlePaste(view, rawEvent, slice) {
80
- var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$a;
79
+ var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
81
80
  const event = rawEvent;
82
81
  if (!event.clipboardData) {
83
82
  return false;
@@ -246,7 +245,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
246
245
  if (handleCodeBlockWithAnalytics(view, event, slice, text)(state, dispatch)) {
247
246
  return true;
248
247
  }
249
- if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch, view)) {
248
+ if (handleMediaSingleWithAnalytics(view, event, slice, isPastedFile ? PasteTypes.binary : PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.media) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.actions.insertMediaAsMediaSingle)(state, dispatch, view)) {
250
249
  return true;
251
250
  }
252
251
  if (handleSelectedTableWithAnalytics(view, event, slice)(state, dispatch)) {
@@ -7,7 +7,7 @@ import RedoIcon from '@atlaskit/icon/glyph/redo';
7
7
  import { undo as undoKeymap, redo as redoKeymap, ToolTipContent, tooltip } from '../../../../keymaps';
8
8
  import { separatorStyles, buttonGroupStyle } from '@atlaskit/editor-common/styles';
9
9
  import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
10
- import { messages } from '../../messages';
10
+ import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
11
  import { createTypeAheadTools } from '../../../type-ahead/api';
12
12
  import { undoFromToolbar, redoFromToolbar } from '../../commands';
13
13
  import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
@@ -48,8 +48,8 @@ export class ToolbarUndoRedo extends PureComponent {
48
48
  const handleRedo = () => {
49
49
  forceFocus(editorView)(redoFromToolbar);
50
50
  };
51
- const labelUndo = formatMessage(messages.undo);
52
- const labelRedo = formatMessage(messages.redo);
51
+ const labelUndo = formatMessage(undoRedoMessages.undo);
52
+ const labelRedo = formatMessage(undoRedoMessages.redo);
53
53
  const {
54
54
  canUndo,
55
55
  canRedo
@@ -4,7 +4,7 @@ import { PureComponent } from 'react';
4
4
  import { injectIntl } from 'react-intl-next';
5
5
  import { IconMap } from '../../plugins/alignment/ui/ToolbarAlignment/icon-map';
6
6
  import AlignmentButton from './AlignmentButton';
7
- import { alignmentMessages } from './messages';
7
+ import { alignmentMessages } from '@atlaskit/editor-common/messages';
8
8
  import { alignmentWrapper } from './styles';
9
9
  import { alignLeft } from '../../keymaps';
10
10
  const alignmentOptions = [{
@@ -4,12 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../plugins/analytics';
5
5
  import { createDispatch } from '../../event-dispatcher';
6
6
  import { analyticsEventKey } from '../../plugins/analytics/consts';
7
- // TODO - ED-20189 Source deprecatedOpenHelpCommand from help-dialog-plugin
8
- import { openHelpCommand } from '../../plugins/help-dialog/commands';
9
- /**
10
- * @deprecated
11
- * Use WithHelpTrigger from @atlaskit/editor-plugin-help-dialog which uses pluginInjectionApi
12
- */
7
+ import { deprecatedOpenHelpCommand } from '@atlaskit/editor-plugin-help-dialog';
13
8
  export default class WithHelpTrigger extends React.Component {
14
9
  constructor(...args) {
15
10
  super(...args);
@@ -31,7 +26,7 @@ export default class WithHelpTrigger extends React.Component {
31
26
  });
32
27
  const editorView = editorActions._privateGetEditorView();
33
28
  if (editorView) {
34
- openHelpCommand(editorView.state.tr, editorView.dispatch);
29
+ deprecatedOpenHelpCommand(editorView.state.tr, editorView.dispatch);
35
30
  }
36
31
  });
37
32
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "188.0.12";
2
+ export const version = "188.2.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -3,7 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import { createEditorSelectionAPI } from '../../../selection-api/api';
6
- import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, borderPlugin } from '../../../plugins';
6
+ import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, borderPlugin } from '../../../plugins';
7
+ import { helpDialogPlugin } from '@atlaskit/editor-plugin-help-dialog';
7
8
  import { rulePlugin } from '@atlaskit/editor-plugin-rule';
8
9
  import { emojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
10
  import { listPlugin } from '@atlaskit/editor-plugin-list';
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { defineMessages } from 'react-intl-next';
3
2
  import CommentIcon from '@atlaskit/icon/glyph/comment';
4
3
  // AFP-2532 TODO: Fix automatic suppressions below
5
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
@@ -7,23 +6,8 @@ import { addInlineComment, ToolTipContent } from '../../keymaps';
7
6
  import { setInlineCommentDraftState } from './commands';
8
7
  import { AnnotationTestIds, AnnotationSelectionType } from './types';
9
8
  import { isSelectionValid } from './utils';
10
- export var annotationMessages = defineMessages({
11
- createComment: {
12
- id: 'fabric.editor.createComment',
13
- defaultMessage: 'Comment',
14
- description: 'Create/add an inline comment based on the users selection'
15
- },
16
- createCommentInvalid: {
17
- id: 'fabric.editor.createCommentInvalid',
18
- defaultMessage: 'You can only comment on text and headings',
19
- description: 'Error message to communicate to the user they can only do the current action in certain contexts'
20
- },
21
- toolbar: {
22
- id: 'fabric.editor.annotationToolbar',
23
- defaultMessage: 'Annotation toolbar',
24
- description: 'A label for a toolbar (UI element) that creates annotations/comments in the document'
25
- }
26
- });
9
+ import { annotationMessages } from '@atlaskit/editor-common/messages';
10
+
27
11
  /**
28
12
  * Returns the coordintes at the bottom the selection.
29
13
  */
@@ -10,7 +10,7 @@ import ideUX from './pm-plugins/ide-ux';
10
10
  import { codeBlockCopySelectionPlugin } from './pm-plugins/codeBlockCopySelectionPlugin';
11
11
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
12
12
  import { IconCode } from '@atlaskit/editor-common/quick-insert';
13
- import { messages } from '@atlaskit/editor-plugin-block-type/messages';
13
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
14
14
  import refreshBrowserSelectionOnChange from './refresh-browser-selection';
15
15
  import { createInsertCodeBlockTransaction, insertCodeBlockWithAnalytics } from './actions';
16
16
  import { createCodeBlockInputRule } from './pm-plugins/input-rule';
@@ -80,8 +80,8 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
80
80
  var formatMessage = _ref5.formatMessage;
81
81
  return [{
82
82
  id: 'codeblock',
83
- title: formatMessage(messages.codeblock),
84
- description: formatMessage(messages.codeblockDescription),
83
+ title: formatMessage(blockTypeMessages.codeblock),
84
+ description: formatMessage(blockTypeMessages.codeblockDescription),
85
85
  keywords: ['code block'],
86
86
  priority: 700,
87
87
  keyshortcut: '```',
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
- import { getSelectedNodeOrNodeParentByNodeType } from '@atlaskit/editor-plugin-copy-button/utils';
5
+ import { getSelectedNodeOrNodeParentByNodeType } from '@atlaskit/editor-common/copy-button';
6
6
  export var copySelectionPluginKey = new PluginKey('codeBlockCopySelectionPlugin');
7
7
  function getSelectionDecorationStartAndEnd(_ref) {
8
8
  var state = _ref.state,
@@ -5,7 +5,6 @@ export { default as collabEditPlugin } from './collab-edit';
5
5
  export { default as datePlugin } from './date';
6
6
  export { default as extensionPlugin } from './extension';
7
7
  export { default as fakeTextCursorPlugin } from './fake-text-cursor';
8
- export { default as helpDialogPlugin } from './help-dialog';
9
8
  export { default as insertBlockPlugin } from './insert-block';
10
9
  export { default as jiraIssuePlugin } from './jira-issue';
11
10
  export { default as layoutPlugin } from './layout';
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import memoize from 'lodash/memoize';
7
7
  import memoizeOne from 'memoize-one';
8
8
  import { messages } from './messages';
9
- import { messages as blockTypeMessages } from '@atlaskit/editor-plugin-block-type/messages';
9
+ import { blockTypeMessages } from '@atlaskit/editor-common/messages';
10
10
  import { ToolTipContent } from '../../../../keymaps';
11
11
  import { sortItems } from './sort-items';
12
12
  import { action, link, media, mention, emoji, table, layout, codeblock, panel, blockquote, decision, horizontalrule, expand, date, placeholder, status, more, imageUpload } from './item';
@@ -23,6 +23,7 @@ import { ReactMediaNode } from './nodeviews/mediaNodeView';
23
23
  import { ReactMediaInlineNode } from './nodeviews/mediaInline';
24
24
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
25
25
  import { stateKey } from './pm-plugins/plugin-key';
26
+ import { insertMediaAsMediaSingle as _insertMediaAsMediaSingle } from './utils/media-single';
26
27
  export { insertMediaSingleNode } from './utils/media-single';
27
28
  var MediaPickerFunctionalComponent = function MediaPickerFunctionalComponent(_ref) {
28
29
  var api = _ref.api,
@@ -54,6 +55,12 @@ var mediaPlugin = function mediaPlugin(_ref2) {
54
55
  }
55
56
  return stateKey.getState(editorState) || null;
56
57
  },
58
+ actions: {
59
+ insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod) {
60
+ var _api$analytics;
61
+ return _insertMediaAsMediaSingle(view, node, inputMethod, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
62
+ }
63
+ },
57
64
  nodes: function nodes() {
58
65
  var _ref3 = options || {},
59
66
  _ref3$allowMediaGroup = _ref3.allowMediaGroup,
@@ -134,8 +141,8 @@ var mediaPlugin = function mediaPlugin(_ref2) {
134
141
  }, {
135
142
  name: 'mediaKeymap',
136
143
  plugin: function plugin() {
137
- var _api$analytics;
138
- return keymapPlugin(options, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
144
+ var _api$analytics2;
145
+ return keymapPlugin(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
139
146
  }
140
147
  }];
141
148
  if (options && options.allowMediaSingle) {
@@ -155,9 +162,9 @@ var mediaPlugin = function mediaPlugin(_ref2) {
155
162
  pmPlugins.push({
156
163
  name: 'mediaAltTextKeymap',
157
164
  plugin: function plugin(_ref6) {
158
- var _api$analytics2;
165
+ var _api$analytics3;
159
166
  var schema = _ref6.schema;
160
- return keymapMediaAltTextPlugin(schema, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
167
+ return keymapMediaAltTextPlugin(schema, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
161
168
  }
162
169
  });
163
170
  }
@@ -240,11 +247,11 @@ var mediaPlugin = function mediaPlugin(_ref2) {
240
247
  return /*#__PURE__*/React.createElement(IconImages, null);
241
248
  },
242
249
  action: function action(insert, state) {
243
- var _api$analytics3;
250
+ var _api$analytics4;
244
251
  var pluginState = pluginKey.getState(state);
245
252
  pluginState === null || pluginState === void 0 || pluginState.showMediaPicker();
246
253
  var tr = insert('');
247
- api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || _api$analytics3.actions.attachAnalyticsEvent({
254
+ api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || _api$analytics4.actions.attachAnalyticsEvent({
248
255
  action: ACTION.OPENED,
249
256
  actionSubject: ACTION_SUBJECT.PICKER,
250
257
  actionSubjectId: ACTION_SUBJECT_ID.PICKER_CLOUD,