@atlaskit/editor-plugin-media 1.18.0 → 1.19.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/nodeviews/mediaInline.js +2 -8
- package/dist/cjs/toolbar/mediaInline.js +30 -8
- package/dist/es2019/nodeviews/mediaInline.js +2 -8
- package/dist/es2019/toolbar/mediaInline.js +30 -8
- package/dist/esm/nodeviews/mediaInline.js +2 -8
- package/dist/esm/toolbar/mediaInline.js +30 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.19.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#96502](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96502)
|
|
14
|
+
[`6d16f58c771d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6d16f58c771d) -
|
|
15
|
+
[ux] Add floating toolbar to inline images in view mode, remove media preview on click
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.18.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -189,13 +189,7 @@ var MediaInline = exports.MediaInline = function MediaInline(props) {
|
|
|
189
189
|
return mark.type.name === 'border';
|
|
190
190
|
});
|
|
191
191
|
if (allowInlineImages && (0, _isType.isImage)(type)) {
|
|
192
|
-
return (0, _react2.jsx)(
|
|
193
|
-
mediaNode: props.node,
|
|
194
|
-
mediaPluginState: props.mediaPluginState,
|
|
195
|
-
isEditorViewMode: props.editorViewMode,
|
|
196
|
-
isSelected: props.isSelected,
|
|
197
|
-
isInline: true
|
|
198
|
-
}, (0, _react2.jsx)(_mediaInline.MediaInlineImageCard, {
|
|
192
|
+
return (0, _react2.jsx)(_mediaInline.MediaInlineImageCard, {
|
|
199
193
|
mediaClient: (0, _mediaClientReact.getMediaClient)(viewMediaClientConfig),
|
|
200
194
|
identifier: identifier,
|
|
201
195
|
isSelected: props.isSelected,
|
|
@@ -206,7 +200,7 @@ var MediaInline = exports.MediaInline = function MediaInline(props) {
|
|
|
206
200
|
borderSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
207
201
|
borderColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color
|
|
208
202
|
}
|
|
209
|
-
})
|
|
203
|
+
});
|
|
210
204
|
}
|
|
211
205
|
return (0, _react2.jsx)(_MediaViewerContainer.MediaViewerContainer, {
|
|
212
206
|
mediaNode: props.node,
|
|
@@ -241,17 +241,36 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
241
241
|
onAddLink: editLink,
|
|
242
242
|
onEditLink: editLink,
|
|
243
243
|
onOpenLink: openLink,
|
|
244
|
-
isInlineNode: true
|
|
244
|
+
isInlineNode: true,
|
|
245
|
+
isViewOnly: options.isViewOnly
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
248
|
return null;
|
|
248
|
-
}
|
|
249
|
+
},
|
|
250
|
+
supportsViewMode: true
|
|
249
251
|
});
|
|
250
252
|
|
|
251
253
|
//Image Preview
|
|
252
|
-
if (
|
|
254
|
+
if (options.allowImagePreview) {
|
|
253
255
|
inlineImageItems.push((0, _index.generateFilePreviewItem)(mediaPluginState, intl), {
|
|
254
|
-
type: 'separator'
|
|
256
|
+
type: 'separator',
|
|
257
|
+
supportsViewMode: true
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (options.isViewOnly) {
|
|
261
|
+
inlineImageItems.push({
|
|
262
|
+
id: 'editor.media.image.download',
|
|
263
|
+
type: 'button',
|
|
264
|
+
icon: _download.default,
|
|
265
|
+
onClick: function onClick() {
|
|
266
|
+
(0, _utils.downloadMedia)(mediaPluginState, options.isViewOnly);
|
|
267
|
+
return true;
|
|
268
|
+
},
|
|
269
|
+
title: intl.formatMessage(_mediaUi.messages.download),
|
|
270
|
+
supportsViewMode: true
|
|
271
|
+
}, {
|
|
272
|
+
type: 'separator',
|
|
273
|
+
supportsViewMode: true
|
|
255
274
|
});
|
|
256
275
|
}
|
|
257
276
|
if (options.allowAltTextOnImages) {
|
|
@@ -266,10 +285,13 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
266
285
|
state: state,
|
|
267
286
|
formatMessage: intl.formatMessage,
|
|
268
287
|
nodeType: mediaInline
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
288
|
+
}],
|
|
289
|
+
supportsViewMode: true
|
|
290
|
+
});
|
|
291
|
+
inlineImageItems.push({
|
|
292
|
+
type: 'separator'
|
|
293
|
+
});
|
|
294
|
+
inlineImageItems.push({
|
|
273
295
|
id: 'editor.media.delete',
|
|
274
296
|
type: 'button',
|
|
275
297
|
appearance: 'danger',
|
|
@@ -120,13 +120,7 @@ export const MediaInline = props => {
|
|
|
120
120
|
} = props.mediaPluginState;
|
|
121
121
|
const borderMark = (_props$node = props.node) === null || _props$node === void 0 ? void 0 : (_props$node$marks = _props$node.marks) === null || _props$node$marks === void 0 ? void 0 : _props$node$marks.find(mark => mark.type.name === 'border');
|
|
122
122
|
if (allowInlineImages && isImage(type)) {
|
|
123
|
-
return jsx(
|
|
124
|
-
mediaNode: props.node,
|
|
125
|
-
mediaPluginState: props.mediaPluginState,
|
|
126
|
-
isEditorViewMode: props.editorViewMode,
|
|
127
|
-
isSelected: props.isSelected,
|
|
128
|
-
isInline: true
|
|
129
|
-
}, jsx(MediaInlineImageCard, {
|
|
123
|
+
return jsx(MediaInlineImageCard, {
|
|
130
124
|
mediaClient: getMediaClient(viewMediaClientConfig),
|
|
131
125
|
identifier: identifier,
|
|
132
126
|
isSelected: props.isSelected,
|
|
@@ -137,7 +131,7 @@ export const MediaInline = props => {
|
|
|
137
131
|
borderSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
138
132
|
borderColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color
|
|
139
133
|
}
|
|
140
|
-
})
|
|
134
|
+
});
|
|
141
135
|
}
|
|
142
136
|
return jsx(MediaViewerContainer, {
|
|
143
137
|
mediaNode: props.node,
|
|
@@ -235,17 +235,36 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
235
235
|
onAddLink: editLink,
|
|
236
236
|
onEditLink: editLink,
|
|
237
237
|
onOpenLink: openLink,
|
|
238
|
-
isInlineNode: true
|
|
238
|
+
isInlineNode: true,
|
|
239
|
+
isViewOnly: options.isViewOnly
|
|
239
240
|
});
|
|
240
241
|
}
|
|
241
242
|
return null;
|
|
242
|
-
}
|
|
243
|
+
},
|
|
244
|
+
supportsViewMode: true
|
|
243
245
|
});
|
|
244
246
|
|
|
245
247
|
//Image Preview
|
|
246
|
-
if (
|
|
248
|
+
if (options.allowImagePreview) {
|
|
247
249
|
inlineImageItems.push(generateFilePreviewItem(mediaPluginState, intl), {
|
|
248
|
-
type: 'separator'
|
|
250
|
+
type: 'separator',
|
|
251
|
+
supportsViewMode: true
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (options.isViewOnly) {
|
|
255
|
+
inlineImageItems.push({
|
|
256
|
+
id: 'editor.media.image.download',
|
|
257
|
+
type: 'button',
|
|
258
|
+
icon: DownloadIcon,
|
|
259
|
+
onClick: () => {
|
|
260
|
+
downloadMedia(mediaPluginState, options.isViewOnly);
|
|
261
|
+
return true;
|
|
262
|
+
},
|
|
263
|
+
title: intl.formatMessage(messages.download),
|
|
264
|
+
supportsViewMode: true
|
|
265
|
+
}, {
|
|
266
|
+
type: 'separator',
|
|
267
|
+
supportsViewMode: true
|
|
249
268
|
});
|
|
250
269
|
}
|
|
251
270
|
if (options.allowAltTextOnImages) {
|
|
@@ -260,10 +279,13 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
260
279
|
state,
|
|
261
280
|
formatMessage: intl.formatMessage,
|
|
262
281
|
nodeType: mediaInline
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
282
|
+
}],
|
|
283
|
+
supportsViewMode: true
|
|
284
|
+
});
|
|
285
|
+
inlineImageItems.push({
|
|
286
|
+
type: 'separator'
|
|
287
|
+
});
|
|
288
|
+
inlineImageItems.push({
|
|
267
289
|
id: 'editor.media.delete',
|
|
268
290
|
type: 'button',
|
|
269
291
|
appearance: 'danger',
|
|
@@ -183,13 +183,7 @@ export var MediaInline = function MediaInline(props) {
|
|
|
183
183
|
return mark.type.name === 'border';
|
|
184
184
|
});
|
|
185
185
|
if (allowInlineImages && isImage(type)) {
|
|
186
|
-
return jsx(
|
|
187
|
-
mediaNode: props.node,
|
|
188
|
-
mediaPluginState: props.mediaPluginState,
|
|
189
|
-
isEditorViewMode: props.editorViewMode,
|
|
190
|
-
isSelected: props.isSelected,
|
|
191
|
-
isInline: true
|
|
192
|
-
}, jsx(MediaInlineImageCard, {
|
|
186
|
+
return jsx(MediaInlineImageCard, {
|
|
193
187
|
mediaClient: getMediaClient(viewMediaClientConfig),
|
|
194
188
|
identifier: identifier,
|
|
195
189
|
isSelected: props.isSelected,
|
|
@@ -200,7 +194,7 @@ export var MediaInline = function MediaInline(props) {
|
|
|
200
194
|
borderSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
201
195
|
borderColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color
|
|
202
196
|
}
|
|
203
|
-
})
|
|
197
|
+
});
|
|
204
198
|
}
|
|
205
199
|
return jsx(MediaViewerContainer, {
|
|
206
200
|
mediaNode: props.node,
|
|
@@ -231,17 +231,36 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
231
231
|
onAddLink: editLink,
|
|
232
232
|
onEditLink: editLink,
|
|
233
233
|
onOpenLink: openLink,
|
|
234
|
-
isInlineNode: true
|
|
234
|
+
isInlineNode: true,
|
|
235
|
+
isViewOnly: options.isViewOnly
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
return null;
|
|
238
|
-
}
|
|
239
|
+
},
|
|
240
|
+
supportsViewMode: true
|
|
239
241
|
});
|
|
240
242
|
|
|
241
243
|
//Image Preview
|
|
242
|
-
if (
|
|
244
|
+
if (options.allowImagePreview) {
|
|
243
245
|
inlineImageItems.push(generateFilePreviewItem(mediaPluginState, intl), {
|
|
244
|
-
type: 'separator'
|
|
246
|
+
type: 'separator',
|
|
247
|
+
supportsViewMode: true
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (options.isViewOnly) {
|
|
251
|
+
inlineImageItems.push({
|
|
252
|
+
id: 'editor.media.image.download',
|
|
253
|
+
type: 'button',
|
|
254
|
+
icon: DownloadIcon,
|
|
255
|
+
onClick: function onClick() {
|
|
256
|
+
downloadMedia(mediaPluginState, options.isViewOnly);
|
|
257
|
+
return true;
|
|
258
|
+
},
|
|
259
|
+
title: intl.formatMessage(messages.download),
|
|
260
|
+
supportsViewMode: true
|
|
261
|
+
}, {
|
|
262
|
+
type: 'separator',
|
|
263
|
+
supportsViewMode: true
|
|
245
264
|
});
|
|
246
265
|
}
|
|
247
266
|
if (options.allowAltTextOnImages) {
|
|
@@ -256,10 +275,13 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
256
275
|
state: state,
|
|
257
276
|
formatMessage: intl.formatMessage,
|
|
258
277
|
nodeType: mediaInline
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
278
|
+
}],
|
|
279
|
+
supportsViewMode: true
|
|
280
|
+
});
|
|
281
|
+
inlineImageItems.push({
|
|
282
|
+
type: 'separator'
|
|
283
|
+
});
|
|
284
|
+
inlineImageItems.push({
|
|
263
285
|
id: 'editor.media.delete',
|
|
264
286
|
type: 'button',
|
|
265
287
|
appearance: 'danger',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@atlaskit/media-common": "^11.2.0",
|
|
62
62
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
63
63
|
"@atlaskit/media-picker": "^66.4.0",
|
|
64
|
-
"@atlaskit/media-ui": "^25.
|
|
64
|
+
"@atlaskit/media-ui": "^25.10.0",
|
|
65
65
|
"@atlaskit/media-viewer": "^48.5.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
67
|
-
"@atlaskit/primitives": "^
|
|
67
|
+
"@atlaskit/primitives": "^6.0.0",
|
|
68
68
|
"@atlaskit/textfield": "^6.3.0",
|
|
69
69
|
"@atlaskit/theme": "^12.7.0",
|
|
70
70
|
"@atlaskit/tokens": "^1.45.0",
|