@atlaskit/editor-plugin-media 8.4.7 → 8.4.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 +16 -0
- package/dist/cjs/nodeviews/mediaNodeView/media.js +9 -0
- package/dist/cjs/pm-plugins/utils/media-files.js +12 -22
- package/dist/es2019/nodeviews/mediaNodeView/media.js +9 -0
- package/dist/es2019/pm-plugins/utils/media-files.js +12 -22
- package/dist/esm/nodeviews/mediaNodeView/media.js +9 -0
- package/dist/esm/pm-plugins/utils/media-files.js +12 -22
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 8.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`768cc7c86e0af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/768cc7c86e0af) -
|
|
8
|
+
[FG-CLEANUP] platform_editor_track_media_fail_to_insert
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 8.4.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`dbf82f5cfa21e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dbf82f5cfa21e) -
|
|
16
|
+
fix media border styles mutation
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 8.4.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -263,6 +263,15 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
263
263
|
alt = _node$attrs.alt;
|
|
264
264
|
var hasNoMediaClientConfig = !viewMediaClientConfig && ((0, _platformFeatureFlags.fg)('platform_media_video_captions') ? !viewAndUploadMediaClientConfig : true);
|
|
265
265
|
if (isLoading || type !== 'external' && hasNoMediaClientConfig) {
|
|
266
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true)) {
|
|
267
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MediaCardWrapper, {
|
|
268
|
+
dimensions: originalDimensions,
|
|
269
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
270
|
+
selected: selected
|
|
271
|
+
}, /*#__PURE__*/_react.default.createElement(_mediaCard.CardLoading, {
|
|
272
|
+
interactionName: "editor-media-card-loading"
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
266
275
|
return /*#__PURE__*/_react.default.createElement(_styles.MediaCardWrapper, {
|
|
267
276
|
dimensions: originalDimensions
|
|
268
277
|
}, /*#__PURE__*/_react.default.createElement(_mediaCard.CardLoading, {
|
|
@@ -11,7 +11,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
12
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
13
13
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _isType = require("./is-type");
|
|
16
15
|
var _mediaCommon = require("./media-common");
|
|
17
16
|
var _mediaInline2 = require("./media-inline");
|
|
@@ -166,33 +165,24 @@ var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMedia
|
|
|
166
165
|
|
|
167
166
|
// Delete the selection if a selection is made
|
|
168
167
|
var deleteRange = findDeleteRange(state);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
try {
|
|
172
|
-
if (!deleteRange) {
|
|
173
|
-
tr.insert(pos, content);
|
|
174
|
-
} else {
|
|
175
|
-
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
176
|
-
}
|
|
177
|
-
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
178
|
-
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
179
|
-
} else {
|
|
180
|
-
payload = getFailToInsertAnalytics(mediaState, _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
181
|
-
}
|
|
182
|
-
} catch (error) {
|
|
183
|
-
payload = getFailToInsertAnalytics(mediaState, _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
184
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
185
|
-
error.toString());
|
|
186
|
-
}
|
|
187
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
188
|
-
} else {
|
|
168
|
+
var payload;
|
|
169
|
+
try {
|
|
189
170
|
if (!deleteRange) {
|
|
190
171
|
tr.insert(pos, content);
|
|
191
172
|
} else {
|
|
192
173
|
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
193
174
|
}
|
|
194
|
-
|
|
175
|
+
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
176
|
+
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
177
|
+
} else {
|
|
178
|
+
payload = getFailToInsertAnalytics(mediaState, _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
payload = getFailToInsertAnalytics(mediaState, _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
183
|
+
error.toString());
|
|
195
184
|
}
|
|
185
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
196
186
|
dispatch(tr);
|
|
197
187
|
return true;
|
|
198
188
|
};
|
|
@@ -205,6 +205,15 @@ export class MediaNode extends Component {
|
|
|
205
205
|
} = node.attrs;
|
|
206
206
|
const hasNoMediaClientConfig = !viewMediaClientConfig && (fg('platform_media_video_captions') ? !viewAndUploadMediaClientConfig : true);
|
|
207
207
|
if (isLoading || type !== 'external' && hasNoMediaClientConfig) {
|
|
208
|
+
if (expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true)) {
|
|
209
|
+
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
210
|
+
dimensions: originalDimensions,
|
|
211
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
212
|
+
selected: selected
|
|
213
|
+
}, /*#__PURE__*/React.createElement(CardLoading, {
|
|
214
|
+
interactionName: "editor-media-card-loading"
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
208
217
|
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
209
218
|
dimensions: originalDimensions
|
|
210
219
|
}, /*#__PURE__*/React.createElement(CardLoading, {
|
|
@@ -5,7 +5,6 @@ import { findFarthestParentNode, insideTableCell, isInLayoutColumn, isInListItem
|
|
|
5
5
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
7
|
import { canInsert, hasParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { isImage } from './is-type';
|
|
10
9
|
import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph, isSelectionNonMediaBlockNode, posOfMediaGroupNearby, posOfParentMediaGroup, posOfPrecedingMediaGroup } from './media-common';
|
|
11
10
|
import { isInSupportedInlineImageParent } from './media-inline';
|
|
@@ -175,33 +174,24 @@ export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, co
|
|
|
175
174
|
|
|
176
175
|
// Delete the selection if a selection is made
|
|
177
176
|
const deleteRange = findDeleteRange(state);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
try {
|
|
181
|
-
if (!deleteRange) {
|
|
182
|
-
tr.insert(pos, content);
|
|
183
|
-
} else {
|
|
184
|
-
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
185
|
-
}
|
|
186
|
-
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
187
|
-
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
188
|
-
} else {
|
|
189
|
-
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
190
|
-
}
|
|
191
|
-
} catch (error) {
|
|
192
|
-
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
193
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
194
|
-
error.toString());
|
|
195
|
-
}
|
|
196
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
197
|
-
} else {
|
|
177
|
+
let payload;
|
|
178
|
+
try {
|
|
198
179
|
if (!deleteRange) {
|
|
199
180
|
tr.insert(pos, content);
|
|
200
181
|
} else {
|
|
201
182
|
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
202
183
|
}
|
|
203
|
-
|
|
184
|
+
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
185
|
+
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
186
|
+
} else {
|
|
187
|
+
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
188
|
+
}
|
|
189
|
+
} catch (error) {
|
|
190
|
+
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
192
|
+
error.toString());
|
|
204
193
|
}
|
|
194
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
205
195
|
dispatch(tr);
|
|
206
196
|
return true;
|
|
207
197
|
};
|
|
@@ -255,6 +255,15 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
255
255
|
alt = _node$attrs.alt;
|
|
256
256
|
var hasNoMediaClientConfig = !viewMediaClientConfig && (fg('platform_media_video_captions') ? !viewAndUploadMediaClientConfig : true);
|
|
257
257
|
if (isLoading || type !== 'external' && hasNoMediaClientConfig) {
|
|
258
|
+
if (expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true)) {
|
|
259
|
+
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
260
|
+
dimensions: originalDimensions,
|
|
261
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
262
|
+
selected: selected
|
|
263
|
+
}, /*#__PURE__*/React.createElement(CardLoading, {
|
|
264
|
+
interactionName: "editor-media-card-loading"
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
258
267
|
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
259
268
|
dimensions: originalDimensions
|
|
260
269
|
}, /*#__PURE__*/React.createElement(CardLoading, {
|
|
@@ -5,7 +5,6 @@ import { findFarthestParentNode, insideTableCell, isInLayoutColumn, isInListItem
|
|
|
5
5
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
7
|
import { canInsert, hasParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { isImage } from './is-type';
|
|
10
9
|
import { copyOptionalAttrsFromMediaState, isInsidePotentialEmptyParagraph, isSelectionNonMediaBlockNode, posOfMediaGroupNearby, posOfParentMediaGroup, posOfPrecedingMediaGroup } from './media-common';
|
|
11
10
|
import { isInSupportedInlineImageParent } from './media-inline';
|
|
@@ -160,33 +159,24 @@ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalytic
|
|
|
160
159
|
|
|
161
160
|
// Delete the selection if a selection is made
|
|
162
161
|
var deleteRange = findDeleteRange(state);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
try {
|
|
166
|
-
if (!deleteRange) {
|
|
167
|
-
tr.insert(pos, content);
|
|
168
|
-
} else {
|
|
169
|
-
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
170
|
-
}
|
|
171
|
-
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
172
|
-
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
173
|
-
} else {
|
|
174
|
-
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
175
|
-
}
|
|
176
|
-
} catch (error) {
|
|
177
|
-
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
-
error.toString());
|
|
180
|
-
}
|
|
181
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
182
|
-
} else {
|
|
162
|
+
var payload;
|
|
163
|
+
try {
|
|
183
164
|
if (!deleteRange) {
|
|
184
165
|
tr.insert(pos, content);
|
|
185
166
|
} else {
|
|
186
167
|
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
187
168
|
}
|
|
188
|
-
|
|
169
|
+
if (hasInsertedNodeOfType(tr, 'mediaInline')) {
|
|
170
|
+
payload = getInsertMediaInlineAnalytics(mediaState, inputMethod, insertMediaVia);
|
|
171
|
+
} else {
|
|
172
|
+
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia);
|
|
173
|
+
}
|
|
174
|
+
} catch (error) {
|
|
175
|
+
payload = getFailToInsertAnalytics(mediaState, ACTION_SUBJECT_ID.MEDIA_INLINE, inputMethod, insertMediaVia,
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
+
error.toString());
|
|
189
178
|
}
|
|
179
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
190
180
|
dispatch(tr);
|
|
191
181
|
return true;
|
|
192
182
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.9",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/form": "^14.2.0",
|
|
55
55
|
"@atlaskit/icon": "^29.0.0",
|
|
56
56
|
"@atlaskit/icon-lab": "^5.12.0",
|
|
57
|
-
"@atlaskit/media-card": "^79.
|
|
57
|
+
"@atlaskit/media-card": "^79.7.0",
|
|
58
58
|
"@atlaskit/media-client": "^35.6.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
60
60
|
"@atlaskit/media-common": "^12.3.0",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"@atlaskit/media-viewer": "^52.4.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
66
66
|
"@atlaskit/primitives": "^16.1.0",
|
|
67
|
-
"@atlaskit/textfield": "^8.
|
|
67
|
+
"@atlaskit/textfield": "^8.1.0",
|
|
68
68
|
"@atlaskit/theme": "^21.0.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
70
70
|
"@atlaskit/tokens": "^8.0.0",
|
|
71
71
|
"@atlaskit/tooltip": "^20.8.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"uuid": "^3.1.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@atlaskit/editor-common": "^110.
|
|
81
|
+
"@atlaskit/editor-common": "^110.29.0",
|
|
82
82
|
"@atlaskit/media-core": "^37.0.0",
|
|
83
83
|
"react": "^18.2.0",
|
|
84
84
|
"react-dom": "^18.2.0",
|
|
@@ -151,9 +151,6 @@
|
|
|
151
151
|
"platform_editor_ssr_media": {
|
|
152
152
|
"type": "boolean"
|
|
153
153
|
},
|
|
154
|
-
"platform_editor_track_media_fail_to_insert": {
|
|
155
|
-
"type": "boolean"
|
|
156
|
-
},
|
|
157
154
|
"confluence_frontend_preload_inline_comment_editor": {
|
|
158
155
|
"type": "boolean"
|
|
159
156
|
},
|