@atlaskit/editor-plugin-media 10.0.11 → 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 +12 -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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 10.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6e25e8bbb01c3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e25e8bbb01c3) -
|
|
8
|
+
[ux] Adds mediaViewerExtensions prop to media-viewer/src/header and threads it through parents.
|
|
9
|
+
Allows callers to pass in additional buttons to the image / video preview'
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 10.0.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/mediaPlugin.js
CHANGED
|
@@ -81,7 +81,8 @@ var mediaViewerStateSelector = function mediaViewerStateSelector(states) {
|
|
|
81
81
|
};
|
|
82
82
|
var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_ref2) {
|
|
83
83
|
var api = _ref2.api,
|
|
84
|
-
editorView = _ref2.editorView
|
|
84
|
+
editorView = _ref2.editorView,
|
|
85
|
+
mediaViewerExtensions = _ref2.mediaViewerExtensions;
|
|
85
86
|
// Only traverse document once when media viewer is visible, media viewer items will not update
|
|
86
87
|
// when document changes are made while media viewer is open
|
|
87
88
|
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['media'], mediaViewerStateSelector),
|
|
@@ -108,7 +109,8 @@ var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_re
|
|
|
108
109
|
mediaClientConfig: mediaClientConfig,
|
|
109
110
|
onClose: handleOnClose,
|
|
110
111
|
selectedNodeAttrs: mediaViewerSelectedMedia,
|
|
111
|
-
items: mediaItems
|
|
112
|
+
items: mediaItems,
|
|
113
|
+
extensions: mediaViewerExtensions
|
|
112
114
|
});
|
|
113
115
|
};
|
|
114
116
|
var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
@@ -342,7 +344,8 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
342
344
|
}
|
|
343
345
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(MediaViewerFunctionalComponent, {
|
|
344
346
|
api: api,
|
|
345
|
-
editorView: editorView
|
|
347
|
+
editorView: editorView,
|
|
348
|
+
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions
|
|
346
349
|
}), /*#__PURE__*/_react.default.createElement(MediaPickerFunctionalComponent, {
|
|
347
350
|
editorDomElement: editorView.dom,
|
|
348
351
|
appearance: appearance,
|
|
@@ -53,9 +53,13 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
53
53
|
mediaOptions = props.mediaOptions,
|
|
54
54
|
pluginInjectionApi = props.pluginInjectionApi;
|
|
55
55
|
var getPos = this.getPos;
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders
|
|
57
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
58
|
+
, {
|
|
57
59
|
providers: ['contextIdentifierProvider'],
|
|
58
|
-
providerFactory: providerFactory
|
|
60
|
+
providerFactory: providerFactory
|
|
61
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
62
|
+
,
|
|
59
63
|
renderNode: function renderNode(_ref2) {
|
|
60
64
|
var contextIdentifierProvider = _ref2.contextIdentifierProvider;
|
|
61
65
|
var renderFn = function renderFn(_ref3) {
|
|
@@ -248,6 +248,7 @@ var MediaGroupNext = exports.MediaGroupNext = (0, _reactIntlNext.injectIntl)( /*
|
|
|
248
248
|
setViewMediaClientConfig(mediaClientConfig);
|
|
249
249
|
}, [mediaClientConfig]);
|
|
250
250
|
(0, _react.useEffect)(function () {
|
|
251
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
|
|
251
252
|
mediaNodesWithOffsets.forEach(function (_ref5) {
|
|
252
253
|
var node = _ref5.node,
|
|
253
254
|
offset = _ref5.offset;
|
|
@@ -200,7 +200,9 @@ var MediaInline = exports.MediaInline = function MediaInline(props) {
|
|
|
200
200
|
isSelected: props.isSelected,
|
|
201
201
|
alt: alt,
|
|
202
202
|
width: width,
|
|
203
|
-
height: height
|
|
203
|
+
height: height
|
|
204
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
205
|
+
,
|
|
204
206
|
border: {
|
|
205
207
|
borderSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
206
208
|
borderColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color
|
|
@@ -308,11 +310,15 @@ var MediaInlineNodeView = exports.MediaInlineNodeView = /*#__PURE__*/function (_
|
|
|
308
310
|
api = props.api;
|
|
309
311
|
var view = this.view;
|
|
310
312
|
var getPos = this.getPos;
|
|
311
|
-
return (0, _react2.jsx)(_providerFactory.WithProviders
|
|
313
|
+
return (0, _react2.jsx)(_providerFactory.WithProviders
|
|
314
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
315
|
+
, {
|
|
312
316
|
providers: ['contextIdentifierProvider'],
|
|
313
|
-
providerFactory: providerFactory
|
|
317
|
+
providerFactory: providerFactory
|
|
318
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
319
|
+
,
|
|
314
320
|
renderNode: function renderNode(_ref4) {
|
|
315
|
-
var
|
|
321
|
+
var _mediaProvider = _ref4.mediaProvider,
|
|
316
322
|
contextIdentifierProvider = _ref4.contextIdentifierProvider;
|
|
317
323
|
return (0, _react2.jsx)(MediaInlineSharedState, {
|
|
318
324
|
identifier: _this.node.attrs.id,
|
|
@@ -280,7 +280,9 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
280
280
|
key: "render",
|
|
281
281
|
value: function render() {
|
|
282
282
|
var providerFactory = this.reactComponentProps.providerFactory;
|
|
283
|
-
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders
|
|
283
|
+
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders
|
|
284
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
285
|
+
, {
|
|
284
286
|
providers: ['contextIdentifierProvider'],
|
|
285
287
|
providerFactory: providerFactory,
|
|
286
288
|
renderNode: this.renderMediaNodeWithProviders
|
|
@@ -366,7 +366,9 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
366
366
|
onContextMenu: this.selectMediaSingle,
|
|
367
367
|
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
368
368
|
selected: selected
|
|
369
|
-
}, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext
|
|
369
|
+
}, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext
|
|
370
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
371
|
+
, {
|
|
370
372
|
data: (0, _defineProperty2.default)({}, _analyticsNamespacedContext.MEDIA_CONTEXT, {
|
|
371
373
|
border: !!borderMark
|
|
372
374
|
})
|
|
@@ -253,9 +253,13 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
253
253
|
|
|
254
254
|
// getPos is a boolean for marks, since this is a node we know it must be a function
|
|
255
255
|
var getPos = this.getPos;
|
|
256
|
-
return (0, _react2.jsx)(_providerFactory.WithProviders
|
|
256
|
+
return (0, _react2.jsx)(_providerFactory.WithProviders
|
|
257
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
258
|
+
, {
|
|
257
259
|
providers: ['contextIdentifierProvider'],
|
|
258
|
-
providerFactory: providerFactory
|
|
260
|
+
providerFactory: providerFactory
|
|
261
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
262
|
+
,
|
|
259
263
|
renderNode: function renderNode(_ref2) {
|
|
260
264
|
var contextIdentifierProvider = _ref2.contextIdentifierProvider;
|
|
261
265
|
return (0, _react2.jsx)(MediaSingleNodeWrapper, {
|
|
@@ -79,14 +79,18 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
79
79
|
mediaWidth: mediaWidth || _mediaSingle.DEFAULT_IMAGE_WIDTH,
|
|
80
80
|
mediaHeight: mediaHeight || _mediaSingle.DEFAULT_IMAGE_HEIGHT,
|
|
81
81
|
minWidth: minWidth,
|
|
82
|
-
maxWidth: maxWidth
|
|
82
|
+
maxWidth: maxWidth
|
|
83
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
84
|
+
,
|
|
83
85
|
onChange: function onChange(valid) {
|
|
84
86
|
if (valid) {
|
|
85
87
|
hoverDecoration === null || hoverDecoration === void 0 || hoverDecoration(mediaSingle, true, 'warning')(editorView.state, dispatch, editorView);
|
|
86
88
|
} else {
|
|
87
89
|
hoverDecoration === null || hoverDecoration === void 0 || hoverDecoration(mediaSingle, false)(editorView.state, dispatch, editorView);
|
|
88
90
|
}
|
|
89
|
-
}
|
|
91
|
+
}
|
|
92
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
93
|
+
,
|
|
90
94
|
onSubmit: function onSubmit(_ref2) {
|
|
91
95
|
var width = _ref2.width,
|
|
92
96
|
validation = _ref2.validation;
|
|
@@ -94,7 +98,9 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
94
98
|
if (tr) {
|
|
95
99
|
dispatch(tr);
|
|
96
100
|
}
|
|
97
|
-
}
|
|
101
|
+
}
|
|
102
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
103
|
+
,
|
|
98
104
|
onMigrate: function onMigrate() {
|
|
99
105
|
var tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, _objectSpread(_objectSpread({}, selectedMediaSingleNode.node.attrs), {}, {
|
|
100
106
|
width: pixelWidthFromElement,
|
|
@@ -107,7 +113,9 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
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: function onCloseAndSave(_ref3, setFocus) {
|
|
112
120
|
var width = _ref3.width,
|
|
113
121
|
validation = _ref3.validation;
|
|
@@ -29,8 +29,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
29
29
|
|
|
30
30
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
31
31
|
|
|
32
|
-
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
|
|
33
|
-
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
32
|
+
// 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
|
|
34
33
|
|
|
35
34
|
var pixelSizingLabel = (0, _primitives.xcss)({
|
|
36
35
|
gridArea: 'label',
|
|
@@ -210,7 +209,7 @@ var PixelEntryComponent = exports.PixelEntryComponent = function PixelEntryCompo
|
|
|
210
209
|
// Ignored via go/ees005
|
|
211
210
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
212
211
|
, (0, _extends2.default)({}, fieldProps, {
|
|
213
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/
|
|
212
|
+
// 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)
|
|
214
213
|
css: [_styles.pixelSizingWidthInput, _styles.pixelSizingInput],
|
|
215
214
|
appearance: "none",
|
|
216
215
|
isCompact: true,
|
|
@@ -237,7 +236,7 @@ var PixelEntryComponent = exports.PixelEntryComponent = function PixelEntryCompo
|
|
|
237
236
|
// Ignored via go/ees005
|
|
238
237
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
239
238
|
, (0, _extends2.default)({}, fieldProps, {
|
|
240
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/
|
|
239
|
+
// 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)
|
|
241
240
|
css: [_styles.pixelSizingHeightInput, _styles.pixelSizingInput],
|
|
242
241
|
appearance: "none",
|
|
243
242
|
isCompact: true,
|
|
@@ -312,73 +311,80 @@ var PixelEntryComponentNext = exports.PixelEntryComponentNext = function PixelEn
|
|
|
312
311
|
}, shouldSetFocus);
|
|
313
312
|
}
|
|
314
313
|
}, [computedWidth, computedHeight, handleCloseAndSave]);
|
|
315
|
-
return (
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
314
|
+
return (
|
|
315
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
316
|
+
(0, _react2.jsx)(_primitives.Box, {
|
|
317
|
+
xcss: [pixelEntryWrapperStyles, isViewMode && pixelEntryWrapperViewModeStyles]
|
|
318
|
+
}, (0, _react2.jsx)(_primitives.Inline, {
|
|
319
|
+
alignBlock: "center",
|
|
320
|
+
spread: "space-between"
|
|
321
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
322
|
+
paddingInlineStart: "space.100"
|
|
323
|
+
}, (0, _react2.jsx)(_primitives.Text, {
|
|
324
|
+
color: "color.text.subtlest"
|
|
325
|
+
}, formatMessage(_media.pixelEntryMessages.inputWidthLabel))), (0, _react2.jsx)("div", {
|
|
326
|
+
css: fieldStyles
|
|
327
|
+
}, (0, _react2.jsx)(_tooltip.default, {
|
|
328
|
+
hideTooltipOnMouseDown: true,
|
|
329
|
+
hideTooltipOnClick: true,
|
|
330
|
+
position: "top",
|
|
331
|
+
content: formatMessage(_media.pixelEntryMessages.inputWidthTooltip, {
|
|
332
|
+
maxWidth: maxWidth
|
|
333
|
+
})
|
|
334
|
+
}, (0, _react2.jsx)(_textfield.default, {
|
|
335
|
+
name: "inputWidth",
|
|
336
|
+
value: computedWidth,
|
|
337
|
+
ref: widthInputRef,
|
|
338
|
+
height: "var(--ds-space-250, 20px)",
|
|
339
|
+
appearance: "none",
|
|
340
|
+
pattern: "\\d*",
|
|
341
|
+
"aria-label": formatMessage(_media.pixelEntryMessages.inputWidthAriaLabel, {
|
|
342
|
+
maxWidth: maxWidth
|
|
343
|
+
}),
|
|
344
|
+
onChange: handleFieldChange('inputWidth'),
|
|
345
|
+
onKeyDown: handleKeyDown
|
|
346
|
+
}))), (0, _react2.jsx)(_primitives.Box, {
|
|
347
|
+
paddingInlineStart: "space.100"
|
|
348
|
+
}, (0, _react2.jsx)(_primitives.Text, {
|
|
349
|
+
color: "color.text.subtlest"
|
|
350
|
+
}, formatMessage(_media.pixelEntryMessages.inputHeightTooltip))), (0, _react2.jsx)("div", {
|
|
351
|
+
css: fieldStyles
|
|
352
|
+
}, (0, _react2.jsx)(_tooltip.default, {
|
|
353
|
+
hideTooltipOnMouseDown: true,
|
|
354
|
+
hideTooltipOnClick: true,
|
|
355
|
+
content: formatMessage(_media.pixelEntryMessages.inputHeightTooltip),
|
|
356
|
+
position: "top"
|
|
357
|
+
}, (0, _react2.jsx)(_textfield.default, {
|
|
358
|
+
name: "inputHeight",
|
|
359
|
+
value: computedHeight,
|
|
360
|
+
height: "var(--ds-space-250, 20px)",
|
|
361
|
+
appearance: "none",
|
|
362
|
+
pattern: "\\d*",
|
|
363
|
+
"aria-label": formatMessage(_media.pixelEntryMessages.inputHeightAriaLabel),
|
|
364
|
+
onChange: handleFieldChange('inputHeight'),
|
|
365
|
+
onKeyDown: handleKeyDown
|
|
366
|
+
}))), !isViewMode && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_primitives.Box, {
|
|
367
|
+
xcss: dividerStyles
|
|
368
|
+
}), (0, _react2.jsx)(_new.IconButton
|
|
369
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
370
|
+
, {
|
|
371
|
+
icon: function icon() {
|
|
372
|
+
return (0, _react2.jsx)(_cross.default, {
|
|
373
|
+
label: "",
|
|
374
|
+
color: "var(--ds-icon-subtlest, #6B6E76)"
|
|
375
|
+
});
|
|
376
|
+
},
|
|
377
|
+
label: formatMessage(_media.pixelEntryMessages.closePixelEntry),
|
|
378
|
+
appearance: "subtle"
|
|
379
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
380
|
+
,
|
|
381
|
+
onClick: function onClick() {
|
|
382
|
+
handleCloseAndSave({
|
|
383
|
+
inputWidth: computedWidth,
|
|
384
|
+
inputHeight: computedHeight
|
|
385
|
+
});
|
|
386
|
+
},
|
|
387
|
+
onKeyDown: handleCloseButtonKeyDown
|
|
388
|
+
}))))
|
|
389
|
+
);
|
|
384
390
|
};
|
|
@@ -67,10 +67,14 @@ var CommentBadgeWrapper = exports.CommentBadgeWrapper = function CommentBadgeWra
|
|
|
67
67
|
return /*#__PURE__*/_react.default.createElement(_mediaSingle.CommentBadgeNext, {
|
|
68
68
|
onClick: onClick,
|
|
69
69
|
mediaSingleElement: mediaSingleElement,
|
|
70
|
-
status: entered ? 'entered' : status
|
|
70
|
+
status: entered ? 'entered' : status
|
|
71
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
72
|
+
,
|
|
71
73
|
onMouseEnter: function onMouseEnter() {
|
|
72
74
|
return setEntered(true);
|
|
73
|
-
}
|
|
75
|
+
}
|
|
76
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
77
|
+
,
|
|
74
78
|
onMouseLeave: function onMouseLeave() {
|
|
75
79
|
return setEntered(false);
|
|
76
80
|
}
|
|
@@ -183,20 +183,26 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
183
183
|
css: (0, _styles2.contextualSubMenu)(0),
|
|
184
184
|
ref: handleSubMenuRef
|
|
185
185
|
}, (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
|
|
186
|
-
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
186
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
187
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
188
|
+
,
|
|
187
189
|
handleClose: function handleClose(e) {
|
|
188
190
|
e.preventDefault();
|
|
189
191
|
e.stopPropagation();
|
|
190
192
|
handleColorSubmenuEsc();
|
|
191
193
|
},
|
|
192
194
|
disableCloseOnArrowClick: true
|
|
193
|
-
}, (0, _react2.jsx)(_uiColor.ColorPalette
|
|
195
|
+
}, (0, _react2.jsx)(_uiColor.ColorPalette
|
|
196
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
197
|
+
, {
|
|
194
198
|
onClick: function onClick(color) {
|
|
195
199
|
setBorder({
|
|
196
200
|
color: color
|
|
197
201
|
});
|
|
198
202
|
setIsOpen(!isOpen);
|
|
199
|
-
}
|
|
203
|
+
}
|
|
204
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
205
|
+
,
|
|
200
206
|
onKeyDown: function onKeyDown(color, _, event) {
|
|
201
207
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
202
208
|
var _openDropdownButtonRe;
|
|
@@ -209,7 +215,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
209
215
|
(_openDropdownButtonRe = openDropdownButtonRef.current) === null || _openDropdownButtonRe === void 0 || _openDropdownButtonRe.focus();
|
|
210
216
|
}
|
|
211
217
|
},
|
|
212
|
-
selectedColor: color !== null && color !== void 0 ? color : null
|
|
218
|
+
selectedColor: color !== null && color !== void 0 ? color : null
|
|
219
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
220
|
+
,
|
|
213
221
|
paletteOptions: {
|
|
214
222
|
palette: _uiColor.borderColorPalette,
|
|
215
223
|
paletteColorTooltipMessages: _uiColor.borderPaletteTooltipMessages,
|
|
@@ -255,7 +263,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
255
263
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU,
|
|
256
264
|
ref: sizeSubmenuRef
|
|
257
265
|
}, isSizeSubmenuOpen && (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
|
|
258
|
-
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
266
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
267
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
268
|
+
,
|
|
259
269
|
handleClose: function handleClose(e) {
|
|
260
270
|
e.preventDefault();
|
|
261
271
|
handleSizeSubmenuEsc();
|
|
@@ -368,11 +378,15 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
368
378
|
spacing: "spacious",
|
|
369
379
|
label: "",
|
|
370
380
|
size: "small"
|
|
371
|
-
})
|
|
381
|
+
})
|
|
382
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
383
|
+
,
|
|
372
384
|
onClick: function onClick() {
|
|
373
385
|
setIsOpen(!isOpen);
|
|
374
386
|
setIsOpenedByKeyboard(false);
|
|
375
|
-
}
|
|
387
|
+
}
|
|
388
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
389
|
+
,
|
|
376
390
|
onKeyDown: function onKeyDown(e) {
|
|
377
391
|
return handleTriggerToolbarByKeyboard(e, function () {
|
|
378
392
|
return setIsOpen(!isOpen);
|
|
@@ -395,6 +409,7 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
395
409
|
//This needs be removed when the a11y is completely handled
|
|
396
410
|
//Disabling key navigation now as it works only partially
|
|
397
411
|
//Same with packages/editor/editor-plugin-table/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx
|
|
412
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
398
413
|
, {
|
|
399
414
|
arrowKeyNavigationProviderOptions: {
|
|
400
415
|
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
@@ -406,20 +421,28 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
406
421
|
} : function () {
|
|
407
422
|
var _openDropdownButtonRe3;
|
|
408
423
|
(_openDropdownButtonRe3 = openDropdownButtonRef.current) === null || _openDropdownButtonRe3 === void 0 || _openDropdownButtonRe3.focus();
|
|
409
|
-
}
|
|
424
|
+
}
|
|
425
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
426
|
+
,
|
|
410
427
|
items: [{
|
|
411
428
|
items: items
|
|
412
429
|
}],
|
|
413
|
-
isOpen: isOpen
|
|
430
|
+
isOpen: isOpen
|
|
431
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
432
|
+
,
|
|
414
433
|
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
415
434
|
return isOpenByKeyboard;
|
|
416
|
-
}
|
|
435
|
+
}
|
|
436
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
437
|
+
,
|
|
417
438
|
onOpenChange: function onOpenChange() {
|
|
418
439
|
setIsOpen(false);
|
|
419
440
|
setIsColorSubmenuOpen(false);
|
|
420
441
|
setIsSizeSubmenuOpen(false);
|
|
421
442
|
setIsOpenedByKeyboard(false);
|
|
422
|
-
}
|
|
443
|
+
}
|
|
444
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
445
|
+
,
|
|
423
446
|
onItemActivated: function onItemActivated(_ref3) {
|
|
424
447
|
var item = _ref3.item;
|
|
425
448
|
if (item.value.name === 'color') {
|
|
@@ -448,7 +471,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
448
471
|
setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
|
|
449
472
|
}
|
|
450
473
|
}
|
|
451
|
-
}
|
|
474
|
+
}
|
|
475
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
476
|
+
,
|
|
452
477
|
onMouseEnter: function onMouseEnter(_ref4) {
|
|
453
478
|
var item = _ref4.item;
|
|
454
479
|
if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
|
|
@@ -461,7 +486,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
461
486
|
setIsOpenedByKeyboard(false);
|
|
462
487
|
}
|
|
463
488
|
}
|
|
464
|
-
}
|
|
489
|
+
}
|
|
490
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
491
|
+
,
|
|
465
492
|
onMouseLeave: function onMouseLeave(_ref5) {
|
|
466
493
|
var item = _ref5.item;
|
|
467
494
|
if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
|
|
@@ -126,13 +126,17 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
126
126
|
icon: (0, _react2.jsx)(_chevronLeft.default, {
|
|
127
127
|
label: formatLinkAddressText,
|
|
128
128
|
size: "small"
|
|
129
|
-
})
|
|
129
|
+
})
|
|
130
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
131
|
+
,
|
|
130
132
|
onClick: function onClick() {
|
|
131
133
|
return _this.handleOnBack({
|
|
132
134
|
url: value,
|
|
133
135
|
inputMethod: currentInputMethod
|
|
134
136
|
});
|
|
135
|
-
}
|
|
137
|
+
}
|
|
138
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
139
|
+
,
|
|
136
140
|
onKeyDown: function onKeyDown(event) {
|
|
137
141
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
138
142
|
event.preventDefault();
|
|
@@ -149,7 +153,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
153
|
placeholder: getPlaceholder(!!activityProvider),
|
|
150
154
|
autoFocus: true,
|
|
151
155
|
onCancel: _this.handleCancel,
|
|
152
|
-
defaultValue: value
|
|
156
|
+
defaultValue: value
|
|
157
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
158
|
+
,
|
|
153
159
|
onSubmit: function onSubmit(inputValue) {
|
|
154
160
|
var validationErrors = _this.getValidationErrors(inputValue, currentInputMethod);
|
|
155
161
|
_this.setState({
|
|
@@ -158,7 +164,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
158
164
|
if (!validationErrors.length) {
|
|
159
165
|
_onSubmit();
|
|
160
166
|
}
|
|
161
|
-
}
|
|
167
|
+
}
|
|
168
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
169
|
+
,
|
|
162
170
|
onChange: function onChange(value) {
|
|
163
171
|
_this.setState({
|
|
164
172
|
validationErrors: []
|
|
@@ -175,10 +183,14 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
175
183
|
title: formatUnlinkText,
|
|
176
184
|
icon: (0, _react2.jsx)(_linkBroken.default, {
|
|
177
185
|
label: formatUnlinkText
|
|
178
|
-
})
|
|
186
|
+
})
|
|
187
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
188
|
+
,
|
|
179
189
|
onClick: function onClick() {
|
|
180
190
|
return _this.handleUnlink();
|
|
181
|
-
}
|
|
191
|
+
}
|
|
192
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
193
|
+
,
|
|
182
194
|
onKeyDown: function onKeyDown(event) {
|
|
183
195
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
184
196
|
event.preventDefault();
|
|
@@ -48,10 +48,14 @@ var DropzoneWrapperInternal = function DropzoneWrapperInternal(_ref) {
|
|
|
48
48
|
config: dropzoneConfig,
|
|
49
49
|
onError: pickerFacadeInstance.handleUploadError,
|
|
50
50
|
onPreviewUpdate: pickerFacadeInstance.handleUploadPreviewUpdate,
|
|
51
|
-
onEnd: pickerFacadeInstance.handleReady
|
|
51
|
+
onEnd: pickerFacadeInstance.handleReady
|
|
52
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
53
|
+
,
|
|
52
54
|
onDragEnter: function onDragEnter() {
|
|
53
55
|
return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('enter');
|
|
54
|
-
}
|
|
56
|
+
}
|
|
57
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
58
|
+
,
|
|
55
59
|
onDragLeave: function onDragLeave() {
|
|
56
60
|
return handleDrag === null || handleDrag === void 0 ? void 0 : handleDrag('leave');
|
|
57
61
|
},
|
|
@@ -115,6 +115,7 @@ function PickerFacadeProvider(_ref) {
|
|
|
115
115
|
}(), [analyticsName, insertFile, mediaOptions, options === null || options === void 0 ? void 0 : options.errorReporter]);
|
|
116
116
|
(0, _react.useEffect)(function () {
|
|
117
117
|
if (mediaProvider) {
|
|
118
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed)
|
|
118
119
|
handleMediaProvider('mediaProvider', Promise.resolve(mediaProvider));
|
|
119
120
|
}
|
|
120
121
|
}, [mediaProvider, handleMediaProvider]);
|
|
@@ -36,6 +36,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
|
|
|
36
36
|
isSelected = _ref$isSelected === void 0 ? true : _ref$isSelected,
|
|
37
37
|
_ref$isInline = _ref.isInline,
|
|
38
38
|
isInline = _ref$isInline === void 0 ? false : _ref$isInline,
|
|
39
|
+
mediaViewerExtensions = _ref.mediaViewerExtensions,
|
|
39
40
|
children = _ref.children;
|
|
40
41
|
var _useState = (0, _react.useState)(false),
|
|
41
42
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -66,6 +67,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
|
|
|
66
67
|
}, children), shouldShowViewer && (0, _react2.jsx)(_PortalWrapper.RenderMediaViewer, {
|
|
67
68
|
selectedNodeAttrs: selectedNodeAttrs,
|
|
68
69
|
mediaClientConfig: mediaClientConfig,
|
|
69
|
-
onClose: closeMediaViewer
|
|
70
|
+
onClose: closeMediaViewer,
|
|
71
|
+
extensions: mediaViewerExtensions
|
|
70
72
|
})) : children);
|
|
71
73
|
};
|
|
@@ -31,7 +31,8 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
|
|
|
31
31
|
onClose = _ref.onClose,
|
|
32
32
|
selectedNodeAttrs = _ref.selectedNodeAttrs,
|
|
33
33
|
_ref$items = _ref.items,
|
|
34
|
-
items = _ref$items === void 0 ? [] : _ref$items
|
|
34
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
35
|
+
extensions = _ref.extensions;
|
|
35
36
|
var identifier = getIdentifier(selectedNodeAttrs);
|
|
36
37
|
var collectionName = (0, _utils.isExternalMedia)(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
37
38
|
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
|
|
@@ -42,6 +43,7 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
|
|
|
42
43
|
,
|
|
43
44
|
mediaClientConfig: mediaClientConfig,
|
|
44
45
|
selectedItem: identifier,
|
|
45
|
-
onClose: onClose
|
|
46
|
+
onClose: onClose,
|
|
47
|
+
extensions: extensions
|
|
46
48
|
}), document.body);
|
|
47
49
|
};
|