@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.
- package/CHANGELOG.md +21 -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 +121 -38
- 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 +123 -36
- 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 +121 -38
- 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 +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/
|
|
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/
|
|
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
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
|
|
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 (
|
|
84
|
-
|
|
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 =>
|
|
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 =>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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 (
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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();
|