@atlaskit/renderer 126.11.1 → 126.12.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,19 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 126.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e1489e8d410d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1489e8d410d5) -
8
+ Exposing optional URL-based Suspense boundaries through SmartCardProvider for renderer inline card
9
+ nodes
10
+
11
+ ### Patch Changes
12
+
13
+ - [`63173c2b1171a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/63173c2b1171a) -
14
+ [ux] Enable sticky header for reference synced blocks in Editor
15
+ - Updated dependencies
16
+
3
17
  ## 126.11.1
4
18
 
5
19
  ### Patch Changes
@@ -31,6 +31,7 @@ var _linkExtractors = require("@atlaskit/link-extractors");
31
31
  * @jsxRuntime classic
32
32
  * @jsx jsx
33
33
  */
34
+ /* eslint-disable jsdoc/check-tag-names */
34
35
 
35
36
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
36
37
 
@@ -150,6 +151,17 @@ var InlineCard = function InlineCard(props) {
150
151
  onSetLinkTarget = props.onSetLinkTarget;
151
152
  var portal = (0, _PortalContext.usePortal)(props);
152
153
  var cardContext = (0, _linkProvider.useSmartCardContext)();
154
+ var SuspenseWrapperForUrl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.SuspenseWrapperForUrl;
155
+
156
+ // Helper fn to conditionally wrap cards when suspense boundary is passed in via product
157
+ var wrapWithSuspense = function wrapWithSuspense(card) {
158
+ if (SuspenseWrapperForUrl && url) {
159
+ return (0, _react2.jsx)(SuspenseWrapperForUrl, {
160
+ url: url
161
+ }, card);
162
+ }
163
+ return card;
164
+ };
153
165
  var reload = (0, _hooks.useSmartLinkReload)({
154
166
  url: url || ''
155
167
  });
@@ -209,23 +221,23 @@ var InlineCard = function InlineCard(props) {
209
221
  // eslint-disable-next-line react/jsx-props-no-spreading
210
222
  }, inlineAnnotationProps), (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
211
223
  data: analyticsData
212
- }, (0, _react2.jsx)(_ssr.CardSSR, {
224
+ }, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
213
225
  appearance: "inline",
214
226
  url: url,
215
227
  showHoverPreview: !hideHoverPreview,
216
228
  actionOptions: actionOptions,
217
229
  onClick: onClick
218
- })));
230
+ }))));
219
231
  }
220
232
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
221
233
  data: analyticsData
222
- }, (0, _react2.jsx)(_ssr.CardSSR, {
234
+ }, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
223
235
  appearance: "inline",
224
236
  url: url,
225
237
  showHoverPreview: !hideHoverPreview,
226
238
  actionOptions: actionOptions,
227
239
  onClick: onClick
228
- }), CompetitorPromptComponent);
240
+ })), CompetitorPromptComponent);
229
241
  } else if ((ssr || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
230
242
  exposure: true
231
243
  })) {
@@ -248,7 +260,7 @@ var InlineCard = function InlineCard(props) {
248
260
  rendererAppearance: rendererAppearance,
249
261
  isResolvedViewRendered: isResolvedViewRendered,
250
262
  fireAnalyticsEvent: fireAnalyticsEvent
251
- }, (0, _react2.jsx)(_ssr.CardSSR, {
263
+ }, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
252
264
  appearance: "inline",
253
265
  url: url,
254
266
  showHoverPreview: !hideHoverPreview,
@@ -265,7 +277,7 @@ var InlineCard = function InlineCard(props) {
265
277
  },
266
278
  onError: onError,
267
279
  disablePreviewPanel: true
268
- }))));
280
+ })))));
269
281
  }
270
282
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
271
283
  data: analyticsData
@@ -274,7 +286,7 @@ var InlineCard = function InlineCard(props) {
274
286
  rendererAppearance: rendererAppearance,
275
287
  isResolvedViewRendered: isResolvedViewRendered,
276
288
  fireAnalyticsEvent: fireAnalyticsEvent
277
- }, (0, _react2.jsx)(_ssr.CardSSR, {
289
+ }, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
278
290
  appearance: "inline",
279
291
  url: url,
280
292
  showHoverPreview: !hideHoverPreview,
@@ -291,7 +303,7 @@ var InlineCard = function InlineCard(props) {
291
303
  },
292
304
  onError: onError,
293
305
  disablePreviewPanel: true
294
- })), CompetitorPromptComponent);
306
+ }))), CompetitorPromptComponent);
295
307
  }
296
308
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
297
309
  data: analyticsData
@@ -312,7 +324,7 @@ var InlineCard = function InlineCard(props) {
312
324
  rendererAppearance: rendererAppearance,
313
325
  isResolvedViewRendered: isResolvedViewRendered,
314
326
  fireAnalyticsEvent: fireAnalyticsEvent
315
- }, (0, _react2.jsx)(_smartCard.Card, (0, _extends2.default)({
327
+ }, wrapWithSuspense((0, _react2.jsx)(_smartCard.Card, (0, _extends2.default)({
316
328
  appearance: "inline",
317
329
  showHoverPreview: !hideHoverPreview,
318
330
  actionOptions: actionOptions
@@ -332,7 +344,7 @@ var InlineCard = function InlineCard(props) {
332
344
  disablePreviewPanel: (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
333
345
  exposure: true
334
346
  })
335
- }))), CompetitorPromptComponent)));
347
+ })))), CompetitorPromptComponent)));
336
348
  };
337
349
  var _default_1 = (0, _SmartCardStorage.withSmartCardStorage)(InlineCard);
338
350
  var _default = exports.default = _default_1;
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
71
71
  var TABLE_INFO_TIMEOUT = 10000;
72
72
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
73
73
  var packageName = "@atlaskit/renderer";
74
- var packageVersion = "126.11.0";
74
+ var packageVersion = "0.0.0-development";
75
75
  var setAsQueryContainerStyles = (0, _react2.css)({
76
76
  containerName: 'ak-renderer-wrapper',
77
77
  containerType: 'inline-size'
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ /* eslint-disable jsdoc/check-tag-names */
6
7
  import { Fragment, useState, useMemo, useEffect } from 'react';
7
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { jsx } from '@emotion/react';
@@ -135,6 +136,17 @@ const InlineCard = props => {
135
136
  } = props;
136
137
  const portal = usePortal(props);
137
138
  const cardContext = useSmartCardContext();
139
+ const SuspenseWrapperForUrl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.SuspenseWrapperForUrl;
140
+
141
+ // Helper fn to conditionally wrap cards when suspense boundary is passed in via product
142
+ const wrapWithSuspense = card => {
143
+ if (SuspenseWrapperForUrl && url) {
144
+ return jsx(SuspenseWrapperForUrl, {
145
+ url: url
146
+ }, card);
147
+ }
148
+ return card;
149
+ };
138
150
  const reload = useSmartLinkReload({
139
151
  url: url || ''
140
152
  });
@@ -193,23 +205,23 @@ const InlineCard = props => {
193
205
  // eslint-disable-next-line react/jsx-props-no-spreading
194
206
  }, inlineAnnotationProps), jsx(AnalyticsContext, {
195
207
  data: analyticsData
196
- }, jsx(CardSSR, {
208
+ }, wrapWithSuspense(jsx(CardSSR, {
197
209
  appearance: "inline",
198
210
  url: url,
199
211
  showHoverPreview: !hideHoverPreview,
200
212
  actionOptions: actionOptions,
201
213
  onClick: onClick
202
- })));
214
+ }))));
203
215
  }
204
216
  return jsx(AnalyticsContext, {
205
217
  data: analyticsData
206
- }, jsx(CardSSR, {
218
+ }, wrapWithSuspense(jsx(CardSSR, {
207
219
  appearance: "inline",
208
220
  url: url,
209
221
  showHoverPreview: !hideHoverPreview,
210
222
  actionOptions: actionOptions,
211
223
  onClick: onClick
212
- }), CompetitorPromptComponent);
224
+ })), CompetitorPromptComponent);
213
225
  } else if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
214
226
  exposure: true
215
227
  })) {
@@ -232,7 +244,7 @@ const InlineCard = props => {
232
244
  rendererAppearance: rendererAppearance,
233
245
  isResolvedViewRendered: isResolvedViewRendered,
234
246
  fireAnalyticsEvent: fireAnalyticsEvent
235
- }, jsx(CardSSR, {
247
+ }, wrapWithSuspense(jsx(CardSSR, {
236
248
  appearance: "inline",
237
249
  url: url,
238
250
  showHoverPreview: !hideHoverPreview,
@@ -249,7 +261,7 @@ const InlineCard = props => {
249
261
  },
250
262
  onError: onError,
251
263
  disablePreviewPanel: true
252
- }))));
264
+ })))));
253
265
  }
254
266
  return jsx(AnalyticsContext, {
255
267
  data: analyticsData
@@ -258,7 +270,7 @@ const InlineCard = props => {
258
270
  rendererAppearance: rendererAppearance,
259
271
  isResolvedViewRendered: isResolvedViewRendered,
260
272
  fireAnalyticsEvent: fireAnalyticsEvent
261
- }, jsx(CardSSR, {
273
+ }, wrapWithSuspense(jsx(CardSSR, {
262
274
  appearance: "inline",
263
275
  url: url,
264
276
  showHoverPreview: !hideHoverPreview,
@@ -275,7 +287,7 @@ const InlineCard = props => {
275
287
  },
276
288
  onError: onError,
277
289
  disablePreviewPanel: true
278
- })), CompetitorPromptComponent);
290
+ }))), CompetitorPromptComponent);
279
291
  }
280
292
  return jsx(AnalyticsContext, {
281
293
  data: analyticsData
@@ -296,7 +308,7 @@ const InlineCard = props => {
296
308
  rendererAppearance: rendererAppearance,
297
309
  isResolvedViewRendered: isResolvedViewRendered,
298
310
  fireAnalyticsEvent: fireAnalyticsEvent
299
- }, jsx(Card, _extends({
311
+ }, wrapWithSuspense(jsx(Card, _extends({
300
312
  appearance: "inline",
301
313
  showHoverPreview: !hideHoverPreview,
302
314
  actionOptions: actionOptions
@@ -316,7 +328,7 @@ const InlineCard = props => {
316
328
  disablePreviewPanel: editorExperiment('platform_editor_preview_panel_linking_exp', true, {
317
329
  exposure: true
318
330
  })
319
- }))), CompetitorPromptComponent)));
331
+ })))), CompetitorPromptComponent)));
320
332
  };
321
333
  const _default_1 = withSmartCardStorage(InlineCard);
322
334
  export default _default_1;
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  const TABLE_INFO_TIMEOUT = 10000;
58
58
  const RENDER_EVENT_SAMPLE_RATE = 0.2;
59
59
  const packageName = "@atlaskit/renderer";
60
- const packageVersion = "126.11.0";
60
+ const packageVersion = "0.0.0-development";
61
61
  const setAsQueryContainerStyles = css({
62
62
  containerName: 'ak-renderer-wrapper',
63
63
  containerType: 'inline-size'
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  * @jsxRuntime classic
5
5
  * @jsx jsx
6
6
  */
7
+ /* eslint-disable jsdoc/check-tag-names */
7
8
  import { Fragment, useState, useMemo, useEffect } from 'react';
8
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
10
  import { jsx } from '@emotion/react';
@@ -141,6 +142,17 @@ var InlineCard = function InlineCard(props) {
141
142
  onSetLinkTarget = props.onSetLinkTarget;
142
143
  var portal = usePortal(props);
143
144
  var cardContext = useSmartCardContext();
145
+ var SuspenseWrapperForUrl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.SuspenseWrapperForUrl;
146
+
147
+ // Helper fn to conditionally wrap cards when suspense boundary is passed in via product
148
+ var wrapWithSuspense = function wrapWithSuspense(card) {
149
+ if (SuspenseWrapperForUrl && url) {
150
+ return jsx(SuspenseWrapperForUrl, {
151
+ url: url
152
+ }, card);
153
+ }
154
+ return card;
155
+ };
144
156
  var reload = useSmartLinkReload({
145
157
  url: url || ''
146
158
  });
@@ -200,23 +212,23 @@ var InlineCard = function InlineCard(props) {
200
212
  // eslint-disable-next-line react/jsx-props-no-spreading
201
213
  }, inlineAnnotationProps), jsx(AnalyticsContext, {
202
214
  data: analyticsData
203
- }, jsx(CardSSR, {
215
+ }, wrapWithSuspense(jsx(CardSSR, {
204
216
  appearance: "inline",
205
217
  url: url,
206
218
  showHoverPreview: !hideHoverPreview,
207
219
  actionOptions: actionOptions,
208
220
  onClick: onClick
209
- })));
221
+ }))));
210
222
  }
211
223
  return jsx(AnalyticsContext, {
212
224
  data: analyticsData
213
- }, jsx(CardSSR, {
225
+ }, wrapWithSuspense(jsx(CardSSR, {
214
226
  appearance: "inline",
215
227
  url: url,
216
228
  showHoverPreview: !hideHoverPreview,
217
229
  actionOptions: actionOptions,
218
230
  onClick: onClick
219
- }), CompetitorPromptComponent);
231
+ })), CompetitorPromptComponent);
220
232
  } else if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
221
233
  exposure: true
222
234
  })) {
@@ -239,7 +251,7 @@ var InlineCard = function InlineCard(props) {
239
251
  rendererAppearance: rendererAppearance,
240
252
  isResolvedViewRendered: isResolvedViewRendered,
241
253
  fireAnalyticsEvent: fireAnalyticsEvent
242
- }, jsx(CardSSR, {
254
+ }, wrapWithSuspense(jsx(CardSSR, {
243
255
  appearance: "inline",
244
256
  url: url,
245
257
  showHoverPreview: !hideHoverPreview,
@@ -256,7 +268,7 @@ var InlineCard = function InlineCard(props) {
256
268
  },
257
269
  onError: onError,
258
270
  disablePreviewPanel: true
259
- }))));
271
+ })))));
260
272
  }
261
273
  return jsx(AnalyticsContext, {
262
274
  data: analyticsData
@@ -265,7 +277,7 @@ var InlineCard = function InlineCard(props) {
265
277
  rendererAppearance: rendererAppearance,
266
278
  isResolvedViewRendered: isResolvedViewRendered,
267
279
  fireAnalyticsEvent: fireAnalyticsEvent
268
- }, jsx(CardSSR, {
280
+ }, wrapWithSuspense(jsx(CardSSR, {
269
281
  appearance: "inline",
270
282
  url: url,
271
283
  showHoverPreview: !hideHoverPreview,
@@ -282,7 +294,7 @@ var InlineCard = function InlineCard(props) {
282
294
  },
283
295
  onError: onError,
284
296
  disablePreviewPanel: true
285
- })), CompetitorPromptComponent);
297
+ }))), CompetitorPromptComponent);
286
298
  }
287
299
  return jsx(AnalyticsContext, {
288
300
  data: analyticsData
@@ -303,7 +315,7 @@ var InlineCard = function InlineCard(props) {
303
315
  rendererAppearance: rendererAppearance,
304
316
  isResolvedViewRendered: isResolvedViewRendered,
305
317
  fireAnalyticsEvent: fireAnalyticsEvent
306
- }, jsx(Card, _extends({
318
+ }, wrapWithSuspense(jsx(Card, _extends({
307
319
  appearance: "inline",
308
320
  showHoverPreview: !hideHoverPreview,
309
321
  actionOptions: actionOptions
@@ -323,7 +335,7 @@ var InlineCard = function InlineCard(props) {
323
335
  disablePreviewPanel: editorExperiment('platform_editor_preview_panel_linking_exp', true, {
324
336
  exposure: true
325
337
  })
326
- }))), CompetitorPromptComponent)));
338
+ })))), CompetitorPromptComponent)));
327
339
  };
328
340
  var _default_1 = withSmartCardStorage(InlineCard);
329
341
  export default _default_1;
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
62
62
  var TABLE_INFO_TIMEOUT = 10000;
63
63
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
64
64
  var packageName = "@atlaskit/renderer";
65
- var packageVersion = "126.11.0";
65
+ var packageVersion = "0.0.0-development";
66
66
  var setAsQueryContainerStyles = css({
67
67
  containerName: 'ak-renderer-wrapper',
68
68
  containerType: 'inline-size'
@@ -39,4 +39,14 @@ export interface SmartLinksOptions {
39
39
  * Component: inline
40
40
  */
41
41
  ssr?: boolean;
42
+ /**
43
+ * A Suspense boundary wrapper to enable inline SmartLinks to wait until data fetchers have completed before rendering
44
+ * Default is undefined.
45
+ *
46
+ * Component: inline
47
+ */
48
+ SuspenseWrapperForUrl?: React.ComponentType<{
49
+ children: React.ReactNode;
50
+ url?: string;
51
+ }>;
42
52
  }
@@ -39,4 +39,14 @@ export interface SmartLinksOptions {
39
39
  * Component: inline
40
40
  */
41
41
  ssr?: boolean;
42
+ /**
43
+ * A Suspense boundary wrapper to enable inline SmartLinks to wait until data fetchers have completed before rendering
44
+ * Default is undefined.
45
+ *
46
+ * Component: inline
47
+ */
48
+ SuspenseWrapperForUrl?: React.ComponentType<{
49
+ children: React.ReactNode;
50
+ url?: string;
51
+ }>;
42
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "126.11.1",
3
+ "version": "126.12.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/status": "^3.1.0",
58
58
  "@atlaskit/task-decision": "^19.2.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^29.3.0",
60
+ "@atlaskit/tmp-editor-statsig": "^29.4.0",
61
61
  "@atlaskit/tokens": "^11.0.0",
62
62
  "@atlaskit/tooltip": "^20.14.0",
63
63
  "@atlaskit/visually-hidden": "^3.0.0",