@atlaskit/editor-plugin-media 0.11.5 → 0.11.7
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/index.js +1 -1
- package/dist/cjs/utils/media-files.js +3 -1
- package/dist/es2019/toolbar/commands.js +1 -1
- package/dist/es2019/toolbar/index.js +1 -1
- package/dist/es2019/utils/media-files.js +3 -1
- package/dist/esm/toolbar/commands.js +1 -1
- package/dist/esm/toolbar/index.js +1 -1
- package/dist/esm/utils/media-files.js +3 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 0.11.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#68380](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68380) [`180e570d3332`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/180e570d3332) - Consolidate media grouped layout ff to inline image base ff
|
|
8
|
+
|
|
9
|
+
## 0.11.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
- [#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
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 0.11.5
|
|
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) {
|
|
@@ -219,7 +219,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
var layoutButtons = (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled);
|
|
222
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.
|
|
222
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.inline-image.base-support') && selectedNode) {
|
|
223
223
|
var selectedLayoutIcon = (0, _utils2.getSelectedLayoutIcon)([].concat((0, _toConsumableArray2.default)(_card.alignmentIcons), (0, _toConsumableArray2.default)(_card.wrappingIcons)), selectedNode.node);
|
|
224
224
|
if (selectedLayoutIcon && layoutButtons.length) {
|
|
225
225
|
var _options = {
|
|
@@ -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) {
|
|
@@ -212,7 +212,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
const layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled);
|
|
215
|
-
if (getBooleanFF('platform.editor.media.
|
|
215
|
+
if (getBooleanFF('platform.editor.media.inline-image.base-support') && selectedNode) {
|
|
216
216
|
const selectedLayoutIcon = getSelectedLayoutIcon([...alignmentIcons, ...wrappingIcons], selectedNode.node);
|
|
217
217
|
if (selectedLayoutIcon && layoutButtons.length) {
|
|
218
218
|
const options = {
|
|
@@ -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) {
|
|
@@ -209,7 +209,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled);
|
|
212
|
-
if (getBooleanFF('platform.editor.media.
|
|
212
|
+
if (getBooleanFF('platform.editor.media.inline-image.base-support') && selectedNode) {
|
|
213
213
|
var selectedLayoutIcon = getSelectedLayoutIcon([].concat(_toConsumableArray(alignmentIcons), _toConsumableArray(wrappingIcons)), selectedNode.node);
|
|
214
214
|
if (selectedLayoutIcon && layoutButtons.length) {
|
|
215
215
|
var _options = {
|
|
@@ -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.7",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-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",
|
|
@@ -135,9 +135,6 @@
|
|
|
135
135
|
"platform.editor.media.inline-image.base-support": {
|
|
136
136
|
"type": "boolean"
|
|
137
137
|
},
|
|
138
|
-
"platform.editor.media.grouped-layout": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
138
|
"platform.media-experience.media-viewer-v2_hgsii": {
|
|
142
139
|
"type": "boolean",
|
|
143
140
|
"referenceOnly": "true"
|