@atlaskit/editor-plugin-media 10.0.11 → 10.1.1
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 +18 -0
- package/dist/cjs/mediaPlugin.js +6 -3
- package/dist/cjs/nodeviews/mediaGroup.js +6 -2
- package/dist/cjs/nodeviews/mediaGroupNext.js +1 -0
- package/dist/cjs/nodeviews/mediaInline.js +10 -4
- package/dist/cjs/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/cjs/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/cjs/nodeviews/mediaSingle.js +6 -2
- package/dist/cjs/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
- package/dist/cjs/ui/CommentBadge/index.js +6 -2
- package/dist/cjs/ui/ImageBorder/index.js +40 -13
- package/dist/cjs/ui/MediaLinkingToolbar.js +18 -6
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/cjs/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/cjs/ui/toolbar/index.js +6 -2
- package/dist/cjs/ui/toolbar/layout-group.js +3 -1
- package/dist/cjs/ui/toolbar/linking.js +15 -5
- package/dist/cjs/ui/toolbar/mediaInline.js +6 -2
- package/dist/es2019/mediaPlugin.js +6 -3
- package/dist/es2019/nodeviews/mediaGroup.js +6 -2
- package/dist/es2019/nodeviews/mediaGroupNext.js +1 -0
- package/dist/es2019/nodeviews/mediaInline.js +11 -4
- package/dist/es2019/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/es2019/nodeviews/mediaSingle.js +6 -2
- package/dist/es2019/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +77 -71
- package/dist/es2019/ui/CommentBadge/index.js +6 -2
- package/dist/es2019/ui/ImageBorder/index.js +40 -13
- package/dist/es2019/ui/MediaLinkingToolbar.js +18 -6
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/es2019/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/es2019/ui/toolbar/index.js +6 -2
- package/dist/es2019/ui/toolbar/layout-group.js +3 -1
- package/dist/es2019/ui/toolbar/linking.js +15 -5
- package/dist/es2019/ui/toolbar/mediaInline.js +6 -2
- package/dist/esm/mediaPlugin.js +6 -3
- package/dist/esm/nodeviews/mediaGroup.js +6 -2
- package/dist/esm/nodeviews/mediaGroupNext.js +1 -0
- package/dist/esm/nodeviews/mediaInline.js +10 -4
- package/dist/esm/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/esm/nodeviews/mediaSingle.js +6 -2
- package/dist/esm/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
- package/dist/esm/ui/CommentBadge/index.js +6 -2
- package/dist/esm/ui/ImageBorder/index.js +40 -13
- package/dist/esm/ui/MediaLinkingToolbar.js +18 -6
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/esm/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/esm/ui/toolbar/index.js +6 -2
- package/dist/esm/ui/toolbar/layout-group.js +3 -1
- package/dist/esm/ui/toolbar/linking.js +15 -5
- package/dist/esm/ui/toolbar/mediaInline.js +6 -2
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
- package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +3 -1
- package/dist/types-ts4.5/types/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
- package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +3 -1
- package/package.json +5 -5
|
@@ -175,20 +175,26 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
175
175
|
css: contextualSubMenu(0),
|
|
176
176
|
ref: handleSubMenuRef
|
|
177
177
|
}, jsx(ArrowKeyNavigationProvider, {
|
|
178
|
-
type: ArrowKeyNavigationType.MENU
|
|
178
|
+
type: ArrowKeyNavigationType.MENU
|
|
179
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
180
|
+
,
|
|
179
181
|
handleClose: function handleClose(e) {
|
|
180
182
|
e.preventDefault();
|
|
181
183
|
e.stopPropagation();
|
|
182
184
|
handleColorSubmenuEsc();
|
|
183
185
|
},
|
|
184
186
|
disableCloseOnArrowClick: true
|
|
185
|
-
}, jsx(ColorPalette
|
|
187
|
+
}, jsx(ColorPalette
|
|
188
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
189
|
+
, {
|
|
186
190
|
onClick: function onClick(color) {
|
|
187
191
|
setBorder({
|
|
188
192
|
color: color
|
|
189
193
|
});
|
|
190
194
|
setIsOpen(!isOpen);
|
|
191
|
-
}
|
|
195
|
+
}
|
|
196
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
197
|
+
,
|
|
192
198
|
onKeyDown: function onKeyDown(color, _, event) {
|
|
193
199
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
194
200
|
var _openDropdownButtonRe;
|
|
@@ -201,7 +207,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
201
207
|
(_openDropdownButtonRe = openDropdownButtonRef.current) === null || _openDropdownButtonRe === void 0 || _openDropdownButtonRe.focus();
|
|
202
208
|
}
|
|
203
209
|
},
|
|
204
|
-
selectedColor: color !== null && color !== void 0 ? color : null
|
|
210
|
+
selectedColor: color !== null && color !== void 0 ? color : null
|
|
211
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
212
|
+
,
|
|
205
213
|
paletteOptions: {
|
|
206
214
|
palette: borderColorPalette,
|
|
207
215
|
paletteColorTooltipMessages: borderPaletteTooltipMessages,
|
|
@@ -247,7 +255,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
247
255
|
className: DropdownMenuSharedCssClassName.SUBMENU,
|
|
248
256
|
ref: sizeSubmenuRef
|
|
249
257
|
}, isSizeSubmenuOpen && jsx(ArrowKeyNavigationProvider, {
|
|
250
|
-
type: ArrowKeyNavigationType.MENU
|
|
258
|
+
type: ArrowKeyNavigationType.MENU
|
|
259
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
260
|
+
,
|
|
251
261
|
handleClose: function handleClose(e) {
|
|
252
262
|
e.preventDefault();
|
|
253
263
|
handleSizeSubmenuEsc();
|
|
@@ -360,11 +370,15 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
360
370
|
spacing: "spacious",
|
|
361
371
|
label: "",
|
|
362
372
|
size: "small"
|
|
363
|
-
})
|
|
373
|
+
})
|
|
374
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
375
|
+
,
|
|
364
376
|
onClick: function onClick() {
|
|
365
377
|
setIsOpen(!isOpen);
|
|
366
378
|
setIsOpenedByKeyboard(false);
|
|
367
|
-
}
|
|
379
|
+
}
|
|
380
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
381
|
+
,
|
|
368
382
|
onKeyDown: function onKeyDown(e) {
|
|
369
383
|
return handleTriggerToolbarByKeyboard(e, function () {
|
|
370
384
|
return setIsOpen(!isOpen);
|
|
@@ -387,6 +401,7 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
387
401
|
//This needs be removed when the a11y is completely handled
|
|
388
402
|
//Disabling key navigation now as it works only partially
|
|
389
403
|
//Same with packages/editor/editor-plugin-table/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx
|
|
404
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
390
405
|
, {
|
|
391
406
|
arrowKeyNavigationProviderOptions: {
|
|
392
407
|
type: ArrowKeyNavigationType.MENU,
|
|
@@ -398,20 +413,28 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
398
413
|
} : function () {
|
|
399
414
|
var _openDropdownButtonRe3;
|
|
400
415
|
(_openDropdownButtonRe3 = openDropdownButtonRef.current) === null || _openDropdownButtonRe3 === void 0 || _openDropdownButtonRe3.focus();
|
|
401
|
-
}
|
|
416
|
+
}
|
|
417
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
418
|
+
,
|
|
402
419
|
items: [{
|
|
403
420
|
items: items
|
|
404
421
|
}],
|
|
405
|
-
isOpen: isOpen
|
|
422
|
+
isOpen: isOpen
|
|
423
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
424
|
+
,
|
|
406
425
|
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
407
426
|
return isOpenByKeyboard;
|
|
408
|
-
}
|
|
427
|
+
}
|
|
428
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
429
|
+
,
|
|
409
430
|
onOpenChange: function onOpenChange() {
|
|
410
431
|
setIsOpen(false);
|
|
411
432
|
setIsColorSubmenuOpen(false);
|
|
412
433
|
setIsSizeSubmenuOpen(false);
|
|
413
434
|
setIsOpenedByKeyboard(false);
|
|
414
|
-
}
|
|
435
|
+
}
|
|
436
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
437
|
+
,
|
|
415
438
|
onItemActivated: function onItemActivated(_ref3) {
|
|
416
439
|
var item = _ref3.item;
|
|
417
440
|
if (item.value.name === 'color') {
|
|
@@ -440,7 +463,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
440
463
|
setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
|
|
441
464
|
}
|
|
442
465
|
}
|
|
443
|
-
}
|
|
466
|
+
}
|
|
467
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
468
|
+
,
|
|
444
469
|
onMouseEnter: function onMouseEnter(_ref4) {
|
|
445
470
|
var item = _ref4.item;
|
|
446
471
|
if (!expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
|
|
@@ -453,7 +478,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
453
478
|
setIsOpenedByKeyboard(false);
|
|
454
479
|
}
|
|
455
480
|
}
|
|
456
|
-
}
|
|
481
|
+
}
|
|
482
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
483
|
+
,
|
|
457
484
|
onMouseLeave: function onMouseLeave(_ref5) {
|
|
458
485
|
var item = _ref5.item;
|
|
459
486
|
if (!expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
|
|
@@ -122,13 +122,17 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
122
122
|
icon: jsx(ChevronLeftLargeIcon, {
|
|
123
123
|
label: formatLinkAddressText,
|
|
124
124
|
size: "small"
|
|
125
|
-
})
|
|
125
|
+
})
|
|
126
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
127
|
+
,
|
|
126
128
|
onClick: function onClick() {
|
|
127
129
|
return _this.handleOnBack({
|
|
128
130
|
url: value,
|
|
129
131
|
inputMethod: currentInputMethod
|
|
130
132
|
});
|
|
131
|
-
}
|
|
133
|
+
}
|
|
134
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
135
|
+
,
|
|
132
136
|
onKeyDown: function onKeyDown(event) {
|
|
133
137
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
134
138
|
event.preventDefault();
|
|
@@ -145,7 +149,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
149
|
placeholder: getPlaceholder(!!activityProvider),
|
|
146
150
|
autoFocus: true,
|
|
147
151
|
onCancel: _this.handleCancel,
|
|
148
|
-
defaultValue: value
|
|
152
|
+
defaultValue: value
|
|
153
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
154
|
+
,
|
|
149
155
|
onSubmit: function onSubmit(inputValue) {
|
|
150
156
|
var validationErrors = _this.getValidationErrors(inputValue, currentInputMethod);
|
|
151
157
|
_this.setState({
|
|
@@ -154,7 +160,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
154
160
|
if (!validationErrors.length) {
|
|
155
161
|
_onSubmit();
|
|
156
162
|
}
|
|
157
|
-
}
|
|
163
|
+
}
|
|
164
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
165
|
+
,
|
|
158
166
|
onChange: function onChange(value) {
|
|
159
167
|
_this.setState({
|
|
160
168
|
validationErrors: []
|
|
@@ -171,10 +179,14 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
171
179
|
title: formatUnlinkText,
|
|
172
180
|
icon: jsx(EditorUnlinkIcon, {
|
|
173
181
|
label: formatUnlinkText
|
|
174
|
-
})
|
|
182
|
+
})
|
|
183
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
184
|
+
,
|
|
175
185
|
onClick: function onClick() {
|
|
176
186
|
return _this.handleUnlink();
|
|
177
|
-
}
|
|
187
|
+
}
|
|
188
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
189
|
+
,
|
|
178
190
|
onKeyDown: function onKeyDown(event) {
|
|
179
191
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
180
192
|
event.preventDefault();
|
|
@@ -41,10 +41,14 @@ var DropzoneWrapperInternal = function DropzoneWrapperInternal(_ref) {
|
|
|
41
41
|
config: dropzoneConfig,
|
|
42
42
|
onError: pickerFacadeInstance.handleUploadError,
|
|
43
43
|
onPreviewUpdate: pickerFacadeInstance.handleUploadPreviewUpdate,
|
|
44
|
-
onEnd: pickerFacadeInstance.handleReady
|
|
44
|
+
onEnd: pickerFacadeInstance.handleReady
|
|
45
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
46
|
+
,
|
|
45
47
|
onDragEnter: function onDragEnter() {
|
|
46
48
|
return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('enter');
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
51
|
+
,
|
|
48
52
|
onDragLeave: function onDragLeave() {
|
|
49
53
|
return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('leave');
|
|
50
54
|
},
|
|
@@ -108,6 +108,7 @@ export default function PickerFacadeProvider(_ref) {
|
|
|
108
108
|
}(), [analyticsName, insertFile, mediaOptions, options === null || options === void 0 ? void 0 : options.errorReporter]);
|
|
109
109
|
useEffect(function () {
|
|
110
110
|
if (mediaProvider) {
|
|
111
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
|
|
111
112
|
handleMediaProvider('mediaProvider', Promise.resolve(mediaProvider));
|
|
112
113
|
}
|
|
113
114
|
}, [mediaProvider, handleMediaProvider]);
|
|
@@ -26,6 +26,7 @@ export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
|
26
26
|
isSelected = _ref$isSelected === void 0 ? true : _ref$isSelected,
|
|
27
27
|
_ref$isInline = _ref.isInline,
|
|
28
28
|
isInline = _ref$isInline === void 0 ? false : _ref$isInline,
|
|
29
|
+
mediaViewerExtensions = _ref.mediaViewerExtensions,
|
|
29
30
|
children = _ref.children;
|
|
30
31
|
var _useState = useState(false),
|
|
31
32
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -56,6 +57,7 @@ export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
|
56
57
|
}, children), shouldShowViewer && jsx(RenderMediaViewer, {
|
|
57
58
|
selectedNodeAttrs: selectedNodeAttrs,
|
|
58
59
|
mediaClientConfig: mediaClientConfig,
|
|
59
|
-
onClose: closeMediaViewer
|
|
60
|
+
onClose: closeMediaViewer,
|
|
61
|
+
extensions: mediaViewerExtensions
|
|
60
62
|
})) : children);
|
|
61
63
|
};
|
|
@@ -24,7 +24,8 @@ export var RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
|
24
24
|
onClose = _ref.onClose,
|
|
25
25
|
selectedNodeAttrs = _ref.selectedNodeAttrs,
|
|
26
26
|
_ref$items = _ref.items,
|
|
27
|
-
items = _ref$items === void 0 ? [] : _ref$items
|
|
27
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
28
|
+
extensions = _ref.extensions;
|
|
28
29
|
var identifier = getIdentifier(selectedNodeAttrs);
|
|
29
30
|
var collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
30
31
|
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
@@ -35,6 +36,7 @@ export var RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
|
35
36
|
,
|
|
36
37
|
mediaClientConfig: mediaClientConfig,
|
|
37
38
|
selectedItem: identifier,
|
|
38
|
-
onClose: onClose
|
|
39
|
+
onClose: onClose,
|
|
40
|
+
extensions: extensions
|
|
39
41
|
}), document.body);
|
|
40
42
|
};
|
|
@@ -430,6 +430,7 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
430
430
|
// when cursor is located below a media with caption,
|
|
431
431
|
// press “Up“ key will result cursor focus on an invalid position, (on the resize handler)
|
|
432
432
|
// This workaround adds an empty div inside the resize handler to prevent the issue.
|
|
433
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
433
434
|
,
|
|
434
435
|
handleComponentFunc: function handleComponentFunc() {
|
|
435
436
|
return jsx("div", {
|
|
@@ -296,11 +296,15 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
296
296
|
var dispatch = editorView.dispatch,
|
|
297
297
|
state = editorView.state;
|
|
298
298
|
var borderMark = currentMediaOrInlineNodeBorderMark(state);
|
|
299
|
-
return /*#__PURE__*/React.createElement(ImageBorderItem
|
|
299
|
+
return /*#__PURE__*/React.createElement(ImageBorderItem
|
|
300
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
301
|
+
, {
|
|
300
302
|
toggleBorder: function toggleBorder() {
|
|
301
303
|
var _pluginInjectionApi$a;
|
|
302
304
|
toggleBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch);
|
|
303
|
-
}
|
|
305
|
+
}
|
|
306
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
307
|
+
,
|
|
304
308
|
setBorder: function setBorder(attrs) {
|
|
305
309
|
var _pluginInjectionApi$a2;
|
|
306
310
|
setBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(attrs)(state, dispatch);
|
|
@@ -42,7 +42,9 @@ export var LayoutGroup = function LayoutGroup(_ref) {
|
|
|
42
42
|
}) : undefined,
|
|
43
43
|
title: item.title,
|
|
44
44
|
selected: item.selected,
|
|
45
|
-
disabled: item.disabled
|
|
45
|
+
disabled: item.disabled
|
|
46
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
47
|
+
,
|
|
46
48
|
onClick: function onClick() {
|
|
47
49
|
dispatchCommand(item.onClick);
|
|
48
50
|
hide();
|
|
@@ -67,12 +67,16 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
|
|
|
67
67
|
displayUrl: link,
|
|
68
68
|
providerFactory: providerFactory,
|
|
69
69
|
intl: intl,
|
|
70
|
-
editing: editing
|
|
70
|
+
editing: editing
|
|
71
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
72
|
+
,
|
|
71
73
|
onUnlink: function onUnlink(setFocus) {
|
|
72
74
|
var _pluginInjectionApi$a;
|
|
73
75
|
unlink(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(view.state, view.dispatch, view);
|
|
74
76
|
setFocusOnFloatingToolbar(setFocus);
|
|
75
|
-
}
|
|
77
|
+
}
|
|
78
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
79
|
+
,
|
|
76
80
|
onBack: function onBack(href, meta, setFocus) {
|
|
77
81
|
if (href.trim() && meta.inputMethod) {
|
|
78
82
|
var _pluginInjectionApi$a2;
|
|
@@ -80,7 +84,9 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
|
|
|
80
84
|
}
|
|
81
85
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
82
86
|
setFocusOnFloatingToolbar(setFocus);
|
|
83
|
-
}
|
|
87
|
+
}
|
|
88
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
89
|
+
,
|
|
84
90
|
onCancel: function onCancel() {
|
|
85
91
|
var _pluginInjectionApi$f2;
|
|
86
92
|
hideLinkingToolbar(view.state, view.dispatch, view, true);
|
|
@@ -92,13 +98,17 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
|
|
|
92
98
|
var selector = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar)) ? FORCE_FOCUS_SELECTOR_EDITOR_CONTROLS : FORCE_FOCUS_SELECTOR;
|
|
93
99
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 || _pluginInjectionApi$f2.forceFocusSelector(selector)(tr);
|
|
94
100
|
dispatch(tr);
|
|
95
|
-
}
|
|
101
|
+
}
|
|
102
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
103
|
+
,
|
|
96
104
|
onSubmit: function onSubmit(href, meta) {
|
|
97
105
|
var _pluginInjectionApi$a3;
|
|
98
106
|
setUrlToMedia(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(view.state, view.dispatch, view);
|
|
99
107
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
100
108
|
setFocusOnFloatingToolbar(true);
|
|
101
|
-
}
|
|
109
|
+
}
|
|
110
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
111
|
+
,
|
|
102
112
|
onBlur: function onBlur() {
|
|
103
113
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
104
114
|
},
|
|
@@ -195,11 +195,15 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
195
195
|
var dispatch = editorView.dispatch,
|
|
196
196
|
state = editorView.state;
|
|
197
197
|
var borderMark = currentMediaOrInlineNodeBorderMark(state);
|
|
198
|
-
return /*#__PURE__*/React.createElement(ImageBorderItem
|
|
198
|
+
return /*#__PURE__*/React.createElement(ImageBorderItem
|
|
199
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
200
|
+
, {
|
|
199
201
|
toggleBorder: function toggleBorder() {
|
|
200
202
|
var _pluginInjectionApi$a2;
|
|
201
203
|
toggleBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(state, dispatch);
|
|
202
|
-
}
|
|
204
|
+
}
|
|
205
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
206
|
+
,
|
|
203
207
|
setBorder: function setBorder(attrs) {
|
|
204
208
|
var _pluginInjectionApi$a3;
|
|
205
209
|
setBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(attrs)(state, dispatch);
|
|
@@ -9,6 +9,7 @@ import type { FileIdentifier } from '@atlaskit/media-client';
|
|
|
9
9
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
10
10
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
11
11
|
import type { MediaFile, UploadParams } from '@atlaskit/media-picker/types';
|
|
12
|
+
import type { MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
12
13
|
interface PlaceholderTextOptions {
|
|
13
14
|
allowInserting?: boolean;
|
|
14
15
|
}
|
|
@@ -91,6 +92,8 @@ export interface MediaPluginOptions {
|
|
|
91
92
|
*/
|
|
92
93
|
isExternalMediaUploadDisabled?: boolean;
|
|
93
94
|
mediaShallowCopyScope?: MediaCopyScope;
|
|
95
|
+
/** Extensions for the media viewer header (e.g. comment navigation button). */
|
|
96
|
+
mediaViewerExtensions?: MediaViewerExtensions;
|
|
94
97
|
onCommentButtonMount?: () => void;
|
|
95
98
|
/**
|
|
96
99
|
* When enabled, prevents automatic focus/selection of media nodes after upload completion.
|
|
@@ -6,6 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
9
|
+
import type { MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
9
10
|
type MediaViewerContainerProps = {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
isEditorViewMode?: boolean;
|
|
@@ -13,7 +14,8 @@ type MediaViewerContainerProps = {
|
|
|
13
14
|
isSelected?: boolean;
|
|
14
15
|
mediaClientConfig: MediaClientConfig;
|
|
15
16
|
mediaNode: PMNode;
|
|
17
|
+
mediaViewerExtensions?: MediaViewerExtensions;
|
|
16
18
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
17
19
|
};
|
|
18
|
-
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
20
|
+
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, mediaViewerExtensions, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
19
21
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { Identifier, MediaClientConfig } from '@atlaskit/media-client';
|
|
4
|
+
import { type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
4
5
|
interface RenderMediaViewerProps {
|
|
6
|
+
extensions?: MediaViewerExtensions;
|
|
5
7
|
items?: Identifier[];
|
|
6
8
|
mediaClientConfig: MediaClientConfig;
|
|
7
9
|
onClose: () => void;
|
|
8
10
|
selectedNodeAttrs: MediaADFAttrs;
|
|
9
11
|
}
|
|
10
|
-
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
12
|
+
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, extensions, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
11
13
|
export {};
|
|
@@ -9,6 +9,7 @@ import type { FileIdentifier } from '@atlaskit/media-client';
|
|
|
9
9
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
10
10
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
11
11
|
import type { MediaFile, UploadParams } from '@atlaskit/media-picker/types';
|
|
12
|
+
import type { MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
12
13
|
interface PlaceholderTextOptions {
|
|
13
14
|
allowInserting?: boolean;
|
|
14
15
|
}
|
|
@@ -91,6 +92,8 @@ export interface MediaPluginOptions {
|
|
|
91
92
|
*/
|
|
92
93
|
isExternalMediaUploadDisabled?: boolean;
|
|
93
94
|
mediaShallowCopyScope?: MediaCopyScope;
|
|
95
|
+
/** Extensions for the media viewer header (e.g. comment navigation button). */
|
|
96
|
+
mediaViewerExtensions?: MediaViewerExtensions;
|
|
94
97
|
onCommentButtonMount?: () => void;
|
|
95
98
|
/**
|
|
96
99
|
* When enabled, prevents automatic focus/selection of media nodes after upload completion.
|
|
@@ -6,6 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
9
|
+
import type { MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
9
10
|
type MediaViewerContainerProps = {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
isEditorViewMode?: boolean;
|
|
@@ -13,7 +14,8 @@ type MediaViewerContainerProps = {
|
|
|
13
14
|
isSelected?: boolean;
|
|
14
15
|
mediaClientConfig: MediaClientConfig;
|
|
15
16
|
mediaNode: PMNode;
|
|
17
|
+
mediaViewerExtensions?: MediaViewerExtensions;
|
|
16
18
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
17
19
|
};
|
|
18
|
-
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
20
|
+
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, mediaViewerExtensions, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
19
21
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { Identifier, MediaClientConfig } from '@atlaskit/media-client';
|
|
4
|
+
import { type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
4
5
|
interface RenderMediaViewerProps {
|
|
6
|
+
extensions?: MediaViewerExtensions;
|
|
5
7
|
items?: Identifier[];
|
|
6
8
|
mediaClientConfig: MediaClientConfig;
|
|
7
9
|
onClose: () => void;
|
|
8
10
|
selectedNodeAttrs: MediaADFAttrs;
|
|
9
11
|
}
|
|
10
|
-
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
12
|
+
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, extensions, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
11
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,19 +54,19 @@
|
|
|
54
54
|
"@atlaskit/form": "^15.4.0",
|
|
55
55
|
"@atlaskit/icon": "^33.0.0",
|
|
56
56
|
"@atlaskit/icon-lab": "^6.0.0",
|
|
57
|
-
"@atlaskit/media-card": "^79.
|
|
57
|
+
"@atlaskit/media-card": "^79.16.0",
|
|
58
58
|
"@atlaskit/media-client": "^36.0.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^5.0.0",
|
|
60
60
|
"@atlaskit/media-common": "^13.0.0",
|
|
61
61
|
"@atlaskit/media-filmstrip": "^51.2.0",
|
|
62
62
|
"@atlaskit/media-picker": "^70.1.0",
|
|
63
63
|
"@atlaskit/media-ui": "^28.7.0",
|
|
64
|
-
"@atlaskit/media-viewer": "^52.
|
|
64
|
+
"@atlaskit/media-viewer": "^52.9.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
66
66
|
"@atlaskit/primitives": "^18.0.0",
|
|
67
67
|
"@atlaskit/textfield": "^8.2.0",
|
|
68
68
|
"@atlaskit/theme": "^22.0.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^45.0.0",
|
|
70
70
|
"@atlaskit/tokens": "^11.1.0",
|
|
71
71
|
"@atlaskit/tooltip": "^21.0.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": "^112.
|
|
81
|
+
"@atlaskit/editor-common": "^112.8.0",
|
|
82
82
|
"@atlaskit/media-core": "^37.0.0",
|
|
83
83
|
"react": "^18.2.0",
|
|
84
84
|
"react-dom": "^18.2.0",
|