@atlaskit/editor-plugin-media 1.0.0 → 1.2.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 +41 -0
- package/dist/cjs/plugin.js +1 -3
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/cjs/toolbar/index.js +5 -4
- package/dist/cjs/utils/media-single.js +3 -5
- package/dist/es2019/plugin.js +1 -3
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/es2019/toolbar/index.js +5 -4
- package/dist/es2019/utils/media-single.js +3 -5
- package/dist/esm/plugin.js +1 -3
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/esm/toolbar/index.js +5 -4
- package/dist/esm/utils/media-single.js +3 -5
- package/dist/types/next-plugin-type.d.ts +0 -2
- package/dist/types/pm-plugins/main.d.ts +0 -1
- package/dist/types/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/next-plugin-type.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -1
- package/dist/types-ts4.5/utils/media-single.d.ts +1 -1
- package/package.json +9 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#72122](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72122) [`c3186450404a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c3186450404a) - Breaking change:
|
|
8
|
+
|
|
9
|
+
## WHAT?:
|
|
10
|
+
|
|
11
|
+
Removing feature flags:
|
|
12
|
+
|
|
13
|
+
- singleLayout
|
|
14
|
+
- newInsertionBehaviour
|
|
15
|
+
- interactiveExpand
|
|
16
|
+
- findReplace
|
|
17
|
+
- findReplaceMatchCase
|
|
18
|
+
- extendFloatingToolbar
|
|
19
|
+
|
|
20
|
+
## WHY?:
|
|
21
|
+
|
|
22
|
+
Because the flags and props are unused/by default active. Removing them will reduce our maintenance burden
|
|
23
|
+
|
|
24
|
+
## HOW to update your code:
|
|
25
|
+
|
|
26
|
+
- If you were using the feature flag - the behaviour is now default and you can remove the flags
|
|
27
|
+
- If you were not using the feature flag - the behaviour is now default.
|
|
28
|
+
- If you have opted out of using the feature flag - we have been careful to ensure no-one has opted out of the behaviours. If you do have an issue please reach out to #help-editor.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
34
|
+
## 1.1.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- [#72258](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72258) [`31cecb8f314b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/31cecb8f314b) - ECA11Y-78: removed feature flag
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies
|
|
43
|
+
|
|
3
44
|
## 1.0.0
|
|
4
45
|
|
|
5
46
|
### Major Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -53,11 +53,9 @@ var MediaPickerFunctionalComponent = function MediaPickerFunctionalComponent(_re
|
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
55
|
var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref2) {
|
|
56
|
-
var _api$featureFlags;
|
|
57
56
|
var _ref2$config = _ref2.config,
|
|
58
57
|
options = _ref2$config === void 0 ? {} : _ref2$config,
|
|
59
58
|
api = _ref2.api;
|
|
60
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
61
59
|
return {
|
|
62
60
|
name: 'media',
|
|
63
61
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -141,7 +139,7 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
141
139
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
142
140
|
customMediaPicker: options && options.customMediaPicker,
|
|
143
141
|
allowResizing: !!(options && options.allowResizing)
|
|
144
|
-
}, reactContext, getIntl, api, dispatch, options
|
|
142
|
+
}, reactContext, getIntl, api, dispatch, options);
|
|
145
143
|
}
|
|
146
144
|
}, {
|
|
147
145
|
name: 'mediaKeymap',
|
|
@@ -228,7 +228,7 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
|
|
|
228
228
|
case 'block':
|
|
229
229
|
// read width state right before inserting to get up-to-date and define values
|
|
230
230
|
var widthPluginState = (_this$pluginInjection2 = _this.pluginInjectionApi) === null || _this$pluginInjection2 === void 0 || (_this$pluginInjection2 = _this$pluginInjection2.width) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.sharedState.currentState();
|
|
231
|
-
(0, _mediaSingle2.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert,
|
|
231
|
+
(0, _mediaSingle2.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, widthPluginState, editorAnalyticsAPI);
|
|
232
232
|
break;
|
|
233
233
|
case 'group':
|
|
234
234
|
(0, _mediaFiles.insertMediaGroupNode)(editorAnalyticsAPI)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
@@ -467,7 +467,6 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
|
|
|
467
467
|
});
|
|
468
468
|
this.options = options;
|
|
469
469
|
this.mediaOptions = mediaOptions;
|
|
470
|
-
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
471
470
|
this.dispatch = _dispatch;
|
|
472
471
|
this.pluginInjectionApi = pluginInjectionApi;
|
|
473
472
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
@@ -557,10 +557,11 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
557
557
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags);
|
|
558
558
|
}
|
|
559
559
|
var assistiveMessage = '';
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
560
|
+
var selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
|
|
561
|
+
if (selectedMediaSingleNode) {
|
|
562
|
+
var selectedMediaNodeView = selectedMediaSingleNode === null || selectedMediaSingleNode === void 0 ? void 0 : selectedMediaSingleNode.node.content;
|
|
563
|
+
if (selectedMediaNodeView) {
|
|
564
|
+
var selectedMediaNode = selectedMediaNodeView.firstChild;
|
|
564
565
|
var selectedNodeTypeSingle = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.__fileMimeType;
|
|
565
566
|
var selectedMediaAlt = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.alt;
|
|
566
567
|
assistiveMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(getMediaTypeMessage(selectedNodeTypeSingle), {
|
|
@@ -113,7 +113,7 @@ var getFileExtension = function getFileExtension(fileName) {
|
|
|
113
113
|
}
|
|
114
114
|
return undefined;
|
|
115
115
|
};
|
|
116
|
-
var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert,
|
|
116
|
+
var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI) {
|
|
117
117
|
var _state$selection$$fro;
|
|
118
118
|
if (collection === undefined) {
|
|
119
119
|
return false;
|
|
@@ -145,9 +145,7 @@ var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMedia
|
|
|
145
145
|
}, editorAnalyticsAPI)(state, dispatch);
|
|
146
146
|
} else {
|
|
147
147
|
var tr = null;
|
|
148
|
-
|
|
149
|
-
tr = (0, _insert.safeInsert)(node, state.selection.from)(state.tr);
|
|
150
|
-
}
|
|
148
|
+
tr = (0, _insert.safeInsert)(node, state.selection.from)(state.tr);
|
|
151
149
|
if (!tr) {
|
|
152
150
|
var content = shouldAddParagraph(view.state) ? _model.Fragment.fromArray([node, state.schema.nodes.paragraph.create()]) : node;
|
|
153
151
|
tr = (0, _utils2.safeInsert)(content, undefined, true)(state.tr);
|
|
@@ -226,7 +224,7 @@ var createMediaSingleNode = exports.createMediaSingleNode = function createMedia
|
|
|
226
224
|
contextId: contextId,
|
|
227
225
|
width: scaledWidth,
|
|
228
226
|
height: height && Math.round(height / scaleFactor)
|
|
229
|
-
},
|
|
227
|
+
}, fileName && {
|
|
230
228
|
alt: fileName
|
|
231
229
|
}));
|
|
232
230
|
var mediaSingleAttrs = alignLeftOnInsert ? {
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -47,8 +47,6 @@ export const mediaPlugin = ({
|
|
|
47
47
|
config: options = {},
|
|
48
48
|
api
|
|
49
49
|
}) => {
|
|
50
|
-
var _api$featureFlags;
|
|
51
|
-
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
52
50
|
return {
|
|
53
51
|
name: 'media',
|
|
54
52
|
getSharedState(editorState) {
|
|
@@ -132,7 +130,7 @@ export const mediaPlugin = ({
|
|
|
132
130
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
133
131
|
customMediaPicker: options && options.customMediaPicker,
|
|
134
132
|
allowResizing: !!(options && options.allowResizing)
|
|
135
|
-
}, reactContext, getIntl, api, dispatch, options
|
|
133
|
+
}, reactContext, getIntl, api, dispatch, options);
|
|
136
134
|
}
|
|
137
135
|
}, {
|
|
138
136
|
name: 'mediaKeymap',
|
|
@@ -176,7 +176,7 @@ export class MediaPluginStateImplementation {
|
|
|
176
176
|
case 'block':
|
|
177
177
|
// read width state right before inserting to get up-to-date and define values
|
|
178
178
|
const widthPluginState = (_this$pluginInjection3 = this.pluginInjectionApi) === null || _this$pluginInjection3 === void 0 ? void 0 : (_this$pluginInjection4 = _this$pluginInjection3.width) === null || _this$pluginInjection4 === void 0 ? void 0 : _this$pluginInjection4.sharedState.currentState();
|
|
179
|
-
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert,
|
|
179
|
+
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert, widthPluginState, editorAnalyticsAPI);
|
|
180
180
|
break;
|
|
181
181
|
case 'group':
|
|
182
182
|
insertMediaGroupNode(editorAnalyticsAPI)(this.view, [mediaStateWithContext], collection, this.getInputMethod(pickerType));
|
|
@@ -414,7 +414,6 @@ export class MediaPluginStateImplementation {
|
|
|
414
414
|
});
|
|
415
415
|
this.options = options;
|
|
416
416
|
this.mediaOptions = mediaOptions;
|
|
417
|
-
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
418
417
|
this.dispatch = _dispatch;
|
|
419
418
|
this.pluginInjectionApi = pluginInjectionApi;
|
|
420
419
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
@@ -558,10 +558,11 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
558
558
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags);
|
|
559
559
|
}
|
|
560
560
|
var assistiveMessage = '';
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
561
|
+
const selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
562
|
+
if (selectedMediaSingleNode) {
|
|
563
|
+
const selectedMediaNodeView = selectedMediaSingleNode === null || selectedMediaSingleNode === void 0 ? void 0 : selectedMediaSingleNode.node.content;
|
|
564
|
+
if (selectedMediaNodeView) {
|
|
565
|
+
const selectedMediaNode = selectedMediaNodeView.firstChild;
|
|
565
566
|
const selectedNodeTypeSingle = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.__fileMimeType;
|
|
566
567
|
const selectedMediaAlt = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.alt;
|
|
567
568
|
assistiveMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(getMediaTypeMessage(selectedNodeTypeSingle), {
|
|
@@ -102,7 +102,7 @@ const getFileExtension = fileName => {
|
|
|
102
102
|
}
|
|
103
103
|
return undefined;
|
|
104
104
|
};
|
|
105
|
-
export const insertMediaSingleNode = (view, mediaState, inputMethod, collection, alignLeftOnInsert,
|
|
105
|
+
export const insertMediaSingleNode = (view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI) => {
|
|
106
106
|
var _state$selection$$fro;
|
|
107
107
|
if (collection === undefined) {
|
|
108
108
|
return false;
|
|
@@ -136,9 +136,7 @@ export const insertMediaSingleNode = (view, mediaState, inputMethod, collection,
|
|
|
136
136
|
}, editorAnalyticsAPI)(state, dispatch);
|
|
137
137
|
} else {
|
|
138
138
|
let tr = null;
|
|
139
|
-
|
|
140
|
-
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
141
|
-
}
|
|
139
|
+
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
142
140
|
if (!tr) {
|
|
143
141
|
const content = shouldAddParagraph(view.state) ? Fragment.fromArray([node, state.schema.nodes.paragraph.create()]) : node;
|
|
144
142
|
tr = pmSafeInsert(content, undefined, true)(state.tr);
|
|
@@ -223,7 +221,7 @@ export const createMediaSingleNode = (schema, collection, maxWidth, minWidth, al
|
|
|
223
221
|
contextId,
|
|
224
222
|
width: scaledWidth,
|
|
225
223
|
height: height && Math.round(height / scaleFactor),
|
|
226
|
-
...(
|
|
224
|
+
...(fileName && {
|
|
227
225
|
alt: fileName
|
|
228
226
|
})
|
|
229
227
|
});
|
package/dist/esm/plugin.js
CHANGED
|
@@ -42,11 +42,9 @@ var MediaPickerFunctionalComponent = function MediaPickerFunctionalComponent(_re
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
45
|
-
var _api$featureFlags;
|
|
46
45
|
var _ref2$config = _ref2.config,
|
|
47
46
|
options = _ref2$config === void 0 ? {} : _ref2$config,
|
|
48
47
|
api = _ref2.api;
|
|
49
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
50
48
|
return {
|
|
51
49
|
name: 'media',
|
|
52
50
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -130,7 +128,7 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
130
128
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
131
129
|
customMediaPicker: options && options.customMediaPicker,
|
|
132
130
|
allowResizing: !!(options && options.allowResizing)
|
|
133
|
-
}, reactContext, getIntl, api, dispatch, options
|
|
131
|
+
}, reactContext, getIntl, api, dispatch, options);
|
|
134
132
|
}
|
|
135
133
|
}, {
|
|
136
134
|
name: 'mediaKeymap',
|
|
@@ -213,7 +213,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
213
213
|
case 'block':
|
|
214
214
|
// read width state right before inserting to get up-to-date and define values
|
|
215
215
|
var widthPluginState = (_this$pluginInjection2 = _this.pluginInjectionApi) === null || _this$pluginInjection2 === void 0 || (_this$pluginInjection2 = _this$pluginInjection2.width) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.sharedState.currentState();
|
|
216
|
-
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert,
|
|
216
|
+
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, widthPluginState, editorAnalyticsAPI);
|
|
217
217
|
break;
|
|
218
218
|
case 'group':
|
|
219
219
|
insertMediaGroupNode(editorAnalyticsAPI)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
@@ -452,7 +452,6 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
452
452
|
});
|
|
453
453
|
this.options = options;
|
|
454
454
|
this.mediaOptions = mediaOptions;
|
|
455
|
-
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
456
455
|
this.dispatch = _dispatch;
|
|
457
456
|
this.pluginInjectionApi = pluginInjectionApi;
|
|
458
457
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
@@ -547,10 +547,11 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
547
547
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags);
|
|
548
548
|
}
|
|
549
549
|
var assistiveMessage = '';
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
550
|
+
var selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
551
|
+
if (selectedMediaSingleNode) {
|
|
552
|
+
var selectedMediaNodeView = selectedMediaSingleNode === null || selectedMediaSingleNode === void 0 ? void 0 : selectedMediaSingleNode.node.content;
|
|
553
|
+
if (selectedMediaNodeView) {
|
|
554
|
+
var selectedMediaNode = selectedMediaNodeView.firstChild;
|
|
554
555
|
var selectedNodeTypeSingle = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.__fileMimeType;
|
|
555
556
|
var selectedMediaAlt = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.alt;
|
|
556
557
|
assistiveMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(getMediaTypeMessage(selectedNodeTypeSingle), {
|
|
@@ -104,7 +104,7 @@ var getFileExtension = function getFileExtension(fileName) {
|
|
|
104
104
|
}
|
|
105
105
|
return undefined;
|
|
106
106
|
};
|
|
107
|
-
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert,
|
|
107
|
+
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI) {
|
|
108
108
|
var _state$selection$$fro;
|
|
109
109
|
if (collection === undefined) {
|
|
110
110
|
return false;
|
|
@@ -136,9 +136,7 @@ export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaSta
|
|
|
136
136
|
}, editorAnalyticsAPI)(state, dispatch);
|
|
137
137
|
} else {
|
|
138
138
|
var tr = null;
|
|
139
|
-
|
|
140
|
-
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
141
|
-
}
|
|
139
|
+
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
142
140
|
if (!tr) {
|
|
143
141
|
var content = shouldAddParagraph(view.state) ? Fragment.fromArray([node, state.schema.nodes.paragraph.create()]) : node;
|
|
144
142
|
tr = pmSafeInsert(content, undefined, true)(state.tr);
|
|
@@ -217,7 +215,7 @@ export var createMediaSingleNode = function createMediaSingleNode(schema, collec
|
|
|
217
215
|
contextId: contextId,
|
|
218
216
|
width: scaledWidth,
|
|
219
217
|
height: height && Math.round(height / scaleFactor)
|
|
220
|
-
},
|
|
218
|
+
}, fileName && {
|
|
221
219
|
alt: fileName
|
|
222
220
|
}));
|
|
223
221
|
var mediaSingleAttrs = alignLeftOnInsert ? {
|
|
@@ -3,7 +3,6 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
5
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
6
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
7
6
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
8
7
|
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
9
8
|
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
@@ -16,7 +15,6 @@ import type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
|
16
15
|
export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
17
16
|
pluginConfiguration: MediaOptions | undefined;
|
|
18
17
|
dependencies: [
|
|
19
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
20
18
|
OptionalPlugin<AnalyticsPlugin>,
|
|
21
19
|
OptionalPlugin<ContextIdentifierPlugin>,
|
|
22
20
|
GuidelinePlugin,
|
|
@@ -33,7 +33,6 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
33
33
|
mediaNodes: MediaNodeWithPosHandler[];
|
|
34
34
|
options: MediaPluginOptions;
|
|
35
35
|
mediaProvider?: MediaProvider;
|
|
36
|
-
newInsertionBehaviour?: boolean;
|
|
37
36
|
isResizing: boolean;
|
|
38
37
|
resizingWidth: number;
|
|
39
38
|
currentMaxWidth?: number;
|
|
@@ -14,7 +14,7 @@ export interface MediaSingleState extends MediaState {
|
|
|
14
14
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
15
15
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
|
|
16
16
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => boolean;
|
|
17
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean,
|
|
17
|
+
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
18
18
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
19
19
|
export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
|
|
20
20
|
export declare function isCaptionNode(editorView: EditorView): boolean;
|
|
@@ -3,7 +3,6 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
3
3
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
4
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
5
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
6
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
7
6
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
8
7
|
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
9
8
|
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
@@ -16,7 +15,6 @@ import type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
|
16
15
|
export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
17
16
|
pluginConfiguration: MediaOptions | undefined;
|
|
18
17
|
dependencies: [
|
|
19
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
20
18
|
OptionalPlugin<AnalyticsPlugin>,
|
|
21
19
|
OptionalPlugin<ContextIdentifierPlugin>,
|
|
22
20
|
GuidelinePlugin,
|
|
@@ -33,7 +33,6 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
33
33
|
mediaNodes: MediaNodeWithPosHandler[];
|
|
34
34
|
options: MediaPluginOptions;
|
|
35
35
|
mediaProvider?: MediaProvider;
|
|
36
|
-
newInsertionBehaviour?: boolean;
|
|
37
36
|
isResizing: boolean;
|
|
38
37
|
resizingWidth: number;
|
|
39
38
|
currentMaxWidth?: number;
|
|
@@ -14,7 +14,7 @@ export interface MediaSingleState extends MediaState {
|
|
|
14
14
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
15
15
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
|
|
16
16
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => boolean;
|
|
17
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean,
|
|
17
|
+
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
18
18
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
19
19
|
export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
|
|
20
20
|
export declare function isCaptionNode(editorView: EditorView): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,14 +36,13 @@
|
|
|
36
36
|
"@atlaskit/adf-schema": "^35.5.1",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
39
|
-
"@atlaskit/button": "^17.
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
39
|
+
"@atlaskit/button": "^17.4.0",
|
|
40
|
+
"@atlaskit/editor-common": "^78.0.0",
|
|
41
41
|
"@atlaskit/editor-palette": "1.5.2",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
44
44
|
"@atlaskit/editor-plugin-editor-disabled": "^1.0.0",
|
|
45
|
-
"@atlaskit/editor-plugin-
|
|
46
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^1.0.0",
|
|
45
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^1.1.0",
|
|
47
46
|
"@atlaskit/editor-plugin-focus": "^1.0.0",
|
|
48
47
|
"@atlaskit/editor-plugin-grid": "^1.0.0",
|
|
49
48
|
"@atlaskit/editor-plugin-guideline": "^1.0.0",
|
|
@@ -54,19 +53,19 @@
|
|
|
54
53
|
"@atlaskit/editor-tables": "^2.5.0",
|
|
55
54
|
"@atlaskit/form": "^9.0.3",
|
|
56
55
|
"@atlaskit/icon": "^22.0.0",
|
|
57
|
-
"@atlaskit/media-card": "^77.
|
|
58
|
-
"@atlaskit/media-client": "^26.
|
|
56
|
+
"@atlaskit/media-card": "^77.10.0",
|
|
57
|
+
"@atlaskit/media-client": "^26.2.0",
|
|
59
58
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
60
59
|
"@atlaskit/media-common": "^11.0.0",
|
|
61
60
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
62
|
-
"@atlaskit/media-picker": "^66.
|
|
61
|
+
"@atlaskit/media-picker": "^66.3.0",
|
|
63
62
|
"@atlaskit/media-ui": "^25.1.0",
|
|
64
63
|
"@atlaskit/media-viewer": "^48.2.0",
|
|
65
64
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
66
65
|
"@atlaskit/primitives": "^2.0.0",
|
|
67
66
|
"@atlaskit/textfield": "^6.0.0",
|
|
68
67
|
"@atlaskit/theme": "^12.6.0",
|
|
69
|
-
"@atlaskit/tokens": "^1.
|
|
68
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
70
69
|
"@atlaskit/tooltip": "^18.1.0",
|
|
71
70
|
"@babel/runtime": "^7.0.0",
|
|
72
71
|
"@emotion/react": "^11.7.1",
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
"typescript": "~4.9.5"
|
|
82
81
|
},
|
|
83
82
|
"peerDependencies": {
|
|
84
|
-
"@atlaskit/media-core": "^34.
|
|
83
|
+
"@atlaskit/media-core": "^34.2.0",
|
|
85
84
|
"react": "^16.8.0",
|
|
86
85
|
"react-dom": "^16.8.0",
|
|
87
86
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -133,9 +132,6 @@
|
|
|
133
132
|
"type": "boolean",
|
|
134
133
|
"referenceOnly": "true"
|
|
135
134
|
},
|
|
136
|
-
"platform.editor.a11y-media_er96o": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
135
|
"platform.editor.a11y-media-resizing_b5v0o": {
|
|
140
136
|
"type": "boolean"
|
|
141
137
|
},
|