@atlaskit/editor-plugin-media 1.43.7 → 1.43.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 +15 -0
- package/dist/cjs/mediaPlugin.js +2 -0
- package/dist/cjs/nodeviews/lazy-media-group.js +4 -1
- package/dist/cjs/nodeviews/lazy-media-inline.js +4 -1
- package/dist/cjs/nodeviews/lazy-media.js +4 -1
- package/dist/cjs/nodeviews/mediaGroup.js +7 -1
- package/dist/cjs/nodeviews/mediaInline.js +6 -1
- package/dist/cjs/nodeviews/mediaNodeView/index.js +6 -2
- package/dist/cjs/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/cjs/nodeviews/mediaSingle.js +41 -8
- package/dist/cjs/nodeviews/toDOM-fixes/toDOMAttrs.js +7 -3
- package/dist/cjs/pm-plugins/alt-text/commands.js +2 -0
- package/dist/cjs/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/cjs/pm-plugins/commands/captions.js +4 -1
- package/dist/cjs/pm-plugins/commands/linking.js +10 -2
- package/dist/cjs/pm-plugins/keymap-media.js +10 -0
- package/dist/cjs/pm-plugins/keymap.js +54 -7
- package/dist/cjs/pm-plugins/linking/keymap.js +3 -0
- package/dist/cjs/pm-plugins/main.js +24 -3
- package/dist/cjs/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/cjs/pm-plugins/picker-facade.js +8 -0
- package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/cjs/pm-plugins/utils/media-files.js +8 -2
- package/dist/cjs/pm-plugins/utils/media-single.js +19 -4
- package/dist/cjs/ui/CaptionPlaceholder/index.js +30 -2
- package/dist/cjs/ui/ImageBorder/index.js +44 -38
- package/dist/cjs/ui/ImageBorder/styles.js +2 -0
- package/dist/cjs/ui/MediaLinkingToolbar.js +2 -1
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/cjs/ui/MediaPicker/index.js +3 -0
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/cjs/ui/PixelEntry/index.js +61 -51
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/cjs/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/cjs/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/cjs/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/cjs/ui/toolbar/commands.js +4 -1
- package/dist/cjs/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/cjs/ui/toolbar/index.js +21 -3
- package/dist/cjs/ui/toolbar/layout-group.js +8 -1
- package/dist/cjs/ui/toolbar/linking.js +4 -1
- package/dist/cjs/ui/toolbar/utils.js +2 -0
- package/dist/es2019/mediaPlugin.js +2 -0
- package/dist/es2019/nodeviews/lazy-media-group.js +4 -1
- package/dist/es2019/nodeviews/lazy-media-inline.js +4 -1
- package/dist/es2019/nodeviews/lazy-media-single.js +4 -1
- package/dist/es2019/nodeviews/lazy-media.js +4 -1
- package/dist/es2019/nodeviews/mediaGroup.js +7 -1
- package/dist/es2019/nodeviews/mediaInline.js +6 -1
- package/dist/es2019/nodeviews/mediaNodeView/index.js +6 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/es2019/nodeviews/mediaSingle.js +43 -8
- package/dist/es2019/nodeviews/toDOM-fixes/toDOMAttrs.js +4 -1
- package/dist/es2019/pm-plugins/alt-text/commands.js +2 -0
- package/dist/es2019/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/es2019/pm-plugins/commands/captions.js +4 -1
- package/dist/es2019/pm-plugins/commands/linking.js +10 -2
- package/dist/es2019/pm-plugins/keymap-media.js +10 -0
- package/dist/es2019/pm-plugins/keymap.js +54 -7
- package/dist/es2019/pm-plugins/linking/keymap.js +3 -0
- package/dist/es2019/pm-plugins/main.js +24 -2
- package/dist/es2019/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/es2019/pm-plugins/picker-facade.js +8 -0
- package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/es2019/pm-plugins/utils/media-files.js +8 -2
- package/dist/es2019/pm-plugins/utils/media-single.js +19 -4
- package/dist/es2019/ui/CaptionPlaceholder/index.js +30 -2
- package/dist/es2019/ui/ImageBorder/index.js +44 -38
- package/dist/es2019/ui/ImageBorder/styles.js +2 -0
- package/dist/es2019/ui/MediaLinkingToolbar.js +4 -2
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/es2019/ui/MediaPicker/index.js +3 -0
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/es2019/ui/PixelEntry/index.js +59 -49
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/es2019/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/es2019/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/es2019/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/es2019/ui/toolbar/commands.js +4 -1
- package/dist/es2019/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/es2019/ui/toolbar/index.js +21 -3
- package/dist/es2019/ui/toolbar/layout-group.js +8 -1
- package/dist/es2019/ui/toolbar/linking.js +4 -1
- package/dist/es2019/ui/toolbar/mediaInline.js +8 -2
- package/dist/es2019/ui/toolbar/utils.js +6 -1
- package/dist/esm/mediaPlugin.js +2 -0
- package/dist/esm/nodeviews/lazy-media-group.js +4 -1
- package/dist/esm/nodeviews/lazy-media-inline.js +4 -1
- package/dist/esm/nodeviews/lazy-media.js +4 -1
- package/dist/esm/nodeviews/mediaGroup.js +7 -1
- package/dist/esm/nodeviews/mediaInline.js +6 -1
- package/dist/esm/nodeviews/mediaNodeView/index.js +6 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/esm/nodeviews/mediaSingle.js +41 -8
- package/dist/esm/nodeviews/toDOM-fixes/toDOMAttrs.js +7 -3
- package/dist/esm/pm-plugins/alt-text/commands.js +2 -0
- package/dist/esm/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/esm/pm-plugins/commands/captions.js +4 -1
- package/dist/esm/pm-plugins/commands/linking.js +10 -2
- package/dist/esm/pm-plugins/keymap-media.js +10 -0
- package/dist/esm/pm-plugins/keymap.js +54 -7
- package/dist/esm/pm-plugins/linking/keymap.js +3 -0
- package/dist/esm/pm-plugins/main.js +24 -2
- package/dist/esm/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/esm/pm-plugins/picker-facade.js +8 -0
- package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/esm/pm-plugins/utils/media-files.js +8 -2
- package/dist/esm/pm-plugins/utils/media-single.js +19 -4
- package/dist/esm/ui/CaptionPlaceholder/index.js +30 -2
- package/dist/esm/ui/ImageBorder/index.js +44 -38
- package/dist/esm/ui/ImageBorder/styles.js +2 -0
- package/dist/esm/ui/MediaLinkingToolbar.js +4 -2
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/esm/ui/MediaPicker/index.js +3 -0
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/esm/ui/PixelEntry/index.js +61 -51
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/esm/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/esm/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/esm/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/esm/ui/toolbar/commands.js +4 -1
- package/dist/esm/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/esm/ui/toolbar/index.js +21 -3
- package/dist/esm/ui/toolbar/layout-group.js +8 -1
- package/dist/esm/ui/toolbar/linking.js +4 -1
- package/dist/esm/ui/toolbar/utils.js +2 -0
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +1 -2
- package/dist/types/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types/ui/toolbar/commands.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +1 -2
- package/package.json +12 -9
|
@@ -295,6 +295,8 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
|
|
|
295
295
|
return null;
|
|
296
296
|
}
|
|
297
297
|
var pos = this.props.getPos();
|
|
298
|
+
// Ignored via go/ees005
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
298
300
|
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
299
301
|
return null;
|
|
300
302
|
}
|
|
@@ -398,7 +400,10 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
|
|
|
398
400
|
fullWidthMode: fullWidthMode,
|
|
399
401
|
width: origWidth
|
|
400
402
|
})
|
|
401
|
-
}, (0, _react2.jsx)(_ui.Resizer
|
|
403
|
+
}, (0, _react2.jsx)(_ui.Resizer
|
|
404
|
+
// Ignored via go/ees005
|
|
405
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
406
|
+
, (0, _extends2.default)({}, this.props, {
|
|
402
407
|
displayGrid: this.displayGrid,
|
|
403
408
|
ratio: ratio,
|
|
404
409
|
width: initialWidth,
|
|
@@ -11,6 +11,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line import/no-namespace
|
|
16
|
+
|
|
14
17
|
var NOTIFICATION_SIZE = 8;
|
|
15
18
|
var SPACE_FROM_EDGE = "var(--ds-space-100, 8px)";
|
|
16
19
|
|
|
@@ -69,5 +69,7 @@ var IconCommentConfluenceTypeWithDotGlyph = function IconCommentConfluenceTypeWi
|
|
|
69
69
|
var CommentWithDotIcon = exports.CommentWithDotIcon = function CommentWithDotIcon(props) {
|
|
70
70
|
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
71
71
|
glyph: (0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements') ? IconCommentConfluenceTypeWithDotGlyph : IconCommentWithDotGlyph
|
|
72
|
+
// Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
72
74
|
}, props));
|
|
73
75
|
};
|
|
@@ -260,7 +260,10 @@ var setBorderMark = exports.setBorderMark = function setBorderMark(editorAnalyti
|
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
var updateMediaSingleWidth = exports.updateMediaSingleWidth = function updateMediaSingleWidth(editorAnalyticsAPI) {
|
|
263
|
-
return function (width, validation, inputMethod, layout
|
|
263
|
+
return function (width, validation, inputMethod, layout
|
|
264
|
+
// Ignored via go/ees005
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
266
|
+
) {
|
|
264
267
|
return function (state, dispatch) {
|
|
265
268
|
var selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
|
|
266
269
|
if (!selectedMediaSingleNode) {
|
|
@@ -44,7 +44,10 @@ var FilePreviewItem = exports.FilePreviewItem = function FilePreviewItem(_ref) {
|
|
|
44
44
|
LEGACY_fallbackIcon: _filePreview.default
|
|
45
45
|
}),
|
|
46
46
|
tooltipContent: tooltipContent
|
|
47
|
-
}), shouldRenderMediaViewer && /*#__PURE__*/_react.default.createElement(_PortalWrapper.RenderMediaViewer
|
|
47
|
+
}), shouldRenderMediaViewer && /*#__PURE__*/_react.default.createElement(_PortalWrapper.RenderMediaViewer
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
|
+
, {
|
|
48
51
|
mediaClientConfig: mediaPluginState.mediaClientConfig,
|
|
49
52
|
onClose: onMediaViewerClose,
|
|
50
53
|
selectedNodeAttrs: selectedNodeAttrs
|
|
@@ -96,7 +96,10 @@ var handleShowMediaViewer = exports.handleShowMediaViewer = function handleShowM
|
|
|
96
96
|
}
|
|
97
97
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.media.commands.showMediaViewer(selectedNodeAttrs));
|
|
98
98
|
};
|
|
99
|
-
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly
|
|
99
|
+
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly
|
|
100
|
+
// Ignored via go/ees005
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
102
|
+
) {
|
|
100
103
|
if (isViewOnly) {
|
|
101
104
|
return [];
|
|
102
105
|
}
|
|
@@ -184,7 +187,10 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
184
187
|
}];
|
|
185
188
|
return items;
|
|
186
189
|
};
|
|
187
|
-
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi
|
|
190
|
+
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi
|
|
191
|
+
// Ignored via go/ees005
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
193
|
+
) {
|
|
188
194
|
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
189
195
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
190
196
|
var allowResizing = options.allowResizing,
|
|
@@ -250,6 +256,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
250
256
|
render: function render(props) {
|
|
251
257
|
return /*#__PURE__*/_react.default.createElement(_layoutGroup.LayoutGroup, (0, _extends2.default)({
|
|
252
258
|
layoutButtons: layoutButtons
|
|
259
|
+
// Ignored via go/ees005
|
|
260
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
253
261
|
}, props));
|
|
254
262
|
},
|
|
255
263
|
width: 156,
|
|
@@ -566,7 +574,10 @@ var getMediaTypeMessage = function getMediaTypeMessage(selectedNodeTypeSingle) {
|
|
|
566
574
|
var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state, intl) {
|
|
567
575
|
var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
|
|
568
576
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
569
|
-
var pluginInjectionApi
|
|
577
|
+
var pluginInjectionApi
|
|
578
|
+
// Ignored via go/ees005
|
|
579
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
580
|
+
= arguments.length > 3 ? arguments[3] : undefined;
|
|
570
581
|
var _state$schema$nodes = state.schema.nodes,
|
|
571
582
|
media = _state$schema$nodes.media,
|
|
572
583
|
mediaInline = _state$schema$nodes.mediaInline,
|
|
@@ -622,6 +633,8 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
622
633
|
baseToolbar.getDomRef = function () {
|
|
623
634
|
var _mediaPluginState$ele;
|
|
624
635
|
var selector = (0, _mediaFilmstrip.mediaFilmstripItemDOMSelector)(mediaOffset);
|
|
636
|
+
// Ignored via go/ees005
|
|
637
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
625
638
|
return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
|
|
626
639
|
};
|
|
627
640
|
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
|
|
@@ -630,11 +643,16 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
630
643
|
} else {
|
|
631
644
|
baseToolbar.getDomRef = function () {
|
|
632
645
|
var _mediaPluginState$ele2;
|
|
646
|
+
// Ignored via go/ees005
|
|
647
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
633
648
|
var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(_styles.MediaSingleNodeSelector));
|
|
634
649
|
return element || mediaPluginState.element;
|
|
635
650
|
};
|
|
636
651
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
637
652
|
}
|
|
653
|
+
|
|
654
|
+
// Ignored via go/ees005
|
|
655
|
+
// eslint-disable-next-line no-var
|
|
638
656
|
var assistiveMessage = '';
|
|
639
657
|
var selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
|
|
640
658
|
if (selectedMediaSingleNode) {
|
|
@@ -26,12 +26,19 @@ var LayoutGroup = exports.LayoutGroup = function LayoutGroup(_ref) {
|
|
|
26
26
|
}, (0, _react.jsx)(_button.ButtonGroup, null, layoutButtons.map(function (item, idx) {
|
|
27
27
|
switch (item.type) {
|
|
28
28
|
case 'separator':
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
29
31
|
return (0, _react.jsx)(_ui.FloatingToolbarSeparator, {
|
|
30
32
|
key: idx
|
|
31
33
|
});
|
|
32
34
|
case 'button':
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
37
|
var ButtonIcon = item.icon;
|
|
34
|
-
return (0, _react.jsx)(_ui.FloatingToolbarButton
|
|
38
|
+
return (0, _react.jsx)(_ui.FloatingToolbarButton
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
41
|
+
, {
|
|
35
42
|
key: idx,
|
|
36
43
|
icon: item.icon ? (0, _react.jsx)(ButtonIcon, {
|
|
37
44
|
label: item.title
|
|
@@ -33,7 +33,10 @@ function shouldShowMediaLinkToolbar(editorState) {
|
|
|
33
33
|
parent = _editorState$doc$reso.parent;
|
|
34
34
|
return parent && parent.type.allowsMarkType(link);
|
|
35
35
|
}
|
|
36
|
-
var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory
|
|
36
|
+
var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
+
) {
|
|
37
40
|
var link = mediaLinkingState.link,
|
|
38
41
|
visible = mediaLinkingState.visible,
|
|
39
42
|
editing = mediaLinkingState.editable,
|
|
@@ -124,6 +124,8 @@ var calcNewLayout = exports.calcNewLayout = function calcNewLayout(width, layout
|
|
|
124
124
|
};
|
|
125
125
|
var maxToolbarFitWidth = 0;
|
|
126
126
|
var getMaxToolbarWidth = exports.getMaxToolbarWidth = function getMaxToolbarWidth() {
|
|
127
|
+
// Ignored via go/ees005
|
|
128
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
127
129
|
var toolbar = document.querySelector("div[aria-label=\"Media floating controls\"]");
|
|
128
130
|
var toolbarWidth = toolbar === null || toolbar === void 0 ? void 0 : toolbar.getBoundingClientRect().width;
|
|
129
131
|
if (!toolbar) {
|
|
@@ -97,6 +97,8 @@ export const mediaPlugin = ({
|
|
|
97
97
|
return stateKey.getState(editorState) || null;
|
|
98
98
|
},
|
|
99
99
|
actions: {
|
|
100
|
+
// Ignored via go/ees005
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
102
|
insertMediaAsMediaSingle: (view, node, inputMethod, isNestingInQuoteSupported, insertMediaVia) => {
|
|
101
103
|
var _api$analytics;
|
|
102
104
|
return insertMediaAsMediaSingle(view, node, inputMethod, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, isNestingInQuoteSupported, insertMediaVia);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaGroupNode } from './mediaGroup';
|
|
4
|
-
export const lazyMediaGroupView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
4
|
+
export const lazyMediaGroupView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
+
) => {
|
|
5
8
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
9
|
return ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
7
10
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 const lazyMediaInlineView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
4
|
+
export const lazyMediaInlineView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
+
) => {
|
|
5
8
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
9
|
return ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent);
|
|
7
10
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaSingleNode } from './mediaSingle';
|
|
4
|
-
export const lazyMediaSingleView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options = {}
|
|
4
|
+
export const lazyMediaSingleView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options = {}
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
+
) => {
|
|
5
8
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
9
|
return ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options);
|
|
7
10
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaNode } from './mediaNodeView';
|
|
4
|
-
export const lazyMediaView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
4
|
+
export const lazyMediaView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
+
) => {
|
|
5
8
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
9
|
return ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
7
10
|
}
|
|
@@ -223,6 +223,9 @@ class MediaGroup extends React.Component {
|
|
|
223
223
|
var _this$mediaPluginStat2;
|
|
224
224
|
(_this$mediaPluginStat2 = this.mediaPluginState) === null || _this$mediaPluginStat2 === void 0 ? void 0 : _this$mediaPluginStat2.handleMediaGroupUpdate(this.mediaNodes, []);
|
|
225
225
|
}
|
|
226
|
+
|
|
227
|
+
// Ignored via go/ees005
|
|
228
|
+
// eslint-disable-next-line react/no-unsafe
|
|
226
229
|
UNSAFE_componentWillReceiveProps(props) {
|
|
227
230
|
this.updateMediaClientConfig();
|
|
228
231
|
this.setMediaItems(props, props.isCopyPasteEnabled || props.isCopyPasteEnabled === undefined);
|
|
@@ -333,7 +336,10 @@ class MediaGroupNodeView extends ReactNodeView {
|
|
|
333
336
|
});
|
|
334
337
|
}
|
|
335
338
|
}
|
|
336
|
-
export const ReactMediaGroupNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
339
|
+
export const ReactMediaGroupNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
340
|
+
// Ignored via go/ees005
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
342
|
+
) => (node, view, getPos) => {
|
|
337
343
|
return new MediaGroupNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
338
344
|
providerFactory,
|
|
339
345
|
mediaOptions,
|
|
@@ -103,6 +103,8 @@ export const MediaInline = props => {
|
|
|
103
103
|
const identifier = {
|
|
104
104
|
id,
|
|
105
105
|
mediaItemType: 'file',
|
|
106
|
+
// Ignored via go/ees005
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
106
108
|
collectionName: collection
|
|
107
109
|
};
|
|
108
110
|
|
|
@@ -221,7 +223,10 @@ export class MediaInlineNodeView extends SelectionBasedNodeView {
|
|
|
221
223
|
});
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
|
-
export const ReactMediaInlineNode = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
226
|
+
export const ReactMediaInlineNode = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
227
|
+
// Ignored via go/ees005
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
229
|
+
) => (node, view, getPos) => {
|
|
225
230
|
return new MediaInlineNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
226
231
|
providerFactory,
|
|
227
232
|
dispatchAnalyticsEvent,
|
|
@@ -7,6 +7,8 @@ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-
|
|
|
7
7
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
8
8
|
import { updateCurrentMediaNodeAttrs } from '../../pm-plugins/commands/helpers';
|
|
9
9
|
import { isMediaBlobUrlFromAttrs } from '../../pm-plugins/utils/media-common';
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
10
12
|
import MediaNode from './media';
|
|
11
13
|
const MediaNodeWithProviders = ({
|
|
12
14
|
pluginInjectionApi,
|
|
@@ -162,7 +164,10 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
|
-
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
167
|
+
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
170
|
+
) => (node, view, getPos) => {
|
|
166
171
|
return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
167
172
|
eventDispatcher,
|
|
168
173
|
providerFactory,
|
|
@@ -133,7 +133,11 @@ export class MediaNode extends Component {
|
|
|
133
133
|
let lastElement;
|
|
134
134
|
const focusableElements = (_this$videoControlsWr = this.videoControlsWrapperRef) === null || _this$videoControlsWr === void 0 ? void 0 : (_this$videoControlsWr2 = _this$videoControlsWr.current) === null || _this$videoControlsWr2 === void 0 ? void 0 : _this$videoControlsWr2.querySelectorAll('button, input, [tabindex]:not([tabindex="-1"])');
|
|
135
135
|
if (focusableElements && focusableElements.length) {
|
|
136
|
+
// Ignored via go/ees005
|
|
137
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
136
138
|
firstElement = focusableElements[0];
|
|
139
|
+
// Ignored via go/ees005
|
|
140
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
137
141
|
lastElement = focusableElements[focusableElements.length - 1];
|
|
138
142
|
if (event.shiftKey && document.activeElement === firstElement) {
|
|
139
143
|
event.preventDefault();
|
|
@@ -187,12 +191,16 @@ export class MediaNode extends Component {
|
|
|
187
191
|
}
|
|
188
192
|
const contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
189
193
|
const identifier = type === 'external' ? {
|
|
194
|
+
// Ignored via go/ees005
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
190
196
|
dataURI: url,
|
|
191
197
|
name: url,
|
|
192
198
|
mediaItemType: 'external-image'
|
|
193
199
|
} : {
|
|
194
200
|
id,
|
|
195
201
|
mediaItemType: 'file',
|
|
202
|
+
// Ignored via go/ees005
|
|
203
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
196
204
|
collectionName: collection
|
|
197
205
|
};
|
|
198
206
|
|
|
@@ -200,6 +208,8 @@ export class MediaNode extends Component {
|
|
|
200
208
|
// there is a possibility mediaClientConfig will be part of a identifier,
|
|
201
209
|
// so this might be not an issue
|
|
202
210
|
const mediaClientConfig = viewMediaClientConfig || {
|
|
211
|
+
// Ignored via go/ees005
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
203
213
|
authProvider: () => ({})
|
|
204
214
|
};
|
|
205
215
|
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
@@ -98,6 +98,8 @@ export default class MediaSingleNode extends Component {
|
|
|
98
98
|
(_this$mediaNodeUpdate3 = this.mediaNodeUpdater) === null || _this$mediaNodeUpdate3 === void 0 ? void 0 : _this$mediaNodeUpdate3.updateDimensions(updatedDimensions);
|
|
99
99
|
}
|
|
100
100
|
if (node.attrs.type === 'external' && node.attrs.__external) {
|
|
101
|
+
// Ignored via go/ees005
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
101
103
|
const updatingNode = this.mediaNodeUpdater.handleExternalMedia(this.props.getPos);
|
|
102
104
|
addPendingTask(updatingNode);
|
|
103
105
|
await updatingNode;
|
|
@@ -114,6 +116,8 @@ export default class MediaSingleNode extends Component {
|
|
|
114
116
|
isCopying: true
|
|
115
117
|
});
|
|
116
118
|
try {
|
|
119
|
+
// Ignored via go/ees005
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
117
121
|
const copyNode = this.mediaNodeUpdater.copyNode({
|
|
118
122
|
traceId: node.attrs.__mediaTraceId
|
|
119
123
|
});
|
|
@@ -206,6 +210,8 @@ export default class MediaSingleNode extends Component {
|
|
|
206
210
|
insertAndSelectCaptionFromMediaSinglePos(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(getPos(), node)(view.state, view.dispatch);
|
|
207
211
|
});
|
|
208
212
|
}
|
|
213
|
+
// Ignored via go/ees005
|
|
214
|
+
// eslint-disable-next-line react/no-unsafe
|
|
209
215
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
210
216
|
if (!this.mediaNodeUpdater) {
|
|
211
217
|
this.createOrUpdateMediaNodeUpdater(nextProps);
|
|
@@ -444,12 +450,21 @@ export default class MediaSingleNode extends Component {
|
|
|
444
450
|
ref: this.captionPlaceHolderRef,
|
|
445
451
|
onClick: this.clickPlaceholder
|
|
446
452
|
})));
|
|
447
|
-
return jsx(Fragment, null, canResize ? fg('platform_editor_media_extended_resize_experience') ? jsx(ResizableMediaSingleNext
|
|
453
|
+
return jsx(Fragment, null, canResize ? fg('platform_editor_media_extended_resize_experience') ? jsx(ResizableMediaSingleNext
|
|
454
|
+
// Ignored via go/ees005
|
|
455
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
456
|
+
, _extends({}, resizableMediaSingleProps, {
|
|
448
457
|
showLegacyNotification: widthType !== 'pixel'
|
|
449
|
-
}), MediaChildren) : jsx(ResizableMediaSingle
|
|
458
|
+
}), MediaChildren) : jsx(ResizableMediaSingle
|
|
459
|
+
// Ignored via go/ees005
|
|
460
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
461
|
+
, _extends({}, resizableMediaSingleProps, {
|
|
450
462
|
lineLength: contentWidthForLegacyExperience,
|
|
451
463
|
pctWidth: mediaSingleWidthAttribute
|
|
452
|
-
}), MediaChildren) : jsx(MediaSingle
|
|
464
|
+
}), MediaChildren) : jsx(MediaSingle
|
|
465
|
+
// Ignored via go/ees005
|
|
466
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
467
|
+
, _extends({}, mediaSingleProps, {
|
|
453
468
|
pctWidth: mediaSingleWidthAttribute,
|
|
454
469
|
size: {
|
|
455
470
|
width: mediaSingleWidthAttribute,
|
|
@@ -507,8 +522,14 @@ const MediaSingleNodeWrapper = ({
|
|
|
507
522
|
editorAppearance: editorAppearance
|
|
508
523
|
});
|
|
509
524
|
}
|
|
510
|
-
return jsx(MediaSingleNode
|
|
511
|
-
|
|
525
|
+
return jsx(MediaSingleNode
|
|
526
|
+
// Ignored via go/ees005
|
|
527
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
528
|
+
, {
|
|
529
|
+
width: widthState.width
|
|
530
|
+
// Ignored via go/ees005
|
|
531
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
532
|
+
,
|
|
512
533
|
lineLength: widthState.lineLength,
|
|
513
534
|
node: node,
|
|
514
535
|
getPos: getPos,
|
|
@@ -634,6 +655,9 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
634
655
|
}
|
|
635
656
|
return false;
|
|
636
657
|
}
|
|
658
|
+
|
|
659
|
+
// Ignored via go/ees005
|
|
660
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
637
661
|
update(node, decorations, _innerDecorations, isValidUpdate) {
|
|
638
662
|
if (!isValidUpdate) {
|
|
639
663
|
isValidUpdate = (currentNode, newNode) => this.getNodeMediaId(currentNode) === this.getNodeMediaId(newNode);
|
|
@@ -668,8 +692,14 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
668
692
|
view: this.view,
|
|
669
693
|
fullWidthMode: fullWidthMode,
|
|
670
694
|
selected: this.isNodeSelected,
|
|
671
|
-
eventDispatcher: eventDispatcher
|
|
672
|
-
|
|
695
|
+
eventDispatcher: eventDispatcher
|
|
696
|
+
// Ignored via go/ees005
|
|
697
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
698
|
+
,
|
|
699
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
700
|
+
// Ignored via go/ees005
|
|
701
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
702
|
+
,
|
|
673
703
|
forwardRef: forwardRef,
|
|
674
704
|
editorAppearance: editorAppearance
|
|
675
705
|
});
|
|
@@ -679,6 +709,8 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
679
709
|
ignoreMutation() {
|
|
680
710
|
// DOM has changed; recalculate if we need to re-render
|
|
681
711
|
if (this.dom) {
|
|
712
|
+
// Ignored via go/ees005
|
|
713
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
682
714
|
const offsetLeft = this.dom.offsetLeft;
|
|
683
715
|
if (offsetLeft !== this.lastOffsetLeft) {
|
|
684
716
|
this.lastOffsetLeft = offsetLeft;
|
|
@@ -693,7 +725,10 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
693
725
|
(_this$unsubscribeToVi = this.unsubscribeToViewModeChange) === null || _this$unsubscribeToVi === void 0 ? void 0 : _this$unsubscribeToVi.call(this);
|
|
694
726
|
}
|
|
695
727
|
}
|
|
696
|
-
export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}
|
|
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) => {
|
|
697
732
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
698
733
|
eventDispatcher,
|
|
699
734
|
fullWidthMode: mediaOptions.fullWidthEnabled,
|
|
@@ -36,7 +36,10 @@ export const getMediaAttrs = (nodeName, node) => {
|
|
|
36
36
|
copyPrivateAttributes(node.attrs, attrs, key => `data-${camelCaseToKebabCase(key.slice(2))}`);
|
|
37
37
|
return attrs;
|
|
38
38
|
};
|
|
39
|
-
export const camelCaseToKebabCase = str =>
|
|
39
|
+
export const camelCaseToKebabCase = str =>
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
42
|
+
str.replace(/([^A-Z]+)([A-Z])/g, (_, x, y) => `${x}-${y.toLowerCase()}`);
|
|
40
43
|
|
|
41
44
|
/**
|
|
42
45
|
* Copied from `packages/adf-schema/src/schema/nodes/media-single.ts`
|
|
@@ -16,6 +16,8 @@ const createCommandWithAnalytics = (actionType, action, transform) => {
|
|
|
16
16
|
eventType: EVENT_TYPE.TRACK,
|
|
17
17
|
attributes: {
|
|
18
18
|
type,
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
21
|
mediaType: mediaNode.attrs.type
|
|
20
22
|
}
|
|
21
23
|
};
|
|
@@ -3,7 +3,13 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
3
3
|
import { closeMediaAltTextMenu, openMediaAltTextMenu } from './commands';
|
|
4
4
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
5
5
|
const list = {};
|
|
6
|
+
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
9
|
bindKeymapWithCommand(addAltText.common, openMediaAltTextMenu(editorAnalyticsAPI), list);
|
|
10
|
+
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
13
|
bindKeymapWithCommand(escape.common, closeMediaAltTextMenu, list);
|
|
8
14
|
return keymap(list);
|
|
9
15
|
}
|
|
@@ -88,6 +88,8 @@ export class AltTextEditComponent extends React.Component {
|
|
|
88
88
|
// We need to pass down the ESCAPE keymap
|
|
89
89
|
// because when we focus on the Toolbar, Prosemirror blur,
|
|
90
90
|
// making all keyboard shortcuts not working
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
93
|
view.someProp('handleKeyDown', fn => fn(view, event));
|
|
92
94
|
onEscape === null || onEscape === void 0 ? void 0 : onEscape();
|
|
93
95
|
});
|
|
@@ -164,6 +166,8 @@ export class AltTextEditComponent extends React.Component {
|
|
|
164
166
|
shortcutOverride: "Esc"
|
|
165
167
|
});
|
|
166
168
|
const errorsList = (this.state.validationErrors || []).map(function (error, index) {
|
|
169
|
+
// Ignored via go/ees005
|
|
170
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
167
171
|
return jsx(ErrorMessage, {
|
|
168
172
|
key: index
|
|
169
173
|
}, error);
|
|
@@ -42,6 +42,9 @@ export const insertAndSelectCaptionFromMediaSinglePos = editorAnalyticsAPI => (m
|
|
|
42
42
|
}
|
|
43
43
|
return true;
|
|
44
44
|
};
|
|
45
|
-
const setSelectionAtEndOfCaption = (tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
|
|
45
|
+
const setSelectionAtEndOfCaption = (tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
48
|
+
) => {
|
|
46
49
|
return setTextSelection(mediaSingleNodePos + mediaNodeSize + captionNodeSize)(tr);
|
|
47
50
|
};
|
|
@@ -61,7 +61,10 @@ 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
|
|
64
|
+
export const hideLinkingToolbar = (state, dispatch, view, focusFloatingToolbar
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
67
|
+
) => {
|
|
65
68
|
hideLinkingToolbarCommand(state, dispatch, view);
|
|
66
69
|
|
|
67
70
|
// restore focus on the editor so keyboard shortcuts aren't lost to the browser
|
|
@@ -86,6 +89,8 @@ function getCurrentUrl(state) {
|
|
|
86
89
|
if (!hasLink) {
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
94
|
const link = node.marks.find(mark => mark.type === linkType); // Already check exist
|
|
90
95
|
const url = link.attrs.href;
|
|
91
96
|
return url;
|
|
@@ -154,7 +159,10 @@ function toggleLinkMark(tr, state, {
|
|
|
154
159
|
toggleInlineLinkMark($pos.pos, $pos.pos + node.nodeSize, tr, state);
|
|
155
160
|
return tr;
|
|
156
161
|
}
|
|
157
|
-
const fireAnalyticForMediaLink = (tr, action, attributes = undefined, editorAnalyticsAPI
|
|
162
|
+
const fireAnalyticForMediaLink = (tr, action, attributes = undefined, editorAnalyticsAPI
|
|
163
|
+
// Ignored via go/ees005
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
165
|
+
) => {
|
|
158
166
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
159
167
|
action,
|
|
160
168
|
eventType: EVENT_TYPE.TRACK,
|
|
@@ -89,6 +89,9 @@ function handleSelectionAfterWrapRight(isEmptyNode) {
|
|
|
89
89
|
// the last is the image so should let the default behaviour delete the image
|
|
90
90
|
return false;
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
92
95
|
const mediaSingle = getSibling(state.selection, -1); // Sibling is a media single already checked in main code
|
|
93
96
|
const mediaSinglePos = $from.pos - mediaSingle.nodeSize;
|
|
94
97
|
|
|
@@ -118,6 +121,8 @@ function handleSelectionAfterWrapRight(isEmptyNode) {
|
|
|
118
121
|
} else {
|
|
119
122
|
// If is any other kind of block just add the paragraph after it
|
|
120
123
|
const endOfBlockPos = maybeAnyBlockPos + maybeSibling.nodeSize - 1;
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
121
126
|
safeInsert($from.parent.copy($from.parent.content), endOfBlockPos)(tr);
|
|
122
127
|
}
|
|
123
128
|
}
|
|
@@ -150,6 +155,9 @@ const backspaceAfterMediaNode = schema => {
|
|
|
150
155
|
if (!isSiblingOfType(state.selection, schema.nodes.mediaSingle, previousSibling) && !isSiblingOfType(state.selection, schema.nodes.mediaGroup, previousSibling)) {
|
|
151
156
|
return false;
|
|
152
157
|
}
|
|
158
|
+
|
|
159
|
+
// Ignored via go/ees005
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
153
161
|
const media = getSibling(state.selection, previousSibling);
|
|
154
162
|
|
|
155
163
|
// if media single
|
|
@@ -184,6 +192,8 @@ const backspaceAfterMediaNode = schema => {
|
|
|
184
192
|
export default function keymapPlugin(schema) {
|
|
185
193
|
const list = {};
|
|
186
194
|
const backspaceAfterMediaCommand = backspaceAfterMediaNode(schema);
|
|
195
|
+
// Ignored via go/ees005
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
187
197
|
bindKeymapWithCommand(backspace.common, backspaceAfterMediaCommand, list);
|
|
188
198
|
return keymap(list);
|
|
189
199
|
}
|