@atlaskit/editor-plugin-card 2.15.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/analytics/utils.js +6 -6
- package/dist/cjs/datasourceErrorBoundary.js +1 -1
- package/dist/cjs/nodeviews/blockCard.js +15 -22
- package/dist/cjs/nodeviews/datasource.js +1 -1
- package/dist/cjs/nodeviews/embedCard.js +14 -21
- package/dist/cjs/nodeviews/genericCard.js +2 -2
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/cjs/nodeviews/lazy-block-card.js +3 -3
- package/dist/cjs/nodeviews/lazy-embed-card.js +3 -3
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/main.js +1 -4
- package/dist/cjs/pm-plugins/reducers.js +1 -1
- package/dist/cjs/toDOM-fixes/blockCard.js +2 -2
- package/dist/cjs/toDOM-fixes/embedCard.js +2 -2
- package/dist/cjs/toolbar.js +12 -19
- package/dist/cjs/ui/CardContextProvider.js +1 -1
- package/dist/cjs/ui/DatasourceModal/index.js +8 -8
- package/dist/cjs/ui/EditLinkToolbar.js +1 -1
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +1 -1
- package/dist/cjs/ui/HyperlinkToolbarAppearance.js +1 -3
- package/dist/cjs/ui/InlineCardOverlay/index.js +1 -1
- package/dist/cjs/ui/LinkToolbarAppearance.js +3 -4
- package/dist/cjs/ui/Pulse/index.js +1 -1
- package/dist/cjs/ui/ResizableEmbedCard.js +1 -1
- package/dist/cjs/ui/ToolbarViewedEvent.js +1 -1
- package/dist/es2019/nodeviews/blockCard.js +13 -20
- package/dist/es2019/nodeviews/embedCard.js +12 -19
- package/dist/es2019/nodeviews/lazy-block-card.js +2 -2
- package/dist/es2019/nodeviews/lazy-embed-card.js +2 -2
- package/dist/es2019/plugin.js +2 -2
- package/dist/es2019/pm-plugins/main.js +1 -4
- package/dist/es2019/toDOM-fixes/blockCard.js +2 -2
- package/dist/es2019/toDOM-fixes/embedCard.js +2 -2
- package/dist/es2019/toolbar.js +11 -18
- package/dist/es2019/ui/HyperlinkToolbarAppearance.js +0 -2
- package/dist/es2019/ui/LinkToolbarAppearance.js +1 -2
- package/dist/esm/analytics/utils.js +6 -6
- package/dist/esm/datasourceErrorBoundary.js +1 -1
- package/dist/esm/nodeviews/blockCard.js +15 -22
- package/dist/esm/nodeviews/datasource.js +1 -1
- package/dist/esm/nodeviews/embedCard.js +14 -21
- package/dist/esm/nodeviews/genericCard.js +1 -1
- package/dist/esm/nodeviews/lazy-block-card.js +2 -2
- package/dist/esm/nodeviews/lazy-embed-card.js +2 -2
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/main.js +1 -4
- package/dist/esm/pm-plugins/reducers.js +1 -1
- package/dist/esm/toDOM-fixes/blockCard.js +2 -2
- package/dist/esm/toDOM-fixes/embedCard.js +2 -2
- package/dist/esm/toolbar.js +11 -18
- package/dist/esm/ui/CardContextProvider.js +1 -1
- package/dist/esm/ui/DatasourceModal/index.js +7 -7
- package/dist/esm/ui/EditLinkToolbar.js +1 -1
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/index.js +1 -1
- package/dist/esm/ui/HyperlinkToolbarAppearance.js +0 -2
- package/dist/esm/ui/LinkToolbarAppearance.js +2 -3
- package/dist/esm/ui/ResizableEmbedCard.js +1 -1
- package/dist/types/nodeviews/blockCard.d.ts +2 -3
- package/dist/types/nodeviews/embedCard.d.ts +2 -3
- package/dist/types/nodeviews/genericCard.d.ts +1 -3
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/toolbar.d.ts +1 -2
- package/dist/types/types.d.ts +0 -1
- package/dist/types/ui/HyperlinkToolbarAppearance.d.ts +0 -2
- package/dist/types/ui/LinkToolbarAppearance.d.ts +0 -2
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +1 -3
- package/dist/types-ts4.5/plugin.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +1 -2
- package/dist/types-ts4.5/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/HyperlinkToolbarAppearance.d.ts +0 -2
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +0 -2
- package/package.json +4 -6
- package/report.api.md +1 -1
|
@@ -57,9 +57,9 @@ export var getNodeContext = function getNodeContext(doc, pos) {
|
|
|
57
57
|
var $pos = doc.resolve(pos);
|
|
58
58
|
var maxDepth = 3;
|
|
59
59
|
for (var i = 0; i <= maxDepth; i++) {
|
|
60
|
-
var
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
60
|
+
var node = $pos.node($pos.depth - i);
|
|
61
|
+
if (node && node.type.name !== 'paragraph') {
|
|
62
|
+
return node.type.name;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return 'unknown';
|
|
@@ -68,14 +68,14 @@ export var findAtPositions = function findAtPositions(tr, positions) {
|
|
|
68
68
|
var entities = [];
|
|
69
69
|
for (var i = 0; i < positions.length; i++) {
|
|
70
70
|
var pos = positions[i];
|
|
71
|
-
var
|
|
72
|
-
if (!
|
|
71
|
+
var node = tr.doc.nodeAt(pos);
|
|
72
|
+
if (!node) {
|
|
73
73
|
continue;
|
|
74
74
|
}
|
|
75
75
|
var nodeContext = getNodeContext(tr.doc, pos);
|
|
76
76
|
entities.push({
|
|
77
77
|
pos: pos,
|
|
78
|
-
node:
|
|
78
|
+
node: node,
|
|
79
79
|
nodeContext: nodeContext
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(
|
|
8
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
11
11
|
import React from 'react';
|
|
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
@@ -90,7 +90,6 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
90
90
|
var _this$props2 = this.props,
|
|
91
91
|
node = _this$props2.node,
|
|
92
92
|
cardContext = _this$props2.cardContext,
|
|
93
|
-
platform = _this$props2.platform,
|
|
94
93
|
actionOptions = _this$props2.actionOptions,
|
|
95
94
|
showServerActions = _this$props2.showServerActions,
|
|
96
95
|
onClick = _this$props2.onClick;
|
|
@@ -106,7 +105,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
106
105
|
onClick: onClick,
|
|
107
106
|
onResolve: this.onResolve,
|
|
108
107
|
onError: this.onError,
|
|
109
|
-
platform:
|
|
108
|
+
platform: 'web',
|
|
110
109
|
actionOptions: actionOptions,
|
|
111
110
|
showServerActions: showServerActions
|
|
112
111
|
}), this.gapCursorSpan());
|
|
@@ -143,21 +142,19 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
143
142
|
value: function createDomRef() {
|
|
144
143
|
var _this3 = this;
|
|
145
144
|
var domRef = document.createElement('div');
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
domRef.contentEditable = 'true';
|
|
158
|
-
}
|
|
159
|
-
domRef.setAttribute('spellcheck', 'false');
|
|
145
|
+
// workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
|
|
146
|
+
// see also: https://github.com/ProseMirror/prosemirror/issues/884
|
|
147
|
+
if (fg('linking-platform-contenteditable-false-live-view')) {
|
|
148
|
+
var _this$reactComponentP, _this$reactComponentP2;
|
|
149
|
+
this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref2) {
|
|
150
|
+
var nextSharedState = _ref2.nextSharedState;
|
|
151
|
+
return _this3.updateContentEditable(nextSharedState, domRef);
|
|
152
|
+
});
|
|
153
|
+
this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
|
|
154
|
+
} else {
|
|
155
|
+
domRef.contentEditable = 'true';
|
|
160
156
|
}
|
|
157
|
+
domRef.setAttribute('spellcheck', 'false');
|
|
161
158
|
return domRef;
|
|
162
159
|
}
|
|
163
160
|
}, {
|
|
@@ -182,7 +179,6 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
182
179
|
key: "render",
|
|
183
180
|
value: function render() {
|
|
184
181
|
var _this$reactComponentP3 = this.reactComponentProps,
|
|
185
|
-
platform = _this$reactComponentP3.platform,
|
|
186
182
|
actionOptions = _this$reactComponentP3.actionOptions,
|
|
187
183
|
showServerActions = _this$reactComponentP3.showServerActions,
|
|
188
184
|
pluginInjectionApi = _this$reactComponentP3.pluginInjectionApi,
|
|
@@ -191,7 +187,6 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
191
187
|
node: this.node,
|
|
192
188
|
view: this.view,
|
|
193
189
|
getPos: this.getPos,
|
|
194
|
-
platform: platform,
|
|
195
190
|
actionOptions: actionOptions,
|
|
196
191
|
showServerActions: showServerActions,
|
|
197
192
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -209,7 +204,6 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
209
204
|
}(ReactNodeView);
|
|
210
205
|
export var blockCardNodeView = function blockCardNodeView(_ref3) {
|
|
211
206
|
var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
|
|
212
|
-
platform = _ref3.platform,
|
|
213
207
|
actionOptions = _ref3.actionOptions,
|
|
214
208
|
showServerActions = _ref3.showServerActions,
|
|
215
209
|
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
@@ -220,7 +214,6 @@ export var blockCardNodeView = function blockCardNodeView(_ref3) {
|
|
|
220
214
|
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
221
215
|
eventDispatcher = pmPluginFactoryParams.eventDispatcher;
|
|
222
216
|
var reactComponentProps = {
|
|
223
|
-
platform: platform,
|
|
224
217
|
actionOptions: actionOptions,
|
|
225
218
|
showServerActions: showServerActions,
|
|
226
219
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -229,7 +222,7 @@ export var blockCardNodeView = function blockCardNodeView(_ref3) {
|
|
|
229
222
|
var isDatasource = isDatasourceNode(node);
|
|
230
223
|
if (isDatasource) {
|
|
231
224
|
var _node$attrs2;
|
|
232
|
-
if (allowDatasource &&
|
|
225
|
+
if (allowDatasource && canRenderDatasource(node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.datasource) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.id)) {
|
|
233
226
|
var datasourcePosition = typeof getPos === 'function' && getPos();
|
|
234
227
|
var datasourceResolvedPosition = datasourcePosition && view.state.doc.resolve(datasourcePosition);
|
|
235
228
|
var isNodeNested = !!(datasourceResolvedPosition && datasourceResolvedPosition.depth > 0);
|
|
@@ -9,7 +9,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
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; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
function _createSuper(
|
|
12
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
import _extends from "@babel/runtime/helpers/extends";
|
|
10
10
|
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; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
function _createSuper(
|
|
12
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import PropTypes from 'prop-types';
|
|
@@ -153,7 +153,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
153
153
|
})();
|
|
154
154
|
try {
|
|
155
155
|
var cardContext = _this.context.contextAdapter ? _this.context.contextAdapter.card : undefined;
|
|
156
|
-
var hasPreview = cardContext && cardContext.value.extractors.getPreview(url,
|
|
156
|
+
var hasPreview = cardContext && cardContext.value.extractors.getPreview(url, 'web');
|
|
157
157
|
if (!hasPreview) {
|
|
158
158
|
_this.setState({
|
|
159
159
|
hasPreview: false
|
|
@@ -257,7 +257,6 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
257
257
|
var _this$props = this.props,
|
|
258
258
|
node = _this$props.node,
|
|
259
259
|
cardContext = _this$props.cardContext,
|
|
260
|
-
platform = _this$props.platform,
|
|
261
260
|
allowResizing = _this$props.allowResizing,
|
|
262
261
|
fullWidthMode = _this$props.fullWidthMode,
|
|
263
262
|
view = _this$props.view,
|
|
@@ -302,7 +301,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
302
301
|
onError: this.onError,
|
|
303
302
|
frameStyle: "show",
|
|
304
303
|
inheritDimensions: true,
|
|
305
|
-
platform:
|
|
304
|
+
platform: 'web',
|
|
306
305
|
container: this.scrollContainer,
|
|
307
306
|
embedIframeRef: this.embedIframeRef,
|
|
308
307
|
actionOptions: actionOptions,
|
|
@@ -368,20 +367,18 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
368
367
|
value: function createDomRef() {
|
|
369
368
|
var _this3 = this;
|
|
370
369
|
var domRef = document.createElement('div');
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
domRef.contentEditable = 'true';
|
|
382
|
-
}
|
|
383
|
-
domRef.setAttribute('spellcheck', 'false');
|
|
370
|
+
// It is a tradeoff for the bug mentioned that occurs in Chrome: https://product-fabric.atlassian.net/browse/ED-5379, https://github.com/ProseMirror/prosemirror/issues/884
|
|
371
|
+
if (fg('linking-platform-contenteditable-false-live-view')) {
|
|
372
|
+
var _this$reactComponentP, _this$reactComponentP2;
|
|
373
|
+
this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref3) {
|
|
374
|
+
var nextSharedState = _ref3.nextSharedState;
|
|
375
|
+
return _this3.updateContentEditable(nextSharedState, domRef);
|
|
376
|
+
});
|
|
377
|
+
this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
|
|
378
|
+
} else {
|
|
379
|
+
domRef.contentEditable = 'true';
|
|
384
380
|
}
|
|
381
|
+
domRef.setAttribute('spellcheck', 'false');
|
|
385
382
|
return domRef;
|
|
386
383
|
}
|
|
387
384
|
}, {
|
|
@@ -390,7 +387,6 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
390
387
|
var _this$reactComponentP3 = this.reactComponentProps,
|
|
391
388
|
eventDispatcher = _this$reactComponentP3.eventDispatcher,
|
|
392
389
|
allowResizing = _this$reactComponentP3.allowResizing,
|
|
393
|
-
platform = _this$reactComponentP3.platform,
|
|
394
390
|
fullWidthMode = _this$reactComponentP3.fullWidthMode,
|
|
395
391
|
dispatchAnalyticsEvent = _this$reactComponentP3.dispatchAnalyticsEvent,
|
|
396
392
|
pluginInjectionApi = _this$reactComponentP3.pluginInjectionApi,
|
|
@@ -401,7 +397,6 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
401
397
|
eventDispatcher: eventDispatcher,
|
|
402
398
|
getPos: this.getPos,
|
|
403
399
|
allowResizing: allowResizing,
|
|
404
|
-
platform: platform,
|
|
405
400
|
fullWidthMode: fullWidthMode,
|
|
406
401
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
407
402
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -419,7 +414,6 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
419
414
|
}(ReactNodeView);
|
|
420
415
|
export var embedCardNodeView = function embedCardNodeView(_ref4) {
|
|
421
416
|
var allowResizing = _ref4.allowResizing,
|
|
422
|
-
platform = _ref4.platform,
|
|
423
417
|
fullWidthMode = _ref4.fullWidthMode,
|
|
424
418
|
pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
|
|
425
419
|
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
@@ -433,7 +427,6 @@ export var embedCardNodeView = function embedCardNodeView(_ref4) {
|
|
|
433
427
|
var reactComponentProps = {
|
|
434
428
|
eventDispatcher: eventDispatcher,
|
|
435
429
|
allowResizing: allowResizing,
|
|
436
|
-
platform: platform,
|
|
437
430
|
fullWidthMode: fullWidthMode,
|
|
438
431
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
439
432
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React, { useCallback } from 'react';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
-
import {
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { blockCardNodeView } from './blockCard';
|
|
4
4
|
export var lazyBlockCardView = function lazyBlockCardView(props) {
|
|
5
|
-
if (
|
|
5
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
6
|
return blockCardNodeView(props);
|
|
7
7
|
}
|
|
8
8
|
return withLazyLoading({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
-
import {
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { embedCardNodeView } from './embedCard';
|
|
4
4
|
export var lazyEmbedCardView = function lazyEmbedCardView(props) {
|
|
5
|
-
if (
|
|
5
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
6
6
|
return embedCardNodeView(props);
|
|
7
7
|
}
|
|
8
8
|
return withLazyLoading({
|
package/dist/esm/plugin.js
CHANGED
|
@@ -25,7 +25,8 @@ import LayoutButton from './ui/LayoutButton';
|
|
|
25
25
|
import { isDatasourceConfigEditable } from './utils';
|
|
26
26
|
export var cardPlugin = function cardPlugin(_ref) {
|
|
27
27
|
var _options$lpLinkPicker;
|
|
28
|
-
var
|
|
28
|
+
var _ref$config = _ref.config,
|
|
29
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
29
30
|
api = _ref.api;
|
|
30
31
|
var previousCardProvider;
|
|
31
32
|
var cardPluginEvents = createEventsQueue();
|
|
@@ -146,7 +147,7 @@ export var cardPlugin = function cardPlugin(_ref) {
|
|
|
146
147
|
getEndingToolbarItems: getEndingToolbarItems(options, api)
|
|
147
148
|
},
|
|
148
149
|
pluginsOptions: {
|
|
149
|
-
floatingToolbar: floatingToolbar(options, (_options$lpLinkPicker = options.lpLinkPicker) !== null && _options$lpLinkPicker !== void 0 ? _options$lpLinkPicker : false, options.
|
|
150
|
+
floatingToolbar: floatingToolbar(options, (_options$lpLinkPicker = options.lpLinkPicker) !== null && _options$lpLinkPicker !== void 0 ? _options$lpLinkPicker : false, options.linkPicker, api, options.disableFloatingToolbar),
|
|
150
151
|
quickInsert: function quickInsert(_ref5) {
|
|
151
152
|
var formatMessage = _ref5.formatMessage;
|
|
152
153
|
var quickInsertArray = [];
|
|
@@ -51,7 +51,6 @@ var handleAwarenessOverlay = function handleAwarenessOverlay(view) {
|
|
|
51
51
|
export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
52
52
|
return function (pmPluginFactoryParams) {
|
|
53
53
|
var editorAppearance = options.editorAppearance,
|
|
54
|
-
platform = options.platform,
|
|
55
54
|
allowResizing = options.allowResizing,
|
|
56
55
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
57
56
|
fullWidthMode = options.fullWidthMode,
|
|
@@ -63,7 +62,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
63
62
|
allowBlockCards = options.allowBlockCards,
|
|
64
63
|
onClickCallback = options.onClickCallback,
|
|
65
64
|
__livePage = options.__livePage;
|
|
66
|
-
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability
|
|
65
|
+
var enableInlineUpgradeFeatures = !!showUpgradeDiscoverability;
|
|
67
66
|
var inlineCardViewProducer = getInlineNodeViewProducer(_objectSpread({
|
|
68
67
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
69
68
|
Component: InlineCardNodeView,
|
|
@@ -234,7 +233,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
234
233
|
inlineCard: inlineCardViewProducer,
|
|
235
234
|
blockCard: lazyBlockCardView({
|
|
236
235
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
237
|
-
platform: platform,
|
|
238
236
|
actionOptions: actionOptions,
|
|
239
237
|
showServerActions: showServerActions,
|
|
240
238
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -244,7 +242,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
244
242
|
}),
|
|
245
243
|
embedCard: lazyEmbedCardView({
|
|
246
244
|
allowResizing: allowResizing,
|
|
247
|
-
platform: platform,
|
|
248
245
|
fullWidthMode: fullWidthMode,
|
|
249
246
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
250
247
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i :
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
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; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -3,10 +3,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { blockCard } from '@atlaskit/adf-schema';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
|
-
import {
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
// @nodeSpecException:toDOM patch
|
|
8
8
|
export var blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM() {
|
|
9
|
-
if (
|
|
9
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
10
10
|
return blockCard;
|
|
11
11
|
}
|
|
12
12
|
return _objectSpread(_objectSpread({}, blockCard), {}, {
|
|
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
import { embedCard } from '@atlaskit/adf-schema';
|
|
15
15
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
16
16
|
import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
17
|
-
import {
|
|
17
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
18
|
// From `packages/editor/editor-common/src/ui/MediaSingle/styled.tsx`
|
|
19
19
|
function calcMargin(layout) {
|
|
20
20
|
switch (layout) {
|
|
@@ -55,7 +55,7 @@ var LINE_LENGTH = 760;
|
|
|
55
55
|
|
|
56
56
|
// @nodeSpecException:toDOM patch
|
|
57
57
|
export var embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM() {
|
|
58
|
-
if (
|
|
58
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
59
59
|
return embedCard;
|
|
60
60
|
}
|
|
61
61
|
return _objectSpread(_objectSpread({}, embedCard), {}, {
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -90,7 +90,7 @@ export var openLinkSettings = function openLinkSettings(editorAnalyticsApi, user
|
|
|
90
90
|
return true;
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
export var floatingToolbar = function floatingToolbar(cardOptions, lpLinkPicker,
|
|
93
|
+
export var floatingToolbar = function floatingToolbar(cardOptions, lpLinkPicker, linkPickerOptions, pluginInjectionApi, disableFloatingToolbar) {
|
|
94
94
|
return function (state, intl, providerFactory) {
|
|
95
95
|
if (disableFloatingToolbar) {
|
|
96
96
|
return;
|
|
@@ -134,7 +134,7 @@ export var floatingToolbar = function floatingToolbar(cardOptions, lpLinkPicker,
|
|
|
134
134
|
}
|
|
135
135
|
return element;
|
|
136
136
|
},
|
|
137
|
-
items: generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker,
|
|
137
|
+
items: generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker, linkPickerOptions, pluginInjectionApi),
|
|
138
138
|
scrollable: pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar ? false : true
|
|
139
139
|
}, editLinkToolbarConfig(Boolean(pluginState === null || pluginState === void 0 ? void 0 : pluginState.showLinkingToolbar), isLinkPickerEnabled));
|
|
140
140
|
};
|
|
@@ -176,7 +176,7 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
176
176
|
}
|
|
177
177
|
}];
|
|
178
178
|
};
|
|
179
|
-
var generateToolbarItems = function generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker,
|
|
179
|
+
var generateToolbarItems = function generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker, linkPicker, pluginInjectionApi) {
|
|
180
180
|
return function (node) {
|
|
181
181
|
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _node$attrs;
|
|
182
182
|
var _titleUrlPairFromNode2 = titleUrlPairFromNode(node),
|
|
@@ -194,17 +194,13 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
194
194
|
title: title
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
|
-
var pluginState = pluginKey.getState(state);
|
|
198
197
|
var currentAppearance = appearanceForNodeType(node.type);
|
|
199
198
|
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
200
199
|
hoverDecoration = _ref2.hoverDecoration;
|
|
201
200
|
var isDatasource = isDatasourceNode(node);
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/* mobile builds toolbar natively using toolbarItems */
|
|
207
|
-
if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar && platform !== 'mobile') {
|
|
201
|
+
var pluginState = pluginKey.getState(state);
|
|
202
|
+
var shouldRenderDatasourceToolbar = isDatasource && cardOptions.allowDatasource && canRenderDatasource(node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 || (_node$attrs = _node$attrs.datasource) === null || _node$attrs === void 0 ? void 0 : _node$attrs.id);
|
|
203
|
+
if (pluginState !== null && pluginState !== void 0 && pluginState.showLinkingToolbar) {
|
|
208
204
|
return [buildEditLinkToolbar({
|
|
209
205
|
providerFactory: providerFactory,
|
|
210
206
|
linkPicker: linkPicker,
|
|
@@ -213,10 +209,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
213
209
|
lpLinkPicker: lpLinkPicker
|
|
214
210
|
})];
|
|
215
211
|
} else if (shouldRenderDatasourceToolbar) {
|
|
216
|
-
return getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, node.attrs.datasource.id, state, cardOptions, currentAppearance
|
|
212
|
+
return getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, node.attrs.datasource.id, state, cardOptions, currentAppearance);
|
|
217
213
|
} else {
|
|
218
214
|
var inlineCard = state.schema.nodes.inlineCard;
|
|
219
|
-
var isEditDropdownEnabled =
|
|
215
|
+
var isEditDropdownEnabled = cardOptions.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
220
216
|
var editItems = isEditDropdownEnabled ? [{
|
|
221
217
|
type: 'custom',
|
|
222
218
|
fallback: [],
|
|
@@ -307,7 +303,6 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
307
303
|
editorState: state,
|
|
308
304
|
allowEmbeds: allowEmbeds,
|
|
309
305
|
allowBlockCards: allowBlockCards,
|
|
310
|
-
platform: platform,
|
|
311
306
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
312
307
|
showUpgradeDiscoverability: showUpgradeDiscoverability
|
|
313
308
|
});
|
|
@@ -329,7 +324,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
329
324
|
type: 'separator'
|
|
330
325
|
}]));
|
|
331
326
|
}
|
|
332
|
-
var shouldShowDatasourceEditButton =
|
|
327
|
+
var shouldShowDatasourceEditButton = allowDatasource && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
333
328
|
if (shouldShowDatasourceEditButton) {
|
|
334
329
|
toolbarItems.unshift({
|
|
335
330
|
type: 'custom',
|
|
@@ -386,7 +381,7 @@ export var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editor
|
|
|
386
381
|
type: 'separator'
|
|
387
382
|
}];
|
|
388
383
|
};
|
|
389
|
-
var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance
|
|
384
|
+
var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance) {
|
|
390
385
|
var _node$attrs2;
|
|
391
386
|
var toolbarItems = [];
|
|
392
387
|
if (isDatasourceConfigEditable(datasourceId) && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
@@ -430,7 +425,6 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
430
425
|
editorState: state,
|
|
431
426
|
allowEmbeds: allowEmbeds,
|
|
432
427
|
allowBlockCards: allowBlockCards,
|
|
433
|
-
platform: platform,
|
|
434
428
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
435
429
|
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
436
430
|
isDatasourceView: true
|
|
@@ -516,7 +510,7 @@ export var shouldRenderToolbarPulse = function shouldRenderToolbarPulse(embedEna
|
|
|
516
510
|
};
|
|
517
511
|
export var getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
518
512
|
return function (intl, link, onEditLink, metadata) {
|
|
519
|
-
var isEditDropdownEnabled = options.
|
|
513
|
+
var isEditDropdownEnabled = options.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
520
514
|
var editLinkItem = isEditDropdownEnabled ? [{
|
|
521
515
|
type: 'custom',
|
|
522
516
|
fallback: [],
|
|
@@ -572,7 +566,6 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
572
566
|
editorView: editorView,
|
|
573
567
|
editorState: editorView.state,
|
|
574
568
|
cardOptions: options,
|
|
575
|
-
platform: options === null || options === void 0 ? void 0 : options.platform,
|
|
576
569
|
editorAnalyticsApi: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
577
570
|
editorPluginApi: api
|
|
578
571
|
});
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
function _createSuper(
|
|
7
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function _createForOfIteratorHelper(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
6
|
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; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import React, { useCallback } from 'react';
|
|
@@ -114,15 +114,15 @@ var resolveColumnsConfig = function resolveColumnsConfig(views) {
|
|
|
114
114
|
try {
|
|
115
115
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
116
116
|
var _step$value = _step.value,
|
|
117
|
-
|
|
117
|
+
key = _step$value.key,
|
|
118
118
|
width = _step$value.width,
|
|
119
119
|
isWrapped = _step$value.isWrapped;
|
|
120
|
-
visibleColumnKeys.push(
|
|
120
|
+
visibleColumnKeys.push(key);
|
|
121
121
|
if (width) {
|
|
122
|
-
columnCustomSizes[
|
|
122
|
+
columnCustomSizes[key] = width;
|
|
123
123
|
}
|
|
124
124
|
if (isWrapped) {
|
|
125
|
-
wrappedColumnKeys.push(
|
|
125
|
+
wrappedColumnKeys.push(key);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
} catch (err) {
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
function _createSuper(
|
|
6
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { ACTION, buildEditLinkPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
function _createSuper(
|
|
7
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
@@ -21,7 +21,6 @@ export function HyperlinkToolbarAppearance(props) {
|
|
|
21
21
|
editorView = props.editorView,
|
|
22
22
|
editorState = props.editorState,
|
|
23
23
|
cardOptions = props.cardOptions,
|
|
24
|
-
platform = props.platform,
|
|
25
24
|
editorAnalyticsApi = props.editorAnalyticsApi;
|
|
26
25
|
var getProvider = /*#__PURE__*/function () {
|
|
27
26
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -141,7 +140,6 @@ export function HyperlinkToolbarAppearance(props) {
|
|
|
141
140
|
editorState: editorState,
|
|
142
141
|
allowEmbeds: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowEmbeds,
|
|
143
142
|
allowBlockCards: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards,
|
|
144
|
-
platform: platform,
|
|
145
143
|
editorAnalyticsApi: editorAnalyticsApi
|
|
146
144
|
}), (cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowDatasource) && /*#__PURE__*/React.createElement(DatasourceAppearanceButton, {
|
|
147
145
|
intl: intl,
|