@atlaskit/editor-plugin-media 1.43.12 → 1.43.14
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 +14 -0
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +186 -147
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/cjs/pm-plugins/utils/media-single.js +43 -25
- package/dist/cjs/ui/MediaLinkingToolbar.js +1 -0
- package/dist/cjs/ui/toolbar/mediaInline.js +3 -3
- package/dist/es2019/nodeviews/mediaNodeUpdater.js +60 -27
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/es2019/pm-plugins/utils/media-single.js +40 -18
- package/dist/es2019/ui/MediaLinkingToolbar.js +1 -0
- package/dist/es2019/ui/toolbar/mediaInline.js +3 -3
- package/dist/esm/nodeviews/mediaNodeUpdater.js +186 -147
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/esm/pm-plugins/utils/media-single.js +43 -25
- package/dist/esm/ui/MediaLinkingToolbar.js +1 -0
- package/dist/esm/ui/toolbar/mediaInline.js +3 -3
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +1 -0
- package/package.json +14 -8
|
@@ -39,14 +39,13 @@ var getInsertMediaAnalytics = function getInsertMediaAnalytics(inputMethod, file
|
|
|
39
39
|
function shouldAddParagraph(state) {
|
|
40
40
|
return (0, _selection.atTheBeginningOfBlock)(state) && !(0, _utils.checkNodeDown)(state.selection, state.doc, _utils.isEmptyParagraph);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var insertMediaVia = arguments.length > 4 ? arguments[4] : undefined;
|
|
42
|
+
function insertNodesWithOptionalParagraph(_ref) {
|
|
43
|
+
var nodes = _ref.nodes,
|
|
44
|
+
_ref$analyticsAttribu = _ref.analyticsAttributes,
|
|
45
|
+
analyticsAttributes = _ref$analyticsAttribu === void 0 ? {} : _ref$analyticsAttribu,
|
|
46
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
47
|
+
isNestingInQuoteSupported = _ref.isNestingInQuoteSupported,
|
|
48
|
+
insertMediaVia = _ref.insertMediaVia;
|
|
50
49
|
return function (state, dispatch) {
|
|
51
50
|
var tr = state.tr,
|
|
52
51
|
schema = state.schema;
|
|
@@ -56,7 +55,7 @@ function insertNodesWithOptionalParagraph(nodes) {
|
|
|
56
55
|
newType = analyticsAttributes.newType,
|
|
57
56
|
previousType = analyticsAttributes.previousType;
|
|
58
57
|
var openEnd = 0;
|
|
59
|
-
if (shouldAddParagraph(state)) {
|
|
58
|
+
if (shouldAddParagraph(state) && !(0, _platformFeatureFlags.fg)('platform_editor_axe_leading_paragraph_from_media')) {
|
|
60
59
|
nodes.push(paragraph.create());
|
|
61
60
|
openEnd = 1;
|
|
62
61
|
}
|
|
@@ -68,12 +67,14 @@ function insertNodesWithOptionalParagraph(nodes) {
|
|
|
68
67
|
var grandparentEndPos = state.selection.$from.start(-1) + grandParentNode.nodeSize - 1;
|
|
69
68
|
(0, _utils2.safeInsert)(nodes[0], grandparentEndPos)(tr).scrollIntoView();
|
|
70
69
|
} else if (state.selection.empty) {
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
var insertFrom = (0, _selection.atTheBeginningOfBlock)(state) && (0, _platformFeatureFlags.fg)('platform_editor_axe_leading_paragraph_from_media') ? state.selection.$from.before() : state.selection.from;
|
|
71
|
+
tr.insert(insertFrom, nodes);
|
|
73
72
|
var endPos = state.selection.from + nodes.reduce(function (totalSize, currNode) {
|
|
74
73
|
return totalSize + currNode.nodeSize;
|
|
75
74
|
}, 0);
|
|
76
|
-
|
|
75
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_axe_leading_paragraph_from_media')) {
|
|
76
|
+
tr.setSelection(new _state.TextSelection(tr.doc.resolve(endPos), tr.doc.resolve(endPos)));
|
|
77
|
+
}
|
|
77
78
|
} else {
|
|
78
79
|
tr.replaceSelection(new _model.Slice(_model.Fragment.from(nodes), 0, openEnd));
|
|
79
80
|
}
|
|
@@ -123,7 +124,13 @@ var insertMediaAsMediaSingle = exports.insertMediaAsMediaSingle = function inser
|
|
|
123
124
|
inputMethod: inputMethod,
|
|
124
125
|
fileExtension: node.attrs.__fileMimeType
|
|
125
126
|
};
|
|
126
|
-
return insertNodesWithOptionalParagraph(
|
|
127
|
+
return insertNodesWithOptionalParagraph({
|
|
128
|
+
nodes: nodes,
|
|
129
|
+
analyticsAttributes: analyticsAttributes,
|
|
130
|
+
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
131
|
+
isNestingInQuoteSupported: isNestingInQuoteSupported,
|
|
132
|
+
insertMediaVia: insertMediaVia
|
|
133
|
+
})(state, dispatch);
|
|
127
134
|
};
|
|
128
135
|
var getFileExtension = function getFileExtension(fileName) {
|
|
129
136
|
if (fileName) {
|
|
@@ -161,10 +168,16 @@ var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMedia
|
|
|
161
168
|
grandParentNodeType: grandParentNodeType,
|
|
162
169
|
content: node
|
|
163
170
|
})) {
|
|
164
|
-
insertNodesWithOptionalParagraph(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
insertNodesWithOptionalParagraph({
|
|
172
|
+
nodes: [node],
|
|
173
|
+
analyticsAttributes: {
|
|
174
|
+
fileExtension: fileExtension,
|
|
175
|
+
inputMethod: inputMethod
|
|
176
|
+
},
|
|
177
|
+
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
178
|
+
isNestingInQuoteSupported: isNestingInQuoteSupported,
|
|
179
|
+
insertMediaVia: insertMediaVia
|
|
180
|
+
})(state, dispatch);
|
|
168
181
|
} else {
|
|
169
182
|
var tr = null;
|
|
170
183
|
tr = (0, _insert.safeInsert)(node, state.selection.from)(state.tr);
|
|
@@ -208,11 +221,16 @@ var changeFromMediaInlineToMediaSingleNode = exports.changeFromMediaInlineToMedi
|
|
|
208
221
|
grandParentNodeType: grandParentNodeType,
|
|
209
222
|
content: node
|
|
210
223
|
})) {
|
|
211
|
-
return insertNodesWithOptionalParagraph(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
224
|
+
return insertNodesWithOptionalParagraph({
|
|
225
|
+
nodes: [node],
|
|
226
|
+
analyticsAttributes: {
|
|
227
|
+
fileExtension: fileExtension,
|
|
228
|
+
newType: _analytics.ACTION_SUBJECT_ID.MEDIA_SINGLE,
|
|
229
|
+
previousType: _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE
|
|
230
|
+
},
|
|
231
|
+
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
232
|
+
isNestingInQuoteSupported: isNestingInQuoteSupported
|
|
233
|
+
})(state, dispatch);
|
|
216
234
|
} else {
|
|
217
235
|
var nodePos = state.tr.doc.resolve(state.selection.from).end();
|
|
218
236
|
var tr = null;
|
|
@@ -238,12 +256,12 @@ var createMediaSingleNode = function createMediaSingleNode(schema, collection, m
|
|
|
238
256
|
_mediaState$scaleFact = mediaState.scaleFactor,
|
|
239
257
|
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact,
|
|
240
258
|
fileName = mediaState.fileName;
|
|
241
|
-
var
|
|
259
|
+
var _ref2 = dimensions || {
|
|
242
260
|
height: undefined,
|
|
243
261
|
width: undefined
|
|
244
262
|
},
|
|
245
|
-
width =
|
|
246
|
-
height =
|
|
263
|
+
width = _ref2.width,
|
|
264
|
+
height = _ref2.height;
|
|
247
265
|
var _schema$nodes = schema.nodes,
|
|
248
266
|
media = _schema$nodes.media,
|
|
249
267
|
mediaSingle = _schema$nodes.mediaSingle;
|
|
@@ -31,6 +31,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
31
31
|
* @jsx jsx
|
|
32
32
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
33
33
|
var validationWrapper = (0, _react2.css)({
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
34
35
|
lineHeight: 0,
|
|
35
36
|
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-300, 24px)", " ", "var(--ds-space-150, 12px)", " 0"),
|
|
36
37
|
margin: "0 ".concat("var(--ds-space-050, 4px)", " 0 ", "var(--ds-space-400, 32px)"),
|
|
@@ -12,9 +12,9 @@ var _card = require("@atlaskit/editor-common/card");
|
|
|
12
12
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
13
13
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
15
|
-
var _growDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/grow-diagonal"));
|
|
16
15
|
var _imageFullscreen = _interopRequireDefault(require("@atlaskit/icon/core/image-fullscreen"));
|
|
17
16
|
var _imageInline = _interopRequireDefault(require("@atlaskit/icon/core/image-inline"));
|
|
17
|
+
var _maximize = _interopRequireDefault(require("@atlaskit/icon/core/maximize"));
|
|
18
18
|
var _download = _interopRequireDefault(require("@atlaskit/icon/core/migration/download"));
|
|
19
19
|
var _smartLinkCard = _interopRequireDefault(require("@atlaskit/icon/core/smart-link-card"));
|
|
20
20
|
var _filePreview = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/file-preview"));
|
|
@@ -77,7 +77,7 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
|
|
|
77
77
|
id: 'editor.media.viewer',
|
|
78
78
|
testId: 'file-preview-toolbar-button',
|
|
79
79
|
type: 'button',
|
|
80
|
-
icon:
|
|
80
|
+
icon: _maximize.default,
|
|
81
81
|
iconFallback: _filePreview.default,
|
|
82
82
|
title: intl.formatMessage(_mediaUi.messages.preview),
|
|
83
83
|
onClick: function onClick() {
|
|
@@ -249,7 +249,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
249
249
|
id: 'editor.media.viewer',
|
|
250
250
|
testId: 'file-preview-toolbar-button',
|
|
251
251
|
type: 'button',
|
|
252
|
-
icon:
|
|
252
|
+
icon: _maximize.default,
|
|
253
253
|
iconFallback: _filePreview.default,
|
|
254
254
|
title: intl.formatMessage(_mediaUi.messages.preview),
|
|
255
255
|
onClick: function onClick() {
|
|
@@ -224,6 +224,34 @@ export class MediaNodeUpdater {
|
|
|
224
224
|
}
|
|
225
225
|
return false;
|
|
226
226
|
});
|
|
227
|
+
_defineProperty(this, "handleCopyFileSwitcher", async attrs => {
|
|
228
|
+
const {
|
|
229
|
+
mediaClient,
|
|
230
|
+
source,
|
|
231
|
+
destination,
|
|
232
|
+
traceContext
|
|
233
|
+
} = attrs;
|
|
234
|
+
if (fg('platform_media_copy_and_paste_v2')) {
|
|
235
|
+
// don't need authProviders for v2 copy
|
|
236
|
+
const {
|
|
237
|
+
authProvider: _sourceAP,
|
|
238
|
+
...copyV2Source
|
|
239
|
+
} = source;
|
|
240
|
+
const {
|
|
241
|
+
authProvider: _destAP,
|
|
242
|
+
...copyV2Destination
|
|
243
|
+
} = destination;
|
|
244
|
+
const {
|
|
245
|
+
id
|
|
246
|
+
} = await mediaClient.file.copyFile(copyV2Source, copyV2Destination, undefined, traceContext);
|
|
247
|
+
return id;
|
|
248
|
+
} else {
|
|
249
|
+
const {
|
|
250
|
+
id
|
|
251
|
+
} = await mediaClient.file.copyFile(source, destination, undefined, traceContext);
|
|
252
|
+
return id;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
227
255
|
_defineProperty(this, "copyNodeFromBlobUrl", async getPos => {
|
|
228
256
|
const attrs = this.getAttrs();
|
|
229
257
|
if (!attrs || attrs.type !== 'external') {
|
|
@@ -256,24 +284,26 @@ export class MediaNodeUpdater {
|
|
|
256
284
|
return;
|
|
257
285
|
}
|
|
258
286
|
const mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
287
|
+
const getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
|
|
288
|
+
const mediaFileId = await this.handleCopyFileSwitcher({
|
|
289
|
+
mediaClient,
|
|
290
|
+
source: {
|
|
291
|
+
id,
|
|
292
|
+
collection,
|
|
293
|
+
authProvider: () => getAuthFromContext(contextId)
|
|
294
|
+
},
|
|
295
|
+
destination: {
|
|
296
|
+
collection: currentCollectionName,
|
|
297
|
+
authProvider: uploadMediaClientConfig.authProvider,
|
|
298
|
+
occurrenceKey: uuidV4()
|
|
299
|
+
}
|
|
300
|
+
});
|
|
271
301
|
const pos = getPos();
|
|
272
302
|
if (typeof pos !== 'number') {
|
|
273
303
|
return;
|
|
274
304
|
}
|
|
275
305
|
replaceExternalMedia(pos + 1, {
|
|
276
|
-
id:
|
|
306
|
+
id: mediaFileId,
|
|
277
307
|
collection: currentCollectionName,
|
|
278
308
|
height,
|
|
279
309
|
width,
|
|
@@ -323,22 +353,25 @@ export class MediaNodeUpdater {
|
|
|
323
353
|
return;
|
|
324
354
|
}
|
|
325
355
|
const mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
326
|
-
const auth = await uploadMediaClientConfig.getAuthFromContext(nodeContextId);
|
|
327
|
-
const objectId = await this.getObjectId();
|
|
328
|
-
const source = {
|
|
329
|
-
id,
|
|
330
|
-
collection,
|
|
331
|
-
authProvider: () => Promise.resolve(auth)
|
|
332
|
-
};
|
|
333
356
|
const currentCollectionName = mediaProvider.uploadParams.collection;
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
357
|
+
const objectId = await this.getObjectId();
|
|
358
|
+
const getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
|
|
359
|
+
const mediaFileId = await this.handleCopyFileSwitcher({
|
|
360
|
+
mediaClient,
|
|
361
|
+
source: {
|
|
362
|
+
id,
|
|
363
|
+
collection,
|
|
364
|
+
authProvider: () => getAuthFromContext(nodeContextId)
|
|
365
|
+
},
|
|
366
|
+
destination: {
|
|
367
|
+
collection: currentCollectionName,
|
|
368
|
+
authProvider: uploadMediaClientConfig.authProvider,
|
|
369
|
+
occurrenceKey: uuidV4()
|
|
370
|
+
},
|
|
371
|
+
traceContext
|
|
372
|
+
});
|
|
340
373
|
return {
|
|
341
|
-
id:
|
|
374
|
+
id: mediaFileId,
|
|
342
375
|
collection: currentCollectionName,
|
|
343
376
|
__contextId: objectId
|
|
344
377
|
};
|
|
@@ -26,6 +26,7 @@ const supportTextStyles = css({
|
|
|
26
26
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
27
27
|
fontSize: relativeFontSizeToBase16(12),
|
|
28
28
|
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-500, 40px)"}`,
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
29
30
|
lineHeight: '20px',
|
|
30
31
|
borderTop: `1px solid ${`var(--ds-border, ${N30})`}`,
|
|
31
32
|
margin: 0
|
|
@@ -36,16 +37,19 @@ const containerStyles = css({
|
|
|
36
37
|
display: 'flex',
|
|
37
38
|
flexDirection: 'column',
|
|
38
39
|
overflow: 'auto',
|
|
40
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
39
41
|
lineHeight: 2
|
|
40
42
|
});
|
|
41
43
|
const inputWrapperStyles = css({
|
|
42
44
|
display: 'flex',
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
43
46
|
lineHeight: 0,
|
|
44
47
|
padding: `${"var(--ds-space-075, 6px)"} 0`,
|
|
45
48
|
alignItems: 'center'
|
|
46
49
|
});
|
|
47
50
|
const validationWrapperStyles = css({
|
|
48
51
|
display: 'flex',
|
|
52
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
49
53
|
lineHeight: 0,
|
|
50
54
|
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-150, 12px)"} 0`,
|
|
51
55
|
margin: `0 ${"var(--ds-space-150, 12px)"} 0 ${"var(--ds-space-500, 40px)"}`,
|
|
@@ -27,10 +27,13 @@ const getInsertMediaAnalytics = (inputMethod, fileExtension, insertMediaVia) =>
|
|
|
27
27
|
function shouldAddParagraph(state) {
|
|
28
28
|
return atTheBeginningOfBlock(state) && !checkNodeDown(state.selection, state.doc, isEmptyParagraph);
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
function insertNodesWithOptionalParagraph({
|
|
31
|
+
nodes,
|
|
32
|
+
analyticsAttributes = {},
|
|
33
|
+
editorAnalyticsAPI,
|
|
34
|
+
isNestingInQuoteSupported,
|
|
35
|
+
insertMediaVia
|
|
36
|
+
}) {
|
|
34
37
|
return function (state, dispatch) {
|
|
35
38
|
const {
|
|
36
39
|
tr,
|
|
@@ -46,7 +49,7 @@ function insertNodesWithOptionalParagraph(nodes, analyticsAttributes = {}, edito
|
|
|
46
49
|
previousType
|
|
47
50
|
} = analyticsAttributes;
|
|
48
51
|
let openEnd = 0;
|
|
49
|
-
if (shouldAddParagraph(state)) {
|
|
52
|
+
if (shouldAddParagraph(state) && !fg('platform_editor_axe_leading_paragraph_from_media')) {
|
|
50
53
|
nodes.push(paragraph.create());
|
|
51
54
|
openEnd = 1;
|
|
52
55
|
}
|
|
@@ -58,10 +61,12 @@ function insertNodesWithOptionalParagraph(nodes, analyticsAttributes = {}, edito
|
|
|
58
61
|
const grandparentEndPos = state.selection.$from.start(-1) + grandParentNode.nodeSize - 1;
|
|
59
62
|
pmSafeInsert(nodes[0], grandparentEndPos)(tr).scrollIntoView();
|
|
60
63
|
} else if (state.selection.empty) {
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
const insertFrom = atTheBeginningOfBlock(state) && fg('platform_editor_axe_leading_paragraph_from_media') ? state.selection.$from.before() : state.selection.from;
|
|
65
|
+
tr.insert(insertFrom, nodes);
|
|
63
66
|
const endPos = state.selection.from + nodes.reduce((totalSize, currNode) => totalSize + currNode.nodeSize, 0);
|
|
64
|
-
|
|
67
|
+
if (!fg('platform_editor_axe_leading_paragraph_from_media')) {
|
|
68
|
+
tr.setSelection(new TextSelection(tr.doc.resolve(endPos), tr.doc.resolve(endPos)));
|
|
69
|
+
}
|
|
65
70
|
} else {
|
|
66
71
|
tr.replaceSelection(new Slice(Fragment.from(nodes), 0, openEnd));
|
|
67
72
|
}
|
|
@@ -112,7 +117,13 @@ export const insertMediaAsMediaSingle = (view, node, inputMethod, editorAnalytic
|
|
|
112
117
|
inputMethod,
|
|
113
118
|
fileExtension: node.attrs.__fileMimeType
|
|
114
119
|
};
|
|
115
|
-
return insertNodesWithOptionalParagraph(
|
|
120
|
+
return insertNodesWithOptionalParagraph({
|
|
121
|
+
nodes,
|
|
122
|
+
analyticsAttributes,
|
|
123
|
+
editorAnalyticsAPI,
|
|
124
|
+
isNestingInQuoteSupported,
|
|
125
|
+
insertMediaVia
|
|
126
|
+
})(state, dispatch);
|
|
116
127
|
};
|
|
117
128
|
const getFileExtension = fileName => {
|
|
118
129
|
if (fileName) {
|
|
@@ -152,10 +163,16 @@ export const insertMediaSingleNode = (view, mediaState, inputMethod, collection,
|
|
|
152
163
|
grandParentNodeType,
|
|
153
164
|
content: node
|
|
154
165
|
})) {
|
|
155
|
-
insertNodesWithOptionalParagraph(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
insertNodesWithOptionalParagraph({
|
|
167
|
+
nodes: [node],
|
|
168
|
+
analyticsAttributes: {
|
|
169
|
+
fileExtension,
|
|
170
|
+
inputMethod
|
|
171
|
+
},
|
|
172
|
+
editorAnalyticsAPI,
|
|
173
|
+
isNestingInQuoteSupported,
|
|
174
|
+
insertMediaVia
|
|
175
|
+
})(state, dispatch);
|
|
159
176
|
} else {
|
|
160
177
|
let tr = null;
|
|
161
178
|
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
@@ -203,11 +220,16 @@ export const changeFromMediaInlineToMediaSingleNode = (view, fromNode, widthPlug
|
|
|
203
220
|
grandParentNodeType,
|
|
204
221
|
content: node
|
|
205
222
|
})) {
|
|
206
|
-
return insertNodesWithOptionalParagraph(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
return insertNodesWithOptionalParagraph({
|
|
224
|
+
nodes: [node],
|
|
225
|
+
analyticsAttributes: {
|
|
226
|
+
fileExtension,
|
|
227
|
+
newType: ACTION_SUBJECT_ID.MEDIA_SINGLE,
|
|
228
|
+
previousType: ACTION_SUBJECT_ID.MEDIA_INLINE
|
|
229
|
+
},
|
|
230
|
+
editorAnalyticsAPI,
|
|
231
|
+
isNestingInQuoteSupported
|
|
232
|
+
})(state, dispatch);
|
|
211
233
|
} else {
|
|
212
234
|
const nodePos = state.tr.doc.resolve(state.selection.from).end();
|
|
213
235
|
let tr = null;
|
|
@@ -19,6 +19,7 @@ import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
|
19
19
|
import EditorUnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
20
20
|
import { R400 } from '@atlaskit/theme/colors';
|
|
21
21
|
const validationWrapper = css({
|
|
22
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
22
23
|
lineHeight: 0,
|
|
23
24
|
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-300, 24px)"} ${"var(--ds-space-150, 12px)"} 0`,
|
|
24
25
|
margin: `0 ${"var(--ds-space-050, 4px)"} 0 ${"var(--ds-space-400, 32px)"}`,
|
|
@@ -4,9 +4,9 @@ import { IconCard, IconEmbed, IconInline } from '@atlaskit/editor-common/card';
|
|
|
4
4
|
import commonMessages, { cardMessages, mediaAndEmbedToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
7
|
-
import ExpandIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
8
7
|
import ImageFullscreenIcon from '@atlaskit/icon/core/image-fullscreen';
|
|
9
8
|
import ImageInlineIcon from '@atlaskit/icon/core/image-inline';
|
|
9
|
+
import MaximizeIcon from '@atlaskit/icon/core/maximize';
|
|
10
10
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
11
11
|
import SmartLinkCardIcon from '@atlaskit/icon/core/smart-link-card';
|
|
12
12
|
import FilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
|
|
@@ -69,7 +69,7 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
69
69
|
id: 'editor.media.viewer',
|
|
70
70
|
testId: 'file-preview-toolbar-button',
|
|
71
71
|
type: 'button',
|
|
72
|
-
icon:
|
|
72
|
+
icon: MaximizeIcon,
|
|
73
73
|
iconFallback: FilePreviewIcon,
|
|
74
74
|
title: intl.formatMessage(messages.preview),
|
|
75
75
|
onClick: () => {
|
|
@@ -249,7 +249,7 @@ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecorati
|
|
|
249
249
|
id: 'editor.media.viewer',
|
|
250
250
|
testId: 'file-preview-toolbar-button',
|
|
251
251
|
type: 'button',
|
|
252
|
-
icon:
|
|
252
|
+
icon: MaximizeIcon,
|
|
253
253
|
iconFallback: FilePreviewIcon,
|
|
254
254
|
title: intl.formatMessage(messages.preview),
|
|
255
255
|
onClick: () => {
|