@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
@@ -77,14 +77,18 @@ export const PixelEntry = ({
77
77
  mediaWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
78
78
  mediaHeight: mediaHeight || DEFAULT_IMAGE_HEIGHT,
79
79
  minWidth: minWidth,
80
- maxWidth: maxWidth,
80
+ maxWidth: maxWidth
81
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
82
+ ,
81
83
  onChange: valid => {
82
84
  if (valid) {
83
85
  hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true, 'warning')(editorView.state, dispatch, editorView);
84
86
  } else {
85
87
  hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false)(editorView.state, dispatch, editorView);
86
88
  }
87
- },
89
+ }
90
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
91
+ ,
88
92
  onSubmit: ({
89
93
  width,
90
94
  validation
@@ -93,7 +97,9 @@ export const PixelEntry = ({
93
97
  if (tr) {
94
98
  dispatch(tr);
95
99
  }
96
- },
100
+ }
101
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
102
+ ,
97
103
  onMigrate: () => {
98
104
  let tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, {
99
105
  ...selectedMediaSingleNode.node.attrs,
@@ -107,7 +113,9 @@ export const PixelEntry = ({
107
113
  tr = newTr !== undefined ? newTr : tr;
108
114
  }
109
115
  dispatch(tr);
110
- },
116
+ }
117
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
118
+ ,
111
119
  onCloseAndSave: ({
112
120
  width,
113
121
  validation
@@ -12,8 +12,7 @@ import { IconButton } from '@atlaskit/button/new';
12
12
  import { pixelEntryMessages as messages } from '@atlaskit/editor-common/media';
13
13
  import Form, { Field } from '@atlaskit/form';
14
14
  import CrossIcon from '@atlaskit/icon/core/cross';
15
- // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
16
- // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
15
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives, @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
17
16
  import { Inline, Box, Text, xcss } from '@atlaskit/primitives';
18
17
  import Textfield from '@atlaskit/textfield';
19
18
  import Tooltip from '@atlaskit/tooltip';
@@ -193,7 +192,7 @@ export const PixelEntryComponent = ({
193
192
  // Ignored via go/ees005
194
193
  // eslint-disable-next-line react/jsx-props-no-spreading
195
194
  , _extends({}, fieldProps, {
196
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
195
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
197
196
  css: [pixelSizingWidthInput, pixelSizingInput],
198
197
  appearance: "none",
199
198
  isCompact: true,
@@ -219,7 +218,7 @@ export const PixelEntryComponent = ({
219
218
  // Ignored via go/ees005
220
219
  // eslint-disable-next-line react/jsx-props-no-spreading
221
220
  , _extends({}, fieldProps, {
222
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
221
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
223
222
  css: [pixelSizingHeightInput, pixelSizingInput],
224
223
  appearance: "none",
225
224
  isCompact: true,
@@ -294,71 +293,78 @@ export const PixelEntryComponentNext = ({
294
293
  }, shouldSetFocus);
295
294
  }
296
295
  }, [computedWidth, computedHeight, handleCloseAndSave]);
297
- return jsx(Box, {
298
- xcss: [pixelEntryWrapperStyles, isViewMode && pixelEntryWrapperViewModeStyles]
299
- }, jsx(Inline, {
300
- alignBlock: "center",
301
- spread: "space-between"
302
- }, jsx(Box, {
303
- paddingInlineStart: "space.100"
304
- }, jsx(Text, {
305
- color: "color.text.subtlest"
306
- }, formatMessage(messages.inputWidthLabel))), jsx("div", {
307
- css: fieldStyles
308
- }, jsx(Tooltip, {
309
- hideTooltipOnMouseDown: true,
310
- hideTooltipOnClick: true,
311
- position: "top",
312
- content: formatMessage(messages.inputWidthTooltip, {
313
- maxWidth
314
- })
315
- }, jsx(Textfield, {
316
- name: "inputWidth",
317
- value: computedWidth,
318
- ref: widthInputRef,
319
- height: "var(--ds-space-250, 20px)",
320
- appearance: "none",
321
- pattern: "\\d*",
322
- "aria-label": formatMessage(messages.inputWidthAriaLabel, {
323
- maxWidth
324
- }),
325
- onChange: handleFieldChange('inputWidth'),
326
- onKeyDown: handleKeyDown
327
- }))), jsx(Box, {
328
- paddingInlineStart: "space.100"
329
- }, jsx(Text, {
330
- color: "color.text.subtlest"
331
- }, formatMessage(messages.inputHeightTooltip))), jsx("div", {
332
- css: fieldStyles
333
- }, jsx(Tooltip, {
334
- hideTooltipOnMouseDown: true,
335
- hideTooltipOnClick: true,
336
- content: formatMessage(messages.inputHeightTooltip),
337
- position: "top"
338
- }, jsx(Textfield, {
339
- name: "inputHeight",
340
- value: computedHeight,
341
- height: "var(--ds-space-250, 20px)",
342
- appearance: "none",
343
- pattern: "\\d*",
344
- "aria-label": formatMessage(messages.inputHeightAriaLabel),
345
- onChange: handleFieldChange('inputHeight'),
346
- onKeyDown: handleKeyDown
347
- }))), !isViewMode && jsx(Fragment, null, jsx(Box, {
348
- xcss: dividerStyles
349
- }), jsx(IconButton, {
350
- icon: () => jsx(CrossIcon, {
351
- label: "",
352
- color: "var(--ds-icon-subtlest, #6B6E76)"
353
- }),
354
- label: formatMessage(messages.closePixelEntry),
355
- appearance: "subtle",
356
- onClick: () => {
357
- handleCloseAndSave({
358
- inputWidth: computedWidth,
359
- inputHeight: computedHeight
360
- });
361
- },
362
- onKeyDown: handleCloseButtonKeyDown
363
- }))));
296
+ return (
297
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
298
+ jsx(Box, {
299
+ xcss: [pixelEntryWrapperStyles, isViewMode && pixelEntryWrapperViewModeStyles]
300
+ }, jsx(Inline, {
301
+ alignBlock: "center",
302
+ spread: "space-between"
303
+ }, jsx(Box, {
304
+ paddingInlineStart: "space.100"
305
+ }, jsx(Text, {
306
+ color: "color.text.subtlest"
307
+ }, formatMessage(messages.inputWidthLabel))), jsx("div", {
308
+ css: fieldStyles
309
+ }, jsx(Tooltip, {
310
+ hideTooltipOnMouseDown: true,
311
+ hideTooltipOnClick: true,
312
+ position: "top",
313
+ content: formatMessage(messages.inputWidthTooltip, {
314
+ maxWidth
315
+ })
316
+ }, jsx(Textfield, {
317
+ name: "inputWidth",
318
+ value: computedWidth,
319
+ ref: widthInputRef,
320
+ height: "var(--ds-space-250, 20px)",
321
+ appearance: "none",
322
+ pattern: "\\d*",
323
+ "aria-label": formatMessage(messages.inputWidthAriaLabel, {
324
+ maxWidth
325
+ }),
326
+ onChange: handleFieldChange('inputWidth'),
327
+ onKeyDown: handleKeyDown
328
+ }))), jsx(Box, {
329
+ paddingInlineStart: "space.100"
330
+ }, jsx(Text, {
331
+ color: "color.text.subtlest"
332
+ }, formatMessage(messages.inputHeightTooltip))), jsx("div", {
333
+ css: fieldStyles
334
+ }, jsx(Tooltip, {
335
+ hideTooltipOnMouseDown: true,
336
+ hideTooltipOnClick: true,
337
+ content: formatMessage(messages.inputHeightTooltip),
338
+ position: "top"
339
+ }, jsx(Textfield, {
340
+ name: "inputHeight",
341
+ value: computedHeight,
342
+ height: "var(--ds-space-250, 20px)",
343
+ appearance: "none",
344
+ pattern: "\\d*",
345
+ "aria-label": formatMessage(messages.inputHeightAriaLabel),
346
+ onChange: handleFieldChange('inputHeight'),
347
+ onKeyDown: handleKeyDown
348
+ }))), !isViewMode && jsx(Fragment, null, jsx(Box, {
349
+ xcss: dividerStyles
350
+ }), jsx(IconButton
351
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
352
+ , {
353
+ icon: () => jsx(CrossIcon, {
354
+ label: "",
355
+ color: "var(--ds-icon-subtlest, #6B6E76)"
356
+ }),
357
+ label: formatMessage(messages.closePixelEntry),
358
+ appearance: "subtle"
359
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
360
+ ,
361
+ onClick: () => {
362
+ handleCloseAndSave({
363
+ inputWidth: computedWidth,
364
+ inputHeight: computedHeight
365
+ });
366
+ },
367
+ onKeyDown: handleCloseButtonKeyDown
368
+ }))))
369
+ );
364
370
  };
@@ -61,8 +61,12 @@ export const CommentBadgeWrapper = ({
61
61
  return /*#__PURE__*/React.createElement(CommentBadgeNext, {
62
62
  onClick: onClick,
63
63
  mediaSingleElement: mediaSingleElement,
64
- status: entered ? 'entered' : status,
65
- onMouseEnter: () => setEntered(true),
64
+ status: entered ? 'entered' : status
65
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
66
+ ,
67
+ onMouseEnter: () => setEntered(true)
68
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
69
+ ,
66
70
  onMouseLeave: () => setEntered(false)
67
71
  });
68
72
  };
@@ -79,12 +79,20 @@ const ImageBorder = ({
79
79
  ref.style.left = `-${rect.width}px`;
80
80
  }
81
81
  };
82
- const handleTriggerByKeyboard = (event, callback) => {
83
- if (event.key === 'Enter' || event.key === ' ') {
84
- event.preventDefault();
85
- callback();
86
- setIsOpenedByKeyboard(true);
82
+ const handleTriggerByKeyboard = (event, allowedKeys, callback) => {
83
+ if (!allowedKeys.includes(event.key)) {
84
+ return;
87
85
  }
86
+ event.preventDefault();
87
+ callback();
88
+ setIsOpenedByKeyboard(true);
89
+ };
90
+ const handleTriggerToolbarByKeyboard = (event, callback) => {
91
+ handleTriggerByKeyboard(event, ['Enter', ' '], callback);
92
+ };
93
+ const handleTriggerSubmenuByKeyboard = (event, callback) => {
94
+ const keys = expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? ['Enter', 'ArrowRight'] : ['Enter', ' '];
95
+ handleTriggerByKeyboard(event, keys, callback);
88
96
  };
89
97
  useEffect(() => {
90
98
  const focusFirstOption = (submenuRef, isOpen) => {
@@ -130,7 +138,19 @@ const ImageBorder = ({
130
138
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
131
139
  dropdownOptionButton,
132
140
  "aria-expanded": isColorSubmenuOpen,
133
- onKeyDown: e => handleTriggerByKeyboard(e, () => setIsColorSubmenuOpen(!isColorSubmenuOpen))
141
+ onKeyDown: e => handleTriggerSubmenuByKeyboard(e, () => {
142
+ if (expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
143
+ setIsColorSubmenuOpen(prev => {
144
+ const next = !prev;
145
+ if (next) {
146
+ setIsSizeSubmenuOpen(false);
147
+ }
148
+ return next;
149
+ });
150
+ } else {
151
+ setIsColorSubmenuOpen(!isColorSubmenuOpen);
152
+ }
153
+ })
134
154
  }, jsx(Text, null, formatMessage(messages.borderColor)), jsx("div", {
135
155
  css: contextualMenuArrow
136
156
  })), jsx("div", {
@@ -143,20 +163,26 @@ const ImageBorder = ({
143
163
  css: contextualSubMenu(0),
144
164
  ref: handleSubMenuRef
145
165
  }, jsx(ArrowKeyNavigationProvider, {
146
- type: ArrowKeyNavigationType.MENU,
166
+ type: ArrowKeyNavigationType.MENU
167
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
168
+ ,
147
169
  handleClose: e => {
148
170
  e.preventDefault();
149
171
  e.stopPropagation();
150
172
  handleColorSubmenuEsc();
151
173
  },
152
174
  disableCloseOnArrowClick: true
153
- }, jsx(ColorPalette, {
175
+ }, jsx(ColorPalette
176
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
177
+ , {
154
178
  onClick: color => {
155
179
  setBorder({
156
180
  color
157
181
  });
158
182
  setIsOpen(!isOpen);
159
- },
183
+ }
184
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
185
+ ,
160
186
  onKeyDown: (color, _, event) => {
161
187
  if (event.key === 'Enter' || event.key === ' ') {
162
188
  var _openDropdownButtonRe;
@@ -169,7 +195,9 @@ const ImageBorder = ({
169
195
  (_openDropdownButtonRe = openDropdownButtonRef.current) === null || _openDropdownButtonRe === void 0 ? void 0 : _openDropdownButtonRe.focus();
170
196
  }
171
197
  },
172
- selectedColor: color !== null && color !== void 0 ? color : null,
198
+ selectedColor: color !== null && color !== void 0 ? color : null
199
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
200
+ ,
173
201
  paletteOptions: {
174
202
  palette: borderColorPalette,
175
203
  paletteColorTooltipMessages: borderPaletteTooltipMessages,
@@ -193,7 +221,19 @@ const ImageBorder = ({
193
221
  dropdownOptionButton,
194
222
  "aria-expanded": isSizeSubmenuOpen,
195
223
  ref: dropDownSizeOptionButton,
196
- onKeyDown: e => handleTriggerByKeyboard(e, () => setIsSizeSubmenuOpen(!isSizeSubmenuOpen))
224
+ onKeyDown: e => handleTriggerSubmenuByKeyboard(e, () => {
225
+ if (expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
226
+ setIsSizeSubmenuOpen(prev => {
227
+ const next = !prev;
228
+ if (next) {
229
+ setIsColorSubmenuOpen(false);
230
+ }
231
+ return next;
232
+ });
233
+ } else {
234
+ setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
235
+ }
236
+ })
197
237
  }, jsx(Text, null, formatMessage(messages.borderSize)), jsx("div", {
198
238
  css: contextualMenuArrow
199
239
  })), jsx("div", {
@@ -201,7 +241,9 @@ const ImageBorder = ({
201
241
  className: DropdownMenuSharedCssClassName.SUBMENU,
202
242
  ref: sizeSubmenuRef
203
243
  }, isSizeSubmenuOpen && jsx(ArrowKeyNavigationProvider, {
204
- type: ArrowKeyNavigationType.MENU,
244
+ type: ArrowKeyNavigationType.MENU
245
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
246
+ ,
205
247
  handleClose: e => {
206
248
  e.preventDefault();
207
249
  handleSizeSubmenuEsc();
@@ -315,12 +357,16 @@ const ImageBorder = ({
315
357
  spacing: "spacious",
316
358
  label: "",
317
359
  size: "small"
318
- }),
360
+ })
361
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
362
+ ,
319
363
  onClick: () => {
320
364
  setIsOpen(!isOpen);
321
365
  setIsOpenedByKeyboard(false);
322
- },
323
- onKeyDown: e => handleTriggerByKeyboard(e, () => setIsOpen(!isOpen))
366
+ }
367
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
368
+ ,
369
+ onKeyDown: e => handleTriggerToolbarByKeyboard(e, () => setIsOpen(!isOpen))
324
370
  }))), jsx(Popup, {
325
371
  target: popupTarget.current ? popupTarget.current : undefined,
326
372
  fitWidth: fitWidth + fitTolerance,
@@ -328,12 +374,17 @@ const ImageBorder = ({
328
374
  forcePlacement: true,
329
375
  stick: true
330
376
  }, jsx("div", {
331
- /* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
377
+ onMouseLeave: expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? undefined : () => {
378
+ setIsColorSubmenuOpen(false);
379
+ setIsSizeSubmenuOpen(false);
380
+ }
381
+ /* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */,
332
382
  css: dropdownWrapper
333
383
  }, jsx(DropdownMenu
334
384
  //This needs be removed when the a11y is completely handled
335
385
  //Disabling key navigation now as it works only partially
336
386
  //Same with packages/editor/editor-plugin-table/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx
387
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
337
388
  , {
338
389
  arrowKeyNavigationProviderOptions: {
339
390
  type: ArrowKeyNavigationType.MENU,
@@ -345,48 +396,84 @@ const ImageBorder = ({
345
396
  } : () => {
346
397
  var _openDropdownButtonRe3;
347
398
  (_openDropdownButtonRe3 = openDropdownButtonRef.current) === null || _openDropdownButtonRe3 === void 0 ? void 0 : _openDropdownButtonRe3.focus();
348
- },
399
+ }
400
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
401
+ ,
349
402
  items: [{
350
403
  items
351
404
  }],
352
- isOpen: isOpen,
353
- shouldFocusFirstItem: () => isOpenByKeyboard,
405
+ isOpen: isOpen
406
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
407
+ ,
408
+ shouldFocusFirstItem: () => isOpenByKeyboard
409
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
410
+ ,
354
411
  onOpenChange: () => {
355
412
  setIsOpen(false);
356
413
  setIsColorSubmenuOpen(false);
357
414
  setIsSizeSubmenuOpen(false);
358
415
  setIsOpenedByKeyboard(false);
359
- },
416
+ }
417
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
418
+ ,
360
419
  onItemActivated: ({
361
420
  item
362
421
  }) => {
363
422
  if (item.value.name === 'color') {
364
- setIsColorSubmenuOpen(!isColorSubmenuOpen);
423
+ if (expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
424
+ setIsColorSubmenuOpen(prev => {
425
+ const next = !prev;
426
+ if (next) {
427
+ setIsSizeSubmenuOpen(false);
428
+ }
429
+ return next;
430
+ });
431
+ } else {
432
+ setIsColorSubmenuOpen(!isColorSubmenuOpen);
433
+ }
365
434
  }
366
435
  if (item.value.name === 'size') {
367
- setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
436
+ if (expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
437
+ setIsSizeSubmenuOpen(prev => {
438
+ const next = !prev;
439
+ if (next) {
440
+ setIsColorSubmenuOpen(false);
441
+ }
442
+ return next;
443
+ });
444
+ } else {
445
+ setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
446
+ }
368
447
  }
369
- },
448
+ }
449
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
450
+ ,
370
451
  onMouseEnter: ({
371
452
  item
372
453
  }) => {
373
- if (item.value.name === 'color') {
374
- setIsColorSubmenuOpen(true);
375
- setIsOpenedByKeyboard(false);
376
- }
377
- if (item.value.name === 'size') {
378
- setIsSizeSubmenuOpen(true);
379
- setIsOpenedByKeyboard(false);
454
+ if (!expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
455
+ if (item.value.name === 'color') {
456
+ setIsColorSubmenuOpen(true);
457
+ setIsOpenedByKeyboard(false);
458
+ }
459
+ if (item.value.name === 'size') {
460
+ setIsSizeSubmenuOpen(true);
461
+ setIsOpenedByKeyboard(false);
462
+ }
380
463
  }
381
- },
464
+ }
465
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
466
+ ,
382
467
  onMouseLeave: ({
383
468
  item
384
469
  }) => {
385
- if (item.value.name === 'color') {
386
- setIsColorSubmenuOpen(false);
387
- }
388
- if (item.value.name === 'size') {
389
- setIsSizeSubmenuOpen(false);
470
+ if (!expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
471
+ if (item.value.name === 'color') {
472
+ setIsColorSubmenuOpen(false);
473
+ }
474
+ if (item.value.name === 'size') {
475
+ setIsSizeSubmenuOpen(false);
476
+ }
390
477
  }
391
478
  },
392
479
  fitWidth: fitWidth + fitTolerance,
@@ -121,11 +121,15 @@ class LinkAddToolbar extends React.PureComponent {
121
121
  icon: jsx(ChevronLeftLargeIcon, {
122
122
  label: formatLinkAddressText,
123
123
  size: "small"
124
- }),
124
+ })
125
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
126
+ ,
125
127
  onClick: () => this.handleOnBack({
126
128
  url: value,
127
129
  inputMethod: currentInputMethod
128
- }),
130
+ })
131
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
132
+ ,
129
133
  onKeyDown: event => {
130
134
  if (event.key === 'Enter' || event.key === ' ') {
131
135
  event.preventDefault();
@@ -142,7 +146,9 @@ class LinkAddToolbar extends React.PureComponent {
142
146
  placeholder: getPlaceholder(!!activityProvider),
143
147
  autoFocus: true,
144
148
  onCancel: this.handleCancel,
145
- defaultValue: value,
149
+ defaultValue: value
150
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
151
+ ,
146
152
  onSubmit: inputValue => {
147
153
  const validationErrors = this.getValidationErrors(inputValue, currentInputMethod);
148
154
  this.setState({
@@ -151,7 +157,9 @@ class LinkAddToolbar extends React.PureComponent {
151
157
  if (!validationErrors.length) {
152
158
  onSubmit();
153
159
  }
154
- },
160
+ }
161
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
162
+ ,
155
163
  onChange: value => {
156
164
  this.setState({
157
165
  validationErrors: []
@@ -168,8 +176,12 @@ class LinkAddToolbar extends React.PureComponent {
168
176
  title: formatUnlinkText,
169
177
  icon: jsx(EditorUnlinkIcon, {
170
178
  label: formatUnlinkText
171
- }),
172
- onClick: () => this.handleUnlink(),
179
+ })
180
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
181
+ ,
182
+ onClick: () => this.handleUnlink()
183
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
184
+ ,
173
185
  onKeyDown: event => {
174
186
  if (event.key === 'Enter' || event.key === ' ') {
175
187
  event.preventDefault();
@@ -42,8 +42,12 @@ const DropzoneWrapperInternal = ({
42
42
  config: dropzoneConfig,
43
43
  onError: pickerFacadeInstance.handleUploadError,
44
44
  onPreviewUpdate: pickerFacadeInstance.handleUploadPreviewUpdate,
45
- onEnd: pickerFacadeInstance.handleReady,
46
- onDragEnter: () => handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('enter'),
45
+ onEnd: pickerFacadeInstance.handleReady
46
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
47
+ ,
48
+ onDragEnter: () => handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('enter')
49
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
50
+ ,
47
51
  onDragLeave: () => handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('leave'),
48
52
  featureFlags: featureFlags
49
53
  }) : null;
@@ -66,6 +66,7 @@ export default function PickerFacadeProvider({
66
66
  }, [analyticsName, insertFile, mediaOptions, options === null || options === void 0 ? void 0 : options.errorReporter]);
67
67
  useEffect(() => {
68
68
  if (mediaProvider) {
69
+ // eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
69
70
  handleMediaProvider('mediaProvider', Promise.resolve(mediaProvider));
70
71
  }
71
72
  }, [mediaProvider, handleMediaProvider]);
@@ -21,6 +21,7 @@ export const MediaViewerContainer = ({
21
21
  isEditorViewMode = false,
22
22
  isSelected = true,
23
23
  isInline = false,
24
+ mediaViewerExtensions,
24
25
  children
25
26
  }) => {
26
27
  var _mediaNode$firstChild;
@@ -50,6 +51,7 @@ export const MediaViewerContainer = ({
50
51
  }, children), shouldShowViewer && jsx(RenderMediaViewer, {
51
52
  selectedNodeAttrs: selectedNodeAttrs,
52
53
  mediaClientConfig: mediaClientConfig,
53
- onClose: closeMediaViewer
54
+ onClose: closeMediaViewer,
55
+ extensions: mediaViewerExtensions
54
56
  })) : children);
55
57
  };
@@ -24,7 +24,8 @@ export const RenderMediaViewer = ({
24
24
  mediaClientConfig,
25
25
  onClose,
26
26
  selectedNodeAttrs,
27
- items = []
27
+ items = [],
28
+ extensions
28
29
  }) => {
29
30
  const identifier = getIdentifier(selectedNodeAttrs);
30
31
  const collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
@@ -36,6 +37,7 @@ export const RenderMediaViewer = ({
36
37
  ,
37
38
  mediaClientConfig: mediaClientConfig,
38
39
  selectedItem: identifier,
39
- onClose: onClose
40
+ onClose: onClose,
41
+ extensions: extensions
40
42
  }), document.body);
41
43
  };
@@ -364,6 +364,7 @@ export default class ResizableMediaSingle extends React.Component {
364
364
  // when cursor is located below a media with caption,
365
365
  // press “Up“ key will result cursor focus on an invalid position, (on the resize handler)
366
366
  // This workaround adds an empty div inside the resize handler to prevent the issue.
367
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
367
368
  ,
368
369
  handleComponentFunc: () => jsx("div", {
369
370
  contentEditable: false
@@ -298,11 +298,15 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
298
298
  state
299
299
  } = editorView;
300
300
  const borderMark = currentMediaOrInlineNodeBorderMark(state);
301
- return /*#__PURE__*/React.createElement(ImageBorderItem, {
301
+ return /*#__PURE__*/React.createElement(ImageBorderItem
302
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
303
+ , {
302
304
  toggleBorder: () => {
303
305
  var _pluginInjectionApi$a;
304
306
  toggleBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch);
305
- },
307
+ }
308
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
309
+ ,
306
310
  setBorder: attrs => {
307
311
  var _pluginInjectionApi$a2;
308
312
  setBorderMark(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(attrs)(state, dispatch);
@@ -43,7 +43,9 @@ export const LayoutGroup = ({
43
43
  }) : undefined,
44
44
  title: item.title,
45
45
  selected: item.selected,
46
- disabled: item.disabled,
46
+ disabled: item.disabled
47
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
48
+ ,
47
49
  onClick: () => {
48
50
  dispatchCommand(item.onClick);
49
51
  hide();