@atlaskit/editor-plugin-media 1.44.8 → 1.44.10

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 (65) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/mediaPlugin.js +0 -2
  3. package/dist/cjs/nodeviews/lazy-media-group.js +1 -4
  4. package/dist/cjs/nodeviews/lazy-media-inline.js +1 -4
  5. package/dist/cjs/nodeviews/lazy-media.js +1 -4
  6. package/dist/cjs/nodeviews/mediaGroup.js +1 -4
  7. package/dist/cjs/nodeviews/mediaInline.js +1 -4
  8. package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -4
  9. package/dist/cjs/nodeviews/mediaSingle.js +0 -3
  10. package/dist/cjs/pm-plugins/commands/captions.js +1 -4
  11. package/dist/cjs/pm-plugins/commands/linking.js +2 -8
  12. package/dist/cjs/pm-plugins/keymap.js +5 -22
  13. package/dist/cjs/pm-plugins/main.js +2 -14
  14. package/dist/cjs/pm-plugins/picker-facade.js +0 -2
  15. package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
  16. package/dist/cjs/pm-plugins/utils/media-files.js +2 -8
  17. package/dist/cjs/pm-plugins/utils/media-single.js +17 -23
  18. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
  19. package/dist/cjs/ui/toolbar/commands.js +1 -4
  20. package/dist/cjs/ui/toolbar/index.js +3 -12
  21. package/dist/cjs/ui/toolbar/linking.js +1 -4
  22. package/dist/es2019/mediaPlugin.js +0 -2
  23. package/dist/es2019/nodeviews/lazy-media-group.js +1 -4
  24. package/dist/es2019/nodeviews/lazy-media-inline.js +1 -4
  25. package/dist/es2019/nodeviews/lazy-media-single.js +1 -4
  26. package/dist/es2019/nodeviews/lazy-media.js +1 -4
  27. package/dist/es2019/nodeviews/mediaGroup.js +1 -4
  28. package/dist/es2019/nodeviews/mediaInline.js +1 -4
  29. package/dist/es2019/nodeviews/mediaNodeView/index.js +1 -4
  30. package/dist/es2019/nodeviews/mediaSingle.js +1 -7
  31. package/dist/es2019/pm-plugins/commands/captions.js +1 -4
  32. package/dist/es2019/pm-plugins/commands/linking.js +2 -8
  33. package/dist/es2019/pm-plugins/keymap.js +5 -22
  34. package/dist/es2019/pm-plugins/main.js +2 -14
  35. package/dist/es2019/pm-plugins/picker-facade.js +0 -2
  36. package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
  37. package/dist/es2019/pm-plugins/utils/media-files.js +2 -8
  38. package/dist/es2019/pm-plugins/utils/media-single.js +18 -24
  39. package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
  40. package/dist/es2019/ui/toolbar/commands.js +1 -4
  41. package/dist/es2019/ui/toolbar/index.js +3 -12
  42. package/dist/es2019/ui/toolbar/linking.js +1 -4
  43. package/dist/es2019/ui/toolbar/mediaInline.js +2 -8
  44. package/dist/es2019/ui/toolbar/utils.js +1 -4
  45. package/dist/esm/mediaPlugin.js +0 -2
  46. package/dist/esm/nodeviews/lazy-media-group.js +1 -4
  47. package/dist/esm/nodeviews/lazy-media-inline.js +1 -4
  48. package/dist/esm/nodeviews/lazy-media.js +1 -4
  49. package/dist/esm/nodeviews/mediaGroup.js +1 -4
  50. package/dist/esm/nodeviews/mediaInline.js +1 -4
  51. package/dist/esm/nodeviews/mediaNodeView/index.js +1 -4
  52. package/dist/esm/nodeviews/mediaSingle.js +0 -3
  53. package/dist/esm/pm-plugins/commands/captions.js +1 -4
  54. package/dist/esm/pm-plugins/commands/linking.js +2 -8
  55. package/dist/esm/pm-plugins/keymap.js +5 -22
  56. package/dist/esm/pm-plugins/main.js +2 -14
  57. package/dist/esm/pm-plugins/picker-facade.js +0 -2
  58. package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
  59. package/dist/esm/pm-plugins/utils/media-files.js +2 -8
  60. package/dist/esm/pm-plugins/utils/media-single.js +18 -24
  61. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
  62. package/dist/esm/ui/toolbar/commands.js +1 -4
  63. package/dist/esm/ui/toolbar/index.js +3 -12
  64. package/dist/esm/ui/toolbar/linking.js +1 -4
  65. package/package.json +5 -5
@@ -655,9 +655,6 @@ class MediaSingleNodeView extends ReactNodeView {
655
655
  }
656
656
  return false;
657
657
  }
658
-
659
- // Ignored via go/ees005
660
- // eslint-disable-next-line @typescript-eslint/max-params
661
658
  update(node, decorations, _innerDecorations, isValidUpdate) {
662
659
  if (!isValidUpdate) {
663
660
  isValidUpdate = (currentNode, newNode) => this.getNodeMediaId(currentNode) === this.getNodeMediaId(newNode);
@@ -725,10 +722,7 @@ class MediaSingleNodeView extends ReactNodeView {
725
722
  (_this$unsubscribeToVi = this.unsubscribeToViewModeChange) === null || _this$unsubscribeToVi === void 0 ? void 0 : _this$unsubscribeToVi.call(this);
726
723
  }
727
724
  }
728
- export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}
729
- // Ignored via go/ees005
730
- // eslint-disable-next-line @typescript-eslint/max-params
731
- ) => (node, view, getPos) => {
725
+ export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}) => (node, view, getPos) => {
732
726
  return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
733
727
  eventDispatcher,
734
728
  fullWidthMode: mediaOptions.fullWidthEnabled,
@@ -42,9 +42,6 @@ export const insertAndSelectCaptionFromMediaSinglePos = editorAnalyticsAPI => (m
42
42
  }
43
43
  return true;
44
44
  };
45
- const setSelectionAtEndOfCaption = (tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
46
- // Ignored via go/ees005
47
- // eslint-disable-next-line @typescript-eslint/max-params
48
- ) => {
45
+ const setSelectionAtEndOfCaption = (tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize) => {
49
46
  return setTextSelection(mediaSingleNodePos + mediaNodeSize + captionNodeSize)(tr);
50
47
  };
@@ -61,10 +61,7 @@ export const showLinkingToolbarWithMediaTypeCheck = (editorState, dispatch, edit
61
61
  const hideLinkingToolbarCommand = createMediaLinkingCommand({
62
62
  type: MediaLinkingActionsTypes.hideToolbar
63
63
  });
64
- export const hideLinkingToolbar = (state, dispatch, view, focusFloatingToolbar
65
- // Ignored via go/ees005
66
- // eslint-disable-next-line @typescript-eslint/max-params
67
- ) => {
64
+ export const hideLinkingToolbar = (state, dispatch, view, focusFloatingToolbar) => {
68
65
  hideLinkingToolbarCommand(state, dispatch, view);
69
66
 
70
67
  // restore focus on the editor so keyboard shortcuts aren't lost to the browser
@@ -159,10 +156,7 @@ function toggleLinkMark(tr, state, {
159
156
  toggleInlineLinkMark($pos.pos, $pos.pos + node.nodeSize, tr, state);
160
157
  return tr;
161
158
  }
162
- const fireAnalyticForMediaLink = (tr, action, attributes = undefined, editorAnalyticsAPI
163
- // Ignored via go/ees005
164
- // eslint-disable-next-line @typescript-eslint/max-params
165
- ) => {
159
+ const fireAnalyticForMediaLink = (tr, action, attributes = undefined, editorAnalyticsAPI) => {
166
160
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
167
161
  action,
168
162
  eventType: EVENT_TYPE.TRACK,
@@ -10,8 +10,6 @@ import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSingleP
10
10
  import { stateKey } from '../pm-plugins/plugin-key';
11
11
  import { updateMediaSingleWidth } from '../ui/toolbar/commands';
12
12
  import { calcNewLayout, getSelectedMediaSingle } from '../ui/toolbar/utils';
13
- // Ignored via go/ees005
14
- // eslint-disable-next-line @typescript-eslint/max-params
15
13
  function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI, widthPlugin, getIntl) {
16
14
  const list = {};
17
15
 
@@ -74,10 +72,7 @@ const focusPlayButton = state => {
74
72
  }
75
73
  return true;
76
74
  };
77
- const validationMaxMin = (newWidth, maxWidth, minWidth, validation
78
- // Ignored via go/ees005
79
- // eslint-disable-next-line @typescript-eslint/max-params
80
- ) => {
75
+ const validationMaxMin = (newWidth, maxWidth, minWidth, validation) => {
81
76
  let newWidthValidated;
82
77
  if (newWidth > maxWidth) {
83
78
  newWidthValidated = maxWidth;
@@ -94,10 +89,7 @@ const validationMaxMin = (newWidth, maxWidth, minWidth, validation
94
89
  validation
95
90
  };
96
91
  };
97
- const createAnnouncer = (action, mediaWidth, changeAmount, validation, getIntl
98
- // Ignored via go/ees005
99
- // eslint-disable-next-line @typescript-eslint/max-params
100
- ) => {
92
+ const createAnnouncer = (action, mediaWidth, changeAmount, validation, getIntl) => {
101
93
  const announcerContainer = document.getElementById('media-announcer') || document.createElement('div');
102
94
  const intl = getIntl();
103
95
  if (!announcerContainer.id) {
@@ -128,10 +120,7 @@ const createAnnouncer = (action, mediaWidth, changeAmount, validation, getIntl
128
120
  }
129
121
  }
130
122
  };
131
- const handleMediaSizeChange = (editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl
132
- // Ignored via go/ees005
133
- // eslint-disable-next-line @typescript-eslint/max-params
134
- ) => (state, dispatch) => {
123
+ const handleMediaSizeChange = (editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl) => (state, dispatch) => {
135
124
  var _getSelectedMediaSing, _getSelectedMediaSing2, _getSelectedMediaSing3, _widthPlugin$sharedSt, _widthPlugin$sharedSt2, _getSelectedMediaSing4, _getSelectedMediaSing5, _getSelectedMediaSing6;
136
125
  const {
137
126
  selection
@@ -169,14 +158,8 @@ const handleMediaSizeChange = (editorAnalyticsAPI, widthPlugin, options, changeA
169
158
  createAnnouncer(action, mediaWidth, changeAmount, validationResult, getIntl);
170
159
  return true;
171
160
  };
172
- const handleMediaIncrease = (editorAnalyticsAPI, widthPlugin, options, getIntl
173
- // Ignored via go/ees005
174
- // eslint-disable-next-line @typescript-eslint/max-params
175
- ) => handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, 1, 'increased', getIntl);
176
- const handleMediaDecrease = (editorAnalyticsAPI, widthPlugin, options, getIntl
177
- // Ignored via go/ees005
178
- // eslint-disable-next-line @typescript-eslint/max-params
179
- ) => handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, -1, 'decreased', getIntl);
161
+ const handleMediaIncrease = (editorAnalyticsAPI, widthPlugin, options, getIntl) => handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, 1, 'increased', getIntl);
162
+ const handleMediaDecrease = (editorAnalyticsAPI, widthPlugin, options, getIntl) => handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, -1, 'decreased', getIntl);
180
163
  const insertAndSelectCaption = editorAnalyticsAPI => (state, dispatch) => {
181
164
  const {
182
165
  selection,
@@ -34,10 +34,7 @@ import { stateKey } from './plugin-key';
34
34
  export const MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
35
35
  export const MEDIA_PLUGIN_IS_RESIZING_KEY = 'mediaSinglePlugin.isResizing';
36
36
  export const MEDIA_PLUGIN_RESIZING_WIDTH_KEY = 'mediaSinglePlugin.resizing-width';
37
- const createDropPlaceholder = (intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine
38
- // Ignored via go/ees005
39
- // eslint-disable-next-line @typescript-eslint/max-params
40
- ) => {
37
+ const createDropPlaceholder = (intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine) => {
41
38
  const dropPlaceholder = document.createElement('div');
42
39
  const createElement = React.createElement;
43
40
  if (fg('platform_editor_react18_plugin_portalprovider')) {
@@ -71,8 +68,6 @@ const createDropPlaceholder = (intl, nodeViewPortalProviderAPI, dropPlaceholderK
71
68
  };
72
69
  const MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
73
70
  export class MediaPluginStateImplementation {
74
- // Ignored via go/ees005
75
- // eslint-disable-next-line @typescript-eslint/max-params
76
71
  constructor(_state, options, mediaOptions, _dispatch, pluginInjectionApi) {
77
72
  var _this$mediaOptions2, _this$mediaOptions3;
78
73
  _defineProperty(this, "allowsUploads", false);
@@ -127,8 +122,6 @@ export class MediaPluginStateImplementation {
127
122
  *
128
123
  * called when we insert a new file via the picker (connected via pickerfacade)
129
124
  */
130
- // Ignored via go/ees005
131
- // eslint-disable-next-line @typescript-eslint/max-params
132
125
  _defineProperty(this, "insertFile", (mediaState, onMediaStateChanged, pickerType, insertMediaVia) => {
133
126
  var _this$pluginInjection, _this$pluginInjection2, _this$pluginInjection3, _this$pluginInjection4, _this$pluginInjection5, _mediaState$collectio, _this$pluginInjection6, _this$pluginInjection7;
134
127
  const {
@@ -697,10 +690,7 @@ export class MediaPluginStateImplementation {
697
690
  }
698
691
  }
699
692
  export const getMediaPluginState = state => stateKey.getState(state);
700
- export const createPlugin = (_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions
701
- // Ignored via go/ees005
702
- // eslint-disable-next-line @typescript-eslint/max-params
703
- ) => {
693
+ export const createPlugin = (_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions) => {
704
694
  const intl = getIntl();
705
695
  return new SafePlugin({
706
696
  state: {
@@ -869,8 +859,6 @@ export const createPlugin = (_schema, options, getIntl, pluginInjectionApi, node
869
859
  return DecorationSet.create(state.doc, dropPlaceholders);
870
860
  },
871
861
  nodeViews: options.nodeViews,
872
- // Ignored via go/ees005
873
- // eslint-disable-next-line @typescript-eslint/max-params
874
862
  handleTextInput(view, from, to, text) {
875
863
  const {
876
864
  selection
@@ -1,8 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { isImagePreview } from '@atlaskit/media-picker';
3
3
  export default class PickerFacade {
4
- // Ignored via go/ees005
5
- // eslint-disable-next-line @typescript-eslint/max-params
6
4
  constructor(pickerType, config, pickerConfig, analyticsName) {
7
5
  _defineProperty(this, "onDragListeners", []);
8
6
  _defineProperty(this, "onStartListeners", []);
@@ -26,8 +26,6 @@ import { batchStepsUpdate } from './batchSteps';
26
26
  * const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
27
27
  * debouncedFunction(arg1, arg2);
28
28
  */
29
- // Ignored via go/ees005
30
- // eslint-disable-next-line @typescript-eslint/max-params
31
29
  function memoizeDebounce(func, wait = 0, options, resolver) {
32
30
  const mem = memoize(function () {
33
31
  return debounce(func, wait, options);
@@ -84,10 +84,7 @@ function shouldAppendParagraph(state, node) {
84
84
  * @param allowInlineImages Configuration for allowing adding of inline images
85
85
  * @param collection Collection for the media to be added
86
86
  */
87
- export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia
88
- // Ignored via go/ees005
89
- // eslint-disable-next-line @typescript-eslint/max-params
90
- ) => {
87
+ export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia) => {
91
88
  const {
92
89
  state,
93
90
  dispatch
@@ -158,10 +155,7 @@ export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, co
158
155
  * @param mediaStates Media files to be added to the editor
159
156
  * @param collection Collection for the media to be added
160
157
  */
161
- export const insertMediaGroupNode = editorAnalyticsAPI => (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia
162
- // Ignored via go/ees005
163
- // eslint-disable-next-line @typescript-eslint/max-params
164
- ) => {
158
+ export const insertMediaGroupNode = editorAnalyticsAPI => (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia) => {
165
159
  const {
166
160
  state,
167
161
  dispatch
@@ -9,7 +9,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { safeInsert as pmSafeInsert, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
- import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
12
+ import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph } from '../utils/media-common';
13
13
  import { findChangeFromLocation, getChangeMediaAnalytics } from './analytics';
14
14
  import { isImage } from './is-type';
15
15
  const getInsertMediaAnalytics = (inputMethod, fileExtension, insertMediaVia) => ({
@@ -48,6 +48,7 @@ function insertNodesWithOptionalParagraph({
48
48
  newType,
49
49
  previousType
50
50
  } = analyticsAttributes;
51
+ let updatedTr = tr;
51
52
  let openEnd = 0;
52
53
  if (shouldAddParagraph(state) && !fg('platform_editor_axe_leading_paragraph_from_media')) {
53
54
  nodes.push(paragraph.create());
@@ -59,34 +60,36 @@ function insertNodesWithOptionalParagraph({
59
60
  const grandParentNodeType = grandParentNode === null || grandParentNode === void 0 ? void 0 : grandParentNode.type.name;
60
61
  if (grandParentNodeType === 'blockquote' && !isNestingInQuoteSupported) {
61
62
  const grandparentEndPos = state.selection.$from.start(-1) + grandParentNode.nodeSize - 1;
62
- pmSafeInsert(nodes[0], grandparentEndPos)(tr).scrollIntoView();
63
+ pmSafeInsert(nodes[0], grandparentEndPos)(updatedTr).scrollIntoView();
63
64
  } else if (state.selection.empty) {
64
65
  const insertFrom = atTheBeginningOfBlock(state) && fg('platform_editor_axe_leading_paragraph_from_media') ? state.selection.$from.before() : state.selection.from;
65
- tr.insert(insertFrom, nodes);
66
+ if (fg('platform_editor_axe_leading_paragraph_from_media')) {
67
+ const shouldInsertFrom = !isInsidePotentialEmptyParagraph(state);
68
+ updatedTr = atTheBeginningOfBlock(state) ? pmSafeInsert(nodes[0], shouldInsertFrom ? insertFrom : undefined, false)(updatedTr) : updatedTr.insert(insertFrom, nodes);
69
+ } else {
70
+ updatedTr.insert(insertFrom, nodes);
71
+ }
66
72
  const endPos = state.selection.from + nodes.reduce((totalSize, currNode) => totalSize + currNode.nodeSize, 0);
67
73
  if (!fg('platform_editor_axe_leading_paragraph_from_media')) {
68
- tr.setSelection(new TextSelection(tr.doc.resolve(endPos), tr.doc.resolve(endPos)));
74
+ updatedTr.setSelection(new TextSelection(updatedTr.doc.resolve(endPos), updatedTr.doc.resolve(endPos)));
69
75
  }
70
76
  } else {
71
- tr.replaceSelection(new Slice(Fragment.from(nodes), 0, openEnd));
77
+ updatedTr.replaceSelection(new Slice(Fragment.from(nodes), 0, openEnd));
72
78
  }
73
79
  if (inputMethod) {
74
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getInsertMediaAnalytics(inputMethod, fileExtension, insertMediaVia))(tr);
80
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getInsertMediaAnalytics(inputMethod, fileExtension, insertMediaVia))(updatedTr);
75
81
  }
76
82
  if (newType && previousType) {
77
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getChangeMediaAnalytics(previousType, newType, findChangeFromLocation(state.selection)))(tr);
83
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(getChangeMediaAnalytics(previousType, newType, findChangeFromLocation(state.selection)))(updatedTr);
78
84
  }
79
85
  if (dispatch) {
80
- dispatch(tr);
86
+ dispatch(updatedTr);
81
87
  }
82
88
  return true;
83
89
  };
84
90
  }
85
91
  export const isMediaSingle = (schema, fileMimeType) => !!schema.nodes.mediaSingle && isImage(fileMimeType);
86
- export const insertMediaAsMediaSingle = (view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia
87
- // Ignored via go/ees005
88
- // eslint-disable-next-line @typescript-eslint/max-params
89
- ) => {
92
+ export const insertMediaAsMediaSingle = (view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia) => {
90
93
  var _node$attrs$width;
91
94
  const {
92
95
  state,
@@ -132,10 +135,7 @@ const getFileExtension = fileName => {
132
135
  }
133
136
  return undefined;
134
137
  };
135
- export const insertMediaSingleNode = (view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia
136
- // Ignored via go/ees005
137
- // eslint-disable-next-line @typescript-eslint/max-params
138
- ) => {
138
+ export const insertMediaSingleNode = (view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia) => {
139
139
  var _state$selection$$fro;
140
140
  if (collection === undefined) {
141
141
  return false;
@@ -190,10 +190,7 @@ export const insertMediaSingleNode = (view, mediaState, inputMethod, collection,
190
190
  }
191
191
  return true;
192
192
  };
193
- export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported
194
- // Ignored via go/ees005
195
- // eslint-disable-next-line @typescript-eslint/max-params
196
- ) => {
193
+ export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported) => {
197
194
  var _state$selection$$fro2;
198
195
  const {
199
196
  state,
@@ -244,10 +241,7 @@ export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPlug
244
241
  }
245
242
  return true;
246
243
  };
247
- const createMediaSingleNode = (schema, collection, maxWidth, minWidth, alignLeftOnInsert
248
- // Ignored via go/ees005
249
- // eslint-disable-next-line @typescript-eslint/max-params
250
- ) => mediaState => {
244
+ const createMediaSingleNode = (schema, collection, maxWidth, minWidth, alignLeftOnInsert) => mediaState => {
251
245
  const {
252
246
  id,
253
247
  dimensions,
@@ -69,8 +69,6 @@ class ResizableMediaSingleNext extends React.Component {
69
69
  }
70
70
  return this.calcUnwrappedLayout(newWidth, containerWidth || 0, lineLength, fullWidthMode, this.isAdjacentMode());
71
71
  });
72
- // Ignored via go/ees005
73
- // eslint-disable-next-line @typescript-eslint/max-params
74
72
  _defineProperty(this, "calcUnwrappedLayout", (width, containerWidth, contentWidth, fullWidthMode, isNestedNode) => {
75
73
  if (isNestedNode) {
76
74
  return 'center';
@@ -534,10 +532,7 @@ const setIsResizingPluginState = ({
534
532
  }
535
533
  return true;
536
534
  };
537
- const calcUnwrappedLayout = (width, containerWidth, contentWidth, fullWidthMode, isNestedNode
538
- // Ignored via go/ees005
539
- // eslint-disable-next-line @typescript-eslint/max-params
540
- ) => {
535
+ const calcUnwrappedLayout = (width, containerWidth, contentWidth, fullWidthMode, isNestedNode) => {
541
536
  if (isNestedNode) {
542
537
  return 'center';
543
538
  }
@@ -577,10 +572,7 @@ const calcNewLayout = ({
577
572
  }
578
573
  return calcUnwrappedLayout(newWidth, containerWidth, lineLength, fullWidthMode, isNestedNode);
579
574
  };
580
- const calculateSizeState = props => (size, delta, onResizeStop = false, aspectRatio
581
- // Ignored via go/ees005
582
- // eslint-disable-next-line @typescript-eslint/max-params
583
- ) => {
575
+ const calculateSizeState = props => (size, delta, onResizeStop = false, aspectRatio) => {
584
576
  const calculatedWidth = Math.round(size.width + delta.width);
585
577
  const calculatedWidthWithLayout = calcNewLayout(props)(calculatedWidth, onResizeStop);
586
578
  return {
@@ -239,10 +239,7 @@ export const setBorderMark = editorAnalyticsAPI => attrs => (state, dispatch) =>
239
239
  }
240
240
  return true;
241
241
  };
242
- export const updateMediaSingleWidth = editorAnalyticsAPI => (width, validation, inputMethod, layout
243
- // Ignored via go/ees005
244
- // eslint-disable-next-line @typescript-eslint/max-params
245
- ) => (state, dispatch) => {
242
+ export const updateMediaSingleWidth = editorAnalyticsAPI => (width, validation, inputMethod, layout) => (state, dispatch) => {
246
243
  const selectedMediaSingleNode = getSelectedMediaSingle(state);
247
244
  if (!selectedMediaSingleNode) {
248
245
  return false;
@@ -68,10 +68,7 @@ export const handleShowMediaViewer = ({
68
68
  }
69
69
  api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.media.commands.showMediaViewer(selectedNodeAttrs));
70
70
  };
71
- const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly
72
- // Ignored via go/ees005
73
- // eslint-disable-next-line @typescript-eslint/max-params
74
- ) => {
71
+ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) => {
75
72
  if (isViewOnly) {
76
73
  return [];
77
74
  }
@@ -159,10 +156,7 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDe
159
156
  }];
160
157
  return items;
161
158
  };
162
- const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi
163
- // Ignored via go/ees005
164
- // eslint-disable-next-line @typescript-eslint/max-params
165
- ) => {
159
+ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi) => {
166
160
  var _pluginInjectionApi$d, _pluginInjectionApi$d2;
167
161
  const {
168
162
  mediaSingle
@@ -558,10 +552,7 @@ const getMediaTypeMessage = selectedNodeTypeSingle => {
558
552
  const mediaType = Object.keys(mediaTypeMessages).find(key => selectedNodeTypeSingle === null || selectedNodeTypeSingle === void 0 ? void 0 : selectedNodeTypeSingle.includes(key));
559
553
  return mediaType ? mediaTypeMessages[mediaType] : messages.file_unknown_is_selected;
560
554
  };
561
- export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi
562
- // Ignored via go/ees005
563
- // eslint-disable-next-line @typescript-eslint/max-params
564
- ) => {
555
+ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) => {
565
556
  var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
566
557
  const {
567
558
  media,
@@ -27,10 +27,7 @@ export function shouldShowMediaLinkToolbar(editorState) {
27
27
  } = editorState.doc.resolve(mediaLinkingState.mediaPos);
28
28
  return parent && parent.type.allowsMarkType(link);
29
29
  }
30
- export const getLinkingToolbar = (toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory
31
- // Ignored via go/ees005
32
- // eslint-disable-next-line @typescript-eslint/max-params
33
- ) => {
30
+ export const getLinkingToolbar = (toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory) => {
34
31
  const {
35
32
  link,
36
33
  visible,
@@ -24,10 +24,7 @@ import { shouldShowImageBorder } from './imageBorder';
24
24
  import { LinkToolbarAppearance } from './linking-toolbar-appearance';
25
25
  import { downloadMedia } from './utils';
26
26
  import { handleShowMediaViewer } from './index';
27
- export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options = {}
28
- // Ignored via go/ees005
29
- // eslint-disable-next-line @typescript-eslint/max-params
30
- ) => {
27
+ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options = {}) => {
31
28
  var _pluginInjectionApi$a, _pluginInjectionApi$f, _pluginInjectionApi$f2;
32
29
  const editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
33
30
  const forceFocusSelector = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : (_pluginInjectionApi$f2 = _pluginInjectionApi$f.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector;
@@ -119,10 +116,7 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
119
116
  }];
120
117
  return items;
121
118
  };
122
- const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options = {}
123
- // Ignored via go/ees005
124
- // eslint-disable-next-line @typescript-eslint/max-params
125
- ) => {
119
+ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options = {}) => {
126
120
  var _pluginInjectionApi$w, _pluginInjectionApi$f3, _pluginInjectionApi$f4;
127
121
  const {
128
122
  mediaInline
@@ -79,10 +79,7 @@ export const getPixelWidthOfElement = memoizeOne((editorView, pos, mediaWidth) =
79
79
  }
80
80
  return mediaWidth;
81
81
  });
82
- export const calcNewLayout = (width, layout, contentWidth, fullWidthMode = false, isNested = false
83
- // Ignored via go/ees005
84
- // eslint-disable-next-line @typescript-eslint/max-params
85
- ) => {
82
+ export const calcNewLayout = (width, layout, contentWidth, fullWidthMode = false, isNested = false) => {
86
83
  const isWrappedLayout = wrappedLayouts.indexOf(layout) > -1;
87
84
 
88
85
  //See flowchart for layout logic: https://hello.atlassian.net/wiki/spaces/TWPCP/whiteboard/2969594044
@@ -93,8 +93,6 @@ export var mediaPlugin = function mediaPlugin(_ref3) {
93
93
  return stateKey.getState(editorState) || null;
94
94
  },
95
95
  actions: {
96
- // Ignored via go/ees005
97
- // eslint-disable-next-line @typescript-eslint/max-params
98
96
  insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod, isNestingInQuoteSupported, insertMediaVia) {
99
97
  var _api$analytics;
100
98
  return _insertMediaAsMediaSingle(view, node, inputMethod, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, isNestingInQuoteSupported, insertMediaVia);
@@ -3,10 +3,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  import { ReactMediaGroupNode } from './mediaGroup';
4
4
  export var lazyMediaGroupView = function lazyMediaGroupView(portalProviderAPI, eventDispatcher, providerFactory) {
5
5
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
6
- var api
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line @typescript-eslint/max-params
9
- = arguments.length > 4 ? arguments[4] : undefined;
6
+ var api = arguments.length > 4 ? arguments[4] : undefined;
10
7
  if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
11
8
  return ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
12
9
  }
@@ -1,10 +1,7 @@
1
1
  import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
2
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  import { ReactMediaInlineNode } from './mediaInline';
4
- export var lazyMediaInlineView = function lazyMediaInlineView(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
5
- // Ignored via go/ees005
6
- // eslint-disable-next-line @typescript-eslint/max-params
7
- ) {
4
+ export var lazyMediaInlineView = function lazyMediaInlineView(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) {
8
5
  if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
9
6
  return ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent);
10
7
  }
@@ -3,10 +3,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  import { ReactMediaNode } from './mediaNodeView';
4
4
  export var lazyMediaView = function lazyMediaView(portalProviderAPI, eventDispatcher, providerFactory) {
5
5
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
6
- var api
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line @typescript-eslint/max-params
9
- = arguments.length > 4 ? arguments[4] : undefined;
6
+ var api = arguments.length > 4 ? arguments[4] : undefined;
10
7
  if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
11
8
  return ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
12
9
  }
@@ -384,10 +384,7 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
384
384
  }(ReactNodeView);
385
385
  export var ReactMediaGroupNode = function ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory) {
386
386
  var mediaOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
387
- var pluginInjectionApi
388
- // Ignored via go/ees005
389
- // eslint-disable-next-line @typescript-eslint/max-params
390
- = arguments.length > 4 ? arguments[4] : undefined;
387
+ var pluginInjectionApi = arguments.length > 4 ? arguments[4] : undefined;
391
388
  return function (node, view, getPos) {
392
389
  return new MediaGroupNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
393
390
  providerFactory: providerFactory,
@@ -297,10 +297,7 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
297
297
  }
298
298
  }]);
299
299
  }(SelectionBasedNodeView);
300
- export var ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
301
- // Ignored via go/ees005
302
- // eslint-disable-next-line @typescript-eslint/max-params
303
- ) {
300
+ export var ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) {
304
301
  return function (node, view, getPos) {
305
302
  return new MediaInlineNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
306
303
  providerFactory: providerFactory,
@@ -183,10 +183,7 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
183
183
  }(SelectionBasedNodeView);
184
184
  export var ReactMediaNode = function ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory) {
185
185
  var mediaOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
186
- var pluginInjectionApi
187
- // Ignored via go/ees005
188
- // eslint-disable-next-line @typescript-eslint/max-params
189
- = arguments.length > 4 ? arguments[4] : undefined;
186
+ var pluginInjectionApi = arguments.length > 4 ? arguments[4] : undefined;
190
187
  return function (node, view, getPos) {
191
188
  return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
192
189
  eventDispatcher: eventDispatcher,
@@ -754,9 +754,6 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
754
754
  }
755
755
  return false;
756
756
  }
757
-
758
- // Ignored via go/ees005
759
- // eslint-disable-next-line @typescript-eslint/max-params
760
757
  }, {
761
758
  key: "update",
762
759
  value: function update(node, decorations, _innerDecorations, isValidUpdate) {
@@ -48,9 +48,6 @@ export var insertAndSelectCaptionFromMediaSinglePos = function insertAndSelectCa
48
48
  };
49
49
  };
50
50
  };
51
- var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
52
- // Ignored via go/ees005
53
- // eslint-disable-next-line @typescript-eslint/max-params
54
- ) {
51
+ var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize) {
55
52
  return setTextSelection(mediaSingleNodePos + mediaNodeSize + captionNodeSize)(tr);
56
53
  };
@@ -63,10 +63,7 @@ export var showLinkingToolbarWithMediaTypeCheck = function showLinkingToolbarWit
63
63
  var hideLinkingToolbarCommand = createMediaLinkingCommand({
64
64
  type: MediaLinkingActionsTypes.hideToolbar
65
65
  });
66
- export var hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar
67
- // Ignored via go/ees005
68
- // eslint-disable-next-line @typescript-eslint/max-params
69
- ) {
66
+ export var hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar) {
70
67
  hideLinkingToolbarCommand(state, dispatch, view);
71
68
 
72
69
  // restore focus on the editor so keyboard shortcuts aren't lost to the browser
@@ -160,10 +157,7 @@ function toggleLinkMark(tr, state, _ref) {
160
157
  }
161
158
  var fireAnalyticForMediaLink = function fireAnalyticForMediaLink(tr, action) {
162
159
  var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
163
- var editorAnalyticsAPI
164
- // Ignored via go/ees005
165
- // eslint-disable-next-line @typescript-eslint/max-params
166
- = arguments.length > 3 ? arguments[3] : undefined;
160
+ var editorAnalyticsAPI = arguments.length > 3 ? arguments[3] : undefined;
167
161
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
168
162
  action: action,
169
163
  eventType: EVENT_TYPE.TRACK,