@atlaskit/editor-core 187.38.2 → 187.38.3
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 +8 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/media/index.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/cjs/plugins/media/pm-plugins/main.js +11 -12
- package/dist/cjs/plugins/media/toolbar/linking.js +4 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +11 -12
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/media/index.js +2 -2
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +11 -12
- package/dist/esm/plugins/media/toolbar/linking.js +4 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/media/commands/linking.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/picker-facade.d.ts +4 -4
- package/dist/types/plugins/media/pm-plugins/alt-text/commands.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/alt-text/keymap.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +4 -4
- package/dist/types/plugins/media/toolbar/alt-text.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/commands.d.ts +4 -4
- package/dist/types/plugins/media/ui/MediaPicker/BrowserWrapper.d.ts +2 -2
- package/dist/types/plugins/media/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
- package/dist/types/plugins/media/ui/MediaPicker/PickerFacadeProvider.d.ts +3 -3
- package/dist/types/plugins/media/utils/media-files.d.ts +2 -2
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/commands/linking.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/picker-facade.d.ts +4 -4
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/commands.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +4 -4
- package/dist/types-ts4.5/plugins/media/toolbar/alt-text.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/commands.d.ts +4 -4
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/BrowserWrapper.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/PickerFacadeProvider.d.ts +3 -3
- package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +1 -1
- package/package.json +3 -2
- package/report.api.md +7 -14
- package/tmp/api-report-tmp.d.ts +7 -14
- package/dist/cjs/plugins/placeholder/index.js +0 -135
- package/dist/es2019/plugins/placeholder/index.js +0 -123
- package/dist/esm/plugins/placeholder/index.js +0 -124
- package/dist/types/plugins/placeholder/index.d.ts +0 -22
- package/dist/types-ts4.5/plugins/placeholder/index.d.ts +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.38.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1b66c23221e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b66c23221e) - Fix missing analytics parameter in media plugin.
|
|
8
|
+
- [`da2d3589ba4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/da2d3589ba4) - Extract placeholder plugin from editor-core to "@atlaskit/editor-plugin-placeholder"
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 187.38.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -24,7 +24,7 @@ var _floatingToolbar = _interopRequireDefault(require("../../../plugins/floating
|
|
|
24
24
|
var _clipboard = _interopRequireDefault(require("../../../plugins/clipboard"));
|
|
25
25
|
var _plugins = require("../../../plugins");
|
|
26
26
|
var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
|
|
27
|
-
var
|
|
27
|
+
var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
|
|
28
28
|
var _annotation = _interopRequireDefault(require("../../../plugins/annotation"));
|
|
29
29
|
var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
|
|
30
30
|
var _quickInsert = _interopRequireDefault(require("../../../plugins/quick-insert"));
|
|
@@ -76,7 +76,7 @@ function createDefaultPreset(options) {
|
|
|
76
76
|
return builder;
|
|
77
77
|
}).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_quickInsert.default, options.quickInsert]).add([_typeAhead.default, options.typeAhead || {
|
|
78
78
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
79
|
-
}]).add([
|
|
79
|
+
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_submitEditor.default, options.submitEditor]).add(_fakeTextCursor.default).add(_floatingToolbar.default).add([_selection.default, options.selection]).add([_codeBlock.default, options.codeBlock || {
|
|
80
80
|
appearance: 'full-page'
|
|
81
81
|
}]);
|
|
82
82
|
return preset;
|
|
@@ -257,12 +257,6 @@ Object.defineProperty(exports, "pastePlugin", {
|
|
|
257
257
|
return _paste.default;
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
Object.defineProperty(exports, "placeholderPlugin", {
|
|
261
|
-
enumerable: true,
|
|
262
|
-
get: function get() {
|
|
263
|
-
return _placeholder.default;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
260
|
Object.defineProperty(exports, "placeholderTextPlugin", {
|
|
267
261
|
enumerable: true,
|
|
268
262
|
get: function get() {
|
|
@@ -361,7 +355,6 @@ var _media = _interopRequireDefault(require("./media"));
|
|
|
361
355
|
var _mentions = _interopRequireDefault(require("./mentions"));
|
|
362
356
|
var _panel = _interopRequireDefault(require("./panel"));
|
|
363
357
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
364
|
-
var _placeholder = _interopRequireDefault(require("./placeholder"));
|
|
365
358
|
var _placeholderText = _interopRequireDefault(require("./placeholder-text"));
|
|
366
359
|
var _quickInsert = _interopRequireDefault(require("./quick-insert"));
|
|
367
360
|
var _saveOnEnter = _interopRequireDefault(require("./save-on-enter"));
|
|
@@ -110,7 +110,7 @@ var mediaPlugin = function mediaPlugin(_ref) {
|
|
|
110
110
|
providerFactory: providerFactory,
|
|
111
111
|
nodeViews: {
|
|
112
112
|
mediaGroup: (0, _mediaGroup.ReactMediaGroupNode)(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
113
|
-
mediaSingle: (0, _mediaSingle.ReactMediaSingleNode)(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options
|
|
113
|
+
mediaSingle: (0, _mediaSingle.ReactMediaSingleNode)(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options),
|
|
114
114
|
media: (0, _mediaNodeView.ReactMediaNode)(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
115
115
|
mediaInline: (0, _mediaInline.ReactMediaInlineNode)(portalProviderAPI, eventDispatcher, providerFactory, api)
|
|
116
116
|
},
|
|
@@ -120,7 +120,7 @@ var mediaPlugin = function mediaPlugin(_ref) {
|
|
|
120
120
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
121
121
|
customMediaPicker: options && options.customMediaPicker,
|
|
122
122
|
allowResizing: !!(options && options.allowResizing)
|
|
123
|
-
}, reactContext, getIntl, dispatch, options, featureFlags.newInsertionBehaviour
|
|
123
|
+
}, reactContext, getIntl, api, dispatch, options, featureFlags.newInsertionBehaviour);
|
|
124
124
|
}
|
|
125
125
|
}, {
|
|
126
126
|
name: 'mediaKeymap',
|
|
@@ -607,9 +607,8 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
607
607
|
}]);
|
|
608
608
|
return MediaSingleNodeView;
|
|
609
609
|
}(_reactNodeView.default);
|
|
610
|
-
var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent) {
|
|
611
|
-
var mediaOptions = arguments.length >
|
|
612
|
-
var pluginInjectionApi = arguments.length > 5 ? arguments[5] : undefined;
|
|
610
|
+
var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent) {
|
|
611
|
+
var mediaOptions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
613
612
|
return function (node, view, getPos) {
|
|
614
613
|
var hasIntlContext = true;
|
|
615
614
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -72,7 +72,7 @@ var createDropPlaceholder = function createDropPlaceholder(intl, allowDropLine)
|
|
|
72
72
|
};
|
|
73
73
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
74
74
|
var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
75
|
-
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch,
|
|
75
|
+
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
76
76
|
var _this = this;
|
|
77
77
|
(0, _classCallCheck2.default)(this, MediaPluginStateImplementation);
|
|
78
78
|
(0, _defineProperty2.default)(this, "allowsUploads", false);
|
|
@@ -225,9 +225,10 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
225
225
|
*
|
|
226
226
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
227
227
|
*/
|
|
228
|
-
(0, _defineProperty2.default)(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType
|
|
229
|
-
var _mediaState$collectio, _this$mediaOptions2;
|
|
228
|
+
(0, _defineProperty2.default)(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType) {
|
|
229
|
+
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$mediaOptions2;
|
|
230
230
|
var state = _this.view.state;
|
|
231
|
+
var editorAnalyticsAPI = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : (_this$pluginInjection2 = _this$pluginInjection.analytics) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.actions;
|
|
231
232
|
var mediaStateWithContext = _objectSpread(_objectSpread({}, mediaState), {}, {
|
|
232
233
|
contextId: _this.contextIdentifierProvider ? _this.contextIdentifierProvider.objectId : undefined
|
|
233
234
|
});
|
|
@@ -243,16 +244,14 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
243
244
|
});
|
|
244
245
|
}
|
|
245
246
|
if ((0, _mediaSingle.isMediaSingle)(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
246
|
-
var _this$
|
|
247
|
+
var _this$pluginInjection3;
|
|
247
248
|
// read width state right before inserting to get up-to-date and define values
|
|
248
|
-
var widthPluginState = (_this$
|
|
249
|
-
(0, _mediaSingle.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState,
|
|
249
|
+
var widthPluginState = (_this$pluginInjection3 = _this.pluginInjectionApi) === null || _this$pluginInjection3 === void 0 ? void 0 : _this$pluginInjection3.width.sharedState.currentState();
|
|
250
|
+
(0, _mediaSingle.insertMediaSingleNode)(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState, editorAnalyticsAPI);
|
|
250
251
|
} else if ((0, _mediaCommon2.getMediaFeatureFlag)('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !(0, _document.isInEmptyLine)(state) && (!(0, _mediaCommon.isInsidePotentialEmptyParagraph)(state) || (0, _utils3.isInListItem)(state)) && (0, _mediaFiles.canInsertMediaInline)(state)) {
|
|
251
|
-
|
|
252
|
-
(0, _mediaFiles.insertMediaInlineNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
252
|
+
(0, _mediaFiles.insertMediaInlineNode)(editorAnalyticsAPI)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
253
253
|
} else {
|
|
254
|
-
|
|
255
|
-
(0, _mediaFiles.insertMediaGroupNode)(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
254
|
+
(0, _mediaFiles.insertMediaGroupNode)(editorAnalyticsAPI)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
256
255
|
}
|
|
257
256
|
|
|
258
257
|
// do events when media state changes
|
|
@@ -489,7 +488,7 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
489
488
|
this.mediaOptions = mediaOptions;
|
|
490
489
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
491
490
|
this.dispatch = _dispatch;
|
|
492
|
-
this.pluginInjectionApi =
|
|
491
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
493
492
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
494
493
|
var nodes = _state.schema.nodes;
|
|
495
494
|
(0, _assert.default)(nodes.media && (nodes.mediaGroup || nodes.mediaSingle), 'Editor: unable to init media plugin - media or mediaGroup/mediaSingle node absent in schema');
|
|
@@ -642,7 +641,7 @@ var getMediaPluginState = function getMediaPluginState(state) {
|
|
|
642
641
|
return _pluginKey.stateKey.getState(state);
|
|
643
642
|
};
|
|
644
643
|
exports.getMediaPluginState = getMediaPluginState;
|
|
645
|
-
var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, dispatch, mediaOptions, newInsertionBehaviour
|
|
644
|
+
var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, pluginInjectionApi, dispatch, mediaOptions, newInsertionBehaviour) {
|
|
646
645
|
var intl = getIntl();
|
|
647
646
|
var dropPlaceholder = createDropPlaceholder(intl, mediaOptions && mediaOptions.allowDropzoneDropLine);
|
|
648
647
|
return new _safePlugin.SafePlugin({
|
|
@@ -63,7 +63,8 @@ var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinki
|
|
|
63
63
|
},
|
|
64
64
|
onBack: function onBack(href, meta) {
|
|
65
65
|
if (href.trim() && meta.inputMethod) {
|
|
66
|
-
|
|
66
|
+
var _pluginInjectionApi$a2;
|
|
67
|
+
(0, _linking.setUrlToMedia)(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(view.state, view.dispatch, view);
|
|
67
68
|
}
|
|
68
69
|
(0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
|
|
69
70
|
},
|
|
@@ -79,7 +80,8 @@ var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinki
|
|
|
79
80
|
dispatch(tr);
|
|
80
81
|
},
|
|
81
82
|
onSubmit: function onSubmit(href, meta) {
|
|
82
|
-
|
|
83
|
+
var _pluginInjectionApi$a3;
|
|
84
|
+
(0, _linking.setUrlToMedia)(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(view.state, view.dispatch, view);
|
|
83
85
|
(0, _linking.hideLinkingToolbar)(view.state, view.dispatch, view);
|
|
84
86
|
},
|
|
85
87
|
onBlur: function onBlur() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.38.
|
|
9
|
+
var version = "187.38.3";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -18,7 +18,7 @@ import floatingToolbarPlugin from '../../../plugins/floating-toolbar';
|
|
|
18
18
|
import clipboardPlugin from '../../../plugins/clipboard';
|
|
19
19
|
import { analyticsPlugin as deprecatedAnalyticsPlugin } from '../../../plugins';
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
|
-
import placeholderPlugin from '
|
|
21
|
+
import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
22
22
|
import annotationPlugin from '../../../plugins/annotation';
|
|
23
23
|
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
24
24
|
import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
@@ -18,7 +18,6 @@ export { default as mediaPlugin } from './media';
|
|
|
18
18
|
export { default as mentionsPlugin } from './mentions';
|
|
19
19
|
export { default as panelPlugin } from './panel';
|
|
20
20
|
export { default as pastePlugin } from './paste';
|
|
21
|
-
export { default as placeholderPlugin } from './placeholder';
|
|
22
21
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
23
22
|
export { default as quickInsertPlugin } from './quick-insert';
|
|
24
23
|
export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
@@ -97,7 +97,7 @@ const mediaPlugin = ({
|
|
|
97
97
|
providerFactory,
|
|
98
98
|
nodeViews: {
|
|
99
99
|
mediaGroup: ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
100
|
-
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options
|
|
100
|
+
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options),
|
|
101
101
|
media: ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
102
102
|
mediaInline: ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api)
|
|
103
103
|
},
|
|
@@ -107,7 +107,7 @@ const mediaPlugin = ({
|
|
|
107
107
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
108
108
|
customMediaPicker: options && options.customMediaPicker,
|
|
109
109
|
allowResizing: !!(options && options.allowResizing)
|
|
110
|
-
}, reactContext, getIntl, dispatch, options, featureFlags.newInsertionBehaviour
|
|
110
|
+
}, reactContext, getIntl, api, dispatch, options, featureFlags.newInsertionBehaviour);
|
|
111
111
|
}
|
|
112
112
|
}, {
|
|
113
113
|
name: 'mediaKeymap',
|
|
@@ -490,7 +490,7 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
490
490
|
return true;
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, mediaOptions = {}
|
|
493
|
+
export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}) => (node, view, getPos) => {
|
|
494
494
|
const hasIntlContext = true;
|
|
495
495
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
496
496
|
eventDispatcher,
|
|
@@ -46,7 +46,7 @@ const createDropPlaceholder = (intl, allowDropLine) => {
|
|
|
46
46
|
};
|
|
47
47
|
const MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
48
48
|
export class MediaPluginStateImplementation {
|
|
49
|
-
constructor(_state, options, mediaOptions, newInsertionBehaviour, _dispatch,
|
|
49
|
+
constructor(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
50
50
|
_defineProperty(this, "allowsUploads", false);
|
|
51
51
|
_defineProperty(this, "ignoreLinks", false);
|
|
52
52
|
_defineProperty(this, "waitForMediaUpload", true);
|
|
@@ -151,11 +151,12 @@ export class MediaPluginStateImplementation {
|
|
|
151
151
|
*
|
|
152
152
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
153
153
|
*/
|
|
154
|
-
_defineProperty(this, "insertFile", (mediaState, onMediaStateChanged, pickerType
|
|
155
|
-
var _mediaState$collectio, _this$mediaOptions2;
|
|
154
|
+
_defineProperty(this, "insertFile", (mediaState, onMediaStateChanged, pickerType) => {
|
|
155
|
+
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$mediaOptions2;
|
|
156
156
|
const {
|
|
157
157
|
state
|
|
158
158
|
} = this.view;
|
|
159
|
+
const editorAnalyticsAPI = (_this$pluginInjection = this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : (_this$pluginInjection2 = _this$pluginInjection.analytics) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.actions;
|
|
159
160
|
const mediaStateWithContext = {
|
|
160
161
|
...mediaState,
|
|
161
162
|
contextId: this.contextIdentifierProvider ? this.contextIdentifierProvider.objectId : undefined
|
|
@@ -172,16 +173,14 @@ export class MediaPluginStateImplementation {
|
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
175
|
-
var _this$
|
|
176
|
+
var _this$pluginInjection3;
|
|
176
177
|
// read width state right before inserting to get up-to-date and define values
|
|
177
|
-
const widthPluginState = (_this$
|
|
178
|
-
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert, this.newInsertionBehaviour, widthPluginState,
|
|
178
|
+
const widthPluginState = (_this$pluginInjection3 = this.pluginInjectionApi) === null || _this$pluginInjection3 === void 0 ? void 0 : _this$pluginInjection3.width.sharedState.currentState();
|
|
179
|
+
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert, this.newInsertionBehaviour, widthPluginState, editorAnalyticsAPI);
|
|
179
180
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
180
|
-
|
|
181
|
-
insertMediaInlineNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(this.view, mediaStateWithContext, collection, this.getInputMethod(pickerType));
|
|
181
|
+
insertMediaInlineNode(editorAnalyticsAPI)(this.view, mediaStateWithContext, collection, this.getInputMethod(pickerType));
|
|
182
182
|
} else {
|
|
183
|
-
|
|
184
|
-
insertMediaGroupNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(this.view, [mediaStateWithContext], collection, this.getInputMethod(pickerType));
|
|
183
|
+
insertMediaGroupNode(editorAnalyticsAPI)(this.view, [mediaStateWithContext], collection, this.getInputMethod(pickerType));
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
// do events when media state changes
|
|
@@ -417,7 +416,7 @@ export class MediaPluginStateImplementation {
|
|
|
417
416
|
this.mediaOptions = mediaOptions;
|
|
418
417
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
419
418
|
this.dispatch = _dispatch;
|
|
420
|
-
this.pluginInjectionApi =
|
|
419
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
421
420
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
422
421
|
const {
|
|
423
422
|
nodes
|
|
@@ -525,7 +524,7 @@ export class MediaPluginStateImplementation {
|
|
|
525
524
|
}
|
|
526
525
|
}
|
|
527
526
|
export const getMediaPluginState = state => stateKey.getState(state);
|
|
528
|
-
export const createPlugin = (_schema, options, reactContext, getIntl, dispatch, mediaOptions, newInsertionBehaviour
|
|
527
|
+
export const createPlugin = (_schema, options, reactContext, getIntl, pluginInjectionApi, dispatch, mediaOptions, newInsertionBehaviour) => {
|
|
529
528
|
const intl = getIntl();
|
|
530
529
|
const dropPlaceholder = createDropPlaceholder(intl, mediaOptions && mediaOptions.allowDropzoneDropLine);
|
|
531
530
|
return new SafePlugin({
|
|
@@ -61,7 +61,8 @@ export const getLinkingToolbar = (toolbarBaseConfig, mediaLinkingState, state, i
|
|
|
61
61
|
},
|
|
62
62
|
onBack: (href, meta) => {
|
|
63
63
|
if (href.trim() && meta.inputMethod) {
|
|
64
|
-
|
|
64
|
+
var _pluginInjectionApi$a2;
|
|
65
|
+
setUrlToMedia(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(view.state, view.dispatch, view);
|
|
65
66
|
}
|
|
66
67
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
67
68
|
},
|
|
@@ -81,7 +82,8 @@ export const getLinkingToolbar = (toolbarBaseConfig, mediaLinkingState, state, i
|
|
|
81
82
|
dispatch(tr);
|
|
82
83
|
},
|
|
83
84
|
onSubmit: (href, meta) => {
|
|
84
|
-
|
|
85
|
+
var _pluginInjectionApi$a3;
|
|
86
|
+
setUrlToMedia(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(view.state, view.dispatch, view);
|
|
85
87
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
86
88
|
},
|
|
87
89
|
onBlur: () => {
|
|
@@ -18,7 +18,7 @@ import floatingToolbarPlugin from '../../../plugins/floating-toolbar';
|
|
|
18
18
|
import clipboardPlugin from '../../../plugins/clipboard';
|
|
19
19
|
import { analyticsPlugin as deprecatedAnalyticsPlugin } from '../../../plugins';
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
|
-
import placeholderPlugin from '
|
|
21
|
+
import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
22
22
|
import annotationPlugin from '../../../plugins/annotation';
|
|
23
23
|
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
24
24
|
import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
@@ -18,7 +18,6 @@ export { default as mediaPlugin } from './media';
|
|
|
18
18
|
export { default as mentionsPlugin } from './mentions';
|
|
19
19
|
export { default as panelPlugin } from './panel';
|
|
20
20
|
export { default as pastePlugin } from './paste';
|
|
21
|
-
export { default as placeholderPlugin } from './placeholder';
|
|
22
21
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
23
22
|
export { default as quickInsertPlugin } from './quick-insert';
|
|
24
23
|
export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
@@ -97,7 +97,7 @@ var mediaPlugin = function mediaPlugin(_ref) {
|
|
|
97
97
|
providerFactory: providerFactory,
|
|
98
98
|
nodeViews: {
|
|
99
99
|
mediaGroup: ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
100
|
-
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options
|
|
100
|
+
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options),
|
|
101
101
|
media: ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api),
|
|
102
102
|
mediaInline: ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api)
|
|
103
103
|
},
|
|
@@ -107,7 +107,7 @@ var mediaPlugin = function mediaPlugin(_ref) {
|
|
|
107
107
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
108
108
|
customMediaPicker: options && options.customMediaPicker,
|
|
109
109
|
allowResizing: !!(options && options.allowResizing)
|
|
110
|
-
}, reactContext, getIntl, dispatch, options, featureFlags.newInsertionBehaviour
|
|
110
|
+
}, reactContext, getIntl, api, dispatch, options, featureFlags.newInsertionBehaviour);
|
|
111
111
|
}
|
|
112
112
|
}, {
|
|
113
113
|
name: 'mediaKeymap',
|
|
@@ -598,9 +598,8 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
598
598
|
}]);
|
|
599
599
|
return MediaSingleNodeView;
|
|
600
600
|
}(ReactNodeView);
|
|
601
|
-
export var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent) {
|
|
602
|
-
var mediaOptions = arguments.length >
|
|
603
|
-
var pluginInjectionApi = arguments.length > 5 ? arguments[5] : undefined;
|
|
601
|
+
export var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent) {
|
|
602
|
+
var mediaOptions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
604
603
|
return function (node, view, getPos) {
|
|
605
604
|
var hasIntlContext = true;
|
|
606
605
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -55,7 +55,7 @@ var createDropPlaceholder = function createDropPlaceholder(intl, allowDropLine)
|
|
|
55
55
|
};
|
|
56
56
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
57
57
|
export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
58
|
-
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch,
|
|
58
|
+
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch, pluginInjectionApi) {
|
|
59
59
|
var _this = this;
|
|
60
60
|
_classCallCheck(this, MediaPluginStateImplementation);
|
|
61
61
|
_defineProperty(this, "allowsUploads", false);
|
|
@@ -208,9 +208,10 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
208
208
|
*
|
|
209
209
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
210
210
|
*/
|
|
211
|
-
_defineProperty(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType
|
|
212
|
-
var _mediaState$collectio, _this$mediaOptions2;
|
|
211
|
+
_defineProperty(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType) {
|
|
212
|
+
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$mediaOptions2;
|
|
213
213
|
var state = _this.view.state;
|
|
214
|
+
var editorAnalyticsAPI = (_this$pluginInjection = _this.pluginInjectionApi) === null || _this$pluginInjection === void 0 ? void 0 : (_this$pluginInjection2 = _this$pluginInjection.analytics) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.actions;
|
|
214
215
|
var mediaStateWithContext = _objectSpread(_objectSpread({}, mediaState), {}, {
|
|
215
216
|
contextId: _this.contextIdentifierProvider ? _this.contextIdentifierProvider.objectId : undefined
|
|
216
217
|
});
|
|
@@ -226,16 +227,14 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
229
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
229
|
-
var _this$
|
|
230
|
+
var _this$pluginInjection3;
|
|
230
231
|
// read width state right before inserting to get up-to-date and define values
|
|
231
|
-
var widthPluginState = (_this$
|
|
232
|
-
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState,
|
|
232
|
+
var widthPluginState = (_this$pluginInjection3 = _this.pluginInjectionApi) === null || _this$pluginInjection3 === void 0 ? void 0 : _this$pluginInjection3.width.sharedState.currentState();
|
|
233
|
+
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour, widthPluginState, editorAnalyticsAPI);
|
|
233
234
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
234
|
-
|
|
235
|
-
insertMediaInlineNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
235
|
+
insertMediaInlineNode(editorAnalyticsAPI)(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
236
236
|
} else {
|
|
237
|
-
|
|
238
|
-
insertMediaGroupNode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
237
|
+
insertMediaGroupNode(editorAnalyticsAPI)(_this.view, [mediaStateWithContext], collection, _this.getInputMethod(pickerType));
|
|
239
238
|
}
|
|
240
239
|
|
|
241
240
|
// do events when media state changes
|
|
@@ -472,7 +471,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
472
471
|
this.mediaOptions = mediaOptions;
|
|
473
472
|
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
474
473
|
this.dispatch = _dispatch;
|
|
475
|
-
this.pluginInjectionApi =
|
|
474
|
+
this.pluginInjectionApi = pluginInjectionApi;
|
|
476
475
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
477
476
|
var nodes = _state.schema.nodes;
|
|
478
477
|
assert(nodes.media && (nodes.mediaGroup || nodes.mediaSingle), 'Editor: unable to init media plugin - media or mediaGroup/mediaSingle node absent in schema');
|
|
@@ -623,7 +622,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
623
622
|
export var getMediaPluginState = function getMediaPluginState(state) {
|
|
624
623
|
return stateKey.getState(state);
|
|
625
624
|
};
|
|
626
|
-
export var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, dispatch, mediaOptions, newInsertionBehaviour
|
|
625
|
+
export var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, pluginInjectionApi, dispatch, mediaOptions, newInsertionBehaviour) {
|
|
627
626
|
var intl = getIntl();
|
|
628
627
|
var dropPlaceholder = createDropPlaceholder(intl, mediaOptions && mediaOptions.allowDropzoneDropLine);
|
|
629
628
|
return new SafePlugin({
|
|
@@ -55,7 +55,8 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
|
|
|
55
55
|
},
|
|
56
56
|
onBack: function onBack(href, meta) {
|
|
57
57
|
if (href.trim() && meta.inputMethod) {
|
|
58
|
-
|
|
58
|
+
var _pluginInjectionApi$a2;
|
|
59
|
+
setUrlToMedia(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(view.state, view.dispatch, view);
|
|
59
60
|
}
|
|
60
61
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
61
62
|
},
|
|
@@ -71,7 +72,8 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
|
|
|
71
72
|
dispatch(tr);
|
|
72
73
|
},
|
|
73
74
|
onSubmit: function onSubmit(href, meta) {
|
|
74
|
-
|
|
75
|
+
var _pluginInjectionApi$a3;
|
|
76
|
+
setUrlToMedia(href, meta.inputMethod, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(view.state, view.dispatch, view);
|
|
75
77
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
76
78
|
},
|
|
77
79
|
onBlur: function onBlur() {
|
|
@@ -4,7 +4,7 @@ import type { BasePluginOptions } from '../../../plugins/base';
|
|
|
4
4
|
import type { EditorProps } from '../../../types/editor-props';
|
|
5
5
|
import type { EditorPresetProps } from './types';
|
|
6
6
|
import type { BlockTypePluginOptions } from '../../../plugins/block-type/types';
|
|
7
|
-
import type { PlaceholderPluginOptions } from '
|
|
7
|
+
import type { PlaceholderPluginOptions } from '@atlaskit/editor-plugin-placeholder';
|
|
8
8
|
import type { AnnotationProviders } from '../../../plugins/annotation';
|
|
9
9
|
import type { TextFormattingOptions, HyperlinkPluginOptions, QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { CodeBlockOptions } from '../../../plugins/code-block/types';
|
|
@@ -18,7 +18,6 @@ export { default as mediaPlugin } from './media';
|
|
|
18
18
|
export { default as mentionsPlugin } from './mentions';
|
|
19
19
|
export { default as panelPlugin } from './panel';
|
|
20
20
|
export { default as pastePlugin } from './paste';
|
|
21
|
-
export { default as placeholderPlugin } from './placeholder';
|
|
22
21
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
23
22
|
export { default as quickInsertPlugin } from './quick-insert';
|
|
24
23
|
export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
@@ -6,5 +6,5 @@ import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/a
|
|
|
6
6
|
export declare const showLinkingToolbar: import("@atlaskit/editor-common/types").Command;
|
|
7
7
|
export declare const showLinkingToolbarWithMediaTypeCheck: Command;
|
|
8
8
|
export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
|
|
9
|
-
export declare const unlink: (editorAnalyticsAPI
|
|
10
|
-
export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI
|
|
9
|
+
export declare const unlink: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
10
|
+
export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -58,5 +58,5 @@ declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps
|
|
|
58
58
|
render(props: MediaSingleNodeViewProps, forwardRef?: ForwardRef): jsx.JSX.Element;
|
|
59
59
|
ignoreMutation(): boolean;
|
|
60
60
|
}
|
|
61
|
-
export declare const ReactMediaSingleNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, mediaOptions?: MediaOptions
|
|
61
|
+
export declare const ReactMediaSingleNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, mediaOptions?: MediaOptions) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaSingleNodeView;
|
|
62
62
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UploadPreviewUpdateEventPayload, UploadParams, UploadErrorEventPayload, UploadEndEventPayload } from '@atlaskit/media-picker/types';
|
|
2
|
-
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
1
|
+
import type { UploadPreviewUpdateEventPayload, UploadParams, UploadErrorEventPayload, UploadEndEventPayload } from '@atlaskit/media-picker/types';
|
|
2
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
3
3
|
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
5
|
-
import { MediaState, CustomMediaPicker, MobileUploadEndEventPayload } from './types';
|
|
4
|
+
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
5
|
+
import type { MediaState, CustomMediaPicker, MobileUploadEndEventPayload } from './types';
|
|
6
6
|
export type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
7
|
export type ExtendedComponentConfigs = {
|
|
8
8
|
customMediaPicker: CustomMediaPicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
|
|
3
|
-
export declare const openMediaAltTextMenu: (editorAnalyticsAPI
|
|
3
|
+
export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4
4
|
export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export default function keymapPlugin(schema: Schema, editorAnalyticsAPI
|
|
4
|
+
export default function keymapPlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { MediaOptions } from '../types';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export declare function keymapPlugin(options
|
|
4
|
+
export declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin;
|
|
5
5
|
export default keymapPlugin;
|
|
@@ -53,8 +53,8 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
53
53
|
showEditingDialog?: boolean;
|
|
54
54
|
mediaOptions?: MediaOptions;
|
|
55
55
|
dispatch?: Dispatch;
|
|
56
|
-
pluginInjectionApi
|
|
57
|
-
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions
|
|
56
|
+
pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined;
|
|
57
|
+
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions: MediaOptions | undefined, newInsertionBehaviour: boolean | undefined, dispatch: Dispatch | undefined, pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined);
|
|
58
58
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
59
59
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
60
60
|
getMediaOptions: () => MediaPluginOptions;
|
|
@@ -68,7 +68,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
68
68
|
*
|
|
69
69
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
70
70
|
*/
|
|
71
|
-
insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string
|
|
71
|
+
insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
72
72
|
addPendingTask: (task: Promise<any>) => void;
|
|
73
73
|
splitMediaGroup: () => boolean;
|
|
74
74
|
onPopupPickerClose: () => void;
|
|
@@ -115,4 +115,4 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
115
115
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
116
116
|
}
|
|
117
117
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
118
|
-
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean
|
|
118
|
+
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean) => SafePlugin<MediaPluginState>;
|
|
@@ -5,7 +5,7 @@ import type { MediaToolbarBaseConfig } from '../types';
|
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
7
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI
|
|
8
|
+
export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
|
|
9
9
|
export declare const altTextEditComponent: (options?: AltTextToolbarOptions) => FloatingToolbarCustom<Command>;
|
|
10
10
|
export interface AltTextToolbarOptions {
|
|
11
11
|
altTextValidator?: (value: string) => string[];
|
|
@@ -3,8 +3,8 @@ import type { Command } from '../../../types';
|
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
5
5
|
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
6
|
-
export declare const changeInlineToMediaCard: (editorAnalyticsAPI
|
|
7
|
-
export declare const changeMediaCardToInline: (editorAnalyticsAPI
|
|
6
|
+
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
7
|
+
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
8
8
|
export declare const removeInlineCard: Command;
|
|
9
|
-
export declare const toggleBorderMark: (editorAnalyticsAPI
|
|
10
|
-
export declare const setBorderMark: (editorAnalyticsAPI
|
|
9
|
+
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
10
|
+
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|