@atlaskit/smart-card 26.46.0 → 26.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/messages.js +5 -0
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +33 -0
  5. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +77 -0
  6. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/types.js +5 -0
  7. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +8 -19
  8. package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -1
  9. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +10 -2
  10. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +11 -2
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/cjs/view/common/ai-icon/index.js +117 -0
  13. package/dist/cjs/view/common/ai-prism/ai-glowing-border/animated-svg-container.js +249 -0
  14. package/dist/cjs/view/common/ai-prism/ai-glowing-border/index.js +55 -0
  15. package/dist/cjs/view/common/ai-prism/ai-glowing-border/types.js +5 -0
  16. package/dist/cjs/view/common/ai-prism/constants.js +53 -0
  17. package/dist/cjs/view/common/ai-prism/index.js +45 -0
  18. package/dist/cjs/view/common/ai-prism/types.js +5 -0
  19. package/dist/es2019/messages.js +5 -0
  20. package/dist/es2019/utils/analytics/analytics.js +1 -1
  21. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +25 -0
  22. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +66 -0
  23. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/types.js +1 -0
  24. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +1 -12
  25. package/dist/es2019/view/FlexibleCard/components/blocks/index.js +2 -1
  26. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +10 -0
  27. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +14 -4
  28. package/dist/es2019/view/LinkUrl/index.js +1 -1
  29. package/dist/es2019/view/common/ai-icon/index.js +108 -0
  30. package/dist/es2019/view/common/ai-prism/ai-glowing-border/animated-svg-container.js +236 -0
  31. package/dist/es2019/view/common/ai-prism/ai-glowing-border/index.js +45 -0
  32. package/dist/es2019/view/common/ai-prism/ai-glowing-border/types.js +1 -0
  33. package/dist/es2019/view/common/ai-prism/constants.js +47 -0
  34. package/dist/es2019/view/common/ai-prism/index.js +36 -0
  35. package/dist/es2019/view/common/ai-prism/types.js +1 -0
  36. package/dist/esm/messages.js +5 -0
  37. package/dist/esm/utils/analytics/analytics.js +1 -1
  38. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +27 -0
  39. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +67 -0
  40. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/types.js +1 -0
  41. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +1 -12
  42. package/dist/esm/view/FlexibleCard/components/blocks/index.js +2 -1
  43. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +9 -1
  44. package/dist/esm/view/HoverCard/components/views/resolved/index.js +13 -4
  45. package/dist/esm/view/LinkUrl/index.js +1 -1
  46. package/dist/esm/view/common/ai-icon/index.js +110 -0
  47. package/dist/esm/view/common/ai-prism/ai-glowing-border/animated-svg-container.js +239 -0
  48. package/dist/esm/view/common/ai-prism/ai-glowing-border/index.js +47 -0
  49. package/dist/esm/view/common/ai-prism/ai-glowing-border/types.js +1 -0
  50. package/dist/esm/view/common/ai-prism/constants.js +47 -0
  51. package/dist/esm/view/common/ai-prism/index.js +37 -0
  52. package/dist/esm/view/common/ai-prism/types.js +1 -0
  53. package/dist/types/__fixtures__/atlas-project-with-ai-summary.d.ts +2 -0
  54. package/dist/types/messages.d.ts +1 -1
  55. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +11 -0
  56. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +4 -0
  57. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +23 -0
  58. package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
  59. package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +1 -0
  60. package/dist/types/view/common/ai-icon/index.d.ts +9 -0
  61. package/dist/types/view/common/ai-prism/ai-glowing-border/animated-svg-container.d.ts +9 -0
  62. package/dist/types/view/common/ai-prism/ai-glowing-border/index.d.ts +10 -0
  63. package/dist/types/view/common/ai-prism/ai-glowing-border/types.d.ts +25 -0
  64. package/dist/types/view/common/ai-prism/constants.d.ts +30 -0
  65. package/dist/types/view/common/ai-prism/index.d.ts +4 -0
  66. package/dist/types/view/common/ai-prism/types.d.ts +13 -0
  67. package/dist/types-ts4.5/__fixtures__/atlas-project-with-ai-summary.d.ts +2 -0
  68. package/dist/types-ts4.5/messages.d.ts +1 -1
  69. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +11 -0
  70. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +4 -0
  71. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +23 -0
  72. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/index.d.ts +1 -0
  73. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/utils.d.ts +1 -0
  74. package/dist/types-ts4.5/view/common/ai-icon/index.d.ts +9 -0
  75. package/dist/types-ts4.5/view/common/ai-prism/ai-glowing-border/animated-svg-container.d.ts +9 -0
  76. package/dist/types-ts4.5/view/common/ai-prism/ai-glowing-border/index.d.ts +10 -0
  77. package/dist/types-ts4.5/view/common/ai-prism/ai-glowing-border/types.d.ts +25 -0
  78. package/dist/types-ts4.5/view/common/ai-prism/constants.d.ts +30 -0
  79. package/dist/types-ts4.5/view/common/ai-prism/index.d.ts +4 -0
  80. package/dist/types-ts4.5/view/common/ai-prism/types.d.ts +13 -0
  81. package/package.json +10 -7
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
4
- import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
5
- import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
4
+ import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
5
+ import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock } from '../../../../FlexibleCard/components/blocks';
6
6
  import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
7
7
  import FlexibleCard from '../../../../FlexibleCard';
8
8
  import { getSimulatedBetterMetadata } from '../../../utils';
@@ -12,6 +12,7 @@ import { messages } from '../../../../../messages';
12
12
  import { FormattedMessage } from 'react-intl-next';
13
13
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
14
  import { getCanBeDatasource } from '../../../../../state/helpers';
15
+ import { useSmartLinkContext } from '../../../../../state';
15
16
  export var toFooterActions = function toFooterActions(cardActions, onActionClick) {
16
17
  var followAction = {
17
18
  hideIcon: true,
@@ -47,7 +48,7 @@ export var toFooterActions = function toFooterActions(cardActions, onActionClick
47
48
  return [followAction].concat(_toConsumableArray(actions));
48
49
  };
49
50
  var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
50
- var _cardState$details;
51
+ var _cardState$details, _cardState$details2;
51
52
  var flexibleCardProps = _ref.flexibleCardProps,
52
53
  titleBlockProps = _ref.titleBlockProps,
53
54
  analytics = _ref.analytics,
@@ -92,6 +93,9 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
92
93
  data: data,
93
94
  fallbackElementHeight: snippetHeight.current
94
95
  });
96
+ var _useSmartLinkContext = useSmartLinkContext(),
97
+ isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
98
+ var showAiView = getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && ((_cardState$details2 = cardState.details) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.meta) === null || _cardState$details2 === void 0 || (_cardState$details2 = _cardState$details2.supportedFeatures) === null || _cardState$details2 === void 0 ? void 0 : _cardState$details2.includes('AISummary'));
95
99
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
96
100
  metadataPosition: SmartLinkPosition.Top
97
101
  })), /*#__PURE__*/React.createElement(MetadataBlock, {
@@ -113,7 +117,12 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
113
117
  }), getBooleanFF('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
114
118
  url: url,
115
119
  size: SmartLinkSize.Small
116
- }), /*#__PURE__*/React.createElement(FooterBlock, {
120
+ }), showAiView ? /*#__PURE__*/React.createElement(AISummaryBlock, {
121
+ metadata: [{
122
+ name: ElementName.Provider
123
+ }],
124
+ actions: footerActions
125
+ }) : /*#__PURE__*/React.createElement(FooterBlock, {
117
126
  actions: footerActions,
118
127
  size: SmartLinkSize.Large,
119
128
  overrideCss: footerBlockCss
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
10
10
  import LinkWarningModal from './LinkWarningModal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "26.46.0",
13
+ packageVersion: "26.46.2",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -0,0 +1,110 @@
1
+ import React from 'react';
2
+ import SVG from '@atlaskit/icon/svg';
3
+ import { B200, B400 } from '@atlaskit/theme/colors';
4
+ /**
5
+ * The bulk of this file is originally from
6
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
7
+ * with modifications
8
+ */
9
+ var AiIcon = function AiIcon(props) {
10
+ return /*#__PURE__*/React.createElement(SVG, props, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
11
+ id: "ai_icon_lg0",
12
+ x1: "21",
13
+ y1: "12",
14
+ x2: "17.5",
15
+ y2: "12",
16
+ gradientUnits: "userSpaceOnUse"
17
+ }, /*#__PURE__*/React.createElement("stop", {
18
+ offset: "0.270833",
19
+ stopColor: "var(--ds-icon-accent-blue, ".concat(B200, ")"),
20
+ color: "var(--ds-icon-accent-blue, ".concat(B200, ")")
21
+ }), /*#__PURE__*/React.createElement("stop", {
22
+ offset: "1",
23
+ stopColor: "var(--ds-text-accent-blue, ".concat(B400, ")"),
24
+ color: "var(--ds-text-accent-blue, ".concat(B400, ")")
25
+ })), /*#__PURE__*/React.createElement("linearGradient", {
26
+ id: "ai_icon_lg1",
27
+ x1: "12.5",
28
+ y1: "3",
29
+ x2: "12.5",
30
+ y2: "6.5",
31
+ gradientUnits: "userSpaceOnUse"
32
+ }, /*#__PURE__*/React.createElement("stop", {
33
+ offset: "0.1875",
34
+ stopColor: "var(--ds-icon-accent-blue, ".concat(B200, ")"),
35
+ color: "var(--ds-icon-accent-blue, ".concat(B200, ")")
36
+ }), /*#__PURE__*/React.createElement("stop", {
37
+ offset: "1",
38
+ stopColor: "var(--ds-text-accent-blue, ".concat(B400, ")"),
39
+ color: "var(--ds-text-accent-blue, ".concat(B400, ")")
40
+ })), /*#__PURE__*/React.createElement("linearGradient", {
41
+ id: "ai_icon_lg2",
42
+ x1: "6.82996",
43
+ y1: "12",
44
+ x2: "3.32996",
45
+ y2: "12",
46
+ gradientUnits: "userSpaceOnUse"
47
+ }, /*#__PURE__*/React.createElement("stop", {
48
+ stopColor: "var(--ds-text-accent-blue, ".concat(B400, ")"),
49
+ color: "var(--ds-text-accent-blue, ".concat(B400, ")")
50
+ }), /*#__PURE__*/React.createElement("stop", {
51
+ offset: "0.791667",
52
+ stopColor: "var(--ds-icon-accent-blue, ".concat(B200, ")"),
53
+ color: "var(--ds-icon-accent-blue, ".concat(B200, ")")
54
+ })), /*#__PURE__*/React.createElement("linearGradient", {
55
+ id: "ai_icon_lg3",
56
+ x1: "12.5",
57
+ y1: "17",
58
+ x2: "12.5",
59
+ y2: "21",
60
+ gradientUnits: "userSpaceOnUse"
61
+ }, /*#__PURE__*/React.createElement("stop", {
62
+ stopColor: "var(--ds-text-accent-blue, ".concat(B400, ")"),
63
+ color: "var(--ds-text-accent-blue, ".concat(B400, ")")
64
+ }), /*#__PURE__*/React.createElement("stop", {
65
+ offset: "0.802083",
66
+ stopColor: "var(--ds-icon-accent-blue, ".concat(B200, ")"),
67
+ color: "var(--ds-icon-accent-blue, ".concat(B200, ")")
68
+ }))), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
69
+ fillRule: "evenodd",
70
+ clipRule: "evenodd",
71
+ d: "M17.17 12C17.17 11.4477 17.6177 11 18.17 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H18.17C17.6177 13 17.17 12.5523 17.17 12Z",
72
+ fill: "url(#ai_icon_lg0)"
73
+ }), /*#__PURE__*/React.createElement("path", {
74
+ fillRule: "evenodd",
75
+ clipRule: "evenodd",
76
+ d: "M12 3C12.5523 3 13 3.44772 13 4V5.83C13 6.38228 12.5523 6.83 12 6.83C11.4477 6.83 11 6.38228 11 5.83V4C11 3.44772 11.4477 3 12 3Z",
77
+ fill: "url(#ai_icon_lg1)"
78
+ }), /*#__PURE__*/React.createElement("path", {
79
+ fillRule: "evenodd",
80
+ clipRule: "evenodd",
81
+ d: "M3 12C3 11.4477 3.44772 11 4 11H5.83C6.38228 11 6.83 11.4477 6.83 12C6.83 12.5523 6.38228 13 5.83 13H4C3.44772 13 3 12.5523 3 12Z",
82
+ fill: "url(#ai_icon_lg2)"
83
+ }), /*#__PURE__*/React.createElement("path", {
84
+ fillRule: "evenodd",
85
+ clipRule: "evenodd",
86
+ d: "M12 17.17C12.5523 17.17 13 17.6177 13 18.17V20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20V18.17C11 17.6177 11.4477 17.17 12 17.17Z",
87
+ fill: "url(#ai_icon_lg3)"
88
+ }), /*#__PURE__*/React.createElement("path", {
89
+ fillRule: "evenodd",
90
+ clipRule: "evenodd",
91
+ d: "M14.2929 14.2929C14.6835 13.9024 15.3166 13.9024 15.7071 14.2929L19.7071 18.2929C20.0977 18.6834 20.0977 19.3166 19.7071 19.7071C19.3166 20.0976 18.6835 20.0976 18.2929 19.7071L14.2929 15.7071C13.9024 15.3166 13.9024 14.6834 14.2929 14.2929Z",
92
+ fill: "var(--ds-icon-accent-blue, ".concat(B200, ")")
93
+ }), /*#__PURE__*/React.createElement("path", {
94
+ fillRule: "evenodd",
95
+ clipRule: "evenodd",
96
+ d: "M19.7071 4.29289C20.0977 4.68342 20.0977 5.31658 19.7071 5.70711L15.7071 9.70711C15.3166 10.0976 14.6835 10.0976 14.2929 9.70711C13.9024 9.31658 13.9024 8.68342 14.2929 8.29289L18.2929 4.29289C18.6835 3.90237 19.3166 3.90237 19.7071 4.29289Z",
97
+ fill: "var(--ds-icon-accent-blue, ".concat(B200, ")")
98
+ }), /*#__PURE__*/React.createElement("path", {
99
+ fillRule: "evenodd",
100
+ clipRule: "evenodd",
101
+ d: "M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z",
102
+ fill: "var(--ds-icon-accent-blue, ".concat(B200, ")")
103
+ }), /*#__PURE__*/React.createElement("path", {
104
+ fillRule: "evenodd",
105
+ clipRule: "evenodd",
106
+ d: "M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z",
107
+ fill: "var(--ds-icon-accent-blue, ".concat(B200, ")")
108
+ })));
109
+ };
110
+ export default AiIcon;
@@ -0,0 +1,239 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ import React, { useEffect, useRef } from 'react';
4
+ import { GLOW_SIZE, OUTER_BORDER_RADIUS } from '../constants';
5
+ var namespaceUUID = 0;
6
+ var svgStyles = css({
7
+ position: 'absolute',
8
+ borderRadius: OUTER_BORDER_RADIUS
9
+ });
10
+ var blurredStyles = css({
11
+ width: "calc(100% - ".concat(GLOW_SIZE / 2, "px)"),
12
+ height: "calc(100% - ".concat(GLOW_SIZE / 2, "px)"),
13
+ top: GLOW_SIZE / 2,
14
+ left: GLOW_SIZE / 2,
15
+ filter: "blur(".concat(GLOW_SIZE, "px)"),
16
+ // for safari... : https://stackoverflow.com/a/71353198
17
+ backfaceVisibility: 'hidden',
18
+ transform: 'translate3d(0, 0, 0)'
19
+ });
20
+ var notBlurredStyles = css({
21
+ left: 0,
22
+ top: 0,
23
+ width: '100%',
24
+ height: '100%'
25
+ });
26
+
27
+ /**
28
+ * The bulk of this file is originally from
29
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
30
+ * with modifications.
31
+ */
32
+ var AnimatedSvgContainer = function AnimatedSvgContainer(_ref) {
33
+ var palette = _ref.palette,
34
+ isMoving = _ref.isMoving,
35
+ isGlowing = _ref.isGlowing,
36
+ additionalCss = _ref.additionalCss;
37
+ var svgRef = useRef(null);
38
+ var namespaceId = useRef();
39
+ if (namespaceId.current === undefined) {
40
+ namespaceId.current = namespaceUUID;
41
+ namespaceUUID += 1;
42
+ }
43
+ useEffect(function () {
44
+ if (isMoving) {
45
+ var svg = svgRef.current;
46
+
47
+ // Schedule animation to begin before next browser paint
48
+ var beginReq = requestAnimationFrame(function () {
49
+ svg === null || svg === void 0 || svg.querySelectorAll('animate').forEach(function (node) {
50
+ return node.beginElement();
51
+ });
52
+ });
53
+ return function () {
54
+ // Ensure any pending animation frame is cancelled as the element animation does not end properly if it
55
+ // begins in the same event tick, i.e. isLoading synchronously changes to true then false.
56
+ cancelAnimationFrame(beginReq);
57
+ requestAnimationFrame(function () {
58
+ svg === null || svg === void 0 || svg.querySelectorAll('animate').forEach(function (node) {
59
+ return node.endElement();
60
+ });
61
+ });
62
+ };
63
+ }
64
+ return undefined;
65
+ }, [isMoving]);
66
+ return jsx("svg", {
67
+ css: [svgStyles, isGlowing ? blurredStyles : notBlurredStyles, additionalCss],
68
+ ref: svgRef,
69
+ viewBox: "0 0 24 24",
70
+ preserveAspectRatio: "none"
71
+ }, jsx("defs", null, jsx("linearGradient", {
72
+ id: "".concat(namespaceId.current, "_lg1"),
73
+ gradientUnits: "userSpaceOnUse",
74
+ x1: "0%",
75
+ y1: "0",
76
+ x2: "400%",
77
+ y2: "0",
78
+ spreadMethod: "reflect"
79
+ }, jsx("animate", {
80
+ begin: "indefinite",
81
+ attributeName: "x1",
82
+ from: "0%",
83
+ to: "400%",
84
+ repeatCount: "indefinite",
85
+ dur: "3s"
86
+ }), jsx("animate", {
87
+ begin: "indefinite",
88
+ attributeName: "x2",
89
+ from: "400%",
90
+ to: "800%",
91
+ repeatCount: "indefinite",
92
+ dur: "3s"
93
+ }), jsx("stop", {
94
+ offset: "0",
95
+ stopColor: palette.blue
96
+ }), jsx("stop", {
97
+ offset: "0.25",
98
+ stopColor: palette.teal
99
+ }), jsx("stop", {
100
+ offset: "0.5",
101
+ stopColor: palette.yellow
102
+ }), jsx("stop", {
103
+ offset: "0.75",
104
+ stopColor: palette.teal
105
+ }), jsx("stop", {
106
+ offset: "1",
107
+ stopColor: palette.blue
108
+ })), jsx("linearGradient", {
109
+ id: "".concat(namespaceId.current, "_lg2"),
110
+ gradientUnits: "userSpaceOnUse",
111
+ x1: "0",
112
+ y1: "-100%",
113
+ x2: "0",
114
+ y2: "300%",
115
+ spreadMethod: "reflect"
116
+ }, jsx("animate", {
117
+ begin: "indefinite",
118
+ attributeName: "y1",
119
+ from: "-100%",
120
+ to: "300%",
121
+ repeatCount: "indefinite",
122
+ dur: "3s"
123
+ }), jsx("animate", {
124
+ begin: "indefinite",
125
+ attributeName: "y2",
126
+ from: "300%",
127
+ to: "700%",
128
+ repeatCount: "indefinite",
129
+ dur: "3s"
130
+ }), jsx("stop", {
131
+ offset: "0",
132
+ stopColor: palette.blue
133
+ }), jsx("stop", {
134
+ offset: "0.25",
135
+ stopColor: palette.teal
136
+ }), jsx("stop", {
137
+ offset: "0.5",
138
+ stopColor: palette.yellow
139
+ }), jsx("stop", {
140
+ offset: "0.75",
141
+ stopColor: palette.teal
142
+ }), jsx("stop", {
143
+ offset: "1",
144
+ stopColor: palette.blue
145
+ })), jsx("linearGradient", {
146
+ id: "".concat(namespaceId.current, "_lg3"),
147
+ gradientUnits: "userSpaceOnUse",
148
+ x1: "300%",
149
+ y1: "0",
150
+ x2: "700%",
151
+ y2: "0",
152
+ spreadMethod: "reflect"
153
+ }, jsx("animate", {
154
+ begin: "indefinite",
155
+ attributeName: "x1",
156
+ from: "300%",
157
+ to: "-100%",
158
+ repeatCount: "indefinite",
159
+ dur: "3s"
160
+ }), jsx("animate", {
161
+ begin: "indefinite",
162
+ attributeName: "x2",
163
+ from: "700%",
164
+ to: "300%",
165
+ repeatCount: "indefinite",
166
+ dur: "3s"
167
+ }), jsx("stop", {
168
+ offset: "0",
169
+ stopColor: palette.blue
170
+ }), jsx("stop", {
171
+ offset: "0.25",
172
+ stopColor: palette.teal
173
+ }), jsx("stop", {
174
+ offset: "0.5",
175
+ stopColor: palette.yellow
176
+ }), jsx("stop", {
177
+ offset: "0.75",
178
+ stopColor: palette.teal
179
+ }), jsx("stop", {
180
+ offset: "1",
181
+ stopColor: palette.blue
182
+ })), jsx("linearGradient", {
183
+ id: "".concat(namespaceId.current, "_lg4"),
184
+ gradientUnits: "userSpaceOnUse",
185
+ x1: "0",
186
+ y1: "0",
187
+ x2: "0",
188
+ y2: "400%",
189
+ spreadMethod: "reflect"
190
+ }, jsx("animate", {
191
+ begin: "indefinite",
192
+ attributeName: "y1",
193
+ from: "0%",
194
+ to: "-400%",
195
+ repeatCount: "indefinite",
196
+ dur: "3s"
197
+ }), jsx("animate", {
198
+ begin: "indefinite",
199
+ attributeName: "y2",
200
+ from: "400%",
201
+ to: "0%",
202
+ repeatCount: "indefinite",
203
+ dur: "3s"
204
+ }), jsx("stop", {
205
+ offset: "0",
206
+ stopColor: palette.blue
207
+ }), jsx("stop", {
208
+ offset: "0.25",
209
+ stopColor: palette.teal
210
+ }), jsx("stop", {
211
+ offset: "0.5",
212
+ stopColor: palette.yellow
213
+ }), jsx("stop", {
214
+ offset: "0.75",
215
+ stopColor: palette.teal
216
+ }), jsx("stop", {
217
+ offset: "1",
218
+ stopColor: palette.blue
219
+ }))), jsx("g", {
220
+ strokeWidth: "8"
221
+ }, jsx("path", {
222
+ stroke: "url(#".concat(namespaceId.current, "_lg1)"),
223
+ d: "M0 0h24",
224
+ vectorEffect: "non-scaling-stroke"
225
+ }), jsx("path", {
226
+ stroke: "url(#".concat(namespaceId.current, "_lg2)"),
227
+ d: "M24 0v24",
228
+ vectorEffect: "non-scaling-stroke"
229
+ }), jsx("path", {
230
+ stroke: "url(#".concat(namespaceId.current, "_lg3)"),
231
+ d: "M24 24H0",
232
+ vectorEffect: "non-scaling-stroke"
233
+ }), jsx("path", {
234
+ stroke: "url(#".concat(namespaceId.current, "_lg4)"),
235
+ d: "M0 24V0",
236
+ vectorEffect: "non-scaling-stroke"
237
+ })));
238
+ };
239
+ export default AnimatedSvgContainer;
@@ -0,0 +1,47 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ import React from 'react';
4
+ import AnimatedSvgContainer from './animated-svg-container';
5
+ import { INNER_BORDER_RADIUS } from '../constants';
6
+ var borderContainerStyles = css({
7
+ display: 'flex',
8
+ position: 'relative',
9
+ padding: "var(--ds-space-025, 2px)",
10
+ width: 'fit-content'
11
+ });
12
+ export var borderContentStyles = css({
13
+ borderRadius: INNER_BORDER_RADIUS,
14
+ flexGrow: 1,
15
+ zIndex: 1 // needs to be more than the svg container at least
16
+ });
17
+
18
+ /**
19
+ * The bulk of this file is originally from
20
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
21
+ * with modifications.
22
+ */
23
+ var AIGlowingBorder = function AIGlowingBorder(_ref) {
24
+ var children = _ref.children,
25
+ palette = _ref.palette,
26
+ _ref$isMoving = _ref.isMoving,
27
+ isMoving = _ref$isMoving === void 0 ? true : _ref$isMoving,
28
+ isGlowing = _ref.isGlowing,
29
+ testId = _ref.testId,
30
+ additionalCss = _ref.additionalCss;
31
+ return jsx("div", {
32
+ css: [borderContainerStyles, additionalCss === null || additionalCss === void 0 ? void 0 : additionalCss.container],
33
+ "data-testid": testId
34
+ }, jsx(AnimatedSvgContainer, {
35
+ palette: palette,
36
+ isMoving: isMoving,
37
+ additionalCss: additionalCss === null || additionalCss === void 0 ? void 0 : additionalCss.animatedSvgContainer
38
+ }), isGlowing && jsx(AnimatedSvgContainer, {
39
+ palette: palette,
40
+ isMoving: isMoving,
41
+ isGlowing: true,
42
+ additionalCss: additionalCss === null || additionalCss === void 0 ? void 0 : additionalCss.animatedSvgContainer
43
+ }), jsx("div", {
44
+ css: borderContentStyles
45
+ }, children, " "));
46
+ };
47
+ export default AIGlowingBorder;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The bulk of this file is originally from
3
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
4
+ * with modifications.
5
+ */
6
+
7
+ export var GLOW_SIZE = 8;
8
+ export var INNER_BORDER_RADIUS = 8;
9
+ export var OUTER_BORDER_RADIUS = 10;
10
+
11
+ // We don't yet have design system tokens representing the AI prism colour palette. We should replace this with
12
+ // equivalent tokens when available
13
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
14
+ export var aiThemeTokens = {
15
+ blueUniqueGradientLight: '#00ACF8',
16
+ blueUniqueGradientDark: '#008BD2',
17
+ blue1000: '#092957',
18
+ blue800: '#0055CC',
19
+ blue700: '#0C66E4',
20
+ blue600: '#1D7AFC',
21
+ blue500: '#388BFF',
22
+ blue300: '#85B8FF',
23
+ blue200: '#CCE0FF',
24
+ blue100: '#E9F2FF',
25
+ teal500: '#37B4C3',
26
+ teal300: '#8BDBE5',
27
+ yellow500: '#CF9F02',
28
+ yellow200: '#F8E6A0',
29
+ red800: '#AE2A19',
30
+ red600: '#E34935',
31
+ orange500: '#F18D13',
32
+ orange300: '#FEC57B'
33
+ };
34
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
35
+
36
+ export var AI_BORDER_PALETTE = {
37
+ dark: {
38
+ blue: aiThemeTokens.blue800,
39
+ teal: aiThemeTokens.teal500,
40
+ yellow: aiThemeTokens.yellow500
41
+ },
42
+ light: {
43
+ blue: aiThemeTokens.blue600,
44
+ teal: aiThemeTokens.teal300,
45
+ yellow: aiThemeTokens.yellow200
46
+ }
47
+ };
@@ -0,0 +1,37 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ import React from 'react';
4
+ import { useThemeObserver } from '@atlaskit/tokens';
5
+ import { AI_BORDER_PALETTE, INNER_BORDER_RADIUS } from './constants';
6
+ import AIGlowingBorder from './ai-glowing-border';
7
+ var contentStyles = css({
8
+ backgroundColor: "var(--ds-surface-raised, white)",
9
+ borderRadius: INNER_BORDER_RADIUS
10
+ });
11
+ var AIPrism = function AIPrism(_ref) {
12
+ var _AI_BORDER_PALETTE$co;
13
+ var children = _ref.children,
14
+ _ref$isGlowing = _ref.isGlowing,
15
+ isGlowing = _ref$isGlowing === void 0 ? true : _ref$isGlowing,
16
+ _ref$isMoving = _ref.isMoving,
17
+ isMoving = _ref$isMoving === void 0 ? true : _ref$isMoving,
18
+ isVisible = _ref.isVisible,
19
+ testId = _ref.testId;
20
+ var _useThemeObserver = useThemeObserver(),
21
+ _useThemeObserver$col = _useThemeObserver.colorMode,
22
+ colorMode = _useThemeObserver$col === void 0 ? 'light' : _useThemeObserver$col;
23
+ return jsx(AIGlowingBorder, {
24
+ additionalCss: {
25
+ animatedSvgContainer: css({
26
+ opacity: isVisible ? 1 : 0
27
+ })
28
+ },
29
+ palette: (_AI_BORDER_PALETTE$co = AI_BORDER_PALETTE[colorMode]) !== null && _AI_BORDER_PALETTE$co !== void 0 ? _AI_BORDER_PALETTE$co : AI_BORDER_PALETTE.light,
30
+ isGlowing: isGlowing,
31
+ isMoving: isMoving,
32
+ testId: testId
33
+ }, jsx("div", {
34
+ css: contentStyles
35
+ }, children));
36
+ };
37
+ export default AIPrism;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const mockAtlasProjectWithAISummary: any;
2
+ export default mockAtlasProjectWithAISummary;
@@ -1,6 +1,6 @@
1
1
  import { MessageDescriptor } from 'react-intl-next';
2
2
  export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title_crossjoin' | 'direct_access_title_crossjoin' | 'direct_access_description_crossjoin' | 'direct_access_crossjoin' | 'request_access_description_crossjoin' | 'request_access_crossjoin' | 'request_access_pending_title_crossjoin' | 'request_access_pending_description_crossjoin' | 'request_access_pending_crossjoin' | 'request_denied_description_crossjoin' | 'access_exists_description_crossjoin' | 'not_found_description_crossjoin' | 'not_found_title_crossjoin';
3
- export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
3
+ export type MessageKey = 'assigned_to' | 'ai_summarize' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'follow' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
4
4
  type Messages = {
5
5
  [K in MessageKey]: MessageDescriptor;
6
6
  };
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { AISummaryBlockProps } from './types';
3
+ /**
4
+ * Represents an AISummaryBlock, designed to summarising link resource
5
+ * content using AI.
6
+ * @public
7
+ * @param {AISummaryBlockProps} AISummaryBlock
8
+ * @see Block
9
+ */
10
+ declare const AISummaryBlock: React.FC<AISummaryBlockProps>;
11
+ export default AISummaryBlock;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { AISummaryBlockProps } from '../types';
3
+ declare const AISummaryBlockResolvedView: React.FC<AISummaryBlockProps>;
4
+ export default AISummaryBlockResolvedView;
@@ -0,0 +1,23 @@
1
+ import { ActionItem, BlockProps, ElementItem } from '../types';
2
+ import { OnActionMenuOpenChangeOptions } from '../types';
3
+ export type AISummaryBlockProps = {
4
+ /**
5
+ * An array of actions to be displayed on the right
6
+ * after AI Summary button.
7
+ * @see ActionItem
8
+ */
9
+ actions?: ActionItem[];
10
+ /**
11
+ * An array of metadata elements to display on the left.
12
+ * @see ElementItem
13
+ */
14
+ metadata?: ElementItem[];
15
+ /**
16
+ * Function to be called when footer action dropdown open state is changed.
17
+ */
18
+ onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
19
+ /**
20
+ * Function to be called when AI Summary state changed.
21
+ */
22
+ onAIActionChange?: () => void;
23
+ } & BlockProps;
@@ -6,3 +6,4 @@ export { default as TitleBlock } from './title-block';
6
6
  export { default as CustomBlock } from './block';
7
7
  export { default as InternalFooterBlock } from './footer-block/resolved';
8
8
  export { default as RelatedUrlsBlock } from './related-urls-block';
9
+ export { default as AISummaryBlock } from './ai-summary-block';
@@ -9,6 +9,7 @@ export declare const getGapSize: (size: SmartLinkSize) => number;
9
9
  export declare const getBaseStyles: (direction: SmartLinkDirection, size: SmartLinkSize) => SerializedStyles;
10
10
  export declare const highlightRemoveStyles: SerializedStyles;
11
11
  export declare const isJSXElementNull: (children: JSX.Element) => boolean;
12
+ export declare const getActionGroupStyles: (size: SmartLinkSize) => SerializedStyles | undefined;
12
13
  export declare const filterActionItems: (items?: ActionItem[], context?: FlexibleUiDataContext) => ActionItem[];
13
14
  export declare const renderChildren: (children: React.ReactNode, size: SmartLinkSize) => React.ReactNode;
14
15
  export declare const renderElementItems: (items?: ElementItem[], display?: ElementDisplaySchemaType) => React.ReactNode | undefined;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { SVGProps } from '@atlaskit/icon/types';
3
+ /**
4
+ * The bulk of this file is originally from
5
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
+ * with modifications
7
+ */
8
+ declare const AiIcon: (props: SVGProps) => JSX.Element;
9
+ export default AiIcon;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { AnimatedSvgContainerProps } from './types';
3
+ /**
4
+ * The bulk of this file is originally from
5
+ * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
+ * with modifications.
7
+ */
8
+ declare const AnimatedSvgContainer: React.FC<AnimatedSvgContainerProps>;
9
+ export default AnimatedSvgContainer;