@atlaskit/renderer 125.1.0 → 125.2.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/react/index.js +14 -2
  3. package/dist/cjs/react/nodes/blockCard.js +6 -3
  4. package/dist/cjs/react/nodes/embedCard.js +12 -6
  5. package/dist/cjs/react/nodes/extension.js +1 -1
  6. package/dist/cjs/react/nodes/fallback.js +26 -4
  7. package/dist/cjs/react/nodes/inlineCard.js +6 -3
  8. package/dist/cjs/react/nodes/table.js +1 -1
  9. package/dist/cjs/react/nodes/tableNew.js +1 -1
  10. package/dist/cjs/ui/Renderer/index.js +1 -1
  11. package/dist/es2019/react/index.js +12 -2
  12. package/dist/es2019/react/nodes/blockCard.js +6 -3
  13. package/dist/es2019/react/nodes/embedCard.js +12 -6
  14. package/dist/es2019/react/nodes/extension.js +1 -1
  15. package/dist/es2019/react/nodes/fallback.js +26 -5
  16. package/dist/es2019/react/nodes/inlineCard.js +6 -3
  17. package/dist/es2019/react/nodes/table.js +1 -1
  18. package/dist/es2019/react/nodes/tableNew.js +1 -1
  19. package/dist/es2019/ui/Renderer/index.js +1 -1
  20. package/dist/esm/react/index.js +14 -2
  21. package/dist/esm/react/nodes/blockCard.js +6 -3
  22. package/dist/esm/react/nodes/embedCard.js +12 -6
  23. package/dist/esm/react/nodes/extension.js +1 -1
  24. package/dist/esm/react/nodes/fallback.js +26 -4
  25. package/dist/esm/react/nodes/inlineCard.js +6 -3
  26. package/dist/esm/react/nodes/table.js +1 -1
  27. package/dist/esm/react/nodes/tableNew.js +1 -1
  28. package/dist/esm/ui/Renderer/index.js +1 -1
  29. package/dist/types/react/index.d.ts +1 -0
  30. package/dist/types/react/nodes/blockCard.d.ts +1 -0
  31. package/dist/types/react/nodes/embedCard.d.ts +2 -1
  32. package/dist/types/react/nodes/extension.d.ts +1 -1
  33. package/dist/types/react/nodes/fallback.d.ts +1 -0
  34. package/dist/types/react/nodes/index.d.ts +2 -0
  35. package/dist/types/react/nodes/inlineCard.d.ts +2 -1
  36. package/dist/types/react/nodes/table.d.ts +1 -1
  37. package/dist/types/ui/SmartCardStorage.d.ts +1 -1
  38. package/dist/types-ts4.5/react/index.d.ts +1 -0
  39. package/dist/types-ts4.5/react/nodes/blockCard.d.ts +1 -0
  40. package/dist/types-ts4.5/react/nodes/embedCard.d.ts +2 -1
  41. package/dist/types-ts4.5/react/nodes/extension.d.ts +1 -1
  42. package/dist/types-ts4.5/react/nodes/fallback.d.ts +1 -0
  43. package/dist/types-ts4.5/react/nodes/index.d.ts +2 -0
  44. package/dist/types-ts4.5/react/nodes/inlineCard.d.ts +2 -1
  45. package/dist/types-ts4.5/react/nodes/table.d.ts +1 -1
  46. package/dist/types-ts4.5/ui/SmartCardStorage.d.ts +1 -1
  47. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 125.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2cb77d624e5f5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2cb77d624e5f5) -
8
+ Configure fallback links shown for errors from smartlinks to respect the optional renderer
9
+ onSetLinkTarget callback used to show/hide external link icon
10
+
11
+ ## 125.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`e64156876a79c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e64156876a79c) -
16
+ Update documentation from Stash to Bitbucket
17
+ - Updated dependencies
18
+
3
19
  ## 125.1.0
4
20
 
5
21
  ### Minor Changes
@@ -264,6 +264,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
264
264
  return this.getEmbedCardProps(node, path);
265
265
  case 'blockCard':
266
266
  return this.getBlockCardProps(node, path);
267
+ case 'inlineCard':
268
+ return this.getInlineCardProps(node, path);
267
269
  case 'expand':
268
270
  return this.getExpandProps(node, path);
269
271
  case 'unsupportedBlock':
@@ -540,7 +542,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
540
542
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
541
543
  var isInsideOfBlockNode = (0, _rendererNode.insideBlockNode)(path, node.type.schema);
542
544
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
543
- isInsideOfBlockNode: isInsideOfBlockNode
545
+ isInsideOfBlockNode: isInsideOfBlockNode,
546
+ onSetLinkTarget: this.onSetLinkTarget
544
547
  });
545
548
  }
546
549
  }, {
@@ -548,7 +551,16 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
548
551
  value: function getBlockCardProps(node) {
549
552
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
550
553
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
551
- isNodeNested: path.length > 0
554
+ isNodeNested: path.length > 0,
555
+ onSetLinkTarget: this.onSetLinkTarget
556
+ });
557
+ }
558
+ }, {
559
+ key: "getInlineCardProps",
560
+ value: function getInlineCardProps(node) {
561
+ var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
562
+ return _objectSpread(_objectSpread({}, this.getProps(node, path)), {}, {
563
+ onSetLinkTarget: this.onSetLinkTarget
552
564
  });
553
565
  }
554
566
  }, {
@@ -41,7 +41,8 @@ function BlockCard(props) {
41
41
  eventHandlers = props.eventHandlers,
42
42
  smartLinks = props.smartLinks,
43
43
  isNodeNested = props.isNodeNested,
44
- localId = props.localId;
44
+ localId = props.localId,
45
+ onSetLinkTarget = props.onSetLinkTarget;
45
46
  var portal = (0, _PortalContext.usePortal)(props);
46
47
  var _ref = smartLinks || {},
47
48
  actionOptions = _ref.actionOptions;
@@ -101,7 +102,8 @@ function BlockCard(props) {
101
102
  data: analyticsData
102
103
  }, (0, _react.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
103
104
  unsupportedComponent: _ui.UnsupportedInline,
104
- datasourceId: props.datasource.id
105
+ datasourceId: props.datasource.id,
106
+ onSetLinkTarget: onSetLinkTarget
105
107
  // Ignored via go/ees005
106
108
  // eslint-disable-next-line react/jsx-props-no-spreading
107
109
  }, cardProps), (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref5) {
@@ -161,7 +163,8 @@ function BlockCard(props) {
161
163
  "data-card-url": url,
162
164
  "data-local-id": localId
163
165
  }, (0, _react.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
164
- unsupportedComponent: _ui.UnsupportedBlock
166
+ unsupportedComponent: _ui.UnsupportedBlock,
167
+ onSetLinkTarget: onSetLinkTarget
165
168
  // Ignored via go/ees005
166
169
  // eslint-disable-next-line react/jsx-props-no-spreading
167
170
  }, cardProps), cardComponent)));
@@ -27,6 +27,7 @@ var _blockCard = _interopRequireDefault(require("./blockCard"));
27
27
  * @jsxRuntime classic
28
28
  * @jsx jsx
29
29
  */
30
+ /* eslint-disable jsdoc/check-tag-names */
30
31
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
31
32
 
32
33
  var embedCardWrapperStyles = (0, _react.css)({
@@ -59,7 +60,8 @@ function EmbedCardInternal(props) {
59
60
  isInsideOfBlockNode = props.isInsideOfBlockNode,
60
61
  rendererAppearance = props.rendererAppearance,
61
62
  smartLinks = props.smartLinks,
62
- isInsideOfInlineExtension = props.isInsideOfInlineExtension;
63
+ isInsideOfInlineExtension = props.isInsideOfInlineExtension,
64
+ onSetLinkTarget = props.onSetLinkTarget;
63
65
  var portal = (0, _PortalContext.usePortal)(props);
64
66
  var embedIframeRef = (0, _react2.useRef)(null);
65
67
  var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
@@ -190,9 +192,10 @@ function EmbedCardInternal(props) {
190
192
  }
191
193
  return (
192
194
  // Ignored via go/ees005
193
- // eslint-disable-next-line react/jsx-props-no-spreading
194
195
  (0, _react.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
195
- unsupportedComponent: _ui.UnsupportedBlock
196
+ unsupportedComponent: _ui.UnsupportedBlock,
197
+ onSetLinkTarget: onSetLinkTarget
198
+ // eslint-disable-next-line react/jsx-props-no-spreading
196
199
  }, cardProps), (0, _react.jsx)(_smartCard.EmbedResizeMessageListener, {
197
200
  embedIframeRef: embedIframeRef,
198
201
  onHeightUpdate: setLiveHeight
@@ -235,7 +238,8 @@ var EmbedOrBlockCardInternal = exports.EmbedOrBlockCardInternal = function Embed
235
238
  rendererAppearance = _ref5.rendererAppearance,
236
239
  isInsideOfBlockNode = _ref5.isInsideOfBlockNode,
237
240
  smartLinks = _ref5.smartLinks,
238
- isInsideOfInlineExtension = _ref5.isInsideOfInlineExtension;
241
+ isInsideOfInlineExtension = _ref5.isInsideOfInlineExtension,
242
+ onSetLinkTarget = _ref5.onSetLinkTarget;
239
243
  var _useContext = (0, _react2.useContext)(_ui.WidthContext),
240
244
  width = _useContext.width;
241
245
  var viewAsBlockCard = width && width <= _editorSharedStyles.akEditorFullPageNarrowBreakout;
@@ -246,7 +250,8 @@ var EmbedOrBlockCardInternal = exports.EmbedOrBlockCardInternal = function Embed
246
250
  portal: portal,
247
251
  layout: layout,
248
252
  rendererAppearance: rendererAppearance,
249
- smartLinks: smartLinks
253
+ smartLinks: smartLinks,
254
+ onSetLinkTarget: onSetLinkTarget
250
255
  }) : (0, _react.jsx)(EmbedCardInternal, {
251
256
  url: url,
252
257
  data: data,
@@ -259,7 +264,8 @@ var EmbedOrBlockCardInternal = exports.EmbedOrBlockCardInternal = function Embed
259
264
  rendererAppearance: rendererAppearance,
260
265
  isInsideOfBlockNode: isInsideOfBlockNode,
261
266
  smartLinks: smartLinks,
262
- isInsideOfInlineExtension: isInsideOfInlineExtension
267
+ isInsideOfInlineExtension: isInsideOfInlineExtension,
268
+ onSetLinkTarget: onSetLinkTarget
263
269
  });
264
270
  };
265
271
  var EmbedCardWithCondition = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
@@ -23,7 +23,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
24
 
25
25
  var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
26
- // Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
26
+ // Mirrors sizes from https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
27
27
  var macroHeights = {
28
28
  small: '112px',
29
29
  medium: '262px',
@@ -17,6 +17,8 @@ var _linkDatasource = require("@atlaskit/link-datasource");
17
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
18
  var _react = _interopRequireDefault(require("react"));
19
19
  var _ = require("./");
20
+ 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; }
21
+ 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) { (0, _defineProperty2.default)(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; }
20
22
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
21
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
22
24
  // Ignored via go/ees005
@@ -53,17 +55,37 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
53
55
  url = _this$props2.url,
54
56
  isDatasource = _this$props2.isDatasource,
55
57
  UnsupportedComponent = _this$props2.unsupportedComponent,
56
- datasourceId = _this$props2.datasourceId;
58
+ datasourceId = _this$props2.datasourceId,
59
+ onSetLinkTarget = _this$props2.onSetLinkTarget;
57
60
  if (url) {
58
- var fallback = (0, _platformFeatureFlags.fg)('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/_react.default.createElement(_link.default, {
61
+ var actualTarget;
62
+ if (onSetLinkTarget && (0, _platformFeatureFlags.fg)('rovo_chat_deep_linking_enabled')) {
63
+ try {
64
+ actualTarget = onSetLinkTarget(url);
65
+ } catch (_unused) {
66
+ // If URL parsing fails, use the original target
67
+ }
68
+ }
69
+ var linkProps = _objectSpread({
59
70
  href: url,
60
71
  onClick: this.onClickFallback
72
+ }, actualTarget === '_blank' && {
73
+ target: '_blank',
74
+ rel: 'noreferrer noopener'
75
+ });
76
+ var fallback = (0, _platformFeatureFlags.fg)('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/_react.default.createElement(_link.default, {
77
+ href: linkProps.href,
78
+ onClick: linkProps.onClick,
79
+ target: linkProps.target,
80
+ rel: linkProps.rel
61
81
  }, url) :
62
82
  /*#__PURE__*/
63
83
  // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
64
84
  _react.default.createElement("a", {
65
- href: url,
66
- onClick: this.onClickFallback
85
+ href: linkProps.href,
86
+ onClick: linkProps.onClick,
87
+ target: linkProps.target,
88
+ rel: linkProps.rel
67
89
  }, url);
68
90
  if (isDatasource) {
69
91
  if ((0, _adfSchema.isSafeUrl)(url)) {
@@ -145,7 +145,8 @@ var InlineCard = function InlineCard(props) {
145
145
  eventHandlers = props.eventHandlers,
146
146
  fireAnalyticsEvent = props.fireAnalyticsEvent,
147
147
  smartLinks = props.smartLinks,
148
- rendererAppearance = props.rendererAppearance;
148
+ rendererAppearance = props.rendererAppearance,
149
+ onSetLinkTarget = props.onSetLinkTarget;
149
150
  var portal = (0, _PortalContext.usePortal)(props);
150
151
  var cardContext = (0, _linkProvider.useSmartCardContext)();
151
152
  var _useState = (0, _react.useState)(false),
@@ -279,7 +280,7 @@ var InlineCard = function InlineCard(props) {
279
280
  },
280
281
  onError: onError,
281
282
  disablePreviewPanel: true
282
- })));
283
+ })), CompetitorPromptComponent);
283
284
  }
284
285
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
285
286
  data: analyticsData
@@ -293,7 +294,9 @@ var InlineCard = function InlineCard(props) {
293
294
  unsupportedComponent: _ui.UnsupportedInline
294
295
  // Ignored via go/ees005
295
296
  // eslint-disable-next-line react/jsx-props-no-spreading
296
- }, cardProps), (0, _react2.jsx)(MaybeOverlay, {
297
+ }, cardProps, {
298
+ onSetLinkTarget: onSetLinkTarget
299
+ }), (0, _react2.jsx)(MaybeOverlay, {
297
300
  url: url || '',
298
301
  rendererAppearance: rendererAppearance,
299
302
  isResolvedViewRendered: isResolvedViewRendered,
@@ -599,7 +599,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
599
599
  height: "var(--ds-space-250, 20px)",
600
600
  // MAX_BROWSER_SCROLLBAR_HEIGHT
601
601
  // Follow editor to hide by default so it does not show empty gap in SSR
602
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
602
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
603
603
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
604
604
  display: fixTableSSRResizing ? 'none' : 'block',
605
605
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -38,7 +38,7 @@ var stickyContainerBaseStyles = {
38
38
  height: "var(--ds-space-250, 20px)",
39
39
  // MAX_BROWSER_SCROLLBAR_HEIGHT
40
40
  // Follow editor to hide by default so it does not show empty gap in SSR
41
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
41
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
42
42
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
43
43
  display: 'block',
44
44
  width: '100%'
@@ -70,7 +70,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
70
70
  var TABLE_INFO_TIMEOUT = 10000;
71
71
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
72
72
  var packageName = "@atlaskit/renderer";
73
- var packageVersion = "125.0.2";
73
+ var packageVersion = "125.1.1";
74
74
  var setAsQueryContainerStyles = (0, _react2.css)({
75
75
  containerName: 'ak-renderer-wrapper',
76
76
  containerType: 'inline-size'
@@ -247,6 +247,8 @@ export default class ReactSerializer {
247
247
  return this.getEmbedCardProps(node, path);
248
248
  case 'blockCard':
249
249
  return this.getBlockCardProps(node, path);
250
+ case 'inlineCard':
251
+ return this.getInlineCardProps(node, path);
250
252
  case 'expand':
251
253
  return this.getExpandProps(node, path);
252
254
  case 'unsupportedBlock':
@@ -486,13 +488,21 @@ export default class ReactSerializer {
486
488
  const isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
487
489
  return {
488
490
  ...this.getProps(node),
489
- isInsideOfBlockNode
491
+ isInsideOfBlockNode,
492
+ onSetLinkTarget: this.onSetLinkTarget
490
493
  };
491
494
  }
492
495
  getBlockCardProps(node, path = []) {
493
496
  return {
494
497
  ...this.getProps(node),
495
- isNodeNested: path.length > 0
498
+ isNodeNested: path.length > 0,
499
+ onSetLinkTarget: this.onSetLinkTarget
500
+ };
501
+ }
502
+ getInlineCardProps(node, path = []) {
503
+ return {
504
+ ...this.getProps(node, path),
505
+ onSetLinkTarget: this.onSetLinkTarget
496
506
  };
497
507
  }
498
508
  getMediaGroupProps(node) {
@@ -34,7 +34,8 @@ export default function BlockCard(props) {
34
34
  eventHandlers,
35
35
  smartLinks,
36
36
  isNodeNested,
37
- localId
37
+ localId,
38
+ onSetLinkTarget
38
39
  } = props;
39
40
  const portal = usePortal(props);
40
41
  const {
@@ -89,7 +90,8 @@ export default function BlockCard(props) {
89
90
  data: analyticsData
90
91
  }, jsx(CardErrorBoundary, _extends({
91
92
  unsupportedComponent: UnsupportedInline,
92
- datasourceId: props.datasource.id
93
+ datasourceId: props.datasource.id,
94
+ onSetLinkTarget: onSetLinkTarget
93
95
  // Ignored via go/ees005
94
96
  // eslint-disable-next-line react/jsx-props-no-spreading
95
97
  }, cardProps), jsx(WidthConsumer, null, ({
@@ -148,7 +150,8 @@ export default function BlockCard(props) {
148
150
  "data-card-url": url,
149
151
  "data-local-id": localId
150
152
  }, jsx(CardErrorBoundary, _extends({
151
- unsupportedComponent: UnsupportedBlock
153
+ unsupportedComponent: UnsupportedBlock,
154
+ onSetLinkTarget: onSetLinkTarget
152
155
  // Ignored via go/ees005
153
156
  // eslint-disable-next-line react/jsx-props-no-spreading
154
157
  }, cardProps), cardComponent)));
@@ -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
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
8
  import { css, jsx } from '@emotion/react';
8
9
  import { useContext, useState, useRef } from 'react';
@@ -51,7 +52,8 @@ function EmbedCardInternal(props) {
51
52
  isInsideOfBlockNode,
52
53
  rendererAppearance,
53
54
  smartLinks,
54
- isInsideOfInlineExtension
55
+ isInsideOfInlineExtension,
56
+ onSetLinkTarget
55
57
  } = props;
56
58
  const portal = usePortal(props);
57
59
  const embedIframeRef = useRef(null);
@@ -178,9 +180,10 @@ function EmbedCardInternal(props) {
178
180
  }
179
181
  return (
180
182
  // Ignored via go/ees005
181
- // eslint-disable-next-line react/jsx-props-no-spreading
182
183
  jsx(CardErrorBoundary, _extends({
183
- unsupportedComponent: UnsupportedBlock
184
+ unsupportedComponent: UnsupportedBlock,
185
+ onSetLinkTarget: onSetLinkTarget
186
+ // eslint-disable-next-line react/jsx-props-no-spreading
184
187
  }, cardProps), jsx(EmbedResizeMessageListener, {
185
188
  embedIframeRef: embedIframeRef,
186
189
  onHeightUpdate: setLiveHeight
@@ -223,7 +226,8 @@ export const EmbedOrBlockCardInternal = ({
223
226
  rendererAppearance,
224
227
  isInsideOfBlockNode,
225
228
  smartLinks,
226
- isInsideOfInlineExtension
229
+ isInsideOfInlineExtension,
230
+ onSetLinkTarget
227
231
  }) => {
228
232
  const {
229
233
  width
@@ -236,7 +240,8 @@ export const EmbedOrBlockCardInternal = ({
236
240
  portal: portal,
237
241
  layout: layout,
238
242
  rendererAppearance: rendererAppearance,
239
- smartLinks: smartLinks
243
+ smartLinks: smartLinks,
244
+ onSetLinkTarget: onSetLinkTarget
240
245
  }) : jsx(EmbedCardInternal, {
241
246
  url: url,
242
247
  data: data,
@@ -249,7 +254,8 @@ export const EmbedOrBlockCardInternal = ({
249
254
  rendererAppearance: rendererAppearance,
250
255
  isInsideOfBlockNode: isInsideOfBlockNode,
251
256
  smartLinks: smartLinks,
252
- isInsideOfInlineExtension: isInsideOfInlineExtension
257
+ isInsideOfInlineExtension: isInsideOfInlineExtension,
258
+ onSetLinkTarget: onSetLinkTarget
253
259
  });
254
260
  };
255
261
  const EmbedCardWithCondition = componentWithCondition(() => editorExperiment('platform_editor_preview_panel_responsiveness', true, {
@@ -15,7 +15,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
15
  import { calcBreakoutWidthCss } from '../utils/breakout';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
17
  const viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
18
- // Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
18
+ // Mirrors sizes from https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
19
19
  const macroHeights = {
20
20
  small: '112px',
21
21
  medium: '262px',
@@ -37,18 +37,39 @@ export class CardErrorBoundary extends React.PureComponent {
37
37
  url,
38
38
  isDatasource,
39
39
  unsupportedComponent: UnsupportedComponent,
40
- datasourceId
40
+ datasourceId,
41
+ onSetLinkTarget
41
42
  } = this.props;
42
43
  if (url) {
43
- const fallback = fg('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/React.createElement(Link, {
44
+ let actualTarget;
45
+ if (onSetLinkTarget && fg('rovo_chat_deep_linking_enabled')) {
46
+ try {
47
+ actualTarget = onSetLinkTarget(url);
48
+ } catch {
49
+ // If URL parsing fails, use the original target
50
+ }
51
+ }
52
+ const linkProps = {
44
53
  href: url,
45
- onClick: this.onClickFallback
54
+ onClick: this.onClickFallback,
55
+ ...(actualTarget === '_blank' && {
56
+ target: '_blank',
57
+ rel: 'noreferrer noopener'
58
+ })
59
+ };
60
+ const fallback = fg('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/React.createElement(Link, {
61
+ href: linkProps.href,
62
+ onClick: linkProps.onClick,
63
+ target: linkProps.target,
64
+ rel: linkProps.rel
46
65
  }, url) :
47
66
  /*#__PURE__*/
48
67
  // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
49
68
  React.createElement("a", {
50
- href: url,
51
- onClick: this.onClickFallback
69
+ href: linkProps.href,
70
+ onClick: linkProps.onClick,
71
+ target: linkProps.target,
72
+ rel: linkProps.rel
52
73
  }, url);
53
74
  if (isDatasource) {
54
75
  if (isSafeUrl(url)) {
@@ -129,7 +129,8 @@ const InlineCard = props => {
129
129
  eventHandlers,
130
130
  fireAnalyticsEvent,
131
131
  smartLinks,
132
- rendererAppearance
132
+ rendererAppearance,
133
+ onSetLinkTarget
133
134
  } = props;
134
135
  const portal = usePortal(props);
135
136
  const cardContext = useSmartCardContext();
@@ -263,7 +264,7 @@ const InlineCard = props => {
263
264
  },
264
265
  onError: onError,
265
266
  disablePreviewPanel: true
266
- })));
267
+ })), CompetitorPromptComponent);
267
268
  }
268
269
  return jsx(AnalyticsContext, {
269
270
  data: analyticsData
@@ -277,7 +278,9 @@ const InlineCard = props => {
277
278
  unsupportedComponent: UnsupportedInline
278
279
  // Ignored via go/ees005
279
280
  // eslint-disable-next-line react/jsx-props-no-spreading
280
- }, cardProps), jsx(MaybeOverlay, {
281
+ }, cardProps, {
282
+ onSetLinkTarget: onSetLinkTarget
283
+ }), jsx(MaybeOverlay, {
281
284
  url: url || '',
282
285
  rendererAppearance: rendererAppearance,
283
286
  isResolvedViewRendered: isResolvedViewRendered,
@@ -542,7 +542,7 @@ export class TableContainer extends React.Component {
542
542
  height: "var(--ds-space-250, 20px)",
543
543
  // MAX_BROWSER_SCROLLBAR_HEIGHT
544
544
  // Follow editor to hide by default so it does not show empty gap in SSR
545
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
545
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
546
546
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
547
547
  display: fixTableSSRResizing ? 'none' : 'block',
548
548
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -20,7 +20,7 @@ const stickyContainerBaseStyles = {
20
20
  height: "var(--ds-space-250, 20px)",
21
21
  // MAX_BROWSER_SCROLLBAR_HEIGHT
22
22
  // Follow editor to hide by default so it does not show empty gap in SSR
23
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
23
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
24
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
25
25
  display: 'block',
26
26
  width: '100%'
@@ -56,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  const TABLE_INFO_TIMEOUT = 10000;
57
57
  const RENDER_EVENT_SAMPLE_RATE = 0.2;
58
58
  const packageName = "@atlaskit/renderer";
59
- const packageVersion = "125.0.2";
59
+ const packageVersion = "125.1.1";
60
60
  const setAsQueryContainerStyles = css({
61
61
  containerName: 'ak-renderer-wrapper',
62
62
  containerType: 'inline-size'
@@ -257,6 +257,8 @@ var ReactSerializer = /*#__PURE__*/function () {
257
257
  return this.getEmbedCardProps(node, path);
258
258
  case 'blockCard':
259
259
  return this.getBlockCardProps(node, path);
260
+ case 'inlineCard':
261
+ return this.getInlineCardProps(node, path);
260
262
  case 'expand':
261
263
  return this.getExpandProps(node, path);
262
264
  case 'unsupportedBlock':
@@ -533,7 +535,8 @@ var ReactSerializer = /*#__PURE__*/function () {
533
535
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
534
536
  var isInsideOfBlockNode = insideBlockNode(path, node.type.schema);
535
537
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
536
- isInsideOfBlockNode: isInsideOfBlockNode
538
+ isInsideOfBlockNode: isInsideOfBlockNode,
539
+ onSetLinkTarget: this.onSetLinkTarget
537
540
  });
538
541
  }
539
542
  }, {
@@ -541,7 +544,16 @@ var ReactSerializer = /*#__PURE__*/function () {
541
544
  value: function getBlockCardProps(node) {
542
545
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
543
546
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
544
- isNodeNested: path.length > 0
547
+ isNodeNested: path.length > 0,
548
+ onSetLinkTarget: this.onSetLinkTarget
549
+ });
550
+ }
551
+ }, {
552
+ key: "getInlineCardProps",
553
+ value: function getInlineCardProps(node) {
554
+ var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
555
+ return _objectSpread(_objectSpread({}, this.getProps(node, path)), {}, {
556
+ onSetLinkTarget: this.onSetLinkTarget
545
557
  });
546
558
  }
547
559
  }, {
@@ -33,7 +33,8 @@ export default function BlockCard(props) {
33
33
  eventHandlers = props.eventHandlers,
34
34
  smartLinks = props.smartLinks,
35
35
  isNodeNested = props.isNodeNested,
36
- localId = props.localId;
36
+ localId = props.localId,
37
+ onSetLinkTarget = props.onSetLinkTarget;
37
38
  var portal = usePortal(props);
38
39
  var _ref = smartLinks || {},
39
40
  actionOptions = _ref.actionOptions;
@@ -93,7 +94,8 @@ export default function BlockCard(props) {
93
94
  data: analyticsData
94
95
  }, jsx(CardErrorBoundary, _extends({
95
96
  unsupportedComponent: UnsupportedInline,
96
- datasourceId: props.datasource.id
97
+ datasourceId: props.datasource.id,
98
+ onSetLinkTarget: onSetLinkTarget
97
99
  // Ignored via go/ees005
98
100
  // eslint-disable-next-line react/jsx-props-no-spreading
99
101
  }, cardProps), jsx(WidthConsumer, null, function (_ref5) {
@@ -153,7 +155,8 @@ export default function BlockCard(props) {
153
155
  "data-card-url": url,
154
156
  "data-local-id": localId
155
157
  }, jsx(CardErrorBoundary, _extends({
156
- unsupportedComponent: UnsupportedBlock
158
+ unsupportedComponent: UnsupportedBlock,
159
+ onSetLinkTarget: onSetLinkTarget
157
160
  // Ignored via go/ees005
158
161
  // eslint-disable-next-line react/jsx-props-no-spreading
159
162
  }, cardProps), cardComponent)));
@@ -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
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { css, jsx } from '@emotion/react';
9
10
  import { useContext, useState, useRef } from 'react';
@@ -51,7 +52,8 @@ function EmbedCardInternal(props) {
51
52
  isInsideOfBlockNode = props.isInsideOfBlockNode,
52
53
  rendererAppearance = props.rendererAppearance,
53
54
  smartLinks = props.smartLinks,
54
- isInsideOfInlineExtension = props.isInsideOfInlineExtension;
55
+ isInsideOfInlineExtension = props.isInsideOfInlineExtension,
56
+ onSetLinkTarget = props.onSetLinkTarget;
55
57
  var portal = usePortal(props);
56
58
  var embedIframeRef = useRef(null);
57
59
  var onClick = getCardClickHandler(eventHandlers, url);
@@ -182,9 +184,10 @@ function EmbedCardInternal(props) {
182
184
  }
183
185
  return (
184
186
  // Ignored via go/ees005
185
- // eslint-disable-next-line react/jsx-props-no-spreading
186
187
  jsx(CardErrorBoundary, _extends({
187
- unsupportedComponent: UnsupportedBlock
188
+ unsupportedComponent: UnsupportedBlock,
189
+ onSetLinkTarget: onSetLinkTarget
190
+ // eslint-disable-next-line react/jsx-props-no-spreading
188
191
  }, cardProps), jsx(EmbedResizeMessageListener, {
189
192
  embedIframeRef: embedIframeRef,
190
193
  onHeightUpdate: setLiveHeight
@@ -227,7 +230,8 @@ export var EmbedOrBlockCardInternal = function EmbedOrBlockCardInternal(_ref5) {
227
230
  rendererAppearance = _ref5.rendererAppearance,
228
231
  isInsideOfBlockNode = _ref5.isInsideOfBlockNode,
229
232
  smartLinks = _ref5.smartLinks,
230
- isInsideOfInlineExtension = _ref5.isInsideOfInlineExtension;
233
+ isInsideOfInlineExtension = _ref5.isInsideOfInlineExtension,
234
+ onSetLinkTarget = _ref5.onSetLinkTarget;
231
235
  var _useContext = useContext(WidthContext),
232
236
  width = _useContext.width;
233
237
  var viewAsBlockCard = width && width <= akEditorFullPageNarrowBreakout;
@@ -238,7 +242,8 @@ export var EmbedOrBlockCardInternal = function EmbedOrBlockCardInternal(_ref5) {
238
242
  portal: portal,
239
243
  layout: layout,
240
244
  rendererAppearance: rendererAppearance,
241
- smartLinks: smartLinks
245
+ smartLinks: smartLinks,
246
+ onSetLinkTarget: onSetLinkTarget
242
247
  }) : jsx(EmbedCardInternal, {
243
248
  url: url,
244
249
  data: data,
@@ -251,7 +256,8 @@ export var EmbedOrBlockCardInternal = function EmbedOrBlockCardInternal(_ref5) {
251
256
  rendererAppearance: rendererAppearance,
252
257
  isInsideOfBlockNode: isInsideOfBlockNode,
253
258
  smartLinks: smartLinks,
254
- isInsideOfInlineExtension: isInsideOfInlineExtension
259
+ isInsideOfInlineExtension: isInsideOfInlineExtension,
260
+ onSetLinkTarget: onSetLinkTarget
255
261
  });
256
262
  };
257
263
  var EmbedCardWithCondition = componentWithCondition(function () {
@@ -15,7 +15,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
15
  import { calcBreakoutWidthCss } from '../utils/breakout';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
17
  var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
18
- // Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
18
+ // Mirrors sizes from https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
19
19
  var macroHeights = {
20
20
  small: '112px',
21
21
  medium: '262px',
@@ -4,6 +4,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
4
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
5
  import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+ 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; }
8
+ 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; }
7
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
11
  import { isSafeUrl } from '@atlaskit/adf-schema';
@@ -46,17 +48,37 @@ export var CardErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
46
48
  url = _this$props2.url,
47
49
  isDatasource = _this$props2.isDatasource,
48
50
  UnsupportedComponent = _this$props2.unsupportedComponent,
49
- datasourceId = _this$props2.datasourceId;
51
+ datasourceId = _this$props2.datasourceId,
52
+ onSetLinkTarget = _this$props2.onSetLinkTarget;
50
53
  if (url) {
51
- var fallback = fg('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/React.createElement(Link, {
54
+ var actualTarget;
55
+ if (onSetLinkTarget && fg('rovo_chat_deep_linking_enabled')) {
56
+ try {
57
+ actualTarget = onSetLinkTarget(url);
58
+ } catch (_unused) {
59
+ // If URL parsing fails, use the original target
60
+ }
61
+ }
62
+ var linkProps = _objectSpread({
52
63
  href: url,
53
64
  onClick: this.onClickFallback
65
+ }, actualTarget === '_blank' && {
66
+ target: '_blank',
67
+ rel: 'noreferrer noopener'
68
+ });
69
+ var fallback = fg('dst-a11y__replace-anchor-with-link__editor') ? /*#__PURE__*/React.createElement(Link, {
70
+ href: linkProps.href,
71
+ onClick: linkProps.onClick,
72
+ target: linkProps.target,
73
+ rel: linkProps.rel
54
74
  }, url) :
55
75
  /*#__PURE__*/
56
76
  // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
57
77
  React.createElement("a", {
58
- href: url,
59
- onClick: this.onClickFallback
78
+ href: linkProps.href,
79
+ onClick: linkProps.onClick,
80
+ target: linkProps.target,
81
+ rel: linkProps.rel
60
82
  }, url);
61
83
  if (isDatasource) {
62
84
  if (isSafeUrl(url)) {
@@ -136,7 +136,8 @@ var InlineCard = function InlineCard(props) {
136
136
  eventHandlers = props.eventHandlers,
137
137
  fireAnalyticsEvent = props.fireAnalyticsEvent,
138
138
  smartLinks = props.smartLinks,
139
- rendererAppearance = props.rendererAppearance;
139
+ rendererAppearance = props.rendererAppearance,
140
+ onSetLinkTarget = props.onSetLinkTarget;
140
141
  var portal = usePortal(props);
141
142
  var cardContext = useSmartCardContext();
142
143
  var _useState = useState(false),
@@ -270,7 +271,7 @@ var InlineCard = function InlineCard(props) {
270
271
  },
271
272
  onError: onError,
272
273
  disablePreviewPanel: true
273
- })));
274
+ })), CompetitorPromptComponent);
274
275
  }
275
276
  return jsx(AnalyticsContext, {
276
277
  data: analyticsData
@@ -284,7 +285,9 @@ var InlineCard = function InlineCard(props) {
284
285
  unsupportedComponent: UnsupportedInline
285
286
  // Ignored via go/ees005
286
287
  // eslint-disable-next-line react/jsx-props-no-spreading
287
- }, cardProps), jsx(MaybeOverlay, {
288
+ }, cardProps, {
289
+ onSetLinkTarget: onSetLinkTarget
290
+ }), jsx(MaybeOverlay, {
288
291
  url: url || '',
289
292
  rendererAppearance: rendererAppearance,
290
293
  isResolvedViewRendered: isResolvedViewRendered,
@@ -592,7 +592,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
592
592
  height: "var(--ds-space-250, 20px)",
593
593
  // MAX_BROWSER_SCROLLBAR_HEIGHT
594
594
  // Follow editor to hide by default so it does not show empty gap in SSR
595
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
595
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
596
596
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
597
597
  display: fixTableSSRResizing ? 'none' : 'block',
598
598
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -32,7 +32,7 @@ var stickyContainerBaseStyles = {
32
32
  height: "var(--ds-space-250, 20px)",
33
33
  // MAX_BROWSER_SCROLLBAR_HEIGHT
34
34
  // Follow editor to hide by default so it does not show empty gap in SSR
35
- // https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
35
+ // https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-table/src/nodeviews/TableComponent.tsx#957
36
36
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
37
37
  display: 'block',
38
38
  width: '100%'
@@ -61,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
61
61
  var TABLE_INFO_TIMEOUT = 10000;
62
62
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
63
63
  var packageName = "@atlaskit/renderer";
64
- var packageVersion = "125.0.2";
64
+ var packageVersion = "125.1.1";
65
65
  var setAsQueryContainerStyles = css({
66
66
  containerName: 'ak-renderer-wrapper',
67
67
  containerType: 'inline-size'
@@ -131,6 +131,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
131
131
  private getEmojiProps;
132
132
  private getEmbedCardProps;
133
133
  private getBlockCardProps;
134
+ private getInlineCardProps;
134
135
  private getMediaGroupProps;
135
136
  private getMediaInlineProps;
136
137
  private getTaskItemProps;
@@ -14,6 +14,7 @@ export default function BlockCard(props: {
14
14
  isNodeNested?: boolean;
15
15
  layout?: string;
16
16
  localId?: string;
17
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
17
18
  portal?: HTMLElement;
18
19
  rendererAppearance?: RendererAppearance;
19
20
  smartLinks?: SmartLinksOptions;
@@ -13,6 +13,7 @@ type EmbedCardInternalProps = {
13
13
  isInsideOfBlockNode?: boolean;
14
14
  isInsideOfInlineExtension?: boolean;
15
15
  layout: RichMediaLayout;
16
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
16
17
  originalHeight?: number;
17
18
  originalWidth?: number;
18
19
  portal?: HTMLElement;
@@ -21,6 +22,6 @@ type EmbedCardInternalProps = {
21
22
  url?: string;
22
23
  width?: number;
23
24
  };
24
- export declare const EmbedOrBlockCardInternal: ({ url, data, eventHandlers, portal, originalHeight, originalWidth, width: embedWidth, layout, rendererAppearance, isInsideOfBlockNode, smartLinks, isInsideOfInlineExtension, }: EmbedCardInternalProps) => jsx.JSX.Element;
25
+ export declare const EmbedOrBlockCardInternal: ({ url, data, eventHandlers, portal, originalHeight, originalWidth, width: embedWidth, layout, rendererAppearance, isInsideOfBlockNode, smartLinks, isInsideOfInlineExtension, onSetLinkTarget, }: EmbedCardInternalProps) => jsx.JSX.Element;
25
26
  declare const EmbedCardWithCondition: import("react").FC<EmbedCardInternalProps>;
26
27
  export default EmbedCardWithCondition;
@@ -32,7 +32,7 @@ type RenderExtensionOptions = {
32
32
  } & AllOrNone<OverflowShadowProps>;
33
33
  export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string, localId?: string) => React.JSX.Element;
34
34
  declare const _default: {
35
- new (props: (Props & OverflowShadowProps) | Readonly<Props & OverflowShadowProps>): {
35
+ new (props: Props & OverflowShadowProps): {
36
36
  overflowContainer?: HTMLElement | null;
37
37
  container?: HTMLElement;
38
38
  shadowObserver?: import("@atlaskit/editor-common/ui").ShadowObserver;
@@ -7,6 +7,7 @@ export declare class CardErrorBoundary extends React.PureComponent<{
7
7
  datasourceId?: string;
8
8
  isDatasource?: boolean;
9
9
  onClick?: (e: React.MouseEvent<HTMLElement>, url?: string) => void;
10
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
10
11
  url?: string;
11
12
  } & CardErrorBoundaryProps> {
12
13
  state: {
@@ -40,6 +40,7 @@ declare const EmbedCard: React.ComponentType<{
40
40
  isInsideOfBlockNode?: boolean;
41
41
  isInsideOfInlineExtension?: boolean;
42
42
  layout: import("@atlaskit/adf-schema").RichMediaLayout;
43
+ onSetLinkTarget?: (url: string) => "_blank" | undefined;
43
44
  originalHeight?: number;
44
45
  originalWidth?: number;
45
46
  portal?: HTMLElement;
@@ -56,6 +57,7 @@ declare const BlockCard: React.ComponentType<{
56
57
  isNodeNested?: boolean;
57
58
  layout?: string;
58
59
  localId?: string;
60
+ onSetLinkTarget?: (url: string) => "_blank" | undefined;
59
61
  portal?: HTMLElement;
60
62
  rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
61
63
  smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions;
@@ -10,13 +10,14 @@ export interface InlineCardProps extends MarkDataAttributes {
10
10
  eventHandlers?: EventHandlers;
11
11
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
12
12
  marks?: Mark[];
13
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
13
14
  portal?: HTMLElement;
14
15
  rendererAppearance?: RendererAppearance;
15
16
  smartLinks?: SmartLinksOptions;
16
17
  url?: string;
17
18
  }
18
19
  declare const _default: {
19
- new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>): {
20
+ new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>): {
20
21
  render(): import("react").JSX.Element;
21
22
  context: unknown;
22
23
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -113,7 +113,7 @@ export declare class TableProcessor extends React.Component<TableProps & Overflo
113
113
  private addNumberColumnIndexes;
114
114
  }
115
115
  declare const _default: {
116
- new (props: import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>>): {
116
+ new (props: import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>): {
117
117
  render(): React.JSX.Element;
118
118
  context: unknown;
119
119
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -6,7 +6,7 @@ export interface WithSmartCardStorageProps {
6
6
  export declare const Context: React.Context<Map<string, string>>;
7
7
  export declare const Provider: ({ children, }: React.PropsWithChildren<unknown>) => React.JSX.Element;
8
8
  export declare const withSmartCardStorage: <Props extends WithSmartCardStorageProps>(WrappedComponent: React.ComponentType<React.PropsWithChildren<Props>>) => {
9
- new (props: Diff<Props, WithSmartCardStorageProps> | Readonly<Diff<Props, WithSmartCardStorageProps>>): {
9
+ new (props: Diff<Props, WithSmartCardStorageProps>): {
10
10
  render(): React.JSX.Element;
11
11
  context: unknown;
12
12
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -131,6 +131,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
131
131
  private getEmojiProps;
132
132
  private getEmbedCardProps;
133
133
  private getBlockCardProps;
134
+ private getInlineCardProps;
134
135
  private getMediaGroupProps;
135
136
  private getMediaInlineProps;
136
137
  private getTaskItemProps;
@@ -14,6 +14,7 @@ export default function BlockCard(props: {
14
14
  isNodeNested?: boolean;
15
15
  layout?: string;
16
16
  localId?: string;
17
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
17
18
  portal?: HTMLElement;
18
19
  rendererAppearance?: RendererAppearance;
19
20
  smartLinks?: SmartLinksOptions;
@@ -13,6 +13,7 @@ type EmbedCardInternalProps = {
13
13
  isInsideOfBlockNode?: boolean;
14
14
  isInsideOfInlineExtension?: boolean;
15
15
  layout: RichMediaLayout;
16
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
16
17
  originalHeight?: number;
17
18
  originalWidth?: number;
18
19
  portal?: HTMLElement;
@@ -21,6 +22,6 @@ type EmbedCardInternalProps = {
21
22
  url?: string;
22
23
  width?: number;
23
24
  };
24
- export declare const EmbedOrBlockCardInternal: ({ url, data, eventHandlers, portal, originalHeight, originalWidth, width: embedWidth, layout, rendererAppearance, isInsideOfBlockNode, smartLinks, isInsideOfInlineExtension, }: EmbedCardInternalProps) => jsx.JSX.Element;
25
+ export declare const EmbedOrBlockCardInternal: ({ url, data, eventHandlers, portal, originalHeight, originalWidth, width: embedWidth, layout, rendererAppearance, isInsideOfBlockNode, smartLinks, isInsideOfInlineExtension, onSetLinkTarget, }: EmbedCardInternalProps) => jsx.JSX.Element;
25
26
  declare const EmbedCardWithCondition: import("react").FC<EmbedCardInternalProps>;
26
27
  export default EmbedCardWithCondition;
@@ -32,7 +32,7 @@ type RenderExtensionOptions = {
32
32
  } & AllOrNone<OverflowShadowProps>;
33
33
  export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string, localId?: string) => React.JSX.Element;
34
34
  declare const _default: {
35
- new (props: (Props & OverflowShadowProps) | Readonly<Props & OverflowShadowProps>): {
35
+ new (props: Props & OverflowShadowProps): {
36
36
  overflowContainer?: HTMLElement | null;
37
37
  container?: HTMLElement;
38
38
  shadowObserver?: import("@atlaskit/editor-common/ui").ShadowObserver;
@@ -7,6 +7,7 @@ export declare class CardErrorBoundary extends React.PureComponent<{
7
7
  datasourceId?: string;
8
8
  isDatasource?: boolean;
9
9
  onClick?: (e: React.MouseEvent<HTMLElement>, url?: string) => void;
10
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
10
11
  url?: string;
11
12
  } & CardErrorBoundaryProps> {
12
13
  state: {
@@ -40,6 +40,7 @@ declare const EmbedCard: React.ComponentType<{
40
40
  isInsideOfBlockNode?: boolean;
41
41
  isInsideOfInlineExtension?: boolean;
42
42
  layout: import("@atlaskit/adf-schema").RichMediaLayout;
43
+ onSetLinkTarget?: (url: string) => "_blank" | undefined;
43
44
  originalHeight?: number;
44
45
  originalWidth?: number;
45
46
  portal?: HTMLElement;
@@ -56,6 +57,7 @@ declare const BlockCard: React.ComponentType<{
56
57
  isNodeNested?: boolean;
57
58
  layout?: string;
58
59
  localId?: string;
60
+ onSetLinkTarget?: (url: string) => "_blank" | undefined;
59
61
  portal?: HTMLElement;
60
62
  rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
61
63
  smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions;
@@ -10,13 +10,14 @@ export interface InlineCardProps extends MarkDataAttributes {
10
10
  eventHandlers?: EventHandlers;
11
11
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
12
12
  marks?: Mark[];
13
+ onSetLinkTarget?: (url: string) => '_blank' | undefined;
13
14
  portal?: HTMLElement;
14
15
  rendererAppearance?: RendererAppearance;
15
16
  smartLinks?: SmartLinksOptions;
16
17
  url?: string;
17
18
  }
18
19
  declare const _default: {
19
- new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>): {
20
+ new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>): {
20
21
  render(): import("react").JSX.Element;
21
22
  context: unknown;
22
23
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -113,7 +113,7 @@ export declare class TableProcessor extends React.Component<TableProps & Overflo
113
113
  private addNumberColumnIndexes;
114
114
  }
115
115
  declare const _default: {
116
- new (props: import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>>): {
116
+ new (props: import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>): {
117
117
  render(): React.JSX.Element;
118
118
  context: unknown;
119
119
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<any, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -6,7 +6,7 @@ export interface WithSmartCardStorageProps {
6
6
  export declare const Context: React.Context<Map<string, string>>;
7
7
  export declare const Provider: ({ children, }: React.PropsWithChildren<unknown>) => React.JSX.Element;
8
8
  export declare const withSmartCardStorage: <Props extends WithSmartCardStorageProps>(WrappedComponent: React.ComponentType<React.PropsWithChildren<Props>>) => {
9
- new (props: Diff<Props, WithSmartCardStorageProps> | Readonly<Diff<Props, WithSmartCardStorageProps>>): {
9
+ new (props: Diff<Props, WithSmartCardStorageProps>): {
10
10
  render(): React.JSX.Element;
11
11
  context: unknown;
12
12
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Diff<Props, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "125.1.0",
3
+ "version": "125.2.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/feature-gate-js-client": "^5.5.0",
41
41
  "@atlaskit/icon": "^29.3.0",
42
42
  "@atlaskit/link": "^3.3.0",
43
- "@atlaskit/link-datasource": "^4.30.0",
43
+ "@atlaskit/link-datasource": "^4.31.0",
44
44
  "@atlaskit/link-extractors": "^2.4.0",
45
45
  "@atlaskit/linking-common": "^9.9.0",
46
46
  "@atlaskit/media-card": "^79.12.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/status": "^3.0.0",
58
58
  "@atlaskit/task-decision": "^19.2.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^16.7.0",
60
+ "@atlaskit/tmp-editor-statsig": "^16.8.0",
61
61
  "@atlaskit/tokens": "^9.1.0",
62
62
  "@atlaskit/tooltip": "^20.11.0",
63
63
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -71,7 +71,7 @@
71
71
  "uuid": "^3.1.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^111.4.0",
74
+ "@atlaskit/editor-common": "^111.5.0",
75
75
  "@atlaskit/link-provider": "^4.1.0",
76
76
  "@atlaskit/media-core": "^37.0.0",
77
77
  "react": "^18.2.0",