@atlaskit/editor-plugin-media 0.11.4 → 0.11.6
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 +14 -0
- package/dist/cjs/toolbar/commands.js +1 -1
- package/dist/cjs/toolbar/mediaInline.js +10 -9
- package/dist/cjs/utils/media-files.js +3 -1
- package/dist/es2019/toolbar/commands.js +1 -1
- package/dist/es2019/toolbar/mediaInline.js +10 -9
- package/dist/es2019/utils/media-files.js +3 -1
- package/dist/esm/toolbar/commands.js +1 -1
- package/dist/esm/toolbar/mediaInline.js +10 -9
- package/dist/esm/utils/media-files.js +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 0.11.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#67912](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67912) [`d24fdd20c0de`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d24fdd20c0de) - [ux] ED-21869 auto populate alt attribute when inserting inline image
|
|
8
|
+
- [#67822](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67822) [`2010719ccc04`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2010719ccc04) - [ux] ED-21870 Fix - divider is removed from document when switching between media single to image inline
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 0.11.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#67908](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67908) [`68ecca634a3a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/68ecca634a3a) - [ux] Unify order of alt and link floating bar positions for mediaInline and mediaSingle
|
|
16
|
+
|
|
3
17
|
## 0.11.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -298,7 +298,7 @@ var changeMediaSingleToMediaInline = exports.changeMediaSingleToMediaInline = fu
|
|
|
298
298
|
var from = state.selection.from;
|
|
299
299
|
var tr = state.tr;
|
|
300
300
|
tr = (0, _utils.removeSelectedNode)(tr);
|
|
301
|
-
tr = (0, _utils.safeInsert)(node, from,
|
|
301
|
+
tr = (0, _utils.safeInsert)(node, from, false)(tr);
|
|
302
302
|
// 3 accounts for paragraph 1 + mediaInline size 1 + space 1
|
|
303
303
|
tr.setSelection(_state.TextSelection.create(tr.doc, from + 3));
|
|
304
304
|
if (dispatch) {
|
|
@@ -205,12 +205,6 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
205
205
|
}, {
|
|
206
206
|
type: 'separator'
|
|
207
207
|
});
|
|
208
|
-
if (options.allowAltTextOnImages) {
|
|
209
|
-
var _pluginInjectionApi$a4;
|
|
210
|
-
inlineImageItems.push((0, _altText.altTextButton)(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions), {
|
|
211
|
-
type: 'separator'
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
208
|
inlineImageItems.push({
|
|
215
209
|
type: 'custom',
|
|
216
210
|
fallback: [],
|
|
@@ -225,10 +219,10 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
225
219
|
};
|
|
226
220
|
var openLink = function openLink() {
|
|
227
221
|
if (editorView) {
|
|
228
|
-
var _pluginInjectionApi$
|
|
222
|
+
var _pluginInjectionApi$a4;
|
|
229
223
|
var tr = editorView.state.tr,
|
|
230
224
|
dispatch = editorView.dispatch;
|
|
231
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
225
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.attachAnalyticsEvent({
|
|
232
226
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
233
227
|
action: _analytics.ACTION.VISITED,
|
|
234
228
|
actionSubject: _analytics.ACTION_SUBJECT.MEDIA,
|
|
@@ -251,7 +245,14 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
251
245
|
}
|
|
252
246
|
return null;
|
|
253
247
|
}
|
|
254
|
-
}
|
|
248
|
+
});
|
|
249
|
+
if (options.allowAltTextOnImages) {
|
|
250
|
+
var _pluginInjectionApi$a5;
|
|
251
|
+
inlineImageItems.push((0, _altText.altTextButton)(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
252
|
+
type: 'separator'
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
inlineImageItems.push({
|
|
255
256
|
type: 'copy-button',
|
|
256
257
|
items: [{
|
|
257
258
|
state: state,
|
|
@@ -95,7 +95,8 @@ var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMedia
|
|
|
95
95
|
var id = mediaState.id,
|
|
96
96
|
dimensions = mediaState.dimensions,
|
|
97
97
|
_mediaState$scaleFact = mediaState.scaleFactor,
|
|
98
|
-
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact
|
|
98
|
+
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact,
|
|
99
|
+
fileName = mediaState.fileName;
|
|
99
100
|
var mediaInlineAttrs = {
|
|
100
101
|
id: id,
|
|
101
102
|
collection: collection
|
|
@@ -112,6 +113,7 @@ var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMedia
|
|
|
112
113
|
mediaInlineAttrs.width = scaledWidth;
|
|
113
114
|
mediaInlineAttrs.height = scaledHeight;
|
|
114
115
|
mediaInlineAttrs.type = 'image';
|
|
116
|
+
mediaInlineAttrs.alt = fileName;
|
|
115
117
|
}
|
|
116
118
|
var mediaInlineNode = mediaInline.create(mediaInlineAttrs);
|
|
117
119
|
var space = state.schema.text(' ');
|
|
@@ -278,7 +278,7 @@ export const changeMediaSingleToMediaInline = editorAnalyticsAPI => (state, disp
|
|
|
278
278
|
} = state.selection;
|
|
279
279
|
let tr = state.tr;
|
|
280
280
|
tr = removeSelectedNode(tr);
|
|
281
|
-
tr = safeInsert(node, from,
|
|
281
|
+
tr = safeInsert(node, from, false)(tr);
|
|
282
282
|
// 3 accounts for paragraph 1 + mediaInline size 1 + space 1
|
|
283
283
|
tr.setSelection(TextSelection.create(tr.doc, from + 3));
|
|
284
284
|
if (dispatch) {
|
|
@@ -193,12 +193,6 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
193
193
|
}, {
|
|
194
194
|
type: 'separator'
|
|
195
195
|
});
|
|
196
|
-
if (options.allowAltTextOnImages) {
|
|
197
|
-
var _pluginInjectionApi$a4;
|
|
198
|
-
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions), {
|
|
199
|
-
type: 'separator'
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
196
|
inlineImageItems.push({
|
|
203
197
|
type: 'custom',
|
|
204
198
|
fallback: [],
|
|
@@ -215,14 +209,14 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
215
209
|
};
|
|
216
210
|
const openLink = () => {
|
|
217
211
|
if (editorView) {
|
|
218
|
-
var _pluginInjectionApi$
|
|
212
|
+
var _pluginInjectionApi$a4;
|
|
219
213
|
const {
|
|
220
214
|
state: {
|
|
221
215
|
tr
|
|
222
216
|
},
|
|
223
217
|
dispatch
|
|
224
218
|
} = editorView;
|
|
225
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
219
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions.attachAnalyticsEvent({
|
|
226
220
|
eventType: EVENT_TYPE.TRACK,
|
|
227
221
|
action: ACTION.VISITED,
|
|
228
222
|
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
@@ -245,7 +239,14 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
245
239
|
}
|
|
246
240
|
return null;
|
|
247
241
|
}
|
|
248
|
-
}
|
|
242
|
+
});
|
|
243
|
+
if (options.allowAltTextOnImages) {
|
|
244
|
+
var _pluginInjectionApi$a5;
|
|
245
|
+
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
246
|
+
type: 'separator'
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
inlineImageItems.push({
|
|
249
250
|
type: 'copy-button',
|
|
250
251
|
items: [{
|
|
251
252
|
state,
|
|
@@ -102,7 +102,8 @@ export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, co
|
|
|
102
102
|
const {
|
|
103
103
|
id,
|
|
104
104
|
dimensions,
|
|
105
|
-
scaleFactor = 1
|
|
105
|
+
scaleFactor = 1,
|
|
106
|
+
fileName
|
|
106
107
|
} = mediaState;
|
|
107
108
|
let mediaInlineAttrs = {
|
|
108
109
|
id,
|
|
@@ -121,6 +122,7 @@ export const insertMediaInlineNode = editorAnalyticsAPI => (view, mediaState, co
|
|
|
121
122
|
mediaInlineAttrs.width = scaledWidth;
|
|
122
123
|
mediaInlineAttrs.height = scaledHeight;
|
|
123
124
|
mediaInlineAttrs.type = 'image';
|
|
125
|
+
mediaInlineAttrs.alt = fileName;
|
|
124
126
|
}
|
|
125
127
|
const mediaInlineNode = mediaInline.create(mediaInlineAttrs);
|
|
126
128
|
const space = state.schema.text(' ');
|
|
@@ -291,7 +291,7 @@ export var changeMediaSingleToMediaInline = function changeMediaSingleToMediaInl
|
|
|
291
291
|
var from = state.selection.from;
|
|
292
292
|
var tr = state.tr;
|
|
293
293
|
tr = removeSelectedNode(tr);
|
|
294
|
-
tr = safeInsert(node, from,
|
|
294
|
+
tr = safeInsert(node, from, false)(tr);
|
|
295
295
|
// 3 accounts for paragraph 1 + mediaInline size 1 + space 1
|
|
296
296
|
tr.setSelection(TextSelection.create(tr.doc, from + 3));
|
|
297
297
|
if (dispatch) {
|
|
@@ -195,12 +195,6 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
195
195
|
}, {
|
|
196
196
|
type: 'separator'
|
|
197
197
|
});
|
|
198
|
-
if (options.allowAltTextOnImages) {
|
|
199
|
-
var _pluginInjectionApi$a4;
|
|
200
|
-
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions), {
|
|
201
|
-
type: 'separator'
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
198
|
inlineImageItems.push({
|
|
205
199
|
type: 'custom',
|
|
206
200
|
fallback: [],
|
|
@@ -215,10 +209,10 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
215
209
|
};
|
|
216
210
|
var openLink = function openLink() {
|
|
217
211
|
if (editorView) {
|
|
218
|
-
var _pluginInjectionApi$
|
|
212
|
+
var _pluginInjectionApi$a4;
|
|
219
213
|
var tr = editorView.state.tr,
|
|
220
214
|
dispatch = editorView.dispatch;
|
|
221
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
215
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.attachAnalyticsEvent({
|
|
222
216
|
eventType: EVENT_TYPE.TRACK,
|
|
223
217
|
action: ACTION.VISITED,
|
|
224
218
|
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
@@ -241,7 +235,14 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
241
235
|
}
|
|
242
236
|
return null;
|
|
243
237
|
}
|
|
244
|
-
}
|
|
238
|
+
});
|
|
239
|
+
if (options.allowAltTextOnImages) {
|
|
240
|
+
var _pluginInjectionApi$a5;
|
|
241
|
+
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
242
|
+
type: 'separator'
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
inlineImageItems.push({
|
|
245
246
|
type: 'copy-button',
|
|
246
247
|
items: [{
|
|
247
248
|
state: state,
|
|
@@ -89,7 +89,8 @@ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalytic
|
|
|
89
89
|
var id = mediaState.id,
|
|
90
90
|
dimensions = mediaState.dimensions,
|
|
91
91
|
_mediaState$scaleFact = mediaState.scaleFactor,
|
|
92
|
-
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact
|
|
92
|
+
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact,
|
|
93
|
+
fileName = mediaState.fileName;
|
|
93
94
|
var mediaInlineAttrs = {
|
|
94
95
|
id: id,
|
|
95
96
|
collection: collection
|
|
@@ -106,6 +107,7 @@ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalytic
|
|
|
106
107
|
mediaInlineAttrs.width = scaledWidth;
|
|
107
108
|
mediaInlineAttrs.height = scaledHeight;
|
|
108
109
|
mediaInlineAttrs.type = 'image';
|
|
110
|
+
mediaInlineAttrs.alt = fileName;
|
|
109
111
|
}
|
|
110
112
|
var mediaInlineNode = mediaInline.create(mediaInlineAttrs);
|
|
111
113
|
var space = state.schema.text(' ');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
39
39
|
"@atlaskit/button": "^17.2.0",
|
|
40
|
-
"@atlaskit/editor-common": "^76.
|
|
40
|
+
"@atlaskit/editor-common": "^76.41.0",
|
|
41
41
|
"@atlaskit/editor-palette": "1.5.2",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
43
43
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/editor-plugin-width": "^0.2.0",
|
|
52
52
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
53
53
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
54
|
-
"@atlaskit/editor-tables": "^2.
|
|
54
|
+
"@atlaskit/editor-tables": "^2.4.0",
|
|
55
55
|
"@atlaskit/form": "^9.0.3",
|
|
56
56
|
"@atlaskit/icon": "^22.0.0",
|
|
57
57
|
"@atlaskit/media-card": "^77.7.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
66
66
|
"@atlaskit/textfield": "^6.0.0",
|
|
67
67
|
"@atlaskit/theme": "^12.6.0",
|
|
68
|
-
"@atlaskit/tokens": "^1.
|
|
68
|
+
"@atlaskit/tokens": "^1.34.0",
|
|
69
69
|
"@atlaskit/tooltip": "^18.1.0",
|
|
70
70
|
"@babel/runtime": "^7.0.0",
|
|
71
71
|
"@emotion/react": "^11.7.1",
|