@atlaskit/smart-card 29.1.1 → 29.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 29.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#150690](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150690)
8
+ [`dc28b053e40da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dc28b053e40da) -
9
+ [ux] Enable new icons behind a feature flag.
10
+
11
+ ## 29.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#150309](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150309)
16
+ [`e59aea25f64b1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e59aea25f64b1) -
17
+ EDM-10845 Use new AI smartlink summary service
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 29.1.1
4
24
 
5
25
  ### Patch Changes
@@ -15,6 +15,7 @@ var _types = require("./types");
15
15
  var _utils = require("./utils");
16
16
  var _readStream = require("./readStream");
17
17
  var _linkingCommon = require("@atlaskit/linking-common");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  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; }
19
20
  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
21
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
@@ -46,7 +47,7 @@ var AISummaryService = exports.AISummaryService = /*#__PURE__*/function () {
46
47
  while (1) switch (_context.prev = _context.next) {
47
48
  case 0:
48
49
  payload = {
49
- recipient_agent_named_id: 'summary_agent',
50
+ recipient_agent_named_id: (0, _platformFeatureFlags.fg)('platform-smart-card-use-ai-smartlink-summary-agent') ? 'smartlink_summary_agent' : 'summary_agent',
50
51
  agent_input_context: {
51
52
  content_url: _this.url,
52
53
  content_ari: _this.ari,
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
22
22
  var context = exports.context = {
23
23
  componentName: 'smart-cards',
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "29.1.1"
25
+ packageVersion: "29.3.0"
26
26
  };
27
27
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
28
28
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ var _react = require("@emotion/react");
10
10
  var _reactIntlNext = require("react-intl-next");
11
11
  var _react2 = require("react");
12
12
  var _colors = require("@atlaskit/theme/colors");
13
- var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
13
+ var _warning = _interopRequireDefault(require("@atlaskit/icon/utility/migration/warning"));
14
14
  var _Frame = require("../components/Frame");
15
15
  var _Byline = require("../../common/Byline");
16
16
  var _ActionList = require("../components/ActionList");
@@ -22,12 +22,16 @@ var _handlers = require("../utils/handlers");
22
22
  var _Link = require("../components/Link");
23
23
  var _UnresolvedText = require("../components/UnresolvedText");
24
24
  var _RetryAction = require("../actions/RetryAction");
25
+ var _primitives = require("@atlaskit/primitives");
25
26
  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; }
26
27
  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; } /**
27
28
  * @jsxRuntime classic
28
29
  * @jsx jsx
29
30
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
30
31
  var textDescriptionProps = _objectSpread({}, _messages.messages.could_not_load_link);
32
+ var iconWrapperStyles = (0, _primitives.xcss)({
33
+ marginInline: 'space.025'
34
+ });
31
35
  /**
32
36
  * Class name for selecting non-flexible errored block card
33
37
  *
@@ -70,14 +74,16 @@ var ErroredView = exports.ErroredView = function ErroredView(_ref) {
70
74
  url: link,
71
75
  testId: testId
72
76
  })), (0, _react.jsx)(_Byline.Byline, null, (0, _react.jsx)(_UnresolvedText.UnresolvedText, {
73
- icon:
74
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19513
75
- (0, _react.jsx)(_warning.default, {
77
+ icon: (0, _react.jsx)(_primitives.Flex, {
78
+ alignItems: "center",
79
+ xcss: iconWrapperStyles
80
+ }, (0, _react.jsx)(_warning.default, {
76
81
  label: "errored-warning-icon",
77
- size: "small",
78
- primaryColor: "var(--ds-icon-warning, ".concat(_colors.R300, ")"),
79
- testId: "".concat(testId, "-warning-icon")
80
- }),
82
+ LEGACY_size: "small",
83
+ color: "var(--ds-icon-warning, ".concat(_colors.R300, ")"),
84
+ testId: "".concat(testId, "-warning-icon"),
85
+ LEGACY_margin: "0 ".concat("var(--ds-space-negative-025, -2px)", " 0 ", "var(--ds-space-negative-025, -2px)")
86
+ })),
81
87
  text: (0, _react.jsx)(_reactIntlNext.FormattedMessage, textDescriptionProps)
82
88
  }))), (0, _react.jsx)(_ContentFooter.ContentFooter, null, (0, _react.jsx)(_ActionList.ActionList, {
83
89
  items: actions
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "29.1.1",
20
+ packageVersion: "29.3.0",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -4,6 +4,7 @@ import { ChunkProcessingError } from './types';
4
4
  import { addPath, getXProductHeaderValue } from './utils';
5
5
  import { readStream } from './readStream';
6
6
  import { getBaseUrl } from '@atlaskit/linking-common';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  export class AISummaryService {
8
9
  constructor(props) {
9
10
  var _getXProductHeaderVal;
@@ -22,7 +23,7 @@ export class AISummaryService {
22
23
  });
23
24
  _defineProperty(this, "fetchStream", async () => {
24
25
  const payload = {
25
- recipient_agent_named_id: 'summary_agent',
26
+ recipient_agent_named_id: fg('platform-smart-card-use-ai-smartlink-summary-agent') ? 'smartlink_summary_agent' : 'summary_agent',
26
27
  agent_input_context: {
27
28
  content_url: this.url,
28
29
  content_ari: this.ari,
@@ -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: "29.1.1"
7
+ packageVersion: "29.3.0"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -7,7 +7,7 @@ import { jsx } from '@emotion/react';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { useMemo } from 'react';
9
9
  import { R300 } from '@atlaskit/theme/colors';
10
- import WarningIcon from '@atlaskit/icon/glyph/warning';
10
+ import WarningIcon from '@atlaskit/icon/utility/migration/warning';
11
11
  import { Frame } from '../components/Frame';
12
12
  import { Byline } from '../../common/Byline';
13
13
  import { ActionList } from '../components/ActionList';
@@ -19,9 +19,13 @@ import { handleClickCommon } from '../utils/handlers';
19
19
  import { Link } from '../components/Link';
20
20
  import { UnresolvedText } from '../components/UnresolvedText';
21
21
  import { RetryAction } from '../actions/RetryAction';
22
+ import { Flex, xcss } from '@atlaskit/primitives';
22
23
  const textDescriptionProps = {
23
24
  ...messages.could_not_load_link
24
25
  };
26
+ const iconWrapperStyles = xcss({
27
+ marginInline: 'space.025'
28
+ });
25
29
  /**
26
30
  * Class name for selecting non-flexible errored block card
27
31
  *
@@ -56,14 +60,16 @@ export const ErroredView = ({
56
60
  url: link,
57
61
  testId: testId
58
62
  })), jsx(Byline, null, jsx(UnresolvedText, {
59
- icon:
60
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19513
61
- jsx(WarningIcon, {
63
+ icon: jsx(Flex, {
64
+ alignItems: "center",
65
+ xcss: iconWrapperStyles
66
+ }, jsx(WarningIcon, {
62
67
  label: "errored-warning-icon",
63
- size: "small",
64
- primaryColor: `var(--ds-icon-warning, ${R300})`,
65
- testId: `${testId}-warning-icon`
66
- }),
68
+ LEGACY_size: "small",
69
+ color: `var(--ds-icon-warning, ${R300})`,
70
+ testId: `${testId}-warning-icon`,
71
+ LEGACY_margin: `0 ${"var(--ds-space-negative-025, -2px)"} 0 ${"var(--ds-space-negative-025, -2px)"}`
72
+ })),
67
73
  text: jsx(FormattedMessage, textDescriptionProps)
68
74
  }))), jsx(ContentFooter, null, jsx(ActionList, {
69
75
  items: actions
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "29.1.1",
10
+ packageVersion: "29.3.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -15,6 +15,7 @@ import { ChunkProcessingError } from './types';
15
15
  import { addPath, getXProductHeaderValue } from './utils';
16
16
  import { readStream } from './readStream';
17
17
  import { getBaseUrl } from '@atlaskit/linking-common';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
18
19
  export var AISummaryService = /*#__PURE__*/function () {
19
20
  function AISummaryService(props) {
20
21
  var _this = this,
@@ -39,7 +40,7 @@ export var AISummaryService = /*#__PURE__*/function () {
39
40
  while (1) switch (_context.prev = _context.next) {
40
41
  case 0:
41
42
  payload = {
42
- recipient_agent_named_id: 'summary_agent',
43
+ recipient_agent_named_id: fg('platform-smart-card-use-ai-smartlink-summary-agent') ? 'smartlink_summary_agent' : 'summary_agent',
43
44
  agent_input_context: {
44
45
  content_url: _this.url,
45
46
  content_ari: _this.ari,
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "29.1.1"
18
+ packageVersion: "29.3.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -10,7 +10,7 @@ import { jsx } from '@emotion/react';
10
10
  import { FormattedMessage } from 'react-intl-next';
11
11
  import { useMemo } from 'react';
12
12
  import { R300 } from '@atlaskit/theme/colors';
13
- import WarningIcon from '@atlaskit/icon/glyph/warning';
13
+ import WarningIcon from '@atlaskit/icon/utility/migration/warning';
14
14
  import { Frame } from '../components/Frame';
15
15
  import { Byline } from '../../common/Byline';
16
16
  import { ActionList } from '../components/ActionList';
@@ -22,7 +22,11 @@ import { handleClickCommon } from '../utils/handlers';
22
22
  import { Link } from '../components/Link';
23
23
  import { UnresolvedText } from '../components/UnresolvedText';
24
24
  import { RetryAction } from '../actions/RetryAction';
25
+ import { Flex, xcss } from '@atlaskit/primitives';
25
26
  var textDescriptionProps = _objectSpread({}, messages.could_not_load_link);
27
+ var iconWrapperStyles = xcss({
28
+ marginInline: 'space.025'
29
+ });
26
30
  /**
27
31
  * Class name for selecting non-flexible errored block card
28
32
  *
@@ -65,14 +69,16 @@ export var ErroredView = function ErroredView(_ref) {
65
69
  url: link,
66
70
  testId: testId
67
71
  })), jsx(Byline, null, jsx(UnresolvedText, {
68
- icon:
69
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons -- TODO - https://product-fabric.atlassian.net/browse/DSP-19513
70
- jsx(WarningIcon, {
72
+ icon: jsx(Flex, {
73
+ alignItems: "center",
74
+ xcss: iconWrapperStyles
75
+ }, jsx(WarningIcon, {
71
76
  label: "errored-warning-icon",
72
- size: "small",
73
- primaryColor: "var(--ds-icon-warning, ".concat(R300, ")"),
74
- testId: "".concat(testId, "-warning-icon")
75
- }),
77
+ LEGACY_size: "small",
78
+ color: "var(--ds-icon-warning, ".concat(R300, ")"),
79
+ testId: "".concat(testId, "-warning-icon"),
80
+ LEGACY_margin: "0 ".concat("var(--ds-space-negative-025, -2px)", " 0 ", "var(--ds-space-negative-025, -2px)")
81
+ })),
76
82
  text: jsx(FormattedMessage, textDescriptionProps)
77
83
  }))), jsx(ContentFooter, null, jsx(ActionList, {
78
84
  items: actions
@@ -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: "29.1.1",
13
+ packageVersion: "29.3.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -26,7 +26,17 @@ export type AISummaryServiceConfig = {
26
26
  };
27
27
  export type AISummaryStatus = 'ready' | 'loading' | 'error' | 'done';
28
28
  export type PostAgentPayload = {
29
- recipient_agent_named_id: string;
29
+ /**
30
+ * Which agent in `assistance_service` to use.
31
+ *
32
+ * The AI mate team requested Linking Platform to move away from the default
33
+ * summary agent and create our own.
34
+ *
35
+ * There is likely to be a future migration from `assistance-service`
36
+ * to `convo-ai` which is currently unclear:
37
+ * https://atlassian.slack.com/archives/C05S4PH8YAY/p1728528096549549
38
+ */
39
+ recipient_agent_named_id: 'smartlink_summary_agent' | 'summary_agent';
30
40
  agent_input_context: AgentInputContext;
31
41
  user_intent?: string;
32
42
  };
@@ -26,7 +26,17 @@ export type AISummaryServiceConfig = {
26
26
  };
27
27
  export type AISummaryStatus = 'ready' | 'loading' | 'error' | 'done';
28
28
  export type PostAgentPayload = {
29
- recipient_agent_named_id: string;
29
+ /**
30
+ * Which agent in `assistance_service` to use.
31
+ *
32
+ * The AI mate team requested Linking Platform to move away from the default
33
+ * summary agent and create our own.
34
+ *
35
+ * There is likely to be a future migration from `assistance-service`
36
+ * to `convo-ai` which is currently unclear:
37
+ * https://atlassian.slack.com/archives/C05S4PH8YAY/p1728528096549549
38
+ */
39
+ recipient_agent_named_id: 'smartlink_summary_agent' | 'summary_agent';
30
40
  agent_input_context: AgentInputContext;
31
41
  user_intent?: string;
32
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "29.1.1",
3
+ "version": "29.3.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/popup": "^1.28.0",
55
55
  "@atlaskit/primitives": "^12.2.0",
56
56
  "@atlaskit/section-message": "^6.6.0",
57
- "@atlaskit/select": "^18.0.0",
57
+ "@atlaskit/select": "^18.1.0",
58
58
  "@atlaskit/spinner": "^16.3.0",
59
59
  "@atlaskit/textarea": "^5.6.0",
60
60
  "@atlaskit/textfield": "^6.5.0",
@@ -156,6 +156,9 @@
156
156
  },
157
157
  "send-smart-link-rendered-ufo-event-half-time": {
158
158
  "type": "boolean"
159
+ },
160
+ "platform-smart-card-use-ai-smartlink-summary-agent": {
161
+ "type": "boolean"
159
162
  }
160
163
  }
161
164
  }