@atlaskit/editor-plugin-card 20.0.6 → 20.1.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 20.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`da5eaf0bc37da`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da5eaf0bc37da) -
8
+ Clean up the platform_editor_editor_ssr_streaming experiment. The SSR streaming code paths are now
9
+ permanent and the isSSRStreaming() utility has been removed from
10
+ @atlaskit/editor-common/core-utils.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 20.0.6
4
17
 
5
18
  ### Patch Changes
package/compass.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  configVersion: 1
2
2
  id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/c4021c09-3810-44dc-93a4-cf58f758b845
3
3
  name: '@atlaskit/editor-plugin-card'
4
- ownerId: ari:cloud:identity::team/og-da2205cb-ea5e-4059-9215-30c9b26c971f # Fabric - Editor
4
+ ownerId: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb # Editor Developers
5
5
  labels:
6
6
  - platform-code
7
7
  - platform-afm
@@ -23,7 +23,7 @@ links:
23
23
  customFields:
24
24
  - name: Department
25
25
  type: text
26
- value: Eng - Editor Frontend Platform
26
+ value: Editor Developers
27
27
  - name: Trusted Reviewer Teams
28
28
  type: text
29
29
  value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
@@ -16,7 +16,6 @@ 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");
20
19
  var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
21
20
  var _ui = require("@atlaskit/editor-common/ui");
22
21
  var _utils = require("@atlaskit/editor-common/utils");
@@ -284,8 +283,8 @@ var blockCardNodeView = exports.blockCardNodeView = function blockCardNodeView(_
284
283
  CompetitorPrompt: CompetitorPrompt,
285
284
  isPageSSRed: isPageSSRed,
286
285
  provider: provider,
287
- intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
288
- smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
286
+ intl: intl,
287
+ smartCardContext: smartCardContext
289
288
  };
290
289
  var isDatasource = (0, _utils2.isDatasourceNode)(node);
291
290
  if (isDatasource) {
@@ -18,7 +18,6 @@ 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");
22
21
  var _hooks = require("@atlaskit/editor-common/hooks");
23
22
  var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
24
23
  var _ui = require("@atlaskit/editor-common/ui");
@@ -607,8 +606,8 @@ var embedCardNodeView = exports.embedCardNodeView = function embedCardNodeView(_
607
606
  CompetitorPrompt: CompetitorPrompt,
608
607
  isPageSSRed: isPageSSRed,
609
608
  provider: provider,
610
- intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
611
- smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
609
+ intl: intl,
610
+ smartCardContext: smartCardContext
612
611
  };
613
612
  return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
614
613
  };
@@ -77,9 +77,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
77
77
  onClickCallback: onClickCallback,
78
78
  isPageSSRed: isPageSSRed,
79
79
  provider: provider,
80
- CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : CompetitorPrompt,
81
- intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
82
- smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
80
+ CompetitorPrompt: (0, _coreUtils.isSSR)() ? undefined : CompetitorPrompt,
81
+ intl: intl,
82
+ smartCardContext: smartCardContext
83
83
  }
84
84
  });
85
85
  return new _safePlugin.SafePlugin({
@@ -278,9 +278,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
278
278
  inlineCardViewProducer: inlineCardViewProducer,
279
279
  isPageSSRed: isPageSSRed,
280
280
  provider: provider,
281
- CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : options.CompetitorPrompt,
282
- intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
283
- smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
281
+ CompetitorPrompt: (0, _coreUtils.isSSR)() ? undefined : options.CompetitorPrompt,
282
+ intl: intl,
283
+ smartCardContext: smartCardContext
284
284
  }),
285
285
  embedCard: (0, _lazyEmbedCard.lazyEmbedCardView)({
286
286
  allowResizing: allowResizing,
@@ -291,9 +291,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
291
291
  onClickCallback: options.onClickCallback,
292
292
  isPageSSRed: isPageSSRed,
293
293
  provider: provider,
294
- CompetitorPrompt: (0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)() ? undefined : options.CompetitorPrompt,
295
- intl: (0, _coreUtils.isSSRStreaming)() ? intl : undefined,
296
- smartCardContext: (0, _coreUtils.isSSRStreaming)() ? smartCardContext : undefined
294
+ CompetitorPrompt: (0, _coreUtils.isSSR)() ? undefined : options.CompetitorPrompt,
295
+ intl: intl,
296
+ smartCardContext: smartCardContext
297
297
  })
298
298
  }
299
299
  }, enableInlineUpgradeFeatures && {
@@ -13,7 +13,7 @@ function SmartCardSSRReactContextsProvider(_ref) {
13
13
  var smartCardContext = _ref.smartCardContext,
14
14
  children = _ref.children,
15
15
  intl = _ref.intl;
16
- if (!(0, _coreUtils.isSSR)() || !(0, _coreUtils.isSSRStreaming)()) {
16
+ if (!(0, _coreUtils.isSSR)()) {
17
17
  return children;
18
18
  }
19
19
  if (!intl || !smartCardContext) {
@@ -4,7 +4,6 @@ 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';
8
7
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
9
8
  import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
10
9
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
@@ -246,8 +245,8 @@ export const blockCardNodeView = ({
246
245
  CompetitorPrompt,
247
246
  isPageSSRed,
248
247
  provider,
249
- intl: isSSRStreaming() ? intl : undefined,
250
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
248
+ intl,
249
+ smartCardContext
251
250
  };
252
251
  const isDatasource = isDatasourceNode(node);
253
252
  if (isDatasource) {
@@ -6,7 +6,6 @@ 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';
10
9
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
10
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
12
11
  import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedBlock } from '@atlaskit/editor-common/ui';
@@ -579,8 +578,8 @@ export const embedCardNodeView = ({
579
578
  CompetitorPrompt,
580
579
  isPageSSRed,
581
580
  provider,
582
- intl: isSSRStreaming() ? intl : undefined,
583
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
581
+ intl,
582
+ smartCardContext
584
583
  };
585
584
  return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
586
585
  };
@@ -1,5 +1,5 @@
1
1
  import rafSchedule from 'raf-schd';
2
- import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
2
+ import { isSSR } 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';
@@ -67,9 +67,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
67
67
  onClickCallback,
68
68
  isPageSSRed,
69
69
  provider,
70
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : CompetitorPrompt,
71
- intl: isSSRStreaming() ? intl : undefined,
72
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
70
+ CompetitorPrompt: isSSR() ? undefined : CompetitorPrompt,
71
+ intl,
72
+ smartCardContext
73
73
  }
74
74
  });
75
75
  return new SafePlugin({
@@ -273,9 +273,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
273
273
  inlineCardViewProducer,
274
274
  isPageSSRed,
275
275
  provider,
276
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
277
- intl: isSSRStreaming() ? intl : undefined,
278
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
276
+ CompetitorPrompt: isSSR() ? undefined : options.CompetitorPrompt,
277
+ intl,
278
+ smartCardContext
279
279
  }),
280
280
  embedCard: lazyEmbedCardView({
281
281
  allowResizing,
@@ -286,9 +286,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
286
286
  onClickCallback: options.onClickCallback,
287
287
  isPageSSRed,
288
288
  provider,
289
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
290
- intl: isSSRStreaming() ? intl : undefined,
291
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
289
+ CompetitorPrompt: isSSR() ? undefined : options.CompetitorPrompt,
290
+ intl,
291
+ smartCardContext
292
292
  })
293
293
  },
294
294
  ...(enableInlineUpgradeFeatures && {
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { RawIntlProvider } from 'react-intl';
3
- import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
3
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
4
4
  import { SmartCardContext } from '@atlaskit/link-provider';
5
5
  export function SmartCardSSRReactContextsProvider({
6
6
  smartCardContext,
7
7
  children,
8
8
  intl
9
9
  }) {
10
- if (!isSSR() || !isSSRStreaming()) {
10
+ if (!isSSR()) {
11
11
  return children;
12
12
  }
13
13
  if (!intl || !smartCardContext) {
@@ -13,7 +13,6 @@ 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';
17
16
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
18
17
  import { findOverflowScrollParent, UnsupportedBlock } from '@atlaskit/editor-common/ui';
19
18
  import { canRenderDatasource } from '@atlaskit/editor-common/utils';
@@ -279,8 +278,8 @@ export var blockCardNodeView = function blockCardNodeView(_ref3) {
279
278
  CompetitorPrompt: CompetitorPrompt,
280
279
  isPageSSRed: isPageSSRed,
281
280
  provider: provider,
282
- intl: isSSRStreaming() ? intl : undefined,
283
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
281
+ intl: intl,
282
+ smartCardContext: smartCardContext
284
283
  };
285
284
  var isDatasource = isDatasourceNode(node);
286
285
  if (isDatasource) {
@@ -17,7 +17,6 @@ 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';
21
20
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
22
21
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
23
22
  import { findOverflowScrollParent, MediaSingle as RichMediaWrapper, UnsupportedBlock } from '@atlaskit/editor-common/ui';
@@ -602,8 +601,8 @@ export var embedCardNodeView = function embedCardNodeView(_ref4) {
602
601
  CompetitorPrompt: CompetitorPrompt,
603
602
  isPageSSRed: isPageSSRed,
604
603
  provider: provider,
605
- intl: isSSRStreaming() ? intl : undefined,
606
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
604
+ intl: intl,
605
+ smartCardContext: smartCardContext
607
606
  };
608
607
  return new EmbedCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps).init();
609
608
  };
@@ -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, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
6
+ import { isSSR } 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';
@@ -70,9 +70,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
70
70
  onClickCallback: onClickCallback,
71
71
  isPageSSRed: isPageSSRed,
72
72
  provider: provider,
73
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : CompetitorPrompt,
74
- intl: isSSRStreaming() ? intl : undefined,
75
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
73
+ CompetitorPrompt: isSSR() ? undefined : CompetitorPrompt,
74
+ intl: intl,
75
+ smartCardContext: smartCardContext
76
76
  }
77
77
  });
78
78
  return new SafePlugin({
@@ -271,9 +271,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
271
271
  inlineCardViewProducer: inlineCardViewProducer,
272
272
  isPageSSRed: isPageSSRed,
273
273
  provider: provider,
274
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
275
- intl: isSSRStreaming() ? intl : undefined,
276
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
274
+ CompetitorPrompt: isSSR() ? undefined : options.CompetitorPrompt,
275
+ intl: intl,
276
+ smartCardContext: smartCardContext
277
277
  }),
278
278
  embedCard: lazyEmbedCardView({
279
279
  allowResizing: allowResizing,
@@ -284,9 +284,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
284
284
  onClickCallback: options.onClickCallback,
285
285
  isPageSSRed: isPageSSRed,
286
286
  provider: provider,
287
- CompetitorPrompt: isSSR() && isSSRStreaming() ? undefined : options.CompetitorPrompt,
288
- intl: isSSRStreaming() ? intl : undefined,
289
- smartCardContext: isSSRStreaming() ? smartCardContext : undefined
287
+ CompetitorPrompt: isSSR() ? undefined : options.CompetitorPrompt,
288
+ intl: intl,
289
+ smartCardContext: smartCardContext
290
290
  })
291
291
  }
292
292
  }, enableInlineUpgradeFeatures && {
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { RawIntlProvider } from 'react-intl';
3
- import { isSSR, isSSRStreaming } from '@atlaskit/editor-common/core-utils';
3
+ import { isSSR } from '@atlaskit/editor-common/core-utils';
4
4
  import { SmartCardContext } from '@atlaskit/link-provider';
5
5
  export function SmartCardSSRReactContextsProvider(_ref) {
6
6
  var smartCardContext = _ref.smartCardContext,
7
7
  children = _ref.children,
8
8
  intl = _ref.intl;
9
- if (!isSSR() || !isSSRStreaming()) {
9
+ if (!isSSR()) {
10
10
  return children;
11
11
  }
12
12
  if (!intl || !smartCardContext) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "20.0.6",
3
+ "version": "20.1.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -61,7 +61,7 @@
61
61
  "@atlaskit/primitives": "^22.2.0",
62
62
  "@atlaskit/prosemirror-history": "^1.1.0",
63
63
  "@atlaskit/smart-card": "^45.17.0",
64
- "@atlaskit/tmp-editor-statsig": "^147.0.0",
64
+ "@atlaskit/tmp-editor-statsig": "^147.1.0",
65
65
  "@atlaskit/tokens": "^16.7.0",
66
66
  "@babel/runtime": "^7.0.0",
67
67
  "@emotion/react": "^11.7.1",
@@ -71,7 +71,7 @@
71
71
  "uuid": "^3.1.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^118.10.0",
74
+ "@atlaskit/editor-common": "^118.12.0",
75
75
  "@atlaskit/link-provider": "^5.3.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -130,11 +130,6 @@
130
130
  "type": "boolean"
131
131
  }
132
132
  },
133
- "stricter": {
134
- "no-unused-dependencies": {
135
- "checkDevDependencies": true
136
- }
137
- },
138
133
  "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/e6f3220b-0ca2-445a-a4c5-78cff6ca2a34",
139
134
  "devDependencies": {
140
135
  "react": "^19.2.0",