@atlaskit/editor-plugin-media 1.44.8 → 1.44.9
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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/mediaPlugin.js +0 -2
- package/dist/cjs/nodeviews/lazy-media-group.js +1 -4
- package/dist/cjs/nodeviews/lazy-media-inline.js +1 -4
- package/dist/cjs/nodeviews/lazy-media.js +1 -4
- package/dist/cjs/nodeviews/mediaGroup.js +1 -4
- package/dist/cjs/nodeviews/mediaInline.js +1 -4
- package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/cjs/nodeviews/mediaSingle.js +0 -3
- package/dist/cjs/pm-plugins/commands/captions.js +1 -4
- package/dist/cjs/pm-plugins/commands/linking.js +2 -8
- package/dist/cjs/pm-plugins/keymap.js +5 -22
- package/dist/cjs/pm-plugins/main.js +2 -14
- package/dist/cjs/pm-plugins/picker-facade.js +0 -2
- package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/cjs/pm-plugins/utils/media-files.js +2 -8
- package/dist/cjs/pm-plugins/utils/media-single.js +4 -16
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/cjs/ui/toolbar/commands.js +1 -4
- package/dist/cjs/ui/toolbar/index.js +3 -12
- package/dist/cjs/ui/toolbar/linking.js +1 -4
- package/dist/es2019/mediaPlugin.js +0 -2
- package/dist/es2019/nodeviews/lazy-media-group.js +1 -4
- package/dist/es2019/nodeviews/lazy-media-inline.js +1 -4
- package/dist/es2019/nodeviews/lazy-media-single.js +1 -4
- package/dist/es2019/nodeviews/lazy-media.js +1 -4
- package/dist/es2019/nodeviews/mediaGroup.js +1 -4
- package/dist/es2019/nodeviews/mediaInline.js +1 -4
- package/dist/es2019/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/es2019/nodeviews/mediaSingle.js +1 -7
- package/dist/es2019/pm-plugins/commands/captions.js +1 -4
- package/dist/es2019/pm-plugins/commands/linking.js +2 -8
- package/dist/es2019/pm-plugins/keymap.js +5 -22
- package/dist/es2019/pm-plugins/main.js +2 -14
- package/dist/es2019/pm-plugins/picker-facade.js +0 -2
- package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/es2019/pm-plugins/utils/media-files.js +2 -8
- package/dist/es2019/pm-plugins/utils/media-single.js +4 -16
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/es2019/ui/toolbar/commands.js +1 -4
- package/dist/es2019/ui/toolbar/index.js +3 -12
- package/dist/es2019/ui/toolbar/linking.js +1 -4
- package/dist/es2019/ui/toolbar/mediaInline.js +2 -8
- package/dist/es2019/ui/toolbar/utils.js +1 -4
- package/dist/esm/mediaPlugin.js +0 -2
- package/dist/esm/nodeviews/lazy-media-group.js +1 -4
- package/dist/esm/nodeviews/lazy-media-inline.js +1 -4
- package/dist/esm/nodeviews/lazy-media.js +1 -4
- package/dist/esm/nodeviews/mediaGroup.js +1 -4
- package/dist/esm/nodeviews/mediaInline.js +1 -4
- package/dist/esm/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/esm/nodeviews/mediaSingle.js +0 -3
- package/dist/esm/pm-plugins/commands/captions.js +1 -4
- package/dist/esm/pm-plugins/commands/linking.js +2 -8
- package/dist/esm/pm-plugins/keymap.js +5 -22
- package/dist/esm/pm-plugins/main.js +2 -14
- package/dist/esm/pm-plugins/picker-facade.js +0 -2
- package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/esm/pm-plugins/utils/media-files.js +2 -8
- package/dist/esm/pm-plugins/utils/media-single.js +4 -16
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/esm/ui/toolbar/commands.js +1 -4
- package/dist/esm/ui/toolbar/index.js +3 -12
- package/dist/esm/ui/toolbar/linking.js +1 -4
- package/package.json +5 -5
|
@@ -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
|
-
|
|
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
|
|
@@ -83,10 +83,7 @@ function insertNodesWithOptionalParagraph({
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
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
|
-
) => {
|
|
86
|
+
export const insertMediaAsMediaSingle = (view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia) => {
|
|
90
87
|
var _node$attrs$width;
|
|
91
88
|
const {
|
|
92
89
|
state,
|
|
@@ -132,10 +129,7 @@ const getFileExtension = fileName => {
|
|
|
132
129
|
}
|
|
133
130
|
return undefined;
|
|
134
131
|
};
|
|
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
|
-
) => {
|
|
132
|
+
export const insertMediaSingleNode = (view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia) => {
|
|
139
133
|
var _state$selection$$fro;
|
|
140
134
|
if (collection === undefined) {
|
|
141
135
|
return false;
|
|
@@ -190,10 +184,7 @@ export const insertMediaSingleNode = (view, mediaState, inputMethod, collection,
|
|
|
190
184
|
}
|
|
191
185
|
return true;
|
|
192
186
|
};
|
|
193
|
-
export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported
|
|
194
|
-
// Ignored via go/ees005
|
|
195
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
196
|
-
) => {
|
|
187
|
+
export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported) => {
|
|
197
188
|
var _state$selection$$fro2;
|
|
198
189
|
const {
|
|
199
190
|
state,
|
|
@@ -244,10 +235,7 @@ export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPlug
|
|
|
244
235
|
}
|
|
245
236
|
return true;
|
|
246
237
|
};
|
|
247
|
-
const createMediaSingleNode = (schema, collection, maxWidth, minWidth, alignLeftOnInsert
|
|
248
|
-
// Ignored via go/ees005
|
|
249
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
250
|
-
) => mediaState => {
|
|
238
|
+
const createMediaSingleNode = (schema, collection, maxWidth, minWidth, alignLeftOnInsert) => mediaState => {
|
|
251
239
|
const {
|
|
252
240
|
id,
|
|
253
241
|
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
|
package/dist/esm/mediaPlugin.js
CHANGED
|
@@ -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,
|
|
@@ -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
|
var list = {};
|
|
17
15
|
|
|
@@ -74,10 +72,7 @@ var focusPlayButton = function focusPlayButton(state) {
|
|
|
74
72
|
}
|
|
75
73
|
return true;
|
|
76
74
|
};
|
|
77
|
-
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
-
) {
|
|
75
|
+
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation) {
|
|
81
76
|
var newWidthValidated;
|
|
82
77
|
if (newWidth > maxWidth) {
|
|
83
78
|
newWidthValidated = maxWidth;
|
|
@@ -94,10 +89,7 @@ var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, v
|
|
|
94
89
|
validation: validation
|
|
95
90
|
};
|
|
96
91
|
};
|
|
97
|
-
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl
|
|
98
|
-
// Ignored via go/ees005
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
|
-
) {
|
|
92
|
+
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl) {
|
|
101
93
|
var announcerContainer = document.getElementById('media-announcer') || document.createElement('div');
|
|
102
94
|
var intl = getIntl();
|
|
103
95
|
if (!announcerContainer.id) {
|
|
@@ -128,10 +120,7 @@ var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount,
|
|
|
128
120
|
}
|
|
129
121
|
}
|
|
130
122
|
};
|
|
131
|
-
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl
|
|
132
|
-
// Ignored via go/ees005
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
134
|
-
) {
|
|
123
|
+
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl) {
|
|
135
124
|
return function (state, dispatch) {
|
|
136
125
|
var _getSelectedMediaSing, _widthPlugin$sharedSt, _widthPlugin$sharedSt2, _getSelectedMediaSing2;
|
|
137
126
|
var selection = state.selection;
|
|
@@ -168,16 +157,10 @@ var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, w
|
|
|
168
157
|
return true;
|
|
169
158
|
};
|
|
170
159
|
};
|
|
171
|
-
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
172
|
-
// Ignored via go/ees005
|
|
173
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
174
|
-
) {
|
|
160
|
+
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl) {
|
|
175
161
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, 1, 'increased', getIntl);
|
|
176
162
|
};
|
|
177
|
-
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
178
|
-
// Ignored via go/ees005
|
|
179
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
180
|
-
) {
|
|
163
|
+
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl) {
|
|
181
164
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, -1, 'decreased', getIntl);
|
|
182
165
|
};
|
|
183
166
|
var insertAndSelectCaption = function insertAndSelectCaption(editorAnalyticsAPI) {
|
|
@@ -43,10 +43,7 @@ import { stateKey } from './plugin-key';
|
|
|
43
43
|
export var MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
44
44
|
export var MEDIA_PLUGIN_IS_RESIZING_KEY = 'mediaSinglePlugin.isResizing';
|
|
45
45
|
export var MEDIA_PLUGIN_RESIZING_WIDTH_KEY = 'mediaSinglePlugin.resizing-width';
|
|
46
|
-
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine
|
|
47
|
-
// Ignored via go/ees005
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
49
|
-
) {
|
|
46
|
+
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine) {
|
|
50
47
|
var dropPlaceholder = document.createElement('div');
|
|
51
48
|
var createElement = React.createElement;
|
|
52
49
|
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
@@ -84,8 +81,6 @@ var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalP
|
|
|
84
81
|
};
|
|
85
82
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
86
83
|
export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
87
|
-
// Ignored via go/ees005
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
89
84
|
function MediaPluginStateImplementation(_state, options, mediaOptions, _dispatch, pluginInjectionApi) {
|
|
90
85
|
var _this = this,
|
|
91
86
|
_this$mediaOptions2,
|
|
@@ -143,8 +138,6 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
143
138
|
*
|
|
144
139
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
145
140
|
*/
|
|
146
|
-
// Ignored via go/ees005
|
|
147
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
148
141
|
_defineProperty(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType, insertMediaVia) {
|
|
149
142
|
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$pluginInjection3;
|
|
150
143
|
var state = _this.view.state;
|
|
@@ -798,10 +791,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
798
791
|
export var getMediaPluginState = function getMediaPluginState(state) {
|
|
799
792
|
return stateKey.getState(state);
|
|
800
793
|
};
|
|
801
|
-
export var createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions
|
|
802
|
-
// Ignored via go/ees005
|
|
803
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
804
|
-
) {
|
|
794
|
+
export var createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions) {
|
|
805
795
|
var intl = getIntl();
|
|
806
796
|
return new SafePlugin({
|
|
807
797
|
state: {
|
|
@@ -971,8 +961,6 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
|
|
|
971
961
|
return DecorationSet.create(state.doc, dropPlaceholders);
|
|
972
962
|
},
|
|
973
963
|
nodeViews: options.nodeViews,
|
|
974
|
-
// Ignored via go/ees005
|
|
975
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
976
964
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
977
965
|
var selection = view.state.selection;
|
|
978
966
|
if (text === ' ' && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
@@ -5,8 +5,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import { isImagePreview } from '@atlaskit/media-picker';
|
|
7
7
|
var PickerFacade = /*#__PURE__*/function () {
|
|
8
|
-
// Ignored via go/ees005
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
8
|
function PickerFacade(pickerType, config, pickerConfig, analyticsName) {
|
|
11
9
|
var _this = this;
|
|
12
10
|
_classCallCheck(this, PickerFacade);
|
|
@@ -31,8 +31,6 @@ import { batchStepsUpdate } from './batchSteps';
|
|
|
31
31
|
* const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
|
|
32
32
|
* debouncedFunction(arg1, arg2);
|
|
33
33
|
*/
|
|
34
|
-
// Ignored via go/ees005
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
36
34
|
function memoizeDebounce(func) {
|
|
37
35
|
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
38
36
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -77,10 +77,7 @@ function shouldAppendParagraph(state, node) {
|
|
|
77
77
|
* @param collection Collection for the media to be added
|
|
78
78
|
*/
|
|
79
79
|
export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalyticsAPI) {
|
|
80
|
-
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia
|
|
81
|
-
// Ignored via go/ees005
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
83
|
-
) {
|
|
80
|
+
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia) {
|
|
84
81
|
var state = view.state,
|
|
85
82
|
dispatch = view.dispatch;
|
|
86
83
|
var schema = state.schema,
|
|
@@ -145,10 +142,7 @@ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalytic
|
|
|
145
142
|
* @param collection Collection for the media to be added
|
|
146
143
|
*/
|
|
147
144
|
export var insertMediaGroupNode = function insertMediaGroupNode(editorAnalyticsAPI) {
|
|
148
|
-
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia
|
|
149
|
-
// Ignored via go/ees005
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
151
|
-
) {
|
|
145
|
+
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia) {
|
|
152
146
|
var state = view.state,
|
|
153
147
|
dispatch = view.dispatch;
|
|
154
148
|
var tr = state.tr,
|