@atlaskit/editor-plugin-media 10.0.11 → 10.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/mediaPlugin.js +6 -3
- package/dist/cjs/nodeviews/mediaGroup.js +6 -2
- package/dist/cjs/nodeviews/mediaGroupNext.js +1 -0
- package/dist/cjs/nodeviews/mediaInline.js +10 -4
- package/dist/cjs/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/cjs/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/cjs/nodeviews/mediaSingle.js +6 -2
- package/dist/cjs/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
- package/dist/cjs/ui/CommentBadge/index.js +6 -2
- package/dist/cjs/ui/ImageBorder/index.js +40 -13
- package/dist/cjs/ui/MediaLinkingToolbar.js +18 -6
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/cjs/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/cjs/ui/toolbar/index.js +6 -2
- package/dist/cjs/ui/toolbar/layout-group.js +3 -1
- package/dist/cjs/ui/toolbar/linking.js +15 -5
- package/dist/cjs/ui/toolbar/mediaInline.js +6 -2
- package/dist/es2019/mediaPlugin.js +6 -3
- package/dist/es2019/nodeviews/mediaGroup.js +6 -2
- package/dist/es2019/nodeviews/mediaGroupNext.js +1 -0
- package/dist/es2019/nodeviews/mediaInline.js +11 -4
- package/dist/es2019/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/es2019/nodeviews/mediaSingle.js +6 -2
- package/dist/es2019/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +77 -71
- package/dist/es2019/ui/CommentBadge/index.js +6 -2
- package/dist/es2019/ui/ImageBorder/index.js +40 -13
- package/dist/es2019/ui/MediaLinkingToolbar.js +18 -6
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/es2019/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/es2019/ui/toolbar/index.js +6 -2
- package/dist/es2019/ui/toolbar/layout-group.js +3 -1
- package/dist/es2019/ui/toolbar/linking.js +15 -5
- package/dist/es2019/ui/toolbar/mediaInline.js +6 -2
- package/dist/esm/mediaPlugin.js +6 -3
- package/dist/esm/nodeviews/mediaGroup.js +6 -2
- package/dist/esm/nodeviews/mediaGroupNext.js +1 -0
- package/dist/esm/nodeviews/mediaInline.js +10 -4
- package/dist/esm/nodeviews/mediaNodeView/index.js +3 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +3 -1
- package/dist/esm/nodeviews/mediaSingle.js +6 -2
- package/dist/esm/pm-plugins/pixel-resizing/ui/index.js +12 -4
- package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +79 -73
- package/dist/esm/ui/CommentBadge/index.js +6 -2
- package/dist/esm/ui/ImageBorder/index.js +40 -13
- package/dist/esm/ui/MediaLinkingToolbar.js +18 -6
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +6 -2
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/esm/ui/ResizableMediaSingle/index.js +1 -0
- package/dist/esm/ui/toolbar/index.js +6 -2
- package/dist/esm/ui/toolbar/layout-group.js +3 -1
- package/dist/esm/ui/toolbar/linking.js +15 -5
- package/dist/esm/ui/toolbar/mediaInline.js +6 -2
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
- package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +3 -1
- package/dist/types-ts4.5/types/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +3 -1
- package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +3 -1
- package/package.json +5 -5
|
@@ -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
|
}) => {
|
|
@@ -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
|
};
|
|
@@ -163,20 +163,26 @@ const ImageBorder = ({
|
|
|
163
163
|
css: contextualSubMenu(0),
|
|
164
164
|
ref: handleSubMenuRef
|
|
165
165
|
}, jsx(ArrowKeyNavigationProvider, {
|
|
166
|
-
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
|
+
,
|
|
167
169
|
handleClose: e => {
|
|
168
170
|
e.preventDefault();
|
|
169
171
|
e.stopPropagation();
|
|
170
172
|
handleColorSubmenuEsc();
|
|
171
173
|
},
|
|
172
174
|
disableCloseOnArrowClick: true
|
|
173
|
-
}, 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
|
+
, {
|
|
174
178
|
onClick: color => {
|
|
175
179
|
setBorder({
|
|
176
180
|
color
|
|
177
181
|
});
|
|
178
182
|
setIsOpen(!isOpen);
|
|
179
|
-
}
|
|
183
|
+
}
|
|
184
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
185
|
+
,
|
|
180
186
|
onKeyDown: (color, _, event) => {
|
|
181
187
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
182
188
|
var _openDropdownButtonRe;
|
|
@@ -189,7 +195,9 @@ const ImageBorder = ({
|
|
|
189
195
|
(_openDropdownButtonRe = openDropdownButtonRef.current) === null || _openDropdownButtonRe === void 0 ? void 0 : _openDropdownButtonRe.focus();
|
|
190
196
|
}
|
|
191
197
|
},
|
|
192
|
-
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
|
+
,
|
|
193
201
|
paletteOptions: {
|
|
194
202
|
palette: borderColorPalette,
|
|
195
203
|
paletteColorTooltipMessages: borderPaletteTooltipMessages,
|
|
@@ -233,7 +241,9 @@ const ImageBorder = ({
|
|
|
233
241
|
className: DropdownMenuSharedCssClassName.SUBMENU,
|
|
234
242
|
ref: sizeSubmenuRef
|
|
235
243
|
}, isSizeSubmenuOpen && jsx(ArrowKeyNavigationProvider, {
|
|
236
|
-
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
|
+
,
|
|
237
247
|
handleClose: e => {
|
|
238
248
|
e.preventDefault();
|
|
239
249
|
handleSizeSubmenuEsc();
|
|
@@ -347,11 +357,15 @@ const ImageBorder = ({
|
|
|
347
357
|
spacing: "spacious",
|
|
348
358
|
label: "",
|
|
349
359
|
size: "small"
|
|
350
|
-
})
|
|
360
|
+
})
|
|
361
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
362
|
+
,
|
|
351
363
|
onClick: () => {
|
|
352
364
|
setIsOpen(!isOpen);
|
|
353
365
|
setIsOpenedByKeyboard(false);
|
|
354
|
-
}
|
|
366
|
+
}
|
|
367
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
368
|
+
,
|
|
355
369
|
onKeyDown: e => handleTriggerToolbarByKeyboard(e, () => setIsOpen(!isOpen))
|
|
356
370
|
}))), jsx(Popup, {
|
|
357
371
|
target: popupTarget.current ? popupTarget.current : undefined,
|
|
@@ -370,6 +384,7 @@ const ImageBorder = ({
|
|
|
370
384
|
//This needs be removed when the a11y is completely handled
|
|
371
385
|
//Disabling key navigation now as it works only partially
|
|
372
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)
|
|
373
388
|
, {
|
|
374
389
|
arrowKeyNavigationProviderOptions: {
|
|
375
390
|
type: ArrowKeyNavigationType.MENU,
|
|
@@ -381,18 +396,26 @@ const ImageBorder = ({
|
|
|
381
396
|
} : () => {
|
|
382
397
|
var _openDropdownButtonRe3;
|
|
383
398
|
(_openDropdownButtonRe3 = openDropdownButtonRef.current) === null || _openDropdownButtonRe3 === void 0 ? void 0 : _openDropdownButtonRe3.focus();
|
|
384
|
-
}
|
|
399
|
+
}
|
|
400
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
401
|
+
,
|
|
385
402
|
items: [{
|
|
386
403
|
items
|
|
387
404
|
}],
|
|
388
|
-
isOpen: isOpen
|
|
389
|
-
|
|
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
|
+
,
|
|
390
411
|
onOpenChange: () => {
|
|
391
412
|
setIsOpen(false);
|
|
392
413
|
setIsColorSubmenuOpen(false);
|
|
393
414
|
setIsSizeSubmenuOpen(false);
|
|
394
415
|
setIsOpenedByKeyboard(false);
|
|
395
|
-
}
|
|
416
|
+
}
|
|
417
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
418
|
+
,
|
|
396
419
|
onItemActivated: ({
|
|
397
420
|
item
|
|
398
421
|
}) => {
|
|
@@ -422,7 +445,9 @@ const ImageBorder = ({
|
|
|
422
445
|
setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
|
|
423
446
|
}
|
|
424
447
|
}
|
|
425
|
-
}
|
|
448
|
+
}
|
|
449
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
450
|
+
,
|
|
426
451
|
onMouseEnter: ({
|
|
427
452
|
item
|
|
428
453
|
}) => {
|
|
@@ -436,7 +461,9 @@ const ImageBorder = ({
|
|
|
436
461
|
setIsOpenedByKeyboard(false);
|
|
437
462
|
}
|
|
438
463
|
}
|
|
439
|
-
}
|
|
464
|
+
}
|
|
465
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
466
|
+
,
|
|
440
467
|
onMouseLeave: ({
|
|
441
468
|
item
|
|
442
469
|
}) => {
|