@atlaskit/smart-card 46.14.1 → 46.14.3

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 (20) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration-dark@2x.png +0 -0
  4. package/dist/cjs/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration@2x.png +0 -0
  5. package/dist/cjs/view/InlineCard/common/one-click-chat-spotlight/index.compiled.css +11 -8
  6. package/dist/cjs/view/InlineCard/common/one-click-chat-spotlight/index.js +46 -22
  7. package/dist/cjs/view/LinkUrl/index.js +1 -1
  8. package/dist/es2019/utils/analytics/analytics.js +1 -1
  9. package/dist/es2019/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration-dark@2x.png +0 -0
  10. package/dist/es2019/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration@2x.png +0 -0
  11. package/dist/es2019/view/InlineCard/common/one-click-chat-spotlight/index.compiled.css +11 -8
  12. package/dist/es2019/view/InlineCard/common/one-click-chat-spotlight/index.js +47 -21
  13. package/dist/es2019/view/LinkUrl/index.js +1 -1
  14. package/dist/esm/utils/analytics/analytics.js +1 -1
  15. package/dist/esm/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration-dark@2x.png +0 -0
  16. package/dist/esm/view/InlineCard/common/one-click-chat-spotlight/assets/rovo-snapshot-illustration@2x.png +0 -0
  17. package/dist/esm/view/InlineCard/common/one-click-chat-spotlight/index.compiled.css +11 -8
  18. package/dist/esm/view/InlineCard/common/one-click-chat-spotlight/index.js +46 -21
  19. package/dist/esm/view/LinkUrl/index.js +1 -1
  20. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 46.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`68e34ed4b53ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/68e34ed4b53ae) -
8
+ Add light and dark Rovo snapshot illustrations and updated heading and body to the One Click Chat
9
+ spotlight behind platform_sl_one_click_chat_spotlight_v2_fg.
10
+ - Updated dependencies
11
+
12
+ ## 46.14.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [`3ff81b8eba204`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3ff81b8eba204) -
17
+ Use a primary button for the One Click Chat spotlight CTA behind
18
+ platform_sl_one_click_chat_spotlight_v2_fg.
19
+ - Updated dependencies
20
+
3
21
  ## 46.14.1
4
22
 
5
23
  ### Patch Changes
@@ -25,7 +25,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
25
25
  var context = exports.context = {
26
26
  componentName: 'smart-cards',
27
27
  packageName: "@atlaskit/smart-card" || '',
28
- packageVersion: "46.14.0" || ''
28
+ packageVersion: "46.14.2" || ''
29
29
  };
30
30
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
31
31
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,33 +1,36 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
3
- ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
4
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
5
- ._1dqonqa1{border-style:solid}
6
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._154iidpf{top:0}
7
- ._154iu2gc{top:var(--ds-space-100,8px)}
3
+ ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._154iidpf{top:0}
4
+ ._154ipxbi{top:var(--ds-space-200,1pc)}
8
5
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
9
6
  ._18m91wug{overflow-y:auto}
7
+ ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
10
8
  ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
11
9
  ._19bvv77o{padding-left:var(--ds-space-025,2px)}
10
+ ._1bsb1osq{width:100%}
12
11
  ._1bsb7vkz{width:1pc}
13
- ._1bsbkpet{width:296px}
12
+ ._1bsbi4q4{width:311px}
13
+ ._1e0c1ule{display:block}
14
14
  ._1reo1wug{overflow-x:auto}
15
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
15
+ ._1xi2pxbi{right:var(--ds-space-200,1pc)}
16
+ ._4t3i1wug{height:auto}
16
17
  ._4t3iftgi{height:8px}
17
18
  ._94n5idpf{bottom:0}
18
19
  ._bfhk1aqn{background-color:var(--ds-background-neutral-bold,#292a2e)}
20
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
19
21
  ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
20
22
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
21
23
  ._kqswh2mm{position:relative}
22
24
  ._kqswstnw{position:absolute}
23
25
  ._lcxvglyw{pointer-events:none}
24
26
  ._mkrz1oyg{clip-path:polygon(50% 0,100% 100%,0 100%)}
27
+ ._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
25
28
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
26
29
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
27
30
  ._p12f1osq{max-width:100%}
28
31
  ._syaz15cr{color:var(--ds-text-inverse,#fff)}
29
32
  ._t9ec1sub{transform:rotate(180deg)}
30
- ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
33
+ ._u5f3oahv{padding-right:var(--ds-space-600,3pc)}
31
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
32
35
  ._u5f3v77o{padding-right:var(--ds-space-025,2px)}
33
36
  ._vchhusvi{box-sizing:border-box}
@@ -17,6 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntl = require("react-intl");
18
18
  var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
19
19
  var _browserApis = require("@atlaskit/browser-apis");
20
+ var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
21
+ var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
20
22
  var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
21
23
  var _choreographedContent = require("@atlaskit/link-provider/choreographed-content");
22
24
  var _popup = require("@atlaskit/popup/popup");
@@ -25,25 +27,29 @@ var _inline = require("@atlaskit/primitives/compiled/inline");
25
27
  var _pressable = require("@atlaskit/primitives/compiled/pressable");
26
28
  var _stack = require("@atlaskit/primitives/compiled/stack");
27
29
  var _text = require("@atlaskit/primitives/compiled/text");
30
+ var _useThemeObserver2 = require("@atlaskit/tokens/use-theme-observer");
28
31
  var _constants = require("../../../../common/analytics/constants");
29
32
  var _getExtensionKey = require("../../../../state/getExtensionKey");
30
33
  var _useOneClickChatSpotlightEligibility = _interopRequireDefault(require("../../../../state/hooks/use-one-click-chat-spotlight-eligibility"));
31
34
  var _useRovoConfig2 = _interopRequireDefault(require("../../../../state/hooks/use-rovo-config"));
32
35
  var _store = require("../../../../state/store");
33
- var _excluded = ["children", "style", "shouldFitViewport", "shouldRenderToParent", "shouldFitContainer", "appearance", "xcss", "isReferenceHidden"];
36
+ var _rovoSnapshotIllustrationDark2x = _interopRequireDefault(require("./assets/rovo-snapshot-illustration-dark@2x.png"));
37
+ var _rovoSnapshotIllustration2x = _interopRequireDefault(require("./assets/rovo-snapshot-illustration@2x.png"));
38
+ var _excluded = ["children", "style", "shouldFitViewport", "shouldRenderToParent", "shouldFitContainer", "appearance", "xcss", "isReferenceHidden"]; // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
39
+ // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
34
40
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
35
41
  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; }
36
42
  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; }
37
43
  var messages = (0, _reactIntl.defineMessages)({
38
44
  heading: {
39
- id: 'smart-card.one-click-chat-spotlight-v2.heading.ai-non-final',
40
- defaultMessage: 'Explore this link with Rovo',
41
- description: 'Accessible name of a spotlight introducing the Rovo action beside a resolved Smart Link.'
45
+ id: 'smart-card.one-click-chat-spotlight-v2.gist-heading.ai-non-final',
46
+ defaultMessage: 'Get the gist from this link',
47
+ description: 'Heading and accessible name of the Smart Link spotlight. Invites users to get a short summary of the linked content with Rovo.'
42
48
  },
43
49
  body: {
44
- id: 'smart-card.one-click-chat-spotlight-v2.takeaways-body.ai-non-final',
45
- defaultMessage: 'Get key decisions and next steps from this link.',
46
- description: 'Spotlight body inviting users to get key decisions and next steps from a linked document or code using Rovo.'
50
+ id: 'smart-card.one-click-chat-spotlight-v2.insights-body.ai-non-final',
51
+ defaultMessage: 'See key insights, context, and next steps.',
52
+ description: 'Smart Link spotlight body describing the insights, context, and next steps users can get from the linked content with Rovo.'
47
53
  },
48
54
  dismiss: {
49
55
  id: 'smart-card.one-click-chat-spotlight-v2.dismiss.ai-non-final',
@@ -57,15 +63,15 @@ var messages = (0, _reactIntl.defineMessages)({
57
63
  }
58
64
  });
59
65
  var styles = {
60
- surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbkpet _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
66
+ surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbi4q4 _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
61
67
  card: "_2rko1qi0 _bfhk1aqn _syaz15cr _16qs130s",
62
68
  caret: "_kqswstnw _1bsb7vkz _4t3iftgi _bfhk1aqn _mkrz1oyg _lcxvglyw",
63
69
  below: "_154iidpf",
64
70
  above: "_94n5idpf _t9ec1sub",
65
- close: "_2rko12b0 _v564k6bl _kqswstnw _154iu2gc _1xi2u2gc _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
71
+ close: "_2rko12b0 _v564k6bl _kqswstnw _154ipxbi _1xi2pxbi _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
66
72
  content: "_kqswh2mm",
67
- body: "_u5f31ejb",
68
- action: "_2rko12b0 _v564k6bl _1h6d8yml _1dqonqa1 _189ee4h9 _syaz15cr _bfhk1aqn _ca0qv77o _n3tdv77o _19bvu2gc _u5f3u2gc _irr31ibz _1ggl5xtf _1di6of27"
73
+ header: "_ca0qpxbi _n3tdpxbi _19bvpxbi _u5f3oahv",
74
+ illustration: "_1e0c1ule _1bsb1osq _4t3i1wug"
69
75
  };
70
76
  var SpotlightOpenContext = /*#__PURE__*/(0, _react.createContext)(false);
71
77
  var TargetContext = /*#__PURE__*/(0, _react.createContext)(null);
@@ -162,18 +168,21 @@ var SpotlightSurface = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, forw
162
168
  });
163
169
  function VisibleSpotlightCard(_ref3) {
164
170
  var onShown = _ref3.onShown,
171
+ heading = _ref3.heading,
165
172
  body = _ref3.body,
166
173
  dismissLabel = _ref3.dismissLabel,
167
174
  actionLabel = _ref3.actionLabel,
168
175
  onDismiss = _ref3.onDismiss,
169
176
  onAction = _ref3.onAction;
177
+ var _useThemeObserver = (0, _useThemeObserver2.useThemeObserver)(),
178
+ colorMode = _useThemeObserver.colorMode;
179
+ var illustration = colorMode === 'dark' ? _rovoSnapshotIllustrationDark2x.default : _rovoSnapshotIllustration2x.default;
170
180
  (0, _react.useEffect)(function () {
171
181
  return onShown();
172
182
  }, [onShown]);
173
183
  return /*#__PURE__*/_react.default.createElement(_box.Box, {
174
184
  testId: "one-click-chat-spotlight-v2",
175
- xcss: styles.content,
176
- padding: "space.150"
185
+ xcss: styles.content
177
186
  }, /*#__PURE__*/_react.default.createElement(_pressable.Pressable, {
178
187
  xcss: styles.close,
179
188
  onClick: onDismiss,
@@ -181,19 +190,33 @@ function VisibleSpotlightCard(_ref3) {
181
190
  }, /*#__PURE__*/_react.default.createElement(_cross.default, {
182
191
  label: "",
183
192
  size: "small"
184
- })), /*#__PURE__*/_react.default.createElement(_stack.Stack, {
185
- space: "space.050"
186
- }, /*#__PURE__*/_react.default.createElement(_box.Box, {
187
- xcss: styles.body
193
+ })), /*#__PURE__*/_react.default.createElement(_box.Box, {
194
+ xcss: styles.header
195
+ }, /*#__PURE__*/_react.default.createElement(_heading.default, {
196
+ as: "h2",
197
+ size: "xsmall",
198
+ color: "color.text.inverse"
199
+ }, heading)), /*#__PURE__*/_react.default.createElement("img", {
200
+ alt: "",
201
+ "aria-hidden": "true",
202
+ "data-testid": "one-click-chat-spotlight-v2-illustration",
203
+ height: 135,
204
+ src: illustration,
205
+ srcSet: "".concat(illustration, " 2x"),
206
+ width: 295,
207
+ className: (0, _runtime.ax)([styles.illustration])
208
+ }), /*#__PURE__*/_react.default.createElement(_box.Box, {
209
+ padding: "space.200"
210
+ }, /*#__PURE__*/_react.default.createElement(_stack.Stack, {
211
+ space: "space.200"
188
212
  }, /*#__PURE__*/_react.default.createElement(_text.Text, {
189
213
  color: "color.text.inverse"
190
- }, body)), /*#__PURE__*/_react.default.createElement(_inline.Inline, {
214
+ }, body), /*#__PURE__*/_react.default.createElement(_inline.Inline, {
191
215
  alignInline: "end"
192
- }, /*#__PURE__*/_react.default.createElement(_pressable.Pressable, {
193
- xcss: styles.action,
216
+ }, /*#__PURE__*/_react.default.createElement(_button.default, {
217
+ appearance: "primary",
218
+ spacing: "compact",
194
219
  onClick: onAction
195
- }, /*#__PURE__*/_react.default.createElement(_text.Text, {
196
- color: "color.text.inverse"
197
220
  }, actionLabel)))));
198
221
  }
199
222
  function OneClickChatSpotlight(_ref4) {
@@ -267,6 +290,7 @@ function OneClickChatSpotlight(_ref4) {
267
290
  }, children);
268
291
  var _content = /*#__PURE__*/_react.default.createElement(VisibleSpotlightCard, {
269
292
  onShown: spotlight.onShown,
293
+ heading: intl.formatMessage(messages.heading),
270
294
  body: intl.formatMessage(messages.body),
271
295
  dismissLabel: intl.formatMessage(messages.dismiss),
272
296
  actionLabel: intl.formatMessage(messages.action),
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "46.14.0",
22
+ packageVersion: "46.14.2",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.14.0" || ''
7
+ packageVersion: "46.14.2" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,33 +1,36 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
3
- ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
4
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
5
- ._1dqonqa1{border-style:solid}
6
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._154iidpf{top:0}
7
- ._154iu2gc{top:var(--ds-space-100,8px)}
3
+ ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._154iidpf{top:0}
4
+ ._154ipxbi{top:var(--ds-space-200,1pc)}
8
5
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
9
6
  ._18m91wug{overflow-y:auto}
7
+ ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
10
8
  ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
11
9
  ._19bvv77o{padding-left:var(--ds-space-025,2px)}
10
+ ._1bsb1osq{width:100%}
12
11
  ._1bsb7vkz{width:1pc}
13
- ._1bsbkpet{width:296px}
12
+ ._1bsbi4q4{width:311px}
13
+ ._1e0c1ule{display:block}
14
14
  ._1reo1wug{overflow-x:auto}
15
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
15
+ ._1xi2pxbi{right:var(--ds-space-200,1pc)}
16
+ ._4t3i1wug{height:auto}
16
17
  ._4t3iftgi{height:8px}
17
18
  ._94n5idpf{bottom:0}
18
19
  ._bfhk1aqn{background-color:var(--ds-background-neutral-bold,#292a2e)}
20
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
19
21
  ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
20
22
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
21
23
  ._kqswh2mm{position:relative}
22
24
  ._kqswstnw{position:absolute}
23
25
  ._lcxvglyw{pointer-events:none}
24
26
  ._mkrz1oyg{clip-path:polygon(50% 0,100% 100%,0 100%)}
27
+ ._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
25
28
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
26
29
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
27
30
  ._p12f1osq{max-width:100%}
28
31
  ._syaz15cr{color:var(--ds-text-inverse,#fff)}
29
32
  ._t9ec1sub{transform:rotate(180deg)}
30
- ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
33
+ ._u5f3oahv{padding-right:var(--ds-space-600,3pc)}
31
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
32
35
  ._u5f3v77o{padding-right:var(--ds-space-025,2px)}
33
36
  ._vchhusvi{box-sizing:border-box}
@@ -6,6 +6,8 @@ import React, { createContext, forwardRef, useCallback, useContext, useEffect, u
6
6
  import { defineMessages, useIntl } from 'react-intl';
7
7
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
8
8
  import { getDocument } from '@atlaskit/browser-apis';
9
+ import Button from '@atlaskit/button/default/button';
10
+ import Heading from '@atlaskit/heading/heading';
9
11
  import CrossIcon from '@atlaskit/icon/core/cross';
10
12
  import { ChoreographedContent } from '@atlaskit/link-provider/choreographed-content';
11
13
  import { Popup } from '@atlaskit/popup/popup';
@@ -14,21 +16,26 @@ import { Inline } from '@atlaskit/primitives/compiled/inline';
14
16
  import { Pressable } from '@atlaskit/primitives/compiled/pressable';
15
17
  import { Stack } from '@atlaskit/primitives/compiled/stack';
16
18
  import { Text } from '@atlaskit/primitives/compiled/text';
19
+ import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
17
20
  import { EVENT_CHANNEL } from '../../../../common/analytics/constants';
18
21
  import { getExtensionKey } from '../../../../state/getExtensionKey';
19
22
  import useOneClickChatSpotlightEligibility from '../../../../state/hooks/use-one-click-chat-spotlight-eligibility';
20
23
  import useRovoConfig from '../../../../state/hooks/use-rovo-config';
21
24
  import { useSmartCardState } from '../../../../state/store';
25
+ // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
26
+ import rovoSnapshotIllustrationDark from './assets/rovo-snapshot-illustration-dark@2x.png';
27
+ // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
28
+ import rovoSnapshotIllustration from './assets/rovo-snapshot-illustration@2x.png';
22
29
  const messages = defineMessages({
23
30
  heading: {
24
- id: 'smart-card.one-click-chat-spotlight-v2.heading.ai-non-final',
25
- defaultMessage: 'Explore this link with Rovo',
26
- description: 'Accessible name of a spotlight introducing the Rovo action beside a resolved Smart Link.'
31
+ id: 'smart-card.one-click-chat-spotlight-v2.gist-heading.ai-non-final',
32
+ defaultMessage: 'Get the gist from this link',
33
+ description: 'Heading and accessible name of the Smart Link spotlight. Invites users to get a short summary of the linked content with Rovo.'
27
34
  },
28
35
  body: {
29
- id: 'smart-card.one-click-chat-spotlight-v2.takeaways-body.ai-non-final',
30
- defaultMessage: 'Get key decisions and next steps from this link.',
31
- description: 'Spotlight body inviting users to get key decisions and next steps from a linked document or code using Rovo.'
36
+ id: 'smart-card.one-click-chat-spotlight-v2.insights-body.ai-non-final',
37
+ defaultMessage: 'See key insights, context, and next steps.',
38
+ description: 'Smart Link spotlight body describing the insights, context, and next steps users can get from the linked content with Rovo.'
32
39
  },
33
40
  dismiss: {
34
41
  id: 'smart-card.one-click-chat-spotlight-v2.dismiss.ai-non-final',
@@ -42,15 +49,15 @@ const messages = defineMessages({
42
49
  }
43
50
  });
44
51
  const styles = {
45
- surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbkpet _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
52
+ surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbi4q4 _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
46
53
  card: "_2rko1qi0 _bfhk1aqn _syaz15cr _16qs130s",
47
54
  caret: "_kqswstnw _1bsb7vkz _4t3iftgi _bfhk1aqn _mkrz1oyg _lcxvglyw",
48
55
  below: "_154iidpf",
49
56
  above: "_94n5idpf _t9ec1sub",
50
- close: "_2rko12b0 _v564k6bl _kqswstnw _154iu2gc _1xi2u2gc _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
57
+ close: "_2rko12b0 _v564k6bl _kqswstnw _154ipxbi _1xi2pxbi _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
51
58
  content: "_kqswh2mm",
52
- body: "_u5f31ejb",
53
- action: "_2rko12b0 _v564k6bl _1h6d8yml _1dqonqa1 _189ee4h9 _syaz15cr _bfhk1aqn _ca0qv77o _n3tdv77o _19bvu2gc _u5f3u2gc _irr31ibz _1ggl5xtf _1di6of27"
59
+ header: "_ca0qpxbi _n3tdpxbi _19bvpxbi _u5f3oahv",
60
+ illustration: "_1e0c1ule _1bsb1osq _4t3i1wug"
54
61
  };
55
62
  const SpotlightOpenContext = /*#__PURE__*/createContext(false);
56
63
  const TargetContext = /*#__PURE__*/createContext(null);
@@ -144,17 +151,21 @@ const SpotlightSurface = /*#__PURE__*/forwardRef(({
144
151
  });
145
152
  function VisibleSpotlightCard({
146
153
  onShown,
154
+ heading,
147
155
  body,
148
156
  dismissLabel,
149
157
  actionLabel,
150
158
  onDismiss,
151
159
  onAction
152
160
  }) {
161
+ const {
162
+ colorMode
163
+ } = useThemeObserver();
164
+ const illustration = colorMode === 'dark' ? rovoSnapshotIllustrationDark : rovoSnapshotIllustration;
153
165
  useEffect(() => onShown(), [onShown]);
154
166
  return /*#__PURE__*/React.createElement(Box, {
155
167
  testId: "one-click-chat-spotlight-v2",
156
- xcss: styles.content,
157
- padding: "space.150"
168
+ xcss: styles.content
158
169
  }, /*#__PURE__*/React.createElement(Pressable, {
159
170
  xcss: styles.close,
160
171
  onClick: onDismiss,
@@ -162,19 +173,33 @@ function VisibleSpotlightCard({
162
173
  }, /*#__PURE__*/React.createElement(CrossIcon, {
163
174
  label: "",
164
175
  size: "small"
165
- })), /*#__PURE__*/React.createElement(Stack, {
166
- space: "space.050"
167
- }, /*#__PURE__*/React.createElement(Box, {
168
- xcss: styles.body
176
+ })), /*#__PURE__*/React.createElement(Box, {
177
+ xcss: styles.header
178
+ }, /*#__PURE__*/React.createElement(Heading, {
179
+ as: "h2",
180
+ size: "xsmall",
181
+ color: "color.text.inverse"
182
+ }, heading)), /*#__PURE__*/React.createElement("img", {
183
+ alt: "",
184
+ "aria-hidden": "true",
185
+ "data-testid": "one-click-chat-spotlight-v2-illustration",
186
+ height: 135,
187
+ src: illustration,
188
+ srcSet: `${illustration} 2x`,
189
+ width: 295,
190
+ className: ax([styles.illustration])
191
+ }), /*#__PURE__*/React.createElement(Box, {
192
+ padding: "space.200"
193
+ }, /*#__PURE__*/React.createElement(Stack, {
194
+ space: "space.200"
169
195
  }, /*#__PURE__*/React.createElement(Text, {
170
196
  color: "color.text.inverse"
171
- }, body)), /*#__PURE__*/React.createElement(Inline, {
197
+ }, body), /*#__PURE__*/React.createElement(Inline, {
172
198
  alignInline: "end"
173
- }, /*#__PURE__*/React.createElement(Pressable, {
174
- xcss: styles.action,
199
+ }, /*#__PURE__*/React.createElement(Button, {
200
+ appearance: "primary",
201
+ spacing: "compact",
175
202
  onClick: onAction
176
- }, /*#__PURE__*/React.createElement(Text, {
177
- color: "color.text.inverse"
178
203
  }, actionLabel)))));
179
204
  }
180
205
  export function OneClickChatSpotlight({
@@ -245,6 +270,7 @@ export function OneClickChatSpotlight({
245
270
  }, children);
246
271
  const content = /*#__PURE__*/React.createElement(VisibleSpotlightCard, {
247
272
  onShown: spotlight.onShown,
273
+ heading: intl.formatMessage(messages.heading),
248
274
  body: intl.formatMessage(messages.body),
249
275
  dismissLabel: intl.formatMessage(messages.dismiss),
250
276
  actionLabel: intl.formatMessage(messages.action),
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "46.14.0",
12
+ packageVersion: "46.14.2",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card" || '',
7
- packageVersion: "46.14.0" || ''
7
+ packageVersion: "46.14.2" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,33 +1,36 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
3
- ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
4
- ._189ee4h9{border-width:var(--ds-border-width,1px)}
5
- ._1dqonqa1{border-style:solid}
6
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._154iidpf{top:0}
7
- ._154iu2gc{top:var(--ds-space-100,8px)}
3
+ ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._154iidpf{top:0}
4
+ ._154ipxbi{top:var(--ds-space-200,1pc)}
8
5
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
9
6
  ._18m91wug{overflow-y:auto}
7
+ ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
10
8
  ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
11
9
  ._19bvv77o{padding-left:var(--ds-space-025,2px)}
10
+ ._1bsb1osq{width:100%}
12
11
  ._1bsb7vkz{width:1pc}
13
- ._1bsbkpet{width:296px}
12
+ ._1bsbi4q4{width:311px}
13
+ ._1e0c1ule{display:block}
14
14
  ._1reo1wug{overflow-x:auto}
15
- ._1xi2u2gc{right:var(--ds-space-100,8px)}
15
+ ._1xi2pxbi{right:var(--ds-space-200,1pc)}
16
+ ._4t3i1wug{height:auto}
16
17
  ._4t3iftgi{height:8px}
17
18
  ._94n5idpf{bottom:0}
18
19
  ._bfhk1aqn{background-color:var(--ds-background-neutral-bold,#292a2e)}
20
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
19
21
  ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
20
22
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
21
23
  ._kqswh2mm{position:relative}
22
24
  ._kqswstnw{position:absolute}
23
25
  ._lcxvglyw{pointer-events:none}
24
26
  ._mkrz1oyg{clip-path:polygon(50% 0,100% 100%,0 100%)}
27
+ ._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
25
28
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
26
29
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
27
30
  ._p12f1osq{max-width:100%}
28
31
  ._syaz15cr{color:var(--ds-text-inverse,#fff)}
29
32
  ._t9ec1sub{transform:rotate(180deg)}
30
- ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
33
+ ._u5f3oahv{padding-right:var(--ds-space-600,3pc)}
31
34
  ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
32
35
  ._u5f3v77o{padding-right:var(--ds-space-025,2px)}
33
36
  ._vchhusvi{box-sizing:border-box}
@@ -12,6 +12,8 @@ import React, { createContext, forwardRef, useCallback, useContext, useEffect, u
12
12
  import { defineMessages, useIntl } from 'react-intl';
13
13
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
14
14
  import { getDocument } from '@atlaskit/browser-apis';
15
+ import Button from '@atlaskit/button/default/button';
16
+ import Heading from '@atlaskit/heading/heading';
15
17
  import CrossIcon from '@atlaskit/icon/core/cross';
16
18
  import { ChoreographedContent } from '@atlaskit/link-provider/choreographed-content';
17
19
  import { Popup } from '@atlaskit/popup/popup';
@@ -20,21 +22,26 @@ import { Inline } from '@atlaskit/primitives/compiled/inline';
20
22
  import { Pressable } from '@atlaskit/primitives/compiled/pressable';
21
23
  import { Stack } from '@atlaskit/primitives/compiled/stack';
22
24
  import { Text } from '@atlaskit/primitives/compiled/text';
25
+ import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
23
26
  import { EVENT_CHANNEL } from '../../../../common/analytics/constants';
24
27
  import { getExtensionKey } from '../../../../state/getExtensionKey';
25
28
  import useOneClickChatSpotlightEligibility from '../../../../state/hooks/use-one-click-chat-spotlight-eligibility';
26
29
  import useRovoConfig from '../../../../state/hooks/use-rovo-config';
27
30
  import { useSmartCardState } from '../../../../state/store';
31
+ // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
32
+ import rovoSnapshotIllustrationDark from './assets/rovo-snapshot-illustration-dark@2x.png';
33
+ // oxlint-disable-next-line import/extensions -- Asset imports require an explicit extension.
34
+ import rovoSnapshotIllustration from './assets/rovo-snapshot-illustration@2x.png';
28
35
  var messages = defineMessages({
29
36
  heading: {
30
- id: 'smart-card.one-click-chat-spotlight-v2.heading.ai-non-final',
31
- defaultMessage: 'Explore this link with Rovo',
32
- description: 'Accessible name of a spotlight introducing the Rovo action beside a resolved Smart Link.'
37
+ id: 'smart-card.one-click-chat-spotlight-v2.gist-heading.ai-non-final',
38
+ defaultMessage: 'Get the gist from this link',
39
+ description: 'Heading and accessible name of the Smart Link spotlight. Invites users to get a short summary of the linked content with Rovo.'
33
40
  },
34
41
  body: {
35
- id: 'smart-card.one-click-chat-spotlight-v2.takeaways-body.ai-non-final',
36
- defaultMessage: 'Get key decisions and next steps from this link.',
37
- description: 'Spotlight body inviting users to get key decisions and next steps from a linked document or code using Rovo.'
42
+ id: 'smart-card.one-click-chat-spotlight-v2.insights-body.ai-non-final',
43
+ defaultMessage: 'See key insights, context, and next steps.',
44
+ description: 'Smart Link spotlight body describing the insights, context, and next steps users can get from the linked content with Rovo.'
38
45
  },
39
46
  dismiss: {
40
47
  id: 'smart-card.one-click-chat-spotlight-v2.dismiss.ai-non-final',
@@ -48,15 +55,15 @@ var messages = defineMessages({
48
55
  }
49
56
  });
50
57
  var styles = {
51
- surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbkpet _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
58
+ surface: "_1reo1wug _18m91wug _kqswh2mm _1bsbi4q4 _p12f1osq _vchhusvi _ca0qu2gc _n3tdu2gc _19bvu2gc _u5f3u2gc",
52
59
  card: "_2rko1qi0 _bfhk1aqn _syaz15cr _16qs130s",
53
60
  caret: "_kqswstnw _1bsb7vkz _4t3iftgi _bfhk1aqn _mkrz1oyg _lcxvglyw",
54
61
  below: "_154iidpf",
55
62
  above: "_94n5idpf _t9ec1sub",
56
- close: "_2rko12b0 _v564k6bl _kqswstnw _154iu2gc _1xi2u2gc _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
63
+ close: "_2rko12b0 _v564k6bl _kqswstnw _154ipxbi _1xi2pxbi _ca0qv77o _n3tdv77o _19bvv77o _u5f3v77o _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
57
64
  content: "_kqswh2mm",
58
- body: "_u5f31ejb",
59
- action: "_2rko12b0 _v564k6bl _1h6d8yml _1dqonqa1 _189ee4h9 _syaz15cr _bfhk1aqn _ca0qv77o _n3tdv77o _19bvu2gc _u5f3u2gc _irr31ibz _1ggl5xtf _1di6of27"
65
+ header: "_ca0qpxbi _n3tdpxbi _19bvpxbi _u5f3oahv",
66
+ illustration: "_1e0c1ule _1bsb1osq _4t3i1wug"
60
67
  };
61
68
  var SpotlightOpenContext = /*#__PURE__*/createContext(false);
62
69
  var TargetContext = /*#__PURE__*/createContext(null);
@@ -153,18 +160,21 @@ var SpotlightSurface = /*#__PURE__*/forwardRef(function (_ref2, forwardedRef) {
153
160
  });
154
161
  function VisibleSpotlightCard(_ref3) {
155
162
  var onShown = _ref3.onShown,
163
+ heading = _ref3.heading,
156
164
  body = _ref3.body,
157
165
  dismissLabel = _ref3.dismissLabel,
158
166
  actionLabel = _ref3.actionLabel,
159
167
  onDismiss = _ref3.onDismiss,
160
168
  onAction = _ref3.onAction;
169
+ var _useThemeObserver = useThemeObserver(),
170
+ colorMode = _useThemeObserver.colorMode;
171
+ var illustration = colorMode === 'dark' ? rovoSnapshotIllustrationDark : rovoSnapshotIllustration;
161
172
  useEffect(function () {
162
173
  return onShown();
163
174
  }, [onShown]);
164
175
  return /*#__PURE__*/React.createElement(Box, {
165
176
  testId: "one-click-chat-spotlight-v2",
166
- xcss: styles.content,
167
- padding: "space.150"
177
+ xcss: styles.content
168
178
  }, /*#__PURE__*/React.createElement(Pressable, {
169
179
  xcss: styles.close,
170
180
  onClick: onDismiss,
@@ -172,19 +182,33 @@ function VisibleSpotlightCard(_ref3) {
172
182
  }, /*#__PURE__*/React.createElement(CrossIcon, {
173
183
  label: "",
174
184
  size: "small"
175
- })), /*#__PURE__*/React.createElement(Stack, {
176
- space: "space.050"
177
- }, /*#__PURE__*/React.createElement(Box, {
178
- xcss: styles.body
185
+ })), /*#__PURE__*/React.createElement(Box, {
186
+ xcss: styles.header
187
+ }, /*#__PURE__*/React.createElement(Heading, {
188
+ as: "h2",
189
+ size: "xsmall",
190
+ color: "color.text.inverse"
191
+ }, heading)), /*#__PURE__*/React.createElement("img", {
192
+ alt: "",
193
+ "aria-hidden": "true",
194
+ "data-testid": "one-click-chat-spotlight-v2-illustration",
195
+ height: 135,
196
+ src: illustration,
197
+ srcSet: "".concat(illustration, " 2x"),
198
+ width: 295,
199
+ className: ax([styles.illustration])
200
+ }), /*#__PURE__*/React.createElement(Box, {
201
+ padding: "space.200"
202
+ }, /*#__PURE__*/React.createElement(Stack, {
203
+ space: "space.200"
179
204
  }, /*#__PURE__*/React.createElement(Text, {
180
205
  color: "color.text.inverse"
181
- }, body)), /*#__PURE__*/React.createElement(Inline, {
206
+ }, body), /*#__PURE__*/React.createElement(Inline, {
182
207
  alignInline: "end"
183
- }, /*#__PURE__*/React.createElement(Pressable, {
184
- xcss: styles.action,
208
+ }, /*#__PURE__*/React.createElement(Button, {
209
+ appearance: "primary",
210
+ spacing: "compact",
185
211
  onClick: onAction
186
- }, /*#__PURE__*/React.createElement(Text, {
187
- color: "color.text.inverse"
188
212
  }, actionLabel)))));
189
213
  }
190
214
  export function OneClickChatSpotlight(_ref4) {
@@ -258,6 +282,7 @@ export function OneClickChatSpotlight(_ref4) {
258
282
  }, children);
259
283
  var _content = /*#__PURE__*/React.createElement(VisibleSpotlightCard, {
260
284
  onShown: spotlight.onShown,
285
+ heading: intl.formatMessage(messages.heading),
261
286
  body: intl.formatMessage(messages.body),
262
287
  dismissLabel: intl.formatMessage(messages.dismiss),
263
288
  actionLabel: intl.formatMessage(messages.action),
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "46.14.0",
15
+ packageVersion: "46.14.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.14.1",
3
+ "version": "46.14.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/form": "^18.3.0",
59
59
  "@atlaskit/frontend-utilities": "^5.1.0",
60
60
  "@atlaskit/heading": "^8.0.0",
61
- "@atlaskit/icon": "^38.0.0",
61
+ "@atlaskit/icon": "^38.1.0",
62
62
  "@atlaskit/icon-file-type": "^8.3.0",
63
63
  "@atlaskit/icon-lab": "^7.11.0",
64
64
  "@atlaskit/image": "^5.2.0",
@@ -83,9 +83,9 @@
83
83
  "@atlaskit/popup": "^10.2.0",
84
84
  "@atlaskit/primitives": "^22.7.0",
85
85
  "@atlaskit/react-compiler-gating": "^0.2.0",
86
- "@atlaskit/react-ufo": "^8.4.0",
86
+ "@atlaskit/react-ufo": "^8.5.0",
87
87
  "@atlaskit/rovo-triggers": "^12.14.0",
88
- "@atlaskit/section-message": "^10.2.0",
88
+ "@atlaskit/section-message": "^10.3.0",
89
89
  "@atlaskit/select": "^23.2.0",
90
90
  "@atlaskit/spinner": "^20.4.0",
91
91
  "@atlaskit/tabs": "^21.3.0",
@@ -95,7 +95,7 @@
95
95
  "@atlaskit/theme": "^28.2.0",
96
96
  "@atlaskit/tile": "^5.0.0",
97
97
  "@atlaskit/tmp-editor-statsig": "^262.0.0",
98
- "@atlaskit/tokens": "^20.11.0",
98
+ "@atlaskit/tokens": "^20.12.0",
99
99
  "@atlaskit/tooltip": "^24.4.0",
100
100
  "@atlaskit/top-layer": "^7.2.0",
101
101
  "@atlaskit/ufo": "^2.0.0",