@atlaskit/editor-plugin-media-insert 19.0.2 → 19.0.4
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/mediaInsertPlugin.js +3 -1
- package/dist/cjs/ui/LocalMedia.js +15 -5
- package/dist/cjs/ui/MediaFromURL.js +25 -7
- package/dist/cjs/ui/MediaInsertPicker.js +9 -3
- package/dist/es2019/mediaInsertPlugin.js +3 -1
- package/dist/es2019/ui/LocalMedia.js +15 -5
- package/dist/es2019/ui/MediaFromURL.js +25 -7
- package/dist/es2019/ui/MediaInsertPicker.js +9 -3
- package/dist/esm/mediaInsertPlugin.js +3 -1
- package/dist/esm/ui/LocalMedia.js +15 -5
- package/dist/esm/ui/MediaFromURL.js +25 -7
- package/dist/esm/ui/MediaInsertPicker.js +9 -3
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 19.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`5892e575833a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5892e575833a1) -
|
|
14
|
+
Internal changes to remove unnecessary token fallbacks and imports from `@atlaskit/theme`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 19.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -114,7 +114,9 @@ var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin(_
|
|
|
114
114
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
115
115
|
popupsMountPoint: popupsMountPoint,
|
|
116
116
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
117
|
-
popupsScrollableElement: popupsScrollableElement
|
|
117
|
+
popupsScrollableElement: popupsScrollableElement
|
|
118
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
119
|
+
,
|
|
118
120
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
119
121
|
return editorView.dispatch((0, _actions.closeMediaInsertPicker)(editorView.state.tr));
|
|
120
122
|
},
|
|
@@ -160,7 +160,9 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
|
|
|
160
160
|
}, uploadState.error && /*#__PURE__*/_react.default.createElement(_sectionMessage.default, {
|
|
161
161
|
appearance: "error"
|
|
162
162
|
}, uploadState.error === 'upload_fail' ? strings.networkError : strings.genericError), /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
163
|
-
id: "local-media-upload-button"
|
|
163
|
+
id: "local-media-upload-button"
|
|
164
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
165
|
+
,
|
|
164
166
|
iconBefore: function iconBefore() {
|
|
165
167
|
return /*#__PURE__*/_react.default.createElement(_upload.default, {
|
|
166
168
|
label: ""
|
|
@@ -168,7 +170,9 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
|
|
|
168
170
|
},
|
|
169
171
|
ref: ref,
|
|
170
172
|
shouldFitContainer: true,
|
|
171
|
-
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
173
|
+
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
174
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
175
|
+
,
|
|
172
176
|
onClick: function onClick() {
|
|
173
177
|
onUploadButtonClickedAnalytics();
|
|
174
178
|
dispatch({
|
|
@@ -176,12 +180,16 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
|
|
|
176
180
|
});
|
|
177
181
|
}
|
|
178
182
|
}, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/_react.default.createElement(_mediaPicker.Browser, {
|
|
179
|
-
isOpen: uploadState.isOpen
|
|
183
|
+
isOpen: uploadState.isOpen
|
|
184
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
185
|
+
,
|
|
180
186
|
config: {
|
|
181
187
|
uploadParams: uploadParams,
|
|
182
188
|
multiple: true
|
|
183
189
|
},
|
|
184
|
-
mediaClientConfig: uploadMediaClientConfig
|
|
190
|
+
mediaClientConfig: uploadMediaClientConfig
|
|
191
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
192
|
+
,
|
|
185
193
|
onUploadsStart: function onUploadsStart() {
|
|
186
194
|
return onUploadCommencedAnalytics('local');
|
|
187
195
|
},
|
|
@@ -191,7 +199,9 @@ var LocalMedia = exports.LocalMedia = /*#__PURE__*/_react.default.forwardRef(fun
|
|
|
191
199
|
// for others like empty files. Those have their own feedback toast
|
|
192
200
|
// owned by media.
|
|
193
201
|
,
|
|
194
|
-
onError: onError
|
|
202
|
+
onError: onError
|
|
203
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
204
|
+
,
|
|
195
205
|
onClose: function onClose() {
|
|
196
206
|
erroredFileIds.clear();
|
|
197
207
|
dispatch({
|
|
@@ -69,6 +69,7 @@ var isValidUrl = exports.isValidUrl = function isValidUrl(value) {
|
|
|
69
69
|
}
|
|
70
70
|
new URL(value);
|
|
71
71
|
} catch (e) {
|
|
72
|
+
// eslint-disable-line no-unused-vars
|
|
72
73
|
return false;
|
|
73
74
|
}
|
|
74
75
|
return (0, _adfSchema.isSafeUrl)(value);
|
|
@@ -168,12 +169,14 @@ function MediaFromURL(_ref) {
|
|
|
168
169
|
occurrenceKey: uploadableFileUpfrontIds.occurrenceKey,
|
|
169
170
|
fileMimeType: mimeType
|
|
170
171
|
}
|
|
172
|
+
// eslint-disable-next-line no-unused-vars
|
|
171
173
|
});
|
|
172
174
|
_context.next = 22;
|
|
173
175
|
break;
|
|
174
176
|
case 19:
|
|
175
177
|
_context.prev = 19;
|
|
176
178
|
_context.t0 = _context["catch"](8);
|
|
179
|
+
// eslint-disable-line no-unused-vars
|
|
177
180
|
if (typeof _context.t0 === 'string' && _context.t0 === 'Could not download remote file') {
|
|
178
181
|
// TODO: ED-26962 - Make sure this gets good unit test coverage with the actual media plugin.
|
|
179
182
|
// This hard coded error message could be changed at any
|
|
@@ -284,6 +287,7 @@ function MediaFromURL(_ref) {
|
|
|
284
287
|
closeMediaInsertPicker();
|
|
285
288
|
}, [closeMediaInsertPicker, dispatchAnalyticsEvent]);
|
|
286
289
|
return /*#__PURE__*/_react.default.createElement(_form.default, {
|
|
290
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
287
291
|
onSubmit: function onSubmit(_ref3, form) {
|
|
288
292
|
var inputUrl = _ref3.inputUrl;
|
|
289
293
|
// This can be triggered from an enter key event on the input even when
|
|
@@ -313,7 +317,9 @@ function MediaFromURL(_ref) {
|
|
|
313
317
|
grow: "fill"
|
|
314
318
|
}, /*#__PURE__*/_react.default.createElement(_form.Field, {
|
|
315
319
|
isRequired: true,
|
|
316
|
-
name: "inputUrl"
|
|
320
|
+
name: "inputUrl"
|
|
321
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
322
|
+
,
|
|
317
323
|
validate: function validate(value) {
|
|
318
324
|
return value && isValidInput(value, customizedUrlValidation) ? undefined : strings.invalidUrl;
|
|
319
325
|
}
|
|
@@ -335,14 +341,20 @@ function MediaFromURL(_ref) {
|
|
|
335
341
|
"aria-label": (0, _platformFeatureFlags.fg)('platform_editor_nov_a11y_fixes') ? strings.pasteLinkToUpload : undefined,
|
|
336
342
|
placeholder: strings.pasteLinkToUpload,
|
|
337
343
|
maxLength: MAX_URL_LENGTH,
|
|
338
|
-
onKeyPress: onInputKeyPress
|
|
344
|
+
onKeyPress: onInputKeyPress
|
|
345
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
346
|
+
,
|
|
339
347
|
onPaste: function onPaste(event) {
|
|
340
348
|
return _onPaste(event, value);
|
|
341
|
-
}
|
|
349
|
+
}
|
|
350
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
351
|
+
,
|
|
342
352
|
onChange: function onChange(value) {
|
|
343
353
|
onURLChange(value);
|
|
344
354
|
_onChange(value);
|
|
345
|
-
}
|
|
355
|
+
}
|
|
356
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
357
|
+
,
|
|
346
358
|
onKeyDown: function onKeyDown(e) {
|
|
347
359
|
if (e.key === 'Enter') {
|
|
348
360
|
e.preventDefault();
|
|
@@ -356,12 +368,16 @@ function MediaFromURL(_ref) {
|
|
|
356
368
|
alignItems: "center",
|
|
357
369
|
justifyContent: "center"
|
|
358
370
|
}, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
359
|
-
type: "button"
|
|
371
|
+
type: "button"
|
|
372
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
373
|
+
,
|
|
360
374
|
onClick: function onClick() {
|
|
361
375
|
return formProps.onSubmit();
|
|
362
376
|
},
|
|
363
377
|
isLoading: previewState.isLoading,
|
|
364
|
-
isDisabled: !!error || !meta.dirty
|
|
378
|
+
isDisabled: !!error || !meta.dirty
|
|
379
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
380
|
+
,
|
|
365
381
|
iconBefore: function iconBefore() {
|
|
366
382
|
return /*#__PURE__*/_react.default.createElement(_growDiagonal.default, {
|
|
367
383
|
label: ""
|
|
@@ -386,7 +402,9 @@ function MediaFromURL(_ref) {
|
|
|
386
402
|
}, strings.cancel), /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
387
403
|
type: "button",
|
|
388
404
|
appearance: "primary",
|
|
389
|
-
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
405
|
+
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
406
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
407
|
+
,
|
|
390
408
|
onClick: function onClick() {
|
|
391
409
|
return formProps.onSubmit();
|
|
392
410
|
}
|
|
@@ -109,7 +109,9 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
|
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
111
|
return /*#__PURE__*/_react.default.createElement(PopupWithListeners, {
|
|
112
|
-
ariaLabel: intl.formatMessage(_messages.mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
112
|
+
ariaLabel: intl.formatMessage(_messages.mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
113
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
114
|
+
,
|
|
113
115
|
offset: [0, 12],
|
|
114
116
|
target: targetRef,
|
|
115
117
|
zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex,
|
|
@@ -132,7 +134,9 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
|
|
|
132
134
|
paddingBlockEnd: "space.150"
|
|
133
135
|
}, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, !isOnlyExternalLinks && /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.fileTabTitle)), /*#__PURE__*/_react.default.createElement(_tabs.Tab, null, intl.formatMessage(_messages.mediaInsertMessages.linkTabTitle)))), !isOnlyExternalLinks && /*#__PURE__*/_react.default.createElement(CustomTabPanel, null, /*#__PURE__*/_react.default.createElement(_LocalMedia.LocalMedia, {
|
|
134
136
|
ref: autofocusRef,
|
|
135
|
-
mediaProvider: mediaProvider
|
|
137
|
+
mediaProvider: mediaProvider
|
|
138
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
139
|
+
,
|
|
136
140
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
137
141
|
_closeMediaInsertPicker();
|
|
138
142
|
focusEditor();
|
|
@@ -141,7 +145,9 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
|
|
|
141
145
|
insertFile: insertFile
|
|
142
146
|
})), /*#__PURE__*/_react.default.createElement(CustomTabPanel, null, /*#__PURE__*/_react.default.createElement(_MediaFromURL.MediaFromURL, {
|
|
143
147
|
mediaProvider: mediaProvider,
|
|
144
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
148
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
149
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
150
|
+
,
|
|
145
151
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
146
152
|
_closeMediaInsertPicker();
|
|
147
153
|
focusEditor();
|
|
@@ -110,7 +110,9 @@ export const mediaInsertPlugin = ({
|
|
|
110
110
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
111
111
|
popupsMountPoint: popupsMountPoint,
|
|
112
112
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
113
|
-
popupsScrollableElement: popupsScrollableElement
|
|
113
|
+
popupsScrollableElement: popupsScrollableElement
|
|
114
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
115
|
+
,
|
|
114
116
|
closeMediaInsertPicker: () => editorView.dispatch(closeMediaInsertPicker(editorView.state.tr)),
|
|
115
117
|
insertMediaSingle: insertMediaSingle,
|
|
116
118
|
insertExternalMediaSingle: insertExternalMediaSingle,
|
|
@@ -150,13 +150,17 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
|
|
|
150
150
|
}, uploadState.error && /*#__PURE__*/React.createElement(SectionMessage, {
|
|
151
151
|
appearance: "error"
|
|
152
152
|
}, uploadState.error === 'upload_fail' ? strings.networkError : strings.genericError), /*#__PURE__*/React.createElement(Button, {
|
|
153
|
-
id: "local-media-upload-button"
|
|
153
|
+
id: "local-media-upload-button"
|
|
154
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
155
|
+
,
|
|
154
156
|
iconBefore: () => /*#__PURE__*/React.createElement(UploadIcon, {
|
|
155
157
|
label: ""
|
|
156
158
|
}),
|
|
157
159
|
ref: ref,
|
|
158
160
|
shouldFitContainer: true,
|
|
159
|
-
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
161
|
+
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
162
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
163
|
+
,
|
|
160
164
|
onClick: () => {
|
|
161
165
|
onUploadButtonClickedAnalytics();
|
|
162
166
|
dispatch({
|
|
@@ -164,12 +168,16 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
|
|
|
164
168
|
});
|
|
165
169
|
}
|
|
166
170
|
}, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
|
|
167
|
-
isOpen: uploadState.isOpen
|
|
171
|
+
isOpen: uploadState.isOpen
|
|
172
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
173
|
+
,
|
|
168
174
|
config: {
|
|
169
175
|
uploadParams: uploadParams,
|
|
170
176
|
multiple: true
|
|
171
177
|
},
|
|
172
|
-
mediaClientConfig: uploadMediaClientConfig
|
|
178
|
+
mediaClientConfig: uploadMediaClientConfig
|
|
179
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
180
|
+
,
|
|
173
181
|
onUploadsStart: () => onUploadCommencedAnalytics('local'),
|
|
174
182
|
onPreviewUpdate: onPreviewUpdate,
|
|
175
183
|
onEnd: onEnd
|
|
@@ -177,7 +185,9 @@ export const LocalMedia = /*#__PURE__*/React.forwardRef(({
|
|
|
177
185
|
// for others like empty files. Those have their own feedback toast
|
|
178
186
|
// owned by media.
|
|
179
187
|
,
|
|
180
|
-
onError: onError
|
|
188
|
+
onError: onError
|
|
189
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
190
|
+
,
|
|
181
191
|
onClose: () => {
|
|
182
192
|
erroredFileIds.clear();
|
|
183
193
|
dispatch({
|
|
@@ -52,6 +52,7 @@ export const isValidUrl = value => {
|
|
|
52
52
|
}
|
|
53
53
|
new URL(value);
|
|
54
54
|
} catch (e) {
|
|
55
|
+
// eslint-disable-line no-unused-vars
|
|
55
56
|
return false;
|
|
56
57
|
}
|
|
57
58
|
return isSafeUrl(value);
|
|
@@ -144,8 +145,10 @@ export function MediaFromURL({
|
|
|
144
145
|
occurrenceKey: uploadableFileUpfrontIds.occurrenceKey,
|
|
145
146
|
fileMimeType: mimeType
|
|
146
147
|
}
|
|
148
|
+
// eslint-disable-next-line no-unused-vars
|
|
147
149
|
});
|
|
148
150
|
} catch (e) {
|
|
151
|
+
// eslint-disable-line no-unused-vars
|
|
149
152
|
if (typeof e === 'string' && e === 'Could not download remote file') {
|
|
150
153
|
// TODO: ED-26962 - Make sure this gets good unit test coverage with the actual media plugin.
|
|
151
154
|
// This hard coded error message could be changed at any
|
|
@@ -248,6 +251,7 @@ export function MediaFromURL({
|
|
|
248
251
|
closeMediaInsertPicker();
|
|
249
252
|
}, [closeMediaInsertPicker, dispatchAnalyticsEvent]);
|
|
250
253
|
return /*#__PURE__*/React.createElement(Form, {
|
|
254
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
251
255
|
onSubmit: ({
|
|
252
256
|
inputUrl
|
|
253
257
|
}, form) => {
|
|
@@ -278,7 +282,9 @@ export function MediaFromURL({
|
|
|
278
282
|
grow: "fill"
|
|
279
283
|
}, /*#__PURE__*/React.createElement(Field, {
|
|
280
284
|
isRequired: true,
|
|
281
|
-
name: "inputUrl"
|
|
285
|
+
name: "inputUrl"
|
|
286
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
287
|
+
,
|
|
282
288
|
validate: value => value && isValidInput(value, customizedUrlValidation) ? undefined : strings.invalidUrl
|
|
283
289
|
}, ({
|
|
284
290
|
fieldProps: {
|
|
@@ -299,12 +305,18 @@ export function MediaFromURL({
|
|
|
299
305
|
"aria-label": fg('platform_editor_nov_a11y_fixes') ? strings.pasteLinkToUpload : undefined,
|
|
300
306
|
placeholder: strings.pasteLinkToUpload,
|
|
301
307
|
maxLength: MAX_URL_LENGTH,
|
|
302
|
-
onKeyPress: onInputKeyPress
|
|
303
|
-
|
|
308
|
+
onKeyPress: onInputKeyPress
|
|
309
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
310
|
+
,
|
|
311
|
+
onPaste: event => onPaste(event, value)
|
|
312
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
313
|
+
,
|
|
304
314
|
onChange: value => {
|
|
305
315
|
onURLChange(value);
|
|
306
316
|
onChange(value);
|
|
307
|
-
}
|
|
317
|
+
}
|
|
318
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
319
|
+
,
|
|
308
320
|
onKeyDown: e => {
|
|
309
321
|
if (e.key === 'Enter') {
|
|
310
322
|
e.preventDefault();
|
|
@@ -318,10 +330,14 @@ export function MediaFromURL({
|
|
|
318
330
|
alignItems: "center",
|
|
319
331
|
justifyContent: "center"
|
|
320
332
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
321
|
-
type: "button"
|
|
333
|
+
type: "button"
|
|
334
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
335
|
+
,
|
|
322
336
|
onClick: () => formProps.onSubmit(),
|
|
323
337
|
isLoading: previewState.isLoading,
|
|
324
|
-
isDisabled: !!error || !meta.dirty
|
|
338
|
+
isDisabled: !!error || !meta.dirty
|
|
339
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
340
|
+
,
|
|
325
341
|
iconBefore: () => /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
326
342
|
label: ""
|
|
327
343
|
})
|
|
@@ -343,7 +359,9 @@ export function MediaFromURL({
|
|
|
343
359
|
}, strings.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
344
360
|
type: "button",
|
|
345
361
|
appearance: "primary",
|
|
346
|
-
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
362
|
+
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
363
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
364
|
+
,
|
|
347
365
|
onClick: () => formProps.onSubmit()
|
|
348
366
|
}, strings.insert))))));
|
|
349
367
|
}
|
|
@@ -101,7 +101,9 @@ export const MediaInsertPicker = ({
|
|
|
101
101
|
focusEditor();
|
|
102
102
|
};
|
|
103
103
|
return /*#__PURE__*/React.createElement(PopupWithListeners, {
|
|
104
|
-
ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
104
|
+
ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
105
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
106
|
+
,
|
|
105
107
|
offset: [0, 12],
|
|
106
108
|
target: targetRef,
|
|
107
109
|
zIndex: akEditorFloatingDialogZIndex,
|
|
@@ -123,7 +125,9 @@ export const MediaInsertPicker = ({
|
|
|
123
125
|
paddingBlockEnd: "space.150"
|
|
124
126
|
}, /*#__PURE__*/React.createElement(TabList, null, !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.fileTabTitle)), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(LocalMedia, {
|
|
125
127
|
ref: autofocusRef,
|
|
126
|
-
mediaProvider: mediaProvider
|
|
128
|
+
mediaProvider: mediaProvider
|
|
129
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
130
|
+
,
|
|
127
131
|
closeMediaInsertPicker: () => {
|
|
128
132
|
closeMediaInsertPicker();
|
|
129
133
|
focusEditor();
|
|
@@ -132,7 +136,9 @@ export const MediaInsertPicker = ({
|
|
|
132
136
|
insertFile: insertFile
|
|
133
137
|
})), /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(MediaFromURL, {
|
|
134
138
|
mediaProvider: mediaProvider,
|
|
135
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
139
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
140
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
141
|
+
,
|
|
136
142
|
closeMediaInsertPicker: () => {
|
|
137
143
|
closeMediaInsertPicker();
|
|
138
144
|
focusEditor();
|
|
@@ -107,7 +107,9 @@ export var mediaInsertPlugin = function mediaInsertPlugin(_ref) {
|
|
|
107
107
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
108
108
|
popupsMountPoint: popupsMountPoint,
|
|
109
109
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
110
|
-
popupsScrollableElement: popupsScrollableElement
|
|
110
|
+
popupsScrollableElement: popupsScrollableElement
|
|
111
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
112
|
+
,
|
|
111
113
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
112
114
|
return editorView.dispatch(_closeMediaInsertPicker(editorView.state.tr));
|
|
113
115
|
},
|
|
@@ -151,7 +151,9 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
151
151
|
}, uploadState.error && /*#__PURE__*/React.createElement(SectionMessage, {
|
|
152
152
|
appearance: "error"
|
|
153
153
|
}, uploadState.error === 'upload_fail' ? strings.networkError : strings.genericError), /*#__PURE__*/React.createElement(Button, {
|
|
154
|
-
id: "local-media-upload-button"
|
|
154
|
+
id: "local-media-upload-button"
|
|
155
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
156
|
+
,
|
|
155
157
|
iconBefore: function iconBefore() {
|
|
156
158
|
return /*#__PURE__*/React.createElement(UploadIcon, {
|
|
157
159
|
label: ""
|
|
@@ -159,7 +161,9 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
159
161
|
},
|
|
160
162
|
ref: ref,
|
|
161
163
|
shouldFitContainer: true,
|
|
162
|
-
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
164
|
+
isDisabled: !uploadMediaClientConfig || !uploadParams
|
|
165
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
166
|
+
,
|
|
163
167
|
onClick: function onClick() {
|
|
164
168
|
onUploadButtonClickedAnalytics();
|
|
165
169
|
dispatch({
|
|
@@ -167,12 +171,16 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
167
171
|
});
|
|
168
172
|
}
|
|
169
173
|
}, strings.upload), uploadMediaClientConfig && uploadParams && /*#__PURE__*/React.createElement(Browser, {
|
|
170
|
-
isOpen: uploadState.isOpen
|
|
174
|
+
isOpen: uploadState.isOpen
|
|
175
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
176
|
+
,
|
|
171
177
|
config: {
|
|
172
178
|
uploadParams: uploadParams,
|
|
173
179
|
multiple: true
|
|
174
180
|
},
|
|
175
|
-
mediaClientConfig: uploadMediaClientConfig
|
|
181
|
+
mediaClientConfig: uploadMediaClientConfig
|
|
182
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
183
|
+
,
|
|
176
184
|
onUploadsStart: function onUploadsStart() {
|
|
177
185
|
return onUploadCommencedAnalytics('local');
|
|
178
186
|
},
|
|
@@ -182,7 +190,9 @@ export var LocalMedia = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
182
190
|
// for others like empty files. Those have their own feedback toast
|
|
183
191
|
// owned by media.
|
|
184
192
|
,
|
|
185
|
-
onError: onError
|
|
193
|
+
onError: onError
|
|
194
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
195
|
+
,
|
|
186
196
|
onClose: function onClose() {
|
|
187
197
|
erroredFileIds.clear();
|
|
188
198
|
dispatch({
|
|
@@ -60,6 +60,7 @@ export var isValidUrl = function isValidUrl(value) {
|
|
|
60
60
|
}
|
|
61
61
|
new URL(value);
|
|
62
62
|
} catch (e) {
|
|
63
|
+
// eslint-disable-line no-unused-vars
|
|
63
64
|
return false;
|
|
64
65
|
}
|
|
65
66
|
return isSafeUrl(value);
|
|
@@ -159,12 +160,14 @@ export function MediaFromURL(_ref) {
|
|
|
159
160
|
occurrenceKey: uploadableFileUpfrontIds.occurrenceKey,
|
|
160
161
|
fileMimeType: mimeType
|
|
161
162
|
}
|
|
163
|
+
// eslint-disable-next-line no-unused-vars
|
|
162
164
|
});
|
|
163
165
|
_context.next = 22;
|
|
164
166
|
break;
|
|
165
167
|
case 19:
|
|
166
168
|
_context.prev = 19;
|
|
167
169
|
_context.t0 = _context["catch"](8);
|
|
170
|
+
// eslint-disable-line no-unused-vars
|
|
168
171
|
if (typeof _context.t0 === 'string' && _context.t0 === 'Could not download remote file') {
|
|
169
172
|
// TODO: ED-26962 - Make sure this gets good unit test coverage with the actual media plugin.
|
|
170
173
|
// This hard coded error message could be changed at any
|
|
@@ -275,6 +278,7 @@ export function MediaFromURL(_ref) {
|
|
|
275
278
|
closeMediaInsertPicker();
|
|
276
279
|
}, [closeMediaInsertPicker, dispatchAnalyticsEvent]);
|
|
277
280
|
return /*#__PURE__*/React.createElement(Form, {
|
|
281
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
278
282
|
onSubmit: function onSubmit(_ref3, form) {
|
|
279
283
|
var inputUrl = _ref3.inputUrl;
|
|
280
284
|
// This can be triggered from an enter key event on the input even when
|
|
@@ -304,7 +308,9 @@ export function MediaFromURL(_ref) {
|
|
|
304
308
|
grow: "fill"
|
|
305
309
|
}, /*#__PURE__*/React.createElement(Field, {
|
|
306
310
|
isRequired: true,
|
|
307
|
-
name: "inputUrl"
|
|
311
|
+
name: "inputUrl"
|
|
312
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
313
|
+
,
|
|
308
314
|
validate: function validate(value) {
|
|
309
315
|
return value && isValidInput(value, customizedUrlValidation) ? undefined : strings.invalidUrl;
|
|
310
316
|
}
|
|
@@ -326,14 +332,20 @@ export function MediaFromURL(_ref) {
|
|
|
326
332
|
"aria-label": fg('platform_editor_nov_a11y_fixes') ? strings.pasteLinkToUpload : undefined,
|
|
327
333
|
placeholder: strings.pasteLinkToUpload,
|
|
328
334
|
maxLength: MAX_URL_LENGTH,
|
|
329
|
-
onKeyPress: onInputKeyPress
|
|
335
|
+
onKeyPress: onInputKeyPress
|
|
336
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
337
|
+
,
|
|
330
338
|
onPaste: function onPaste(event) {
|
|
331
339
|
return _onPaste(event, value);
|
|
332
|
-
}
|
|
340
|
+
}
|
|
341
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
342
|
+
,
|
|
333
343
|
onChange: function onChange(value) {
|
|
334
344
|
onURLChange(value);
|
|
335
345
|
_onChange(value);
|
|
336
|
-
}
|
|
346
|
+
}
|
|
347
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
348
|
+
,
|
|
337
349
|
onKeyDown: function onKeyDown(e) {
|
|
338
350
|
if (e.key === 'Enter') {
|
|
339
351
|
e.preventDefault();
|
|
@@ -347,12 +359,16 @@ export function MediaFromURL(_ref) {
|
|
|
347
359
|
alignItems: "center",
|
|
348
360
|
justifyContent: "center"
|
|
349
361
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
350
|
-
type: "button"
|
|
362
|
+
type: "button"
|
|
363
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
364
|
+
,
|
|
351
365
|
onClick: function onClick() {
|
|
352
366
|
return formProps.onSubmit();
|
|
353
367
|
},
|
|
354
368
|
isLoading: previewState.isLoading,
|
|
355
|
-
isDisabled: !!error || !meta.dirty
|
|
369
|
+
isDisabled: !!error || !meta.dirty
|
|
370
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
371
|
+
,
|
|
356
372
|
iconBefore: function iconBefore() {
|
|
357
373
|
return /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
358
374
|
label: ""
|
|
@@ -377,7 +393,9 @@ export function MediaFromURL(_ref) {
|
|
|
377
393
|
}, strings.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
378
394
|
type: "button",
|
|
379
395
|
appearance: "primary",
|
|
380
|
-
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
396
|
+
isDisabled: isOnlyExternalLinks ? !input || !isValidInput(input, customizedUrlValidation) : !previewState.previewInfo && !previewState.warning
|
|
397
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
398
|
+
,
|
|
381
399
|
onClick: function onClick() {
|
|
382
400
|
return formProps.onSubmit();
|
|
383
401
|
}
|
|
@@ -100,7 +100,9 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
return /*#__PURE__*/React.createElement(PopupWithListeners, {
|
|
103
|
-
ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
103
|
+
ariaLabel: intl.formatMessage(mediaInsertMessages.mediaPickerPopupAriaLabel)
|
|
104
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
105
|
+
,
|
|
104
106
|
offset: [0, 12],
|
|
105
107
|
target: targetRef,
|
|
106
108
|
zIndex: akEditorFloatingDialogZIndex,
|
|
@@ -123,7 +125,9 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
123
125
|
paddingBlockEnd: "space.150"
|
|
124
126
|
}, /*#__PURE__*/React.createElement(TabList, null, !isOnlyExternalLinks && /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.fileTabTitle)), /*#__PURE__*/React.createElement(Tab, null, intl.formatMessage(mediaInsertMessages.linkTabTitle)))), !isOnlyExternalLinks && /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(LocalMedia, {
|
|
125
127
|
ref: autofocusRef,
|
|
126
|
-
mediaProvider: mediaProvider
|
|
128
|
+
mediaProvider: mediaProvider
|
|
129
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
130
|
+
,
|
|
127
131
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
128
132
|
_closeMediaInsertPicker();
|
|
129
133
|
focusEditor();
|
|
@@ -132,7 +136,9 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
132
136
|
insertFile: insertFile
|
|
133
137
|
})), /*#__PURE__*/React.createElement(CustomTabPanel, null, /*#__PURE__*/React.createElement(MediaFromURL, {
|
|
134
138
|
mediaProvider: mediaProvider,
|
|
135
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
139
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
140
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
141
|
+
,
|
|
136
142
|
closeMediaInsertPicker: function closeMediaInsertPicker() {
|
|
137
143
|
_closeMediaInsertPicker();
|
|
138
144
|
focusEditor();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.4",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"@atlaskit/adf-schema": "^52.4.0",
|
|
25
25
|
"@atlaskit/button": "^23.10.0",
|
|
26
26
|
"@atlaskit/editor-plugin-analytics": "^8.0.0",
|
|
27
|
-
"@atlaskit/editor-plugin-media": "^10.
|
|
27
|
+
"@atlaskit/editor-plugin-media": "^10.1.0",
|
|
28
28
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
29
29
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
30
|
-
"@atlaskit/form": "^15.
|
|
31
|
-
"@atlaskit/icon": "^
|
|
32
|
-
"@atlaskit/media-card": "^79.
|
|
30
|
+
"@atlaskit/form": "^15.5.0",
|
|
31
|
+
"@atlaskit/icon": "^34.0.0",
|
|
32
|
+
"@atlaskit/media-card": "^79.16.0",
|
|
33
33
|
"@atlaskit/media-client": "^36.0.0",
|
|
34
34
|
"@atlaskit/media-client-react": "^5.0.0",
|
|
35
35
|
"@atlaskit/media-picker": "^70.1.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
|
-
"@atlaskit/primitives": "^18.
|
|
37
|
+
"@atlaskit/primitives": "^18.1.0",
|
|
38
38
|
"@atlaskit/section-message": "^8.12.0",
|
|
39
39
|
"@atlaskit/tabs": "^19.0.0",
|
|
40
40
|
"@atlaskit/textfield": "^8.2.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^112.
|
|
46
|
-
"@atlaskit/tokens": "^11.
|
|
45
|
+
"@atlaskit/editor-common": "^112.15.0",
|
|
46
|
+
"@atlaskit/tokens": "^11.4.0",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0"
|
|
49
49
|
},
|