@atlaskit/editor-plugin-media 10.0.10 → 10.1.0

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/mediaPlugin.js +6 -3
  3. package/dist/cjs/nodeviews/mediaGroup.js +6 -2
  4. package/dist/cjs/nodeviews/mediaGroupNext.js +1 -0
  5. package/dist/cjs/nodeviews/mediaInline.js +10 -4
  6. package/dist/cjs/nodeviews/mediaNodeView/index.js +3 -1
  7. package/dist/cjs/nodeviews/mediaNodeView/media.js +3 -1
  8. package/dist/cjs/nodeviews/mediaSingle.js +6 -2
  9. package/dist/cjs/pm-plugins/pixel-resizing/ui/index.js +12 -4
  10. package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
  11. package/dist/cjs/ui/CommentBadge/index.js +6 -2
  12. package/dist/cjs/ui/ImageBorder/index.js +121 -38
  13. package/dist/cjs/ui/MediaLinkingToolbar.js +18 -6
  14. package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +6 -2
  15. package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +1 -0
  16. package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -1
  17. package/dist/cjs/ui/MediaViewer/PortalWrapper.js +4 -2
  18. package/dist/cjs/ui/ResizableMediaSingle/index.js +1 -0
  19. package/dist/cjs/ui/toolbar/index.js +6 -2
  20. package/dist/cjs/ui/toolbar/layout-group.js +3 -1
  21. package/dist/cjs/ui/toolbar/linking.js +15 -5
  22. package/dist/cjs/ui/toolbar/mediaInline.js +6 -2
  23. package/dist/es2019/mediaPlugin.js +6 -3
  24. package/dist/es2019/nodeviews/mediaGroup.js +6 -2
  25. package/dist/es2019/nodeviews/mediaGroupNext.js +1 -0
  26. package/dist/es2019/nodeviews/mediaInline.js +11 -4
  27. package/dist/es2019/nodeviews/mediaNodeView/index.js +3 -1
  28. package/dist/es2019/nodeviews/mediaNodeView/media.js +3 -1
  29. package/dist/es2019/nodeviews/mediaSingle.js +6 -2
  30. package/dist/es2019/pm-plugins/pixel-resizing/ui/index.js +12 -4
  31. package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +77 -71
  32. package/dist/es2019/ui/CommentBadge/index.js +6 -2
  33. package/dist/es2019/ui/ImageBorder/index.js +123 -36
  34. package/dist/es2019/ui/MediaLinkingToolbar.js +18 -6
  35. package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +6 -2
  36. package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +1 -0
  37. package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -1
  38. package/dist/es2019/ui/MediaViewer/PortalWrapper.js +4 -2
  39. package/dist/es2019/ui/ResizableMediaSingle/index.js +1 -0
  40. package/dist/es2019/ui/toolbar/index.js +6 -2
  41. package/dist/es2019/ui/toolbar/layout-group.js +3 -1
  42. package/dist/es2019/ui/toolbar/linking.js +15 -5
  43. package/dist/es2019/ui/toolbar/mediaInline.js +6 -2
  44. package/dist/esm/mediaPlugin.js +6 -3
  45. package/dist/esm/nodeviews/mediaGroup.js +6 -2
  46. package/dist/esm/nodeviews/mediaGroupNext.js +1 -0
  47. package/dist/esm/nodeviews/mediaInline.js +10 -4
  48. package/dist/esm/nodeviews/mediaNodeView/index.js +3 -1
  49. package/dist/esm/nodeviews/mediaNodeView/media.js +3 -1
  50. package/dist/esm/nodeviews/mediaSingle.js +6 -2
  51. package/dist/esm/pm-plugins/pixel-resizing/ui/index.js +12 -4
  52. package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
  53. package/dist/esm/ui/CommentBadge/index.js +6 -2
  54. package/dist/esm/ui/ImageBorder/index.js +121 -38
  55. package/dist/esm/ui/MediaLinkingToolbar.js +18 -6
  56. package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +6 -2
  57. package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +1 -0
  58. package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -1
  59. package/dist/esm/ui/MediaViewer/PortalWrapper.js +4 -2
  60. package/dist/esm/ui/ResizableMediaSingle/index.js +1 -0
  61. package/dist/esm/ui/toolbar/index.js +6 -2
  62. package/dist/esm/ui/toolbar/layout-group.js +3 -1
  63. package/dist/esm/ui/toolbar/linking.js +15 -5
  64. package/dist/esm/ui/toolbar/mediaInline.js +6 -2
  65. package/dist/types/types/index.d.ts +3 -0
  66. package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
  67. package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +3 -1
  68. package/dist/types-ts4.5/types/index.d.ts +3 -0
  69. package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
  70. package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +3 -1
  71. package/package.json +4 -4
@@ -97,12 +97,20 @@ var ImageBorder = function ImageBorder(_ref) {
97
97
  ref.style.left = "-".concat(rect.width, "px");
98
98
  }
99
99
  };
100
- var handleTriggerByKeyboard = function handleTriggerByKeyboard(event, callback) {
101
- if (event.key === 'Enter' || event.key === ' ') {
102
- event.preventDefault();
103
- callback();
104
- setIsOpenedByKeyboard(true);
100
+ var handleTriggerByKeyboard = function handleTriggerByKeyboard(event, allowedKeys, callback) {
101
+ if (!allowedKeys.includes(event.key)) {
102
+ return;
105
103
  }
104
+ event.preventDefault();
105
+ callback();
106
+ setIsOpenedByKeyboard(true);
107
+ };
108
+ var handleTriggerToolbarByKeyboard = function handleTriggerToolbarByKeyboard(event, callback) {
109
+ handleTriggerByKeyboard(event, ['Enter', ' '], callback);
110
+ };
111
+ var handleTriggerSubmenuByKeyboard = function handleTriggerSubmenuByKeyboard(event, callback) {
112
+ var keys = (0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? ['Enter', 'ArrowRight'] : ['Enter', ' '];
113
+ handleTriggerByKeyboard(event, keys, callback);
106
114
  };
107
115
  (0, _react.useEffect)(function () {
108
116
  var focusFirstOption = function focusFirstOption(submenuRef, isOpen) {
@@ -149,8 +157,18 @@ var ImageBorder = function ImageBorder(_ref) {
149
157
  _styles2.dropdownOptionButton,
150
158
  "aria-expanded": isColorSubmenuOpen,
151
159
  onKeyDown: function onKeyDown(e) {
152
- return handleTriggerByKeyboard(e, function () {
153
- return setIsColorSubmenuOpen(!isColorSubmenuOpen);
160
+ return handleTriggerSubmenuByKeyboard(e, function () {
161
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
162
+ setIsColorSubmenuOpen(function (prev) {
163
+ var next = !prev;
164
+ if (next) {
165
+ setIsSizeSubmenuOpen(false);
166
+ }
167
+ return next;
168
+ });
169
+ } else {
170
+ setIsColorSubmenuOpen(!isColorSubmenuOpen);
171
+ }
154
172
  });
155
173
  }
156
174
  }, (0, _react2.jsx)(_compiled.Text, null, formatMessage(_media.imageBorderMessages.borderColor)), (0, _react2.jsx)("div", {
@@ -165,20 +183,26 @@ var ImageBorder = function ImageBorder(_ref) {
165
183
  css: (0, _styles2.contextualSubMenu)(0),
166
184
  ref: handleSubMenuRef
167
185
  }, (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
168
- type: _uiMenu.ArrowKeyNavigationType.MENU,
186
+ type: _uiMenu.ArrowKeyNavigationType.MENU
187
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
188
+ ,
169
189
  handleClose: function handleClose(e) {
170
190
  e.preventDefault();
171
191
  e.stopPropagation();
172
192
  handleColorSubmenuEsc();
173
193
  },
174
194
  disableCloseOnArrowClick: true
175
- }, (0, _react2.jsx)(_uiColor.ColorPalette, {
195
+ }, (0, _react2.jsx)(_uiColor.ColorPalette
196
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
197
+ , {
176
198
  onClick: function onClick(color) {
177
199
  setBorder({
178
200
  color: color
179
201
  });
180
202
  setIsOpen(!isOpen);
181
- },
203
+ }
204
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
205
+ ,
182
206
  onKeyDown: function onKeyDown(color, _, event) {
183
207
  if (event.key === 'Enter' || event.key === ' ') {
184
208
  var _openDropdownButtonRe;
@@ -191,7 +215,9 @@ var ImageBorder = function ImageBorder(_ref) {
191
215
  (_openDropdownButtonRe = openDropdownButtonRef.current) === null || _openDropdownButtonRe === void 0 || _openDropdownButtonRe.focus();
192
216
  }
193
217
  },
194
- selectedColor: color !== null && color !== void 0 ? color : null,
218
+ selectedColor: color !== null && color !== void 0 ? color : null
219
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
220
+ ,
195
221
  paletteOptions: {
196
222
  palette: _uiColor.borderColorPalette,
197
223
  paletteColorTooltipMessages: _uiColor.borderPaletteTooltipMessages,
@@ -216,8 +242,18 @@ var ImageBorder = function ImageBorder(_ref) {
216
242
  "aria-expanded": isSizeSubmenuOpen,
217
243
  ref: dropDownSizeOptionButton,
218
244
  onKeyDown: function onKeyDown(e) {
219
- return handleTriggerByKeyboard(e, function () {
220
- return setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
245
+ return handleTriggerSubmenuByKeyboard(e, function () {
246
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
247
+ setIsSizeSubmenuOpen(function (prev) {
248
+ var next = !prev;
249
+ if (next) {
250
+ setIsColorSubmenuOpen(false);
251
+ }
252
+ return next;
253
+ });
254
+ } else {
255
+ setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
256
+ }
221
257
  });
222
258
  }
223
259
  }, (0, _react2.jsx)(_compiled.Text, null, formatMessage(_media.imageBorderMessages.borderSize)), (0, _react2.jsx)("div", {
@@ -227,7 +263,9 @@ var ImageBorder = function ImageBorder(_ref) {
227
263
  className: _styles.DropdownMenuSharedCssClassName.SUBMENU,
228
264
  ref: sizeSubmenuRef
229
265
  }, isSizeSubmenuOpen && (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
230
- type: _uiMenu.ArrowKeyNavigationType.MENU,
266
+ type: _uiMenu.ArrowKeyNavigationType.MENU
267
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
268
+ ,
231
269
  handleClose: function handleClose(e) {
232
270
  e.preventDefault();
233
271
  handleSizeSubmenuEsc();
@@ -340,13 +378,17 @@ var ImageBorder = function ImageBorder(_ref) {
340
378
  spacing: "spacious",
341
379
  label: "",
342
380
  size: "small"
343
- }),
381
+ })
382
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
383
+ ,
344
384
  onClick: function onClick() {
345
385
  setIsOpen(!isOpen);
346
386
  setIsOpenedByKeyboard(false);
347
- },
387
+ }
388
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
389
+ ,
348
390
  onKeyDown: function onKeyDown(e) {
349
- return handleTriggerByKeyboard(e, function () {
391
+ return handleTriggerToolbarByKeyboard(e, function () {
350
392
  return setIsOpen(!isOpen);
351
393
  });
352
394
  }
@@ -357,12 +399,17 @@ var ImageBorder = function ImageBorder(_ref) {
357
399
  forcePlacement: true,
358
400
  stick: true
359
401
  }, (0, _react2.jsx)("div", {
360
- /* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
402
+ onMouseLeave: (0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? undefined : function () {
403
+ setIsColorSubmenuOpen(false);
404
+ setIsSizeSubmenuOpen(false);
405
+ }
406
+ /* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */,
361
407
  css: _styles2.dropdownWrapper
362
408
  }, (0, _react2.jsx)(_uiMenu.DropdownMenu
363
409
  //This needs be removed when the a11y is completely handled
364
410
  //Disabling key navigation now as it works only partially
365
411
  //Same with packages/editor/editor-plugin-table/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx
412
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
366
413
  , {
367
414
  arrowKeyNavigationProviderOptions: {
368
415
  type: _uiMenu.ArrowKeyNavigationType.MENU,
@@ -374,47 +421,83 @@ var ImageBorder = function ImageBorder(_ref) {
374
421
  } : function () {
375
422
  var _openDropdownButtonRe3;
376
423
  (_openDropdownButtonRe3 = openDropdownButtonRef.current) === null || _openDropdownButtonRe3 === void 0 || _openDropdownButtonRe3.focus();
377
- },
424
+ }
425
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
426
+ ,
378
427
  items: [{
379
428
  items: items
380
429
  }],
381
- isOpen: isOpen,
430
+ isOpen: isOpen
431
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
432
+ ,
382
433
  shouldFocusFirstItem: function shouldFocusFirstItem() {
383
434
  return isOpenByKeyboard;
384
- },
435
+ }
436
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
437
+ ,
385
438
  onOpenChange: function onOpenChange() {
386
439
  setIsOpen(false);
387
440
  setIsColorSubmenuOpen(false);
388
441
  setIsSizeSubmenuOpen(false);
389
442
  setIsOpenedByKeyboard(false);
390
- },
443
+ }
444
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
445
+ ,
391
446
  onItemActivated: function onItemActivated(_ref3) {
392
447
  var item = _ref3.item;
393
448
  if (item.value.name === 'color') {
394
- setIsColorSubmenuOpen(!isColorSubmenuOpen);
449
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
450
+ setIsColorSubmenuOpen(function (prev) {
451
+ var next = !prev;
452
+ if (next) {
453
+ setIsSizeSubmenuOpen(false);
454
+ }
455
+ return next;
456
+ });
457
+ } else {
458
+ setIsColorSubmenuOpen(!isColorSubmenuOpen);
459
+ }
395
460
  }
396
461
  if (item.value.name === 'size') {
397
- setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
462
+ if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
463
+ setIsSizeSubmenuOpen(function (prev) {
464
+ var next = !prev;
465
+ if (next) {
466
+ setIsColorSubmenuOpen(false);
467
+ }
468
+ return next;
469
+ });
470
+ } else {
471
+ setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
472
+ }
398
473
  }
399
- },
474
+ }
475
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
476
+ ,
400
477
  onMouseEnter: function onMouseEnter(_ref4) {
401
478
  var item = _ref4.item;
402
- if (item.value.name === 'color') {
403
- setIsColorSubmenuOpen(true);
404
- setIsOpenedByKeyboard(false);
405
- }
406
- if (item.value.name === 'size') {
407
- setIsSizeSubmenuOpen(true);
408
- setIsOpenedByKeyboard(false);
479
+ if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
480
+ if (item.value.name === 'color') {
481
+ setIsColorSubmenuOpen(true);
482
+ setIsOpenedByKeyboard(false);
483
+ }
484
+ if (item.value.name === 'size') {
485
+ setIsSizeSubmenuOpen(true);
486
+ setIsOpenedByKeyboard(false);
487
+ }
409
488
  }
410
- },
489
+ }
490
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
491
+ ,
411
492
  onMouseLeave: function onMouseLeave(_ref5) {
412
493
  var item = _ref5.item;
413
- if (item.value.name === 'color') {
414
- setIsColorSubmenuOpen(false);
415
- }
416
- if (item.value.name === 'size') {
417
- setIsSizeSubmenuOpen(false);
494
+ if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
495
+ if (item.value.name === 'color') {
496
+ setIsColorSubmenuOpen(false);
497
+ }
498
+ if (item.value.name === 'size') {
499
+ setIsSizeSubmenuOpen(false);
500
+ }
418
501
  }
419
502
  },
420
503
  fitWidth: fitWidth + fitTolerance,
@@ -126,13 +126,17 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
126
126
  icon: (0, _react2.jsx)(_chevronLeft.default, {
127
127
  label: formatLinkAddressText,
128
128
  size: "small"
129
- }),
129
+ })
130
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
131
+ ,
130
132
  onClick: function onClick() {
131
133
  return _this.handleOnBack({
132
134
  url: value,
133
135
  inputMethod: currentInputMethod
134
136
  });
135
- },
137
+ }
138
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
139
+ ,
136
140
  onKeyDown: function onKeyDown(event) {
137
141
  if (event.key === 'Enter' || event.key === ' ') {
138
142
  event.preventDefault();
@@ -149,7 +153,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
149
153
  placeholder: getPlaceholder(!!activityProvider),
150
154
  autoFocus: true,
151
155
  onCancel: _this.handleCancel,
152
- defaultValue: value,
156
+ defaultValue: value
157
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
158
+ ,
153
159
  onSubmit: function onSubmit(inputValue) {
154
160
  var validationErrors = _this.getValidationErrors(inputValue, currentInputMethod);
155
161
  _this.setState({
@@ -158,7 +164,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
158
164
  if (!validationErrors.length) {
159
165
  _onSubmit();
160
166
  }
161
- },
167
+ }
168
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
169
+ ,
162
170
  onChange: function onChange(value) {
163
171
  _this.setState({
164
172
  validationErrors: []
@@ -175,10 +183,14 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
175
183
  title: formatUnlinkText,
176
184
  icon: (0, _react2.jsx)(_linkBroken.default, {
177
185
  label: formatUnlinkText
178
- }),
186
+ })
187
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
188
+ ,
179
189
  onClick: function onClick() {
180
190
  return _this.handleUnlink();
181
- },
191
+ }
192
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
193
+ ,
182
194
  onKeyDown: function onKeyDown(event) {
183
195
  if (event.key === 'Enter' || event.key === ' ') {
184
196
  event.preventDefault();
@@ -48,10 +48,14 @@ var DropzoneWrapperInternal = function DropzoneWrapperInternal(_ref) {
48
48
  config: dropzoneConfig,
49
49
  onError: pickerFacadeInstance.handleUploadError,
50
50
  onPreviewUpdate: pickerFacadeInstance.handleUploadPreviewUpdate,
51
- onEnd: pickerFacadeInstance.handleReady,
51
+ onEnd: pickerFacadeInstance.handleReady
52
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
53
+ ,
52
54
  onDragEnter: function onDragEnter() {
53
55
  return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('enter');
54
- },
56
+ }
57
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
58
+ ,
55
59
  onDragLeave: function onDragLeave() {
56
60
  return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('leave');
57
61
  },
@@ -115,6 +115,7 @@ function PickerFacadeProvider(_ref) {
115
115
  }(), [analyticsName, insertFile, mediaOptions, options === null || options === void 0 ? void 0 : options.errorReporter]);
116
116
  (0, _react.useEffect)(function () {
117
117
  if (mediaProvider) {
118
+ // eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
118
119
  handleMediaProvider('mediaProvider', Promise.resolve(mediaProvider));
119
120
  }
120
121
  }, [mediaProvider, handleMediaProvider]);
@@ -36,6 +36,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
36
36
  isSelected = _ref$isSelected === void 0 ? true : _ref$isSelected,
37
37
  _ref$isInline = _ref.isInline,
38
38
  isInline = _ref$isInline === void 0 ? false : _ref$isInline,
39
+ mediaViewerExtensions = _ref.mediaViewerExtensions,
39
40
  children = _ref.children;
40
41
  var _useState = (0, _react.useState)(false),
41
42
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -66,6 +67,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
66
67
  }, children), shouldShowViewer && (0, _react2.jsx)(_PortalWrapper.RenderMediaViewer, {
67
68
  selectedNodeAttrs: selectedNodeAttrs,
68
69
  mediaClientConfig: mediaClientConfig,
69
- onClose: closeMediaViewer
70
+ onClose: closeMediaViewer,
71
+ extensions: mediaViewerExtensions
70
72
  })) : children);
71
73
  };
@@ -31,7 +31,8 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
31
31
  onClose = _ref.onClose,
32
32
  selectedNodeAttrs = _ref.selectedNodeAttrs,
33
33
  _ref$items = _ref.items,
34
- items = _ref$items === void 0 ? [] : _ref$items;
34
+ items = _ref$items === void 0 ? [] : _ref$items,
35
+ extensions = _ref.extensions;
35
36
  var identifier = getIdentifier(selectedNodeAttrs);
36
37
  var collectionName = (0, _utils.isExternalMedia)(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
37
38
  return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
@@ -42,6 +43,7 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
42
43
  ,
43
44
  mediaClientConfig: mediaClientConfig,
44
45
  selectedItem: identifier,
45
- onClose: onClose
46
+ onClose: onClose,
47
+ extensions: extensions
46
48
  }), document.body);
47
49
  };
@@ -434,6 +434,7 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
434
434
  // when cursor is located below a media with caption,
435
435
  // press “Up“ key will result cursor focus on an invalid position, (on the resize handler)
436
436
  // This workaround adds an empty div inside the resize handler to prevent the issue.
437
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
437
438
  ,
438
439
  handleComponentFunc: function handleComponentFunc() {
439
440
  return (0, _react2.jsx)("div", {
@@ -305,11 +305,15 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
305
305
  var dispatch = editorView.dispatch,
306
306
  state = editorView.state;
307
307
  var borderMark = (0, _currentMediaNode.currentMediaOrInlineNodeBorderMark)(state);
308
- return /*#__PURE__*/_react.default.createElement(_ImageBorder.default, {
308
+ return /*#__PURE__*/_react.default.createElement(_ImageBorder.default
309
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
310
+ , {
309
311
  toggleBorder: function toggleBorder() {
310
312
  var _pluginInjectionApi$a;
311
313
  (0, _commands.toggleBorderMark)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch);
312
- },
314
+ }
315
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
316
+ ,
313
317
  setBorder: function setBorder(attrs) {
314
318
  var _pluginInjectionApi$a2;
315
319
  (0, _commands.setBorderMark)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(attrs)(state, dispatch);
@@ -50,7 +50,9 @@ var LayoutGroup = exports.LayoutGroup = function LayoutGroup(_ref) {
50
50
  }) : undefined,
51
51
  title: item.title,
52
52
  selected: item.selected,
53
- disabled: item.disabled,
53
+ disabled: item.disabled
54
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
55
+ ,
54
56
  onClick: function onClick() {
55
57
  dispatchCommand(item.onClick);
56
58
  hide();
@@ -75,12 +75,16 @@ var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(t
75
75
  displayUrl: link,
76
76
  providerFactory: providerFactory,
77
77
  intl: intl,
78
- editing: editing,
78
+ editing: editing
79
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
80
+ ,
79
81
  onUnlink: function onUnlink(setFocus) {
80
82
  var _pluginInjectionApi$a;
81
83
  (0, _linking.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);
82
84
  setFocusOnFloatingToolbar(setFocus);
83
- },
85
+ }
86
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
87
+ ,
84
88
  onBack: function onBack(href, meta, setFocus) {
85
89
  if (href.trim() && meta.inputMethod) {
86
90
  var _pluginInjectionApi$a2;
@@ -88,7 +92,9 @@ var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(t
88
92
  }
89
93
  (0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
90
94
  setFocusOnFloatingToolbar(setFocus);
91
- },
95
+ }
96
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
97
+ ,
92
98
  onCancel: function onCancel() {
93
99
  var _pluginInjectionApi$f2;
94
100
  (0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view, true);
@@ -100,13 +106,17 @@ var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(t
100
106
  var selector = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar)) ? FORCE_FOCUS_SELECTOR_EDITOR_CONTROLS : FORCE_FOCUS_SELECTOR;
101
107
  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);
102
108
  dispatch(tr);
103
- },
109
+ }
110
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
111
+ ,
104
112
  onSubmit: function onSubmit(href, meta) {
105
113
  var _pluginInjectionApi$a3;
106
114
  (0, _linking.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);
107
115
  (0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
108
116
  setFocusOnFloatingToolbar(true);
109
- },
117
+ }
118
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
119
+ ,
110
120
  onBlur: function onBlur() {
111
121
  (0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
112
122
  },
@@ -204,11 +204,15 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
204
204
  var dispatch = editorView.dispatch,
205
205
  state = editorView.state;
206
206
  var borderMark = (0, _currentMediaNode.currentMediaOrInlineNodeBorderMark)(state);
207
- return /*#__PURE__*/_react.default.createElement(_ImageBorder.default, {
207
+ return /*#__PURE__*/_react.default.createElement(_ImageBorder.default
208
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
209
+ , {
208
210
  toggleBorder: function toggleBorder() {
209
211
  var _pluginInjectionApi$a2;
210
212
  (0, _commands.toggleBorderMark)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(state, dispatch);
211
- },
213
+ }
214
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
215
+ ,
212
216
  setBorder: function setBorder(attrs) {
213
217
  var _pluginInjectionApi$a3;
214
218
  (0, _commands.setBorderMark)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(attrs)(state, dispatch);
@@ -71,7 +71,8 @@ const mediaViewerStateSelector = states => {
71
71
  };
72
72
  const MediaViewerFunctionalComponent = ({
73
73
  api,
74
- editorView
74
+ editorView,
75
+ mediaViewerExtensions
75
76
  }) => {
76
77
  // Only traverse document once when media viewer is visible, media viewer items will not update
77
78
  // when document changes are made while media viewer is open
@@ -100,7 +101,8 @@ const MediaViewerFunctionalComponent = ({
100
101
  mediaClientConfig: mediaClientConfig,
101
102
  onClose: handleOnClose,
102
103
  selectedNodeAttrs: mediaViewerSelectedMedia,
103
- items: mediaItems
104
+ items: mediaItems,
105
+ extensions: mediaViewerExtensions
104
106
  });
105
107
  };
106
108
  export const mediaPlugin = ({
@@ -339,7 +341,8 @@ export const mediaPlugin = ({
339
341
  }
340
342
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaViewerFunctionalComponent, {
341
343
  api: api,
342
- editorView: editorView
344
+ editorView: editorView,
345
+ mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions
343
346
  }), /*#__PURE__*/React.createElement(MediaPickerFunctionalComponent, {
344
347
  editorDomElement: editorView.dom,
345
348
  appearance: appearance,
@@ -35,9 +35,13 @@ class MediaGroupNodeView extends ReactNodeView {
35
35
  pluginInjectionApi
36
36
  } = props;
37
37
  const getPos = this.getPos;
38
- return /*#__PURE__*/React.createElement(WithProviders, {
38
+ return /*#__PURE__*/React.createElement(WithProviders
39
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
40
+ , {
39
41
  providers: ['contextIdentifierProvider'],
40
- providerFactory: providerFactory,
42
+ providerFactory: providerFactory
43
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
44
+ ,
41
45
  renderNode: ({
42
46
  contextIdentifierProvider
43
47
  }) => {
@@ -204,6 +204,7 @@ export const MediaGroupNext = injectIntl( /*#__PURE__*/React.memo(props => {
204
204
  setViewMediaClientConfig(mediaClientConfig);
205
205
  }, [mediaClientConfig]);
206
206
  useEffect(() => {
207
+ // eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
207
208
  mediaNodesWithOffsets.forEach(({
208
209
  node,
209
210
  offset
@@ -55,6 +55,7 @@ const updateMediaNodeAttributes = async (props, mediaNodeUpdater) => {
55
55
  addPendingTask(copyNode);
56
56
  await copyNode;
57
57
  } catch (e) {
58
+ // eslint-disable-line no-unused-vars
58
59
  return;
59
60
  }
60
61
  }
@@ -132,7 +133,9 @@ export const MediaInline = props => {
132
133
  isSelected: props.isSelected,
133
134
  alt: alt,
134
135
  width: width,
135
- height: height,
136
+ height: height
137
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
138
+ ,
136
139
  border: {
137
140
  borderSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
138
141
  borderColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color
@@ -230,11 +233,15 @@ export class MediaInlineNodeView extends SelectionBasedNodeView {
230
233
  view
231
234
  } = this;
232
235
  const getPos = this.getPos;
233
- return jsx(WithProviders, {
236
+ return jsx(WithProviders
237
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
238
+ , {
234
239
  providers: ['contextIdentifierProvider'],
235
- providerFactory: providerFactory,
240
+ providerFactory: providerFactory
241
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
242
+ ,
236
243
  renderNode: ({
237
- mediaProvider,
244
+ mediaProvider: _mediaProvider,
238
245
  contextIdentifierProvider
239
246
  }) => {
240
247
  return jsx(MediaInlineSharedState, {
@@ -257,7 +257,9 @@ class MediaNodeView extends SelectionBasedNodeView {
257
257
  const {
258
258
  providerFactory
259
259
  } = this.reactComponentProps;
260
- return /*#__PURE__*/React.createElement(WithProviders, {
260
+ return /*#__PURE__*/React.createElement(WithProviders
261
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
262
+ , {
261
263
  providers: ['contextIdentifierProvider'],
262
264
  providerFactory: providerFactory,
263
265
  renderNode: this.renderMediaNodeWithProviders
@@ -305,7 +305,9 @@ export class MediaNode extends Component {
305
305
  onContextMenu: this.selectMediaSingle,
306
306
  borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
307
307
  selected: selected
308
- }, /*#__PURE__*/React.createElement(AnalyticsContext, {
308
+ }, /*#__PURE__*/React.createElement(AnalyticsContext
309
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
310
+ , {
309
311
  data: {
310
312
  [MEDIA_CONTEXT]: {
311
313
  border: !!borderMark
@@ -211,9 +211,13 @@ class MediaSingleNodeView extends ReactNodeView {
211
211
 
212
212
  // getPos is a boolean for marks, since this is a node we know it must be a function
213
213
  const getPos = this.getPos;
214
- return jsx(WithProviders, {
214
+ return jsx(WithProviders
215
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
216
+ , {
215
217
  providers: ['contextIdentifierProvider'],
216
- providerFactory: providerFactory,
218
+ providerFactory: providerFactory
219
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
220
+ ,
217
221
  renderNode: ({
218
222
  contextIdentifierProvider
219
223
  }) => {