@atlaskit/editor-plugin-card 17.2.1 → 17.3.1
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 +19 -0
- package/dist/cjs/nodeviews/blockCard.js +3 -3
- package/dist/cjs/nodeviews/embedCard.js +3 -3
- package/dist/cjs/pm-plugins/main.js +9 -10
- package/dist/cjs/ui/SmartCardSSRReactContextsProvider.js +1 -2
- package/dist/es2019/nodeviews/blockCard.js +3 -3
- package/dist/es2019/nodeviews/embedCard.js +3 -3
- package/dist/es2019/pm-plugins/main.js +10 -11
- package/dist/es2019/ui/SmartCardSSRReactContextsProvider.js +2 -3
- package/dist/esm/nodeviews/blockCard.js +3 -3
- package/dist/esm/nodeviews/embedCard.js +3 -3
- package/dist/esm/pm-plugins/main.js +10 -11
- package/dist/esm/ui/SmartCardSSRReactContextsProvider.js +2 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 17.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 17.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`6e3b4e2317b34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e3b4e2317b34) -
|
|
14
|
+
[EDITOR-7476](https://hello.jira.atlassian.cloud/browse/EDITOR-7476) - centralize SSR streaming
|
|
15
|
+
checks behind `isSSRStreaming()` so SSR eligibility is checked before emitting exposure for the
|
|
16
|
+
`platform_editor_editor_ssr_streaming` experiment.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 17.2.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
17
17
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
18
18
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
19
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
19
20
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
20
21
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
21
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -23,7 +24,6 @@ var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable")
|
|
|
23
24
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
25
|
var _smartCard = require("@atlaskit/smart-card");
|
|
25
26
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
26
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
27
27
|
var _datasource = require("../nodeviews/datasource");
|
|
28
28
|
var _actions = require("../pm-plugins/actions");
|
|
29
29
|
var _utils2 = require("../pm-plugins/utils");
|
|
@@ -285,8 +285,8 @@ var blockCardNodeView = exports.blockCardNodeView = function blockCardNodeView(_
|
|
|
285
285
|
CompetitorPrompt: CompetitorPrompt,
|
|
286
286
|
isPageSSRed: isPageSSRed,
|
|
287
287
|
provider: provider,
|
|
288
|
-
intl: (0,
|
|
289
|
-
smartCardContext: (0,
|
|
288
|
+
intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
|
|
289
|
+
smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
|
|
290
290
|
};
|
|
291
291
|
var isDatasource = (0, _utils2.isDatasourceNode)(node);
|
|
292
292
|
if (isDatasource) {
|
|
@@ -18,6 +18,7 @@ var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
|
18
18
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
19
19
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
20
20
|
var _urlCheckers = require("@atlaskit/editor-card-provider/url-checkers");
|
|
21
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
21
22
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
22
23
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
23
24
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
@@ -29,7 +30,6 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
29
30
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
30
31
|
var _smartCard = require("@atlaskit/smart-card");
|
|
31
32
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
32
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
33
33
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
34
34
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
35
35
|
var _actions = require("../pm-plugins/actions");
|
|
@@ -608,8 +608,8 @@ var embedCardNodeView = exports.embedCardNodeView = function embedCardNodeView(_
|
|
|
608
608
|
CompetitorPrompt: CompetitorPrompt,
|
|
609
609
|
isPageSSRed: isPageSSRed,
|
|
610
610
|
provider: provider,
|
|
611
|
-
intl: (0,
|
|
612
|
-
smartCardContext: (0,
|
|
611
|
+
intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
|
|
612
|
+
smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
|
|
613
613
|
};
|
|
614
614
|
return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
|
|
615
615
|
};
|
|
@@ -16,7 +16,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
16
16
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
19
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
21
20
|
var _inlineCard = require("../nodeviews/inlineCard");
|
|
22
21
|
var _lazyBlockCard = require("../nodeviews/lazy-block-card");
|
|
@@ -79,9 +78,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
79
78
|
onClickCallback: onClickCallback,
|
|
80
79
|
isPageSSRed: isPageSSRed,
|
|
81
80
|
provider: provider,
|
|
82
|
-
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0,
|
|
83
|
-
intl: (0,
|
|
84
|
-
smartCardContext: (0,
|
|
81
|
+
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : CompetitorPrompt,
|
|
82
|
+
intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
|
|
83
|
+
smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
|
|
85
84
|
}
|
|
86
85
|
});
|
|
87
86
|
return new _safePlugin.SafePlugin({
|
|
@@ -280,9 +279,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
280
279
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
281
280
|
isPageSSRed: isPageSSRed,
|
|
282
281
|
provider: provider,
|
|
283
|
-
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0,
|
|
284
|
-
intl: (0,
|
|
285
|
-
smartCardContext: (0,
|
|
282
|
+
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : options.CompetitorPrompt,
|
|
283
|
+
intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
|
|
284
|
+
smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
|
|
286
285
|
}),
|
|
287
286
|
embedCard: (0, _lazyEmbedCard.lazyEmbedCardView)({
|
|
288
287
|
allowResizing: allowResizing,
|
|
@@ -293,9 +292,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
293
292
|
onClickCallback: options.onClickCallback,
|
|
294
293
|
isPageSSRed: isPageSSRed,
|
|
295
294
|
provider: provider,
|
|
296
|
-
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0,
|
|
297
|
-
intl: (0,
|
|
298
|
-
smartCardContext: (0,
|
|
295
|
+
CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : options.CompetitorPrompt,
|
|
296
|
+
intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
|
|
297
|
+
smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
|
|
299
298
|
})
|
|
300
299
|
}
|
|
301
300
|
}, enableInlineUpgradeFeatures && {
|
|
@@ -9,12 +9,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
10
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
11
11
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
12
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
12
|
function SmartCardSSRReactContextsProvider(_ref) {
|
|
14
13
|
var smartCardContext = _ref.smartCardContext,
|
|
15
14
|
children = _ref.children,
|
|
16
15
|
intl = _ref.intl;
|
|
17
|
-
if (!(0,
|
|
16
|
+
if (!(0, _coreUtils.isSSR)() || !(0, _coreUtils.isSSRStreaming)()) {
|
|
18
17
|
return children;
|
|
19
18
|
}
|
|
20
19
|
if (!intl || !smartCardContext) {
|
|
@@ -4,6 +4,7 @@ import rafSchedule from 'raf-schd';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
5
|
import uuid from 'uuid/v4';
|
|
6
6
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
7
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
7
8
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
8
9
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
9
10
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
@@ -11,7 +12,6 @@ import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from
|
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
13
14
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
14
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
15
|
import { Datasource } from '../nodeviews/datasource';
|
|
16
16
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
17
17
|
import { isDatasourceNode } from '../pm-plugins/utils';
|
|
@@ -247,8 +247,8 @@ export const blockCardNodeView = ({
|
|
|
247
247
|
CompetitorPrompt,
|
|
248
248
|
isPageSSRed,
|
|
249
249
|
provider,
|
|
250
|
-
intl:
|
|
251
|
-
smartCardContext:
|
|
250
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
251
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
252
252
|
};
|
|
253
253
|
const isDatasource = isDatasourceNode(node);
|
|
254
254
|
if (isDatasource) {
|
|
@@ -6,6 +6,7 @@ import rafSchedule from 'raf-schd';
|
|
|
6
6
|
import uuid from 'uuid/v4';
|
|
7
7
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
8
8
|
import { isConfluenceSlideUrl } from '@atlaskit/editor-card-provider/url-checkers';
|
|
9
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
9
10
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
10
11
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
12
|
import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
@@ -17,7 +18,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
17
18
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
18
19
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
19
20
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
20
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
21
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
22
22
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
23
23
|
import { registerCard, removeCard } from '../pm-plugins/actions';
|
|
@@ -580,8 +580,8 @@ export const embedCardNodeView = ({
|
|
|
580
580
|
CompetitorPrompt,
|
|
581
581
|
isPageSSRed,
|
|
582
582
|
provider,
|
|
583
|
-
intl:
|
|
584
|
-
smartCardContext:
|
|
583
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
584
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
585
585
|
};
|
|
586
586
|
return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
|
|
587
587
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import rafSchedule from 'raf-schd';
|
|
2
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
2
|
+
import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
3
3
|
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/styles';
|
|
@@ -7,7 +7,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
12
11
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
13
12
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
@@ -69,9 +68,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
69
68
|
onClickCallback,
|
|
70
69
|
isPageSSRed,
|
|
71
70
|
provider,
|
|
72
|
-
CompetitorPrompt: isSSR() &&
|
|
73
|
-
intl:
|
|
74
|
-
smartCardContext:
|
|
71
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : CompetitorPrompt,
|
|
72
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
73
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
76
|
return new SafePlugin({
|
|
@@ -275,9 +274,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
275
274
|
inlineCardViewProducer,
|
|
276
275
|
isPageSSRed,
|
|
277
276
|
provider,
|
|
278
|
-
CompetitorPrompt: isSSR() &&
|
|
279
|
-
intl:
|
|
280
|
-
smartCardContext:
|
|
277
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
|
|
278
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
279
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
281
280
|
}),
|
|
282
281
|
embedCard: lazyEmbedCardView({
|
|
283
282
|
allowResizing,
|
|
@@ -288,9 +287,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
288
287
|
onClickCallback: options.onClickCallback,
|
|
289
288
|
isPageSSRed,
|
|
290
289
|
provider,
|
|
291
|
-
CompetitorPrompt: isSSR() &&
|
|
292
|
-
intl:
|
|
293
|
-
smartCardContext:
|
|
290
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
|
|
291
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
292
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
294
293
|
})
|
|
295
294
|
},
|
|
296
295
|
...(enableInlineUpgradeFeatures && {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RawIntlProvider } from 'react-intl';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
|
+
import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
4
4
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
export function SmartCardSSRReactContextsProvider({
|
|
7
6
|
smartCardContext,
|
|
8
7
|
children,
|
|
9
8
|
intl
|
|
10
9
|
}) {
|
|
11
|
-
if (!
|
|
10
|
+
if (!isSSR() || !isSSRStreaming()) {
|
|
12
11
|
return children;
|
|
13
12
|
}
|
|
14
13
|
if (!intl || !smartCardContext) {
|
|
@@ -13,6 +13,7 @@ import rafSchedule from 'raf-schd';
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
14
14
|
import uuid from 'uuid/v4';
|
|
15
15
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
16
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
16
17
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
17
18
|
import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
18
19
|
import { canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
@@ -20,7 +21,6 @@ import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from
|
|
|
20
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
22
|
import { Card as SmartCard } from '@atlaskit/smart-card';
|
|
22
23
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
23
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
24
24
|
import { Datasource } from '../nodeviews/datasource';
|
|
25
25
|
import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
|
|
26
26
|
import { isDatasourceNode } from '../pm-plugins/utils';
|
|
@@ -280,8 +280,8 @@ export var blockCardNodeView = function blockCardNodeView(_ref3) {
|
|
|
280
280
|
CompetitorPrompt: CompetitorPrompt,
|
|
281
281
|
isPageSSRed: isPageSSRed,
|
|
282
282
|
provider: provider,
|
|
283
|
-
intl:
|
|
284
|
-
smartCardContext:
|
|
283
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
284
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
285
285
|
};
|
|
286
286
|
var isDatasource = isDatasourceNode(node);
|
|
287
287
|
if (isDatasource) {
|
|
@@ -17,6 +17,7 @@ import rafSchedule from 'raf-schd';
|
|
|
17
17
|
import uuid from 'uuid/v4';
|
|
18
18
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
19
19
|
import { isConfluenceSlideUrl } from '@atlaskit/editor-card-provider/url-checkers';
|
|
20
|
+
import { isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
20
21
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
21
22
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
22
23
|
import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
@@ -28,7 +29,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
28
29
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
29
30
|
import { EmbedResizeMessageListener, Card as SmartCard } from '@atlaskit/smart-card';
|
|
30
31
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
31
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
32
32
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
33
33
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
34
34
|
import { registerCard, removeCard as _removeCard } from '../pm-plugins/actions';
|
|
@@ -603,8 +603,8 @@ export var embedCardNodeView = function embedCardNodeView(_ref4) {
|
|
|
603
603
|
CompetitorPrompt: CompetitorPrompt,
|
|
604
604
|
isPageSSRed: isPageSSRed,
|
|
605
605
|
provider: provider,
|
|
606
|
-
intl:
|
|
607
|
-
smartCardContext:
|
|
606
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
607
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
608
608
|
};
|
|
609
609
|
return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
|
|
610
610
|
};
|
|
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
6
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
6
|
+
import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
7
7
|
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
9
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/styles';
|
|
@@ -11,7 +11,6 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
11
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
14
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
16
15
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
17
16
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
@@ -72,9 +71,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
72
71
|
onClickCallback: onClickCallback,
|
|
73
72
|
isPageSSRed: isPageSSRed,
|
|
74
73
|
provider: provider,
|
|
75
|
-
CompetitorPrompt: isSSR() &&
|
|
76
|
-
intl:
|
|
77
|
-
smartCardContext:
|
|
74
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : CompetitorPrompt,
|
|
75
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
76
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
78
77
|
}
|
|
79
78
|
});
|
|
80
79
|
return new SafePlugin({
|
|
@@ -273,9 +272,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
273
272
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
274
273
|
isPageSSRed: isPageSSRed,
|
|
275
274
|
provider: provider,
|
|
276
|
-
CompetitorPrompt: isSSR() &&
|
|
277
|
-
intl:
|
|
278
|
-
smartCardContext:
|
|
275
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
|
|
276
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
277
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
279
278
|
}),
|
|
280
279
|
embedCard: lazyEmbedCardView({
|
|
281
280
|
allowResizing: allowResizing,
|
|
@@ -286,9 +285,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
286
285
|
onClickCallback: options.onClickCallback,
|
|
287
286
|
isPageSSRed: isPageSSRed,
|
|
288
287
|
provider: provider,
|
|
289
|
-
CompetitorPrompt: isSSR() &&
|
|
290
|
-
intl:
|
|
291
|
-
smartCardContext:
|
|
288
|
+
CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
|
|
289
|
+
intl: isSSRStreaming() ? intl : undefined,
|
|
290
|
+
smartCardContext: isSSRStreaming() ? smartCardContext : undefined
|
|
292
291
|
})
|
|
293
292
|
}
|
|
294
293
|
}, enableInlineUpgradeFeatures && {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RawIntlProvider } from 'react-intl';
|
|
3
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
|
+
import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
|
|
4
4
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
export function SmartCardSSRReactContextsProvider(_ref) {
|
|
7
6
|
var smartCardContext = _ref.smartCardContext,
|
|
8
7
|
children = _ref.children,
|
|
9
8
|
intl = _ref.intl;
|
|
10
|
-
if (!
|
|
9
|
+
if (!isSSR() || !isSSRStreaming()) {
|
|
11
10
|
return children;
|
|
12
11
|
}
|
|
13
12
|
if (!intl || !smartCardContext) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.3.1",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@atlaskit/primitives": "^19.0.0",
|
|
67
67
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
68
68
|
"@atlaskit/smart-card": "^44.23.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
70
|
-
"@atlaskit/tokens": "^13.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^90.0.0",
|
|
70
|
+
"@atlaskit/tokens": "^13.3.0",
|
|
71
71
|
"@babel/runtime": "^7.0.0",
|
|
72
72
|
"@emotion/react": "^11.7.1",
|
|
73
73
|
"lodash": "^4.17.21",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"uuid": "^3.1.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@atlaskit/editor-common": "^115.
|
|
79
|
+
"@atlaskit/editor-common": "^115.7.0",
|
|
80
80
|
"@atlaskit/link-provider": "^4.6.0",
|
|
81
81
|
"react": "^18.2.0",
|
|
82
82
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|