@atlaskit/editor-plugin-card 11.4.0 → 11.4.2
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/nodeviews/blockCard.js +23 -72
- package/dist/cjs/nodeviews/embedCard.js +21 -65
- package/dist/cjs/nodeviews/inlineCard.js +7 -51
- package/dist/cjs/pm-plugins/keymap.js +3 -2
- package/dist/es2019/nodeviews/blockCard.js +5 -28
- package/dist/es2019/nodeviews/embedCard.js +2 -23
- package/dist/es2019/nodeviews/inlineCard.js +4 -25
- package/dist/es2019/pm-plugins/keymap.js +3 -2
- package/dist/esm/nodeviews/blockCard.js +24 -72
- package/dist/esm/nodeviews/embedCard.js +21 -65
- package/dist/esm/nodeviews/inlineCard.js +8 -52
- package/dist/esm/pm-plugins/keymap.js +3 -2
- package/dist/types/nodeviews/blockCard.d.ts +1 -7
- package/dist/types/nodeviews/embedCard.d.ts +0 -2
- package/dist/types-ts4.5/nodeviews/blockCard.d.ts +1 -7
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +0 -2
- package/package.json +6 -6
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { memo, useCallback, useEffect, useMemo, useRef
|
|
2
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import rafSchedule from 'raf-schd';
|
|
4
4
|
import uuid from 'uuid/v4';
|
|
5
|
-
import { EditorCardProvider } from '@atlaskit/editor-card-provider';
|
|
6
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
8
7
|
import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
@@ -50,22 +49,6 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
50
49
|
view.dispatch(tr);
|
|
51
50
|
};
|
|
52
51
|
}, [getPos, view]);
|
|
53
|
-
const [isSSRDataAvailable, setIsSSRDataAvailable] = useState(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (!provider) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const updateSSRDataAvailability = async () => {
|
|
62
|
-
const resolvedProvider = await provider;
|
|
63
|
-
if (resolvedProvider instanceof EditorCardProvider) {
|
|
64
|
-
setIsSSRDataAvailable(resolvedProvider.getCacheStatusForNode(node) === 'ssr');
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
void updateSSRDataAvailability();
|
|
68
|
-
}, [provider, node]);
|
|
69
52
|
const scrollContainer = useMemo(
|
|
70
53
|
// Ignored via go/ees005
|
|
71
54
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -124,10 +107,7 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
124
107
|
}, [propsOnClick, url, view, pluginInjectionApi]);
|
|
125
108
|
const onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
|
|
126
109
|
const card = useMemo(() => {
|
|
127
|
-
if (
|
|
128
|
-
// The `isSSRDataAvailable` check is only required when the OTP experiment is on,
|
|
129
|
-
// because inline smart card SSR is already implemented without OTP.
|
|
130
|
-
(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ? isSSRDataAvailable : true) && isPageSSRed && url) {
|
|
110
|
+
if (isPageSSRed && url) {
|
|
131
111
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
132
112
|
key: url,
|
|
133
113
|
url: url,
|
|
@@ -143,9 +123,8 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
143
123
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
144
124
|
disablePreviewPanel: disablePreviewPanel
|
|
145
125
|
// Durin `platform_editor_smart_card_otp` cleaning up, replace this with `true`.
|
|
146
|
-
// Ths `isSSRDataAvailable` should be checked in the `if` condition above.
|
|
147
126
|
,
|
|
148
|
-
hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
|
|
127
|
+
hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
|
|
149
128
|
});
|
|
150
129
|
}
|
|
151
130
|
return /*#__PURE__*/React.createElement(SmartCard, {
|
|
@@ -163,7 +142,7 @@ export const InlineCard = /*#__PURE__*/memo(({
|
|
|
163
142
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
164
143
|
disablePreviewPanel: disablePreviewPanel
|
|
165
144
|
});
|
|
166
|
-
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel
|
|
145
|
+
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel]);
|
|
167
146
|
|
|
168
147
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
169
148
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { bindKeymapWithCommand, moveDown, moveUp } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findChildren, flatten } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
const lookupPixel = 10;
|
|
7
8
|
const getClosestInlineCardPos = (state, editorView, direction) => {
|
|
8
9
|
var _editorView$posAtCoor;
|
|
@@ -49,7 +50,7 @@ const selectAboveBelowInlineCard = direction => {
|
|
|
49
50
|
};
|
|
50
51
|
export function cardKeymap(featureFlags) {
|
|
51
52
|
const list = {};
|
|
52
|
-
|
|
53
|
+
const browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
53
54
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1227468 introduced since Chrome 91
|
|
54
55
|
if (browser.chrome && browser.chrome_version > 90) {
|
|
55
56
|
// Ignored via go/ees005
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _get from "@babel/runtime/helpers/get";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -7,18 +6,15 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
8
|
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
9
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
11
|
import React from 'react';
|
|
16
12
|
import rafSchedule from 'raf-schd';
|
|
17
13
|
import uuid from 'uuid/v4';
|
|
18
|
-
import {
|
|
14
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
19
15
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
20
16
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
21
|
-
import {
|
|
17
|
+
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
22
18
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
23
19
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
24
20
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -26,6 +22,7 @@ import { Datasource } from '../nodeviews/datasource';
|
|
|
26
22
|
import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
|
|
27
23
|
import { isDatasourceNode } from '../pm-plugins/utils';
|
|
28
24
|
import { Card } from './genericCard';
|
|
25
|
+
|
|
29
26
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
27
|
export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
31
28
|
function BlockCardComponent(props) {
|
|
@@ -34,9 +31,6 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
34
31
|
_this = _callSuper(this, BlockCardComponent, [props]);
|
|
35
32
|
// Ignored via go/ees005
|
|
36
33
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
37
|
-
_defineProperty(_this, "state", {
|
|
38
|
-
isSSRDataAvailable: false
|
|
39
|
-
});
|
|
40
34
|
_defineProperty(_this, "onResolve", function (data) {
|
|
41
35
|
var _this$props = _this.props,
|
|
42
36
|
getPos = _this$props.getPos,
|
|
@@ -64,6 +58,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
58
|
});
|
|
65
59
|
_defineProperty(_this, "removeCardDispatched", false);
|
|
66
60
|
_defineProperty(_this, "gapCursorSpan", function () {
|
|
61
|
+
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
67
62
|
// Don't render in EdgeHTMl version <= 18 (Edge version 44)
|
|
68
63
|
// as it forces the edit popup to render 24px lower than it should
|
|
69
64
|
if (browser.ie && browser.ie_version < 79) {
|
|
@@ -83,53 +78,10 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
78
|
}
|
|
84
79
|
});
|
|
85
80
|
_this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
86
|
-
_this.state = {
|
|
87
|
-
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
88
|
-
};
|
|
89
81
|
return _this;
|
|
90
82
|
}
|
|
91
83
|
_inherits(BlockCardComponent, _React$PureComponent);
|
|
92
84
|
return _createClass(BlockCardComponent, [{
|
|
93
|
-
key: "componentDidMount",
|
|
94
|
-
value: function componentDidMount() {
|
|
95
|
-
var _this2 = this;
|
|
96
|
-
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
var provider = this.props.provider;
|
|
100
|
-
if (!provider) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
var updateSSRDataAvailability = /*#__PURE__*/function () {
|
|
104
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
105
|
-
var resolvedProvider;
|
|
106
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
107
|
-
while (1) switch (_context.prev = _context.next) {
|
|
108
|
-
case 0:
|
|
109
|
-
_context.next = 2;
|
|
110
|
-
return provider;
|
|
111
|
-
case 2:
|
|
112
|
-
resolvedProvider = _context.sent;
|
|
113
|
-
if (resolvedProvider instanceof EditorCardProvider) {
|
|
114
|
-
_this2.setState(function (state) {
|
|
115
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
116
|
-
isSSRDataAvailable: resolvedProvider.getCacheStatusForNode(_this2.props.node) === 'ssr'
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
case 4:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context.stop();
|
|
123
|
-
}
|
|
124
|
-
}, _callee);
|
|
125
|
-
}));
|
|
126
|
-
return function updateSSRDataAvailability() {
|
|
127
|
-
return _ref2.apply(this, arguments);
|
|
128
|
-
};
|
|
129
|
-
}();
|
|
130
|
-
void updateSSRDataAvailability();
|
|
131
|
-
}
|
|
132
|
-
}, {
|
|
133
85
|
key: "componentWillUnmount",
|
|
134
86
|
value: function componentWillUnmount() {
|
|
135
87
|
this.removeCard();
|
|
@@ -160,7 +112,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
160
112
|
var _node$attrs = node.attrs,
|
|
161
113
|
url = _node$attrs.url,
|
|
162
114
|
data = _node$attrs.data;
|
|
163
|
-
var cardInner = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) &&
|
|
115
|
+
var cardInner = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardSSR, {
|
|
164
116
|
key: url,
|
|
165
117
|
url: url !== null && url !== void 0 ? url : data.url,
|
|
166
118
|
container: this.scrollContainer,
|
|
@@ -195,31 +147,31 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
195
147
|
var WrappedBlockCard = Card(BlockCardComponent, UnsupportedBlock);
|
|
196
148
|
export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
197
149
|
function BlockCard() {
|
|
198
|
-
var
|
|
150
|
+
var _this2;
|
|
199
151
|
_classCallCheck(this, BlockCard);
|
|
200
152
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
201
153
|
args[_key] = arguments[_key];
|
|
202
154
|
}
|
|
203
|
-
|
|
204
|
-
_defineProperty(
|
|
205
|
-
_defineProperty(
|
|
155
|
+
_this2 = _callSuper(this, BlockCard, [].concat(args));
|
|
156
|
+
_defineProperty(_this2, "id", uuid());
|
|
157
|
+
_defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
|
|
206
158
|
divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
|
|
207
159
|
});
|
|
208
|
-
return
|
|
160
|
+
return _this2;
|
|
209
161
|
}
|
|
210
162
|
_inherits(BlockCard, _ReactNodeView);
|
|
211
163
|
return _createClass(BlockCard, [{
|
|
212
164
|
key: "createDomRef",
|
|
213
165
|
value: function createDomRef() {
|
|
214
166
|
var _this$reactComponentP,
|
|
215
|
-
|
|
167
|
+
_this3 = this,
|
|
216
168
|
_this$reactComponentP2;
|
|
217
169
|
var domRef = document.createElement('div');
|
|
218
170
|
// workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
|
|
219
171
|
// see also: https://github.com/ProseMirror/prosemirror/issues/884
|
|
220
|
-
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 (
|
|
221
|
-
var nextSharedState =
|
|
222
|
-
return
|
|
172
|
+
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) {
|
|
173
|
+
var nextSharedState = _ref2.nextSharedState;
|
|
174
|
+
return _this3.updateContentEditable(nextSharedState, domRef);
|
|
223
175
|
});
|
|
224
176
|
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);
|
|
225
177
|
domRef.setAttribute('spellcheck', 'false');
|
|
@@ -275,16 +227,16 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
275
227
|
}
|
|
276
228
|
}]);
|
|
277
229
|
}(ReactNodeView);
|
|
278
|
-
export var blockCardNodeView = function blockCardNodeView(
|
|
279
|
-
var pmPluginFactoryParams =
|
|
280
|
-
actionOptions =
|
|
281
|
-
pluginInjectionApi =
|
|
282
|
-
onClickCallback =
|
|
283
|
-
allowDatasource =
|
|
284
|
-
inlineCardViewProducer =
|
|
285
|
-
CompetitorPrompt =
|
|
286
|
-
isPageSSRed =
|
|
287
|
-
provider =
|
|
230
|
+
export var blockCardNodeView = function blockCardNodeView(_ref3) {
|
|
231
|
+
var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
|
|
232
|
+
actionOptions = _ref3.actionOptions,
|
|
233
|
+
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
234
|
+
onClickCallback = _ref3.onClickCallback,
|
|
235
|
+
allowDatasource = _ref3.allowDatasource,
|
|
236
|
+
inlineCardViewProducer = _ref3.inlineCardViewProducer,
|
|
237
|
+
CompetitorPrompt = _ref3.CompetitorPrompt,
|
|
238
|
+
isPageSSRed = _ref3.isPageSSRed,
|
|
239
|
+
provider = _ref3.provider;
|
|
288
240
|
return function (node, view, getPos, decorations) {
|
|
289
241
|
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
290
242
|
eventDispatcher = pmPluginFactoryParams.eventDispatcher;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _get from "@babel/runtime/helpers/get";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -8,7 +7,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
10
9
|
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
11
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
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; }
|
|
13
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; }
|
|
14
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -17,7 +15,6 @@ import React from 'react';
|
|
|
17
15
|
import rafSchedule from 'raf-schd';
|
|
18
16
|
import uuid from 'uuid/v4';
|
|
19
17
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
20
|
-
import { EditorCardProvider } from '@atlaskit/editor-card-provider';
|
|
21
18
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
22
19
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
23
20
|
import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
@@ -261,53 +258,12 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
261
258
|
_defineProperty(_this, "removeCardDispatched", false);
|
|
262
259
|
_this.scrollContainer = findOverflowScrollParent(props.view.dom) || undefined;
|
|
263
260
|
_this.state = {
|
|
264
|
-
hasPreview: true
|
|
265
|
-
isSSRDataAvailable: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && props.isPageSSRed
|
|
261
|
+
hasPreview: true
|
|
266
262
|
};
|
|
267
263
|
return _this;
|
|
268
264
|
}
|
|
269
265
|
_inherits(EmbedCardComponent, _React$PureComponent);
|
|
270
266
|
return _createClass(EmbedCardComponent, [{
|
|
271
|
-
key: "componentDidMount",
|
|
272
|
-
value: function componentDidMount() {
|
|
273
|
-
var _this2 = this;
|
|
274
|
-
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
var provider = this.props.provider;
|
|
278
|
-
if (!provider) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
var updateSSRDataAvailability = /*#__PURE__*/function () {
|
|
282
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
283
|
-
var resolvedProvider;
|
|
284
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
285
|
-
while (1) switch (_context.prev = _context.next) {
|
|
286
|
-
case 0:
|
|
287
|
-
_context.next = 2;
|
|
288
|
-
return provider;
|
|
289
|
-
case 2:
|
|
290
|
-
resolvedProvider = _context.sent;
|
|
291
|
-
if (resolvedProvider instanceof EditorCardProvider) {
|
|
292
|
-
_this2.setState(function (state) {
|
|
293
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
294
|
-
isSSRDataAvailable: resolvedProvider.getCacheStatusForNode(_this2.props.node) === 'ssr'
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
case 4:
|
|
299
|
-
case "end":
|
|
300
|
-
return _context.stop();
|
|
301
|
-
}
|
|
302
|
-
}, _callee);
|
|
303
|
-
}));
|
|
304
|
-
return function updateSSRDataAvailability() {
|
|
305
|
-
return _ref3.apply(this, arguments);
|
|
306
|
-
};
|
|
307
|
-
}();
|
|
308
|
-
void updateSSRDataAvailability();
|
|
309
|
-
}
|
|
310
|
-
}, {
|
|
311
267
|
key: "componentWillUnmount",
|
|
312
268
|
value: function componentWillUnmount() {
|
|
313
269
|
this.removeCard();
|
|
@@ -366,7 +322,7 @@ export var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
366
322
|
pctWidth: pctWidth,
|
|
367
323
|
fullWidthMode: fullWidthMode
|
|
368
324
|
};
|
|
369
|
-
var smartCard = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) &&
|
|
325
|
+
var smartCard = expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed ? /*#__PURE__*/React.createElement(CardSSR, {
|
|
370
326
|
key: url,
|
|
371
327
|
url: url,
|
|
372
328
|
appearance: "embed",
|
|
@@ -471,17 +427,17 @@ var WrappedEmbedCardWithCondition = componentWithCondition(function () {
|
|
|
471
427
|
var WrappedEmbedCard = Card(WrappedEmbedCardWithCondition, UnsupportedBlock);
|
|
472
428
|
export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
473
429
|
function EmbedCard() {
|
|
474
|
-
var
|
|
430
|
+
var _this2;
|
|
475
431
|
_classCallCheck(this, EmbedCard);
|
|
476
432
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
477
433
|
args[_key] = arguments[_key];
|
|
478
434
|
}
|
|
479
|
-
|
|
480
|
-
_defineProperty(
|
|
481
|
-
_defineProperty(
|
|
435
|
+
_this2 = _callSuper(this, EmbedCard, [].concat(args));
|
|
436
|
+
_defineProperty(_this2, "id", uuid());
|
|
437
|
+
_defineProperty(_this2, "updateContentEditable", function (editorViewModeState, divElement) {
|
|
482
438
|
divElement.contentEditable = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view' ? 'false' : 'true';
|
|
483
439
|
});
|
|
484
|
-
return
|
|
440
|
+
return _this2;
|
|
485
441
|
}
|
|
486
442
|
_inherits(EmbedCard, _ReactNodeView);
|
|
487
443
|
return _createClass(EmbedCard, [{
|
|
@@ -496,13 +452,13 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
496
452
|
key: "createDomRef",
|
|
497
453
|
value: function createDomRef() {
|
|
498
454
|
var _this$reactComponentP,
|
|
499
|
-
|
|
455
|
+
_this3 = this,
|
|
500
456
|
_this$reactComponentP2;
|
|
501
457
|
var domRef = document.createElement('div');
|
|
502
458
|
// 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
|
|
503
|
-
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 (
|
|
504
|
-
var nextSharedState =
|
|
505
|
-
return
|
|
459
|
+
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) {
|
|
460
|
+
var nextSharedState = _ref3.nextSharedState;
|
|
461
|
+
return _this3.updateContentEditable(nextSharedState, domRef);
|
|
506
462
|
});
|
|
507
463
|
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);
|
|
508
464
|
domRef.setAttribute('spellcheck', 'false');
|
|
@@ -546,16 +502,16 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
546
502
|
}
|
|
547
503
|
}]);
|
|
548
504
|
}(ReactNodeView);
|
|
549
|
-
export var embedCardNodeView = function embedCardNodeView(
|
|
550
|
-
var allowResizing =
|
|
551
|
-
fullWidthMode =
|
|
552
|
-
pmPluginFactoryParams =
|
|
553
|
-
pluginInjectionApi =
|
|
554
|
-
actionOptions =
|
|
555
|
-
onClickCallback =
|
|
556
|
-
CompetitorPrompt =
|
|
557
|
-
isPageSSRed =
|
|
558
|
-
provider =
|
|
505
|
+
export var embedCardNodeView = function embedCardNodeView(_ref4) {
|
|
506
|
+
var allowResizing = _ref4.allowResizing,
|
|
507
|
+
fullWidthMode = _ref4.fullWidthMode,
|
|
508
|
+
pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
|
|
509
|
+
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
510
|
+
actionOptions = _ref4.actionOptions,
|
|
511
|
+
onClickCallback = _ref4.onClickCallback,
|
|
512
|
+
CompetitorPrompt = _ref4.CompetitorPrompt,
|
|
513
|
+
isPageSSRed = _ref4.isPageSSRed,
|
|
514
|
+
provider = _ref4.provider;
|
|
559
515
|
return function (node, view, getPos) {
|
|
560
516
|
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
561
517
|
eventDispatcher = pmPluginFactoryParams.eventDispatcher,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
3
|
import rafSchedule from 'raf-schd';
|
|
7
4
|
import uuid from 'uuid/v4';
|
|
8
|
-
import { EditorCardProvider } from '@atlaskit/editor-card-provider';
|
|
9
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
7
|
import { UnsupportedInline, findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
@@ -49,42 +45,6 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
49
45
|
view.dispatch(tr);
|
|
50
46
|
};
|
|
51
47
|
}, [getPos, view]);
|
|
52
|
-
var _useState = useState(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) && isPageSSRed),
|
|
53
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
54
|
-
isSSRDataAvailable = _useState2[0],
|
|
55
|
-
setIsSSRDataAvailable = _useState2[1];
|
|
56
|
-
useEffect(function () {
|
|
57
|
-
if (!expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!provider) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
var updateSSRDataAvailability = /*#__PURE__*/function () {
|
|
64
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
65
|
-
var resolvedProvider;
|
|
66
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
67
|
-
while (1) switch (_context.prev = _context.next) {
|
|
68
|
-
case 0:
|
|
69
|
-
_context.next = 2;
|
|
70
|
-
return provider;
|
|
71
|
-
case 2:
|
|
72
|
-
resolvedProvider = _context.sent;
|
|
73
|
-
if (resolvedProvider instanceof EditorCardProvider) {
|
|
74
|
-
setIsSSRDataAvailable(resolvedProvider.getCacheStatusForNode(node) === 'ssr');
|
|
75
|
-
}
|
|
76
|
-
case 4:
|
|
77
|
-
case "end":
|
|
78
|
-
return _context.stop();
|
|
79
|
-
}
|
|
80
|
-
}, _callee);
|
|
81
|
-
}));
|
|
82
|
-
return function updateSSRDataAvailability() {
|
|
83
|
-
return _ref2.apply(this, arguments);
|
|
84
|
-
};
|
|
85
|
-
}();
|
|
86
|
-
void updateSSRDataAvailability();
|
|
87
|
-
}, [provider, node]);
|
|
88
48
|
var scrollContainer = useMemo(
|
|
89
49
|
// Ignored via go/ees005
|
|
90
50
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -129,8 +89,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
129
89
|
var handleOnClick = useCallback(function (event) {
|
|
130
90
|
if (event.metaKey || event.ctrlKey) {
|
|
131
91
|
var _pluginInjectionApi$a;
|
|
132
|
-
var
|
|
133
|
-
editorAnalyticsApi =
|
|
92
|
+
var _ref2 = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
93
|
+
editorAnalyticsApi = _ref2.actions;
|
|
134
94
|
visitCardLinkAnalytics(editorAnalyticsApi, INPUT_METHOD.META_CLICK)(view.state, view.dispatch);
|
|
135
95
|
window.open(url, '_blank');
|
|
136
96
|
} else {
|
|
@@ -140,10 +100,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
140
100
|
}, [propsOnClick, url, view, pluginInjectionApi]);
|
|
141
101
|
var onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
|
|
142
102
|
var card = useMemo(function () {
|
|
143
|
-
if (
|
|
144
|
-
// The `isSSRDataAvailable` check is only required when the OTP experiment is on,
|
|
145
|
-
// because inline smart card SSR is already implemented without OTP.
|
|
146
|
-
(expValEquals('platform_editor_smart_card_otp', 'isEnabled', true) ? isSSRDataAvailable : true) && isPageSSRed && url) {
|
|
103
|
+
if (isPageSSRed && url) {
|
|
147
104
|
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
148
105
|
key: url,
|
|
149
106
|
url: url,
|
|
@@ -159,9 +116,8 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
159
116
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
160
117
|
disablePreviewPanel: disablePreviewPanel
|
|
161
118
|
// Durin `platform_editor_smart_card_otp` cleaning up, replace this with `true`.
|
|
162
|
-
// Ths `isSSRDataAvailable` should be checked in the `if` condition above.
|
|
163
119
|
,
|
|
164
|
-
hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
|
|
120
|
+
hideIconLoadingSkeleton: expValEquals('platform_editor_smart_card_otp', 'isEnabled', true)
|
|
165
121
|
});
|
|
166
122
|
}
|
|
167
123
|
return /*#__PURE__*/React.createElement(SmartCard, {
|
|
@@ -179,7 +135,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
179
135
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
180
136
|
disablePreviewPanel: disablePreviewPanel
|
|
181
137
|
});
|
|
182
|
-
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel
|
|
138
|
+
}, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel]);
|
|
183
139
|
|
|
184
140
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
185
141
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -236,8 +192,8 @@ export function InlineCardNodeView(props) {
|
|
|
236
192
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
237
193
|
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, mode === 'view'))), fg('prompt_whiteboard_competitor_link_gate') && CompetitorPromptComponent);
|
|
238
194
|
}
|
|
239
|
-
export var inlineCardNodeView = function inlineCardNodeView(
|
|
240
|
-
var inlineCardViewProducer =
|
|
195
|
+
export var inlineCardNodeView = function inlineCardNodeView(_ref3) {
|
|
196
|
+
var inlineCardViewProducer = _ref3.inlineCardViewProducer;
|
|
241
197
|
return function (node, view, getPos, decorations) {
|
|
242
198
|
return inlineCardViewProducer(node, view, getPos, decorations);
|
|
243
199
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
1
|
+
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { bindKeymapWithCommand, moveDown, moveUp } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findChildren, flatten } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
var lookupPixel = 10;
|
|
7
8
|
var getClosestInlineCardPos = function getClosestInlineCardPos(state, editorView, direction) {
|
|
8
9
|
var _editorView$posAtCoor;
|
|
@@ -48,7 +49,7 @@ var selectAboveBelowInlineCard = function selectAboveBelowInlineCard(direction)
|
|
|
48
49
|
};
|
|
49
50
|
export function cardKeymap(featureFlags) {
|
|
50
51
|
var list = {};
|
|
51
|
-
|
|
52
|
+
var browser = expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) ? getBrowserInfo() : browserLegacy;
|
|
52
53
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1227468 introduced since Chrome 91
|
|
53
54
|
if (browser.chrome && browser.chrome_version > 90) {
|
|
54
55
|
// Ignored via go/ees005
|
|
@@ -5,14 +5,10 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { Datasource } from '../nodeviews/datasource';
|
|
7
7
|
import type { SmartCardProps } from './genericCard';
|
|
8
|
-
interface State {
|
|
9
|
-
isSSRDataAvailable?: boolean;
|
|
10
|
-
}
|
|
11
8
|
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps & {
|
|
12
9
|
id?: string;
|
|
13
|
-
},
|
|
10
|
+
}, unknown> {
|
|
14
11
|
private scrollContainer?;
|
|
15
|
-
state: State;
|
|
16
12
|
constructor(props: SmartCardProps & {
|
|
17
13
|
id?: string;
|
|
18
14
|
});
|
|
@@ -20,7 +16,6 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
20
16
|
title?: string;
|
|
21
17
|
url?: string;
|
|
22
18
|
}) => void;
|
|
23
|
-
componentDidMount(): void;
|
|
24
19
|
componentWillUnmount(): void;
|
|
25
20
|
private removeCardDispatched;
|
|
26
21
|
private removeCard;
|
|
@@ -56,4 +51,3 @@ export interface BlockCardNodeViewProperties {
|
|
|
56
51
|
provider: BlockCardNodeViewProps['provider'];
|
|
57
52
|
}
|
|
58
53
|
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView | Datasource | BlockCard;
|
|
59
|
-
export {};
|
|
@@ -9,7 +9,6 @@ import type { SmartCardProps } from './genericCard';
|
|
|
9
9
|
export type EmbedCardState = {
|
|
10
10
|
hasPreview: boolean;
|
|
11
11
|
initialAspectRatio?: number;
|
|
12
|
-
isSSRDataAvailable?: boolean;
|
|
13
12
|
liveHeight?: number;
|
|
14
13
|
};
|
|
15
14
|
export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps & {
|
|
@@ -39,7 +38,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
39
38
|
onError: ({ err }: {
|
|
40
39
|
err?: Error;
|
|
41
40
|
}) => void;
|
|
42
|
-
componentDidMount(): void;
|
|
43
41
|
componentWillUnmount(): void;
|
|
44
42
|
private removeCardDispatched;
|
|
45
43
|
private removeCard;
|
|
@@ -5,14 +5,10 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { Datasource } from '../nodeviews/datasource';
|
|
7
7
|
import type { SmartCardProps } from './genericCard';
|
|
8
|
-
interface State {
|
|
9
|
-
isSSRDataAvailable?: boolean;
|
|
10
|
-
}
|
|
11
8
|
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps & {
|
|
12
9
|
id?: string;
|
|
13
|
-
},
|
|
10
|
+
}, unknown> {
|
|
14
11
|
private scrollContainer?;
|
|
15
|
-
state: State;
|
|
16
12
|
constructor(props: SmartCardProps & {
|
|
17
13
|
id?: string;
|
|
18
14
|
});
|
|
@@ -20,7 +16,6 @@ export declare class BlockCardComponent extends React.PureComponent<SmartCardPro
|
|
|
20
16
|
title?: string;
|
|
21
17
|
url?: string;
|
|
22
18
|
}) => void;
|
|
23
|
-
componentDidMount(): void;
|
|
24
19
|
componentWillUnmount(): void;
|
|
25
20
|
private removeCardDispatched;
|
|
26
21
|
private removeCard;
|
|
@@ -56,4 +51,3 @@ export interface BlockCardNodeViewProperties {
|
|
|
56
51
|
provider: BlockCardNodeViewProps['provider'];
|
|
57
52
|
}
|
|
58
53
|
export declare const blockCardNodeView: ({ pmPluginFactoryParams, actionOptions, pluginInjectionApi, onClickCallback, allowDatasource, inlineCardViewProducer, CompetitorPrompt, isPageSSRed, provider, }: BlockCardNodeViewProperties) => (node: Node, view: EditorView, getPos: () => number | undefined, decorations: readonly Decoration[]) => import("prosemirror-view").NodeView | Datasource | BlockCard;
|
|
59
|
-
export {};
|
|
@@ -9,7 +9,6 @@ import type { SmartCardProps } from './genericCard';
|
|
|
9
9
|
export type EmbedCardState = {
|
|
10
10
|
hasPreview: boolean;
|
|
11
11
|
initialAspectRatio?: number;
|
|
12
|
-
isSSRDataAvailable?: boolean;
|
|
13
12
|
liveHeight?: number;
|
|
14
13
|
};
|
|
15
14
|
export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps & {
|
|
@@ -39,7 +38,6 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
|
|
|
39
38
|
onError: ({ err }: {
|
|
40
39
|
err?: Error;
|
|
41
40
|
}) => void;
|
|
42
|
-
componentDidMount(): void;
|
|
43
41
|
componentWillUnmount(): void;
|
|
44
42
|
private removeCardDispatched;
|
|
45
43
|
private removeCard;
|