@atlaskit/editor-plugin-media 1.44.7 → 1.44.9
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 +16 -0
- package/dist/cjs/mediaPlugin.js +0 -2
- package/dist/cjs/nodeviews/lazy-media-group.js +1 -4
- package/dist/cjs/nodeviews/lazy-media-inline.js +1 -4
- package/dist/cjs/nodeviews/lazy-media.js +1 -4
- package/dist/cjs/nodeviews/mediaGroup.js +1 -4
- package/dist/cjs/nodeviews/mediaInline.js +1 -4
- package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/cjs/nodeviews/mediaSingle.js +0 -3
- package/dist/cjs/nodeviews/toDOM-fixes/media.js +8 -3
- package/dist/cjs/pm-plugins/commands/captions.js +1 -4
- package/dist/cjs/pm-plugins/commands/linking.js +2 -8
- package/dist/cjs/pm-plugins/keymap.js +5 -22
- package/dist/cjs/pm-plugins/main.js +2 -14
- package/dist/cjs/pm-plugins/picker-facade.js +0 -2
- package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/cjs/pm-plugins/utils/media-files.js +2 -8
- package/dist/cjs/pm-plugins/utils/media-single.js +4 -16
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/cjs/ui/toolbar/commands.js +1 -4
- package/dist/cjs/ui/toolbar/index.js +3 -12
- package/dist/cjs/ui/toolbar/linking.js +1 -4
- package/dist/es2019/mediaPlugin.js +0 -2
- package/dist/es2019/nodeviews/lazy-media-group.js +1 -4
- package/dist/es2019/nodeviews/lazy-media-inline.js +1 -4
- package/dist/es2019/nodeviews/lazy-media-single.js +1 -4
- package/dist/es2019/nodeviews/lazy-media.js +1 -4
- package/dist/es2019/nodeviews/mediaGroup.js +1 -4
- package/dist/es2019/nodeviews/mediaInline.js +1 -4
- package/dist/es2019/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/es2019/nodeviews/mediaSingle.js +1 -7
- package/dist/es2019/nodeviews/toDOM-fixes/media.js +8 -3
- package/dist/es2019/pm-plugins/commands/captions.js +1 -4
- package/dist/es2019/pm-plugins/commands/linking.js +2 -8
- package/dist/es2019/pm-plugins/keymap.js +5 -22
- package/dist/es2019/pm-plugins/main.js +2 -14
- package/dist/es2019/pm-plugins/picker-facade.js +0 -2
- package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/es2019/pm-plugins/utils/media-files.js +2 -8
- package/dist/es2019/pm-plugins/utils/media-single.js +4 -16
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/es2019/ui/toolbar/commands.js +1 -4
- package/dist/es2019/ui/toolbar/index.js +3 -12
- package/dist/es2019/ui/toolbar/linking.js +1 -4
- package/dist/es2019/ui/toolbar/mediaInline.js +2 -8
- package/dist/es2019/ui/toolbar/utils.js +1 -4
- package/dist/esm/mediaPlugin.js +0 -2
- package/dist/esm/nodeviews/lazy-media-group.js +1 -4
- package/dist/esm/nodeviews/lazy-media-inline.js +1 -4
- package/dist/esm/nodeviews/lazy-media.js +1 -4
- package/dist/esm/nodeviews/mediaGroup.js +1 -4
- package/dist/esm/nodeviews/mediaInline.js +1 -4
- package/dist/esm/nodeviews/mediaNodeView/index.js +1 -4
- package/dist/esm/nodeviews/mediaSingle.js +0 -3
- package/dist/esm/nodeviews/toDOM-fixes/media.js +8 -3
- package/dist/esm/pm-plugins/commands/captions.js +1 -4
- package/dist/esm/pm-plugins/commands/linking.js +2 -8
- package/dist/esm/pm-plugins/keymap.js +5 -22
- package/dist/esm/pm-plugins/main.js +2 -14
- package/dist/esm/pm-plugins/picker-facade.js +0 -2
- package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +0 -2
- package/dist/esm/pm-plugins/utils/media-files.js +2 -8
- package/dist/esm/pm-plugins/utils/media-single.js +4 -16
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -10
- package/dist/esm/ui/toolbar/commands.js +1 -4
- package/dist/esm/ui/toolbar/index.js +3 -12
- package/dist/esm/ui/toolbar/linking.js +1 -4
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.44.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.44.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#105278](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105278)
|
|
14
|
+
[`3fb1e0a806ca3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3fb1e0a806ca3) -
|
|
15
|
+
[ux] ED-25716 fixes issue with copying media nodes on safari when
|
|
16
|
+
platform_editor_exp_lazy_node_views is enabled
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 1.44.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/mediaPlugin.js
CHANGED
|
@@ -103,8 +103,6 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
103
103
|
return _pluginKey.stateKey.getState(editorState) || null;
|
|
104
104
|
},
|
|
105
105
|
actions: {
|
|
106
|
-
// Ignored via go/ees005
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
108
106
|
insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod, isNestingInQuoteSupported, insertMediaVia) {
|
|
109
107
|
var _api$analytics;
|
|
110
108
|
return (0, _mediaSingle2.insertMediaAsMediaSingle)(view, node, inputMethod, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, isNestingInQuoteSupported, insertMediaVia);
|
|
@@ -13,10 +13,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
var lazyMediaGroupView = exports.lazyMediaGroupView = function lazyMediaGroupView(portalProviderAPI, eventDispatcher, providerFactory) {
|
|
15
15
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
16
|
-
var api
|
|
17
|
-
// Ignored via go/ees005
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
16
|
+
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
20
17
|
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
21
18
|
return (0, _mediaGroup.ReactMediaGroupNode)(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
22
19
|
}
|
|
@@ -11,10 +11,7 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
|
11
11
|
var _mediaInline = require("./mediaInline");
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
var lazyMediaInlineView = exports.lazyMediaInlineView = function lazyMediaInlineView(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
-
) {
|
|
14
|
+
var lazyMediaInlineView = exports.lazyMediaInlineView = function lazyMediaInlineView(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) {
|
|
18
15
|
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
19
16
|
return (0, _mediaInline.ReactMediaInlineNode)(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent);
|
|
20
17
|
}
|
|
@@ -13,10 +13,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
var lazyMediaView = exports.lazyMediaView = function lazyMediaView(portalProviderAPI, eventDispatcher, providerFactory) {
|
|
15
15
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
16
|
-
var api
|
|
17
|
-
// Ignored via go/ees005
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
16
|
+
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
20
17
|
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
21
18
|
return (0, _mediaNodeView.ReactMediaNode)(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
22
19
|
}
|
|
@@ -391,10 +391,7 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
391
391
|
}(_reactNodeView.default);
|
|
392
392
|
var ReactMediaGroupNode = exports.ReactMediaGroupNode = function ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory) {
|
|
393
393
|
var mediaOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
394
|
-
var pluginInjectionApi
|
|
395
|
-
// Ignored via go/ees005
|
|
396
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
397
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
394
|
+
var pluginInjectionApi = arguments.length > 4 ? arguments[4] : undefined;
|
|
398
395
|
return function (node, view, getPos) {
|
|
399
396
|
return new MediaGroupNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
400
397
|
providerFactory: providerFactory,
|
|
@@ -301,10 +301,7 @@ var MediaInlineNodeView = exports.MediaInlineNodeView = /*#__PURE__*/function (_
|
|
|
301
301
|
}
|
|
302
302
|
}]);
|
|
303
303
|
}(_selectionBasedNodeView.SelectionBasedNodeView);
|
|
304
|
-
var ReactMediaInlineNode = exports.ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
305
|
-
// Ignored via go/ees005
|
|
306
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
307
|
-
) {
|
|
304
|
+
var ReactMediaInlineNode = exports.ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) {
|
|
308
305
|
return function (node, view, getPos) {
|
|
309
306
|
return new MediaInlineNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
310
307
|
providerFactory: providerFactory,
|
|
@@ -189,10 +189,7 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
189
189
|
}(_selectionBasedNodeView.SelectionBasedNodeView);
|
|
190
190
|
var ReactMediaNode = exports.ReactMediaNode = function ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory) {
|
|
191
191
|
var mediaOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
192
|
-
var pluginInjectionApi
|
|
193
|
-
// Ignored via go/ees005
|
|
194
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
195
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
192
|
+
var pluginInjectionApi = arguments.length > 4 ? arguments[4] : undefined;
|
|
196
193
|
return function (node, view, getPos) {
|
|
197
194
|
return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
198
195
|
eventDispatcher: eventDispatcher,
|
|
@@ -759,9 +759,6 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
759
759
|
}
|
|
760
760
|
return false;
|
|
761
761
|
}
|
|
762
|
-
|
|
763
|
-
// Ignored via go/ees005
|
|
764
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
765
762
|
}, {
|
|
766
763
|
key: "update",
|
|
767
764
|
value: function update(node, decorations, _innerDecorations, isValidUpdate) {
|
|
@@ -8,6 +8,7 @@ exports.mediaSpecWithFixedToDOM = exports.defaultImageCardDimensions = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
13
|
var _toDOMAttrs = require("./toDOMAttrs");
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -51,13 +52,12 @@ var mediaSpecWithFixedToDOM = exports.mediaSpecWithFixedToDOM = function mediaSp
|
|
|
51
52
|
var dataUrl = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
|
52
53
|
var width = defaultImageCardDimensions.width;
|
|
53
54
|
var height = defaultImageCardDimensions.height;
|
|
54
|
-
|
|
55
|
+
var sharedAttrs = _objectSpread(_objectSpread({
|
|
55
56
|
width: width,
|
|
56
57
|
height: height
|
|
57
58
|
}, attrs), {}, {
|
|
58
59
|
// Manually kept in sync with the style of media cards. The goal is to render a plain gray
|
|
59
60
|
// rectangle that provides an affordance for media.
|
|
60
|
-
|
|
61
61
|
style: (0, _lazyNodeView.convertToInlineCss)({
|
|
62
62
|
display: 'var(--ak-editor-media-card-display, inline-block)',
|
|
63
63
|
backgroundImage: "url(\"".concat(dataUrl, "\")"),
|
|
@@ -71,7 +71,12 @@ var mediaSpecWithFixedToDOM = exports.mediaSpecWithFixedToDOM = function mediaSp
|
|
|
71
71
|
height: "var(--ak-editor-media-card-height, 0)",
|
|
72
72
|
paddingBottom: "var(--ak-editor-media-padding-bottom, 0)"
|
|
73
73
|
})
|
|
74
|
-
})
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Safari is stripping the dom if a child does not exist for the media nodes on safari.
|
|
77
|
+
// Creating an empty child allows safari to pick up the media node within the clipboard.
|
|
78
|
+
// https://product-fabric.atlassian.net/browse/ED-25841
|
|
79
|
+
return (0, _platformFeatureFlags.fg)('platform_editor_safari_media_clipboard_fix') ? ['div', sharedAttrs, ['div', {}]] : ['div', sharedAttrs];
|
|
75
80
|
}
|
|
76
81
|
return ['div', _objectSpread(_objectSpread({}, attrs), {}, {
|
|
77
82
|
styles: (0, _lazyNodeView.convertToInlineCss)({
|
|
@@ -54,9 +54,6 @@ var insertAndSelectCaptionFromMediaSinglePos = exports.insertAndSelectCaptionFro
|
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
|
-
) {
|
|
57
|
+
var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize) {
|
|
61
58
|
return (0, _utils.setTextSelection)(mediaSingleNodePos + mediaNodeSize + captionNodeSize)(tr);
|
|
62
59
|
};
|
|
@@ -70,10 +70,7 @@ var showLinkingToolbarWithMediaTypeCheck = exports.showLinkingToolbarWithMediaTy
|
|
|
70
70
|
var hideLinkingToolbarCommand = (0, _linking.createMediaLinkingCommand)({
|
|
71
71
|
type: _actions.MediaLinkingActionsTypes.hideToolbar
|
|
72
72
|
});
|
|
73
|
-
var hideLinkingToolbar = exports.hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar
|
|
74
|
-
// Ignored via go/ees005
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
76
|
-
) {
|
|
73
|
+
var hideLinkingToolbar = exports.hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar) {
|
|
77
74
|
hideLinkingToolbarCommand(state, dispatch, view);
|
|
78
75
|
|
|
79
76
|
// restore focus on the editor so keyboard shortcuts aren't lost to the browser
|
|
@@ -167,10 +164,7 @@ function toggleLinkMark(tr, state, _ref) {
|
|
|
167
164
|
}
|
|
168
165
|
var fireAnalyticForMediaLink = function fireAnalyticForMediaLink(tr, action) {
|
|
169
166
|
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
170
|
-
var editorAnalyticsAPI
|
|
171
|
-
// Ignored via go/ees005
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
173
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
167
|
+
var editorAnalyticsAPI = arguments.length > 3 ? arguments[3] : undefined;
|
|
174
168
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
175
169
|
action: action,
|
|
176
170
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
@@ -16,8 +16,6 @@ var _captions = require("../pm-plugins/commands/captions");
|
|
|
16
16
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
17
17
|
var _commands = require("../ui/toolbar/commands");
|
|
18
18
|
var _utils = require("../ui/toolbar/utils");
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
19
|
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI, widthPlugin, getIntl) {
|
|
22
20
|
var list = {};
|
|
23
21
|
|
|
@@ -80,10 +78,7 @@ var focusPlayButton = function focusPlayButton(state) {
|
|
|
80
78
|
}
|
|
81
79
|
return true;
|
|
82
80
|
};
|
|
83
|
-
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation
|
|
84
|
-
// Ignored via go/ees005
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
86
|
-
) {
|
|
81
|
+
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation) {
|
|
87
82
|
var newWidthValidated;
|
|
88
83
|
if (newWidth > maxWidth) {
|
|
89
84
|
newWidthValidated = maxWidth;
|
|
@@ -100,10 +95,7 @@ var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, v
|
|
|
100
95
|
validation: validation
|
|
101
96
|
};
|
|
102
97
|
};
|
|
103
|
-
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl
|
|
104
|
-
// Ignored via go/ees005
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
106
|
-
) {
|
|
98
|
+
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl) {
|
|
107
99
|
var announcerContainer = document.getElementById('media-announcer') || document.createElement('div');
|
|
108
100
|
var intl = getIntl();
|
|
109
101
|
if (!announcerContainer.id) {
|
|
@@ -134,10 +126,7 @@ var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount,
|
|
|
134
126
|
}
|
|
135
127
|
}
|
|
136
128
|
};
|
|
137
|
-
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl
|
|
138
|
-
// Ignored via go/ees005
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
140
|
-
) {
|
|
129
|
+
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl) {
|
|
141
130
|
return function (state, dispatch) {
|
|
142
131
|
var _getSelectedMediaSing, _widthPlugin$sharedSt, _widthPlugin$sharedSt2, _getSelectedMediaSing2;
|
|
143
132
|
var selection = state.selection;
|
|
@@ -174,16 +163,10 @@ var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, w
|
|
|
174
163
|
return true;
|
|
175
164
|
};
|
|
176
165
|
};
|
|
177
|
-
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
178
|
-
// Ignored via go/ees005
|
|
179
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
180
|
-
) {
|
|
166
|
+
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl) {
|
|
181
167
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, 1, 'increased', getIntl);
|
|
182
168
|
};
|
|
183
|
-
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
184
|
-
// Ignored via go/ees005
|
|
185
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
186
|
-
) {
|
|
169
|
+
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl) {
|
|
187
170
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, -1, 'decreased', getIntl);
|
|
188
171
|
};
|
|
189
172
|
var insertAndSelectCaption = function insertAndSelectCaption(editorAnalyticsAPI) {
|
|
@@ -52,10 +52,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
52
52
|
var MEDIA_CONTENT_WRAP_CLASS_NAME = exports.MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
53
53
|
var MEDIA_PLUGIN_IS_RESIZING_KEY = exports.MEDIA_PLUGIN_IS_RESIZING_KEY = 'mediaSinglePlugin.isResizing';
|
|
54
54
|
var MEDIA_PLUGIN_RESIZING_WIDTH_KEY = exports.MEDIA_PLUGIN_RESIZING_WIDTH_KEY = 'mediaSinglePlugin.resizing-width';
|
|
55
|
-
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine
|
|
56
|
-
// Ignored via go/ees005
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
58
|
-
) {
|
|
55
|
+
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine) {
|
|
59
56
|
var dropPlaceholder = document.createElement('div');
|
|
60
57
|
var createElement = _react.default.createElement;
|
|
61
58
|
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
|
|
@@ -93,8 +90,6 @@ var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalP
|
|
|
93
90
|
};
|
|
94
91
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
95
92
|
var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
96
|
-
// Ignored via go/ees005
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
98
93
|
function MediaPluginStateImplementation(_state, options, mediaOptions, _dispatch, pluginInjectionApi) {
|
|
99
94
|
var _this = this,
|
|
100
95
|
_this$mediaOptions2,
|
|
@@ -152,8 +147,6 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
|
|
|
152
147
|
*
|
|
153
148
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
154
149
|
*/
|
|
155
|
-
// Ignored via go/ees005
|
|
156
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
157
150
|
(0, _defineProperty2.default)(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType, insertMediaVia) {
|
|
158
151
|
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$pluginInjection3;
|
|
159
152
|
var state = _this.view.state;
|
|
@@ -807,10 +800,7 @@ var MediaPluginStateImplementation = exports.MediaPluginStateImplementation = /*
|
|
|
807
800
|
var getMediaPluginState = exports.getMediaPluginState = function getMediaPluginState(state) {
|
|
808
801
|
return _pluginKey.stateKey.getState(state);
|
|
809
802
|
};
|
|
810
|
-
var createPlugin = exports.createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions
|
|
811
|
-
// Ignored via go/ees005
|
|
812
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
813
|
-
) {
|
|
803
|
+
var createPlugin = exports.createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions) {
|
|
814
804
|
var intl = getIntl();
|
|
815
805
|
return new _safePlugin.SafePlugin({
|
|
816
806
|
state: {
|
|
@@ -980,8 +970,6 @@ var createPlugin = exports.createPlugin = function createPlugin(_schema, options
|
|
|
980
970
|
return _view2.DecorationSet.create(state.doc, dropPlaceholders);
|
|
981
971
|
},
|
|
982
972
|
nodeViews: options.nodeViews,
|
|
983
|
-
// Ignored via go/ees005
|
|
984
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
985
973
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
986
974
|
var selection = view.state.selection;
|
|
987
975
|
if (text === ' ' && selection instanceof _state2.NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
@@ -12,8 +12,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _mediaPicker = require("@atlaskit/media-picker");
|
|
14
14
|
var PickerFacade = exports.default = /*#__PURE__*/function () {
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
15
|
function PickerFacade(pickerType, config, pickerConfig, analyticsName) {
|
|
18
16
|
var _this = this;
|
|
19
17
|
(0, _classCallCheck2.default)(this, PickerFacade);
|
|
@@ -37,8 +37,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
37
37
|
* const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
|
|
38
38
|
* debouncedFunction(arg1, arg2);
|
|
39
39
|
*/
|
|
40
|
-
// Ignored via go/ees005
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
42
40
|
function memoizeDebounce(func) {
|
|
43
41
|
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
44
42
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -83,10 +83,7 @@ function shouldAppendParagraph(state, node) {
|
|
|
83
83
|
* @param collection Collection for the media to be added
|
|
84
84
|
*/
|
|
85
85
|
var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMediaInlineNode(editorAnalyticsAPI) {
|
|
86
|
-
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia
|
|
87
|
-
// Ignored via go/ees005
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
89
|
-
) {
|
|
86
|
+
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia) {
|
|
90
87
|
var state = view.state,
|
|
91
88
|
dispatch = view.dispatch;
|
|
92
89
|
var schema = state.schema,
|
|
@@ -151,10 +148,7 @@ var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMedia
|
|
|
151
148
|
* @param collection Collection for the media to be added
|
|
152
149
|
*/
|
|
153
150
|
var insertMediaGroupNode = exports.insertMediaGroupNode = function insertMediaGroupNode(editorAnalyticsAPI) {
|
|
154
|
-
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia
|
|
155
|
-
// Ignored via go/ees005
|
|
156
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
157
|
-
) {
|
|
151
|
+
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia) {
|
|
158
152
|
var state = view.state,
|
|
159
153
|
dispatch = view.dispatch;
|
|
160
154
|
var tr = state.tr,
|
|
@@ -93,10 +93,7 @@ function insertNodesWithOptionalParagraph(_ref) {
|
|
|
93
93
|
var isMediaSingle = exports.isMediaSingle = function isMediaSingle(schema, fileMimeType) {
|
|
94
94
|
return !!schema.nodes.mediaSingle && (0, _isType.isImage)(fileMimeType);
|
|
95
95
|
};
|
|
96
|
-
var insertMediaAsMediaSingle = exports.insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia
|
|
97
|
-
// Ignored via go/ees005
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
99
|
-
) {
|
|
96
|
+
var insertMediaAsMediaSingle = exports.insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia) {
|
|
100
97
|
var _node$attrs$width;
|
|
101
98
|
var state = view.state,
|
|
102
99
|
dispatch = view.dispatch;
|
|
@@ -139,10 +136,7 @@ var getFileExtension = function getFileExtension(fileName) {
|
|
|
139
136
|
}
|
|
140
137
|
return undefined;
|
|
141
138
|
};
|
|
142
|
-
var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia
|
|
143
|
-
// Ignored via go/ees005
|
|
144
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
145
|
-
) {
|
|
139
|
+
var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia) {
|
|
146
140
|
var _state$selection$$fro;
|
|
147
141
|
if (collection === undefined) {
|
|
148
142
|
return false;
|
|
@@ -195,10 +189,7 @@ var insertMediaSingleNode = exports.insertMediaSingleNode = function insertMedia
|
|
|
195
189
|
}
|
|
196
190
|
return true;
|
|
197
191
|
};
|
|
198
|
-
var changeFromMediaInlineToMediaSingleNode = exports.changeFromMediaInlineToMediaSingleNode = function changeFromMediaInlineToMediaSingleNode(view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported
|
|
199
|
-
// Ignored via go/ees005
|
|
200
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
201
|
-
) {
|
|
192
|
+
var changeFromMediaInlineToMediaSingleNode = exports.changeFromMediaInlineToMediaSingleNode = function changeFromMediaInlineToMediaSingleNode(view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported) {
|
|
202
193
|
var _state$selection$$fro2;
|
|
203
194
|
var state = view.state,
|
|
204
195
|
dispatch = view.dispatch;
|
|
@@ -245,10 +236,7 @@ var changeFromMediaInlineToMediaSingleNode = exports.changeFromMediaInlineToMedi
|
|
|
245
236
|
}
|
|
246
237
|
return true;
|
|
247
238
|
};
|
|
248
|
-
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert
|
|
249
|
-
// Ignored via go/ees005
|
|
250
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
251
|
-
) {
|
|
239
|
+
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert) {
|
|
252
240
|
return function (mediaState) {
|
|
253
241
|
var id = mediaState.id,
|
|
254
242
|
dimensions = mediaState.dimensions,
|
|
@@ -86,8 +86,6 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
86
86
|
}
|
|
87
87
|
return _this.calcUnwrappedLayout(newWidth, containerWidth || 0, lineLength, fullWidthMode, _this.isAdjacentMode());
|
|
88
88
|
});
|
|
89
|
-
// Ignored via go/ees005
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
91
89
|
(0, _defineProperty2.default)(_this, "calcUnwrappedLayout", function (width, containerWidth, contentWidth, fullWidthMode, isNestedNode) {
|
|
92
90
|
if (isNestedNode) {
|
|
93
91
|
return 'center';
|
|
@@ -618,10 +616,7 @@ var setIsResizingPluginState = function setIsResizingPluginState(_ref4) {
|
|
|
618
616
|
return true;
|
|
619
617
|
};
|
|
620
618
|
};
|
|
621
|
-
var calcUnwrappedLayout = function calcUnwrappedLayout(width, containerWidth, contentWidth, fullWidthMode, isNestedNode
|
|
622
|
-
// Ignored via go/ees005
|
|
623
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
624
|
-
) {
|
|
619
|
+
var calcUnwrappedLayout = function calcUnwrappedLayout(width, containerWidth, contentWidth, fullWidthMode, isNestedNode) {
|
|
625
620
|
if (isNestedNode) {
|
|
626
621
|
return 'center';
|
|
627
622
|
}
|
|
@@ -665,10 +660,7 @@ var calcNewLayout = function calcNewLayout(_ref5) {
|
|
|
665
660
|
var calculateSizeState = function calculateSizeState(props) {
|
|
666
661
|
return function (size, delta) {
|
|
667
662
|
var onResizeStop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
668
|
-
var aspectRatio
|
|
669
|
-
// Ignored via go/ees005
|
|
670
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
671
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
663
|
+
var aspectRatio = arguments.length > 3 ? arguments[3] : undefined;
|
|
672
664
|
var calculatedWidth = Math.round(size.width + delta.width);
|
|
673
665
|
var calculatedWidthWithLayout = calcNewLayout(props)(calculatedWidth, onResizeStop);
|
|
674
666
|
return {
|
|
@@ -260,10 +260,7 @@ var setBorderMark = exports.setBorderMark = function setBorderMark(editorAnalyti
|
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
var updateMediaSingleWidth = exports.updateMediaSingleWidth = function updateMediaSingleWidth(editorAnalyticsAPI) {
|
|
263
|
-
return function (width, validation, inputMethod, layout
|
|
264
|
-
// Ignored via go/ees005
|
|
265
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
266
|
-
) {
|
|
263
|
+
return function (width, validation, inputMethod, layout) {
|
|
267
264
|
return function (state, dispatch) {
|
|
268
265
|
var selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
|
|
269
266
|
if (!selectedMediaSingleNode) {
|
|
@@ -81,10 +81,7 @@ var handleShowMediaViewer = exports.handleShowMediaViewer = function handleShowM
|
|
|
81
81
|
}
|
|
82
82
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.media.commands.showMediaViewer(selectedNodeAttrs));
|
|
83
83
|
};
|
|
84
|
-
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly
|
|
85
|
-
// Ignored via go/ees005
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
87
|
-
) {
|
|
84
|
+
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) {
|
|
88
85
|
if (isViewOnly) {
|
|
89
86
|
return [];
|
|
90
87
|
}
|
|
@@ -172,10 +169,7 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
172
169
|
}];
|
|
173
170
|
return items;
|
|
174
171
|
};
|
|
175
|
-
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi
|
|
176
|
-
// Ignored via go/ees005
|
|
177
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
178
|
-
) {
|
|
172
|
+
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, pluginInjectionApi) {
|
|
179
173
|
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
180
174
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
181
175
|
var allowResizing = options.allowResizing,
|
|
@@ -559,10 +553,7 @@ var getMediaTypeMessage = function getMediaTypeMessage(selectedNodeTypeSingle) {
|
|
|
559
553
|
var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state, intl) {
|
|
560
554
|
var _pluginInjectionApi$d3, _pluginInjectionApi$d4;
|
|
561
555
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
562
|
-
var pluginInjectionApi
|
|
563
|
-
// Ignored via go/ees005
|
|
564
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
565
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
556
|
+
var pluginInjectionApi = arguments.length > 3 ? arguments[3] : undefined;
|
|
566
557
|
var _state$schema$nodes = state.schema.nodes,
|
|
567
558
|
media = _state$schema$nodes.media,
|
|
568
559
|
mediaInline = _state$schema$nodes.mediaInline,
|
|
@@ -33,10 +33,7 @@ function shouldShowMediaLinkToolbar(editorState) {
|
|
|
33
33
|
parent = _editorState$doc$reso.parent;
|
|
34
34
|
return parent && parent.type.allowsMarkType(link);
|
|
35
35
|
}
|
|
36
|
-
var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
-
) {
|
|
36
|
+
var getLinkingToolbar = exports.getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory) {
|
|
40
37
|
var link = mediaLinkingState.link,
|
|
41
38
|
visible = mediaLinkingState.visible,
|
|
42
39
|
editing = mediaLinkingState.editable,
|
|
@@ -97,8 +97,6 @@ export const mediaPlugin = ({
|
|
|
97
97
|
return stateKey.getState(editorState) || null;
|
|
98
98
|
},
|
|
99
99
|
actions: {
|
|
100
|
-
// Ignored via go/ees005
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
102
100
|
insertMediaAsMediaSingle: (view, node, inputMethod, isNestingInQuoteSupported, insertMediaVia) => {
|
|
103
101
|
var _api$analytics;
|
|
104
102
|
return insertMediaAsMediaSingle(view, node, inputMethod, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, isNestingInQuoteSupported, insertMediaVia);
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaGroupNode } from './mediaGroup';
|
|
4
|
-
export const lazyMediaGroupView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) => {
|
|
4
|
+
export const lazyMediaGroupView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api) => {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
10
7
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaInlineNode } from './mediaInline';
|
|
4
|
-
export const lazyMediaInlineView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) => {
|
|
4
|
+
export const lazyMediaInlineView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) => {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent);
|
|
10
7
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaSingleNode } from './mediaSingle';
|
|
4
|
-
export const lazyMediaSingleView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options = {}
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) => {
|
|
4
|
+
export const lazyMediaSingleView = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options = {}) => {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent, options);
|
|
10
7
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { ReactMediaNode } from './mediaNodeView';
|
|
4
|
-
export const lazyMediaView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) => {
|
|
4
|
+
export const lazyMediaView = (portalProviderAPI, eventDispatcher, providerFactory, options = {}, api) => {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options, api);
|
|
10
7
|
}
|
|
@@ -336,10 +336,7 @@ class MediaGroupNodeView extends ReactNodeView {
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
export const ReactMediaGroupNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
340
|
-
// Ignored via go/ees005
|
|
341
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
342
|
-
) => (node, view, getPos) => {
|
|
339
|
+
export const ReactMediaGroupNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi) => (node, view, getPos) => {
|
|
343
340
|
return new MediaGroupNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
344
341
|
providerFactory,
|
|
345
342
|
mediaOptions,
|
|
@@ -223,10 +223,7 @@ export class MediaInlineNodeView extends SelectionBasedNodeView {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
export const ReactMediaInlineNode = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent
|
|
227
|
-
// Ignored via go/ees005
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
229
|
-
) => (node, view, getPos) => {
|
|
226
|
+
export const ReactMediaInlineNode = (portalProviderAPI, eventDispatcher, providerFactory, api, dispatchAnalyticsEvent) => (node, view, getPos) => {
|
|
230
227
|
return new MediaInlineNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
231
228
|
providerFactory,
|
|
232
229
|
dispatchAnalyticsEvent,
|
|
@@ -164,10 +164,7 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi
|
|
168
|
-
// Ignored via go/ees005
|
|
169
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
170
|
-
) => (node, view, getPos) => {
|
|
167
|
+
export const ReactMediaNode = (portalProviderAPI, eventDispatcher, providerFactory, mediaOptions = {}, pluginInjectionApi) => (node, view, getPos) => {
|
|
171
168
|
return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
172
169
|
eventDispatcher,
|
|
173
170
|
providerFactory,
|
|
@@ -655,9 +655,6 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
655
655
|
}
|
|
656
656
|
return false;
|
|
657
657
|
}
|
|
658
|
-
|
|
659
|
-
// Ignored via go/ees005
|
|
660
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
661
658
|
update(node, decorations, _innerDecorations, isValidUpdate) {
|
|
662
659
|
if (!isValidUpdate) {
|
|
663
660
|
isValidUpdate = (currentNode, newNode) => this.getNodeMediaId(currentNode) === this.getNodeMediaId(newNode);
|
|
@@ -725,10 +722,7 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
725
722
|
(_this$unsubscribeToVi = this.unsubscribeToViewModeChange) === null || _this$unsubscribeToVi === void 0 ? void 0 : _this$unsubscribeToVi.call(this);
|
|
726
723
|
}
|
|
727
724
|
}
|
|
728
|
-
export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}
|
|
729
|
-
// Ignored via go/ees005
|
|
730
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
731
|
-
) => (node, view, getPos) => {
|
|
725
|
+
export const ReactMediaSingleNode = (portalProviderAPI, eventDispatcher, providerFactory, pluginInjectionApi, dispatchAnalyticsEvent, mediaOptions = {}) => (node, view, getPos) => {
|
|
732
726
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
733
727
|
eventDispatcher,
|
|
734
728
|
fullWidthMode: mediaOptions.fullWidthEnabled,
|