@atlaskit/smart-card 43.24.4 → 43.24.6

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 (63) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/common/ui/icons/angle-brackets-icon.js +1 -3
  3. package/dist/cjs/common/ui/icons/audio-icon.js +1 -3
  4. package/dist/cjs/common/ui/icons/chart-bar-icon.js +1 -3
  5. package/dist/cjs/common/ui/icons/file-icon.js +1 -3
  6. package/dist/cjs/common/ui/icons/folder-icon.js +1 -3
  7. package/dist/cjs/common/ui/icons/image-icon.js +1 -3
  8. package/dist/cjs/common/ui/icons/list-bullet-icon.js +1 -3
  9. package/dist/cjs/common/ui/icons/page-icon.js +1 -3
  10. package/dist/cjs/common/ui/icons/utils.js +2 -6
  11. package/dist/cjs/common/ui/icons/video-icon.js +1 -3
  12. package/dist/cjs/state/hooks/use-rovo-chat/index.js +5 -1
  13. package/dist/cjs/state/hooks/use-rovo-config/index.js +16 -0
  14. package/dist/cjs/utils/analytics/analytics.js +1 -1
  15. package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +22 -17
  16. package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +105 -0
  17. package/dist/cjs/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
  18. package/dist/cjs/view/LinkUrl/index.js +1 -1
  19. package/dist/es2019/common/ui/icons/angle-brackets-icon.js +2 -4
  20. package/dist/es2019/common/ui/icons/audio-icon.js +2 -4
  21. package/dist/es2019/common/ui/icons/chart-bar-icon.js +2 -4
  22. package/dist/es2019/common/ui/icons/file-icon.js +2 -4
  23. package/dist/es2019/common/ui/icons/folder-icon.js +2 -4
  24. package/dist/es2019/common/ui/icons/image-icon.js +2 -4
  25. package/dist/es2019/common/ui/icons/list-bullet-icon.js +2 -4
  26. package/dist/es2019/common/ui/icons/page-icon.js +2 -4
  27. package/dist/es2019/common/ui/icons/utils.js +2 -6
  28. package/dist/es2019/common/ui/icons/video-icon.js +2 -4
  29. package/dist/es2019/state/hooks/use-rovo-chat/index.js +5 -1
  30. package/dist/es2019/state/hooks/use-rovo-config/index.js +9 -0
  31. package/dist/es2019/utils/analytics/analytics.js +1 -1
  32. package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +22 -17
  33. package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +93 -0
  34. package/dist/es2019/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +3 -2
  35. package/dist/es2019/view/LinkUrl/index.js +1 -1
  36. package/dist/esm/common/ui/icons/angle-brackets-icon.js +2 -4
  37. package/dist/esm/common/ui/icons/audio-icon.js +2 -4
  38. package/dist/esm/common/ui/icons/chart-bar-icon.js +2 -4
  39. package/dist/esm/common/ui/icons/file-icon.js +2 -4
  40. package/dist/esm/common/ui/icons/folder-icon.js +2 -4
  41. package/dist/esm/common/ui/icons/image-icon.js +2 -4
  42. package/dist/esm/common/ui/icons/list-bullet-icon.js +2 -4
  43. package/dist/esm/common/ui/icons/page-icon.js +2 -4
  44. package/dist/esm/common/ui/icons/utils.js +2 -6
  45. package/dist/esm/common/ui/icons/video-icon.js +2 -4
  46. package/dist/esm/state/hooks/use-rovo-chat/index.js +5 -1
  47. package/dist/esm/state/hooks/use-rovo-config/index.js +10 -0
  48. package/dist/esm/utils/analytics/analytics.js +1 -1
  49. package/dist/esm/view/BlockCard/views/UnauthorisedView.js +22 -17
  50. package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +96 -0
  51. package/dist/esm/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/index.js +4 -2
  52. package/dist/esm/view/LinkUrl/index.js +1 -1
  53. package/dist/types/common/ui/icons/utils.d.ts +1 -1
  54. package/dist/types/state/hooks/use-rovo-chat/index.d.ts +3 -1
  55. package/dist/types/state/hooks/use-rovo-config/index.d.ts +2 -0
  56. package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +11 -0
  57. package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
  58. package/dist/types-ts4.5/common/ui/icons/utils.d.ts +1 -1
  59. package/dist/types-ts4.5/state/hooks/use-rovo-chat/index.d.ts +3 -1
  60. package/dist/types-ts4.5/state/hooks/use-rovo-config/index.d.ts +2 -0
  61. package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +11 -0
  62. package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/types.d.ts +1 -0
  63. package/package.json +6 -3
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useCallback, useMemo } from 'react';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
9
+ import { fg } from "@atlaskit/platform-feature-flags";
9
10
  import { Box } from '@atlaskit/primitives/compiled';
10
11
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
11
12
  import { ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../constants';
@@ -128,22 +129,26 @@ const NewUnauthorisedBlock = ({
128
129
  let overrideUrl = data === null || data === void 0 ? void 0 : (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url;
129
130
  let isHardcodedImage = !overrideUrl;
130
131
  if (isHardcodedImage) {
131
- switch (extensionKey) {
132
- case 'figma-object-provider':
133
- overrideUrl = unauthIllustrationFigma;
134
- break;
135
- case 'google-object-provider':
136
- overrideUrl = unauthIllustrationGdrive;
137
- break;
138
- case 'onedrive-object-provider':
139
- overrideUrl = unauthIllustrationOnedrive;
140
- break;
141
- case 'slack-object-provider':
142
- overrideUrl = unauthIllustrationSlack;
143
- break;
144
- default:
145
- overrideUrl = unauthIllustrationGeneral;
146
- break;
132
+ if (fg('navx-3264-refactoring-unauth-provider-images-fe')) {
133
+ overrideUrl = unauthIllustrationGeneral;
134
+ } else {
135
+ switch (extensionKey) {
136
+ case 'figma-object-provider':
137
+ overrideUrl = unauthIllustrationFigma;
138
+ break;
139
+ case 'google-object-provider':
140
+ overrideUrl = unauthIllustrationGdrive;
141
+ break;
142
+ case 'onedrive-object-provider':
143
+ overrideUrl = unauthIllustrationOnedrive;
144
+ break;
145
+ case 'slack-object-provider':
146
+ overrideUrl = unauthIllustrationSlack;
147
+ break;
148
+ default:
149
+ overrideUrl = unauthIllustrationGeneral;
150
+ break;
151
+ }
147
152
  }
148
153
  }
149
154
  return /*#__PURE__*/React.createElement(Block, _extends({}, titleBlockOptions, {
@@ -172,7 +177,7 @@ const NewUnauthorisedBlock = ({
172
177
  }, renderElementItems([{
173
178
  name: ElementName.HostName
174
179
  }])))), children, actionGroup), hasActions ? /*#__PURE__*/React.createElement("div", {
175
- className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", isHardcodedImage && "_1bsbo60d"])
180
+ className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", (isHardcodedImage || fg('navx-3264-refactoring-unauth-provider-images-fe')) && "_1bsbo60d"])
176
181
  }, /*#__PURE__*/React.createElement("div", {
177
182
  style: {
178
183
  backgroundImage: `url(${overrideUrl})`
@@ -0,0 +1,93 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useCallback, useMemo } from 'react';
3
+ import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
4
+ import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
5
+ import Action from '../action';
6
+ // Replace this with actual message key, e.g. link-relevancy, link-summary, etc.
7
+ export let RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
8
+ RovoChatPromptKey["MESSAGE_1"] = "message-1";
9
+ RovoChatPromptKey["MESSAGE_2"] = "message-2";
10
+ return RovoChatPromptKey;
11
+ }({});
12
+ const DEFAULT_PROMPTS = [RovoChatPromptKey.MESSAGE_1, RovoChatPromptKey.MESSAGE_2];
13
+ const getPromptAction = promptKey => {
14
+ // NAVX-3581: Replace this with real prompt message
15
+ switch (promptKey) {
16
+ case RovoChatPromptKey.MESSAGE_1:
17
+ return {
18
+ icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
19
+ label: "",
20
+ spacing: "spacious"
21
+ }),
22
+ content: 'Action title 1',
23
+ tooltipMessage: 'Action tooltip 1',
24
+ data: {
25
+ name: 'Chat title 1',
26
+ dialogues: [],
27
+ prompt: {
28
+ version: 1,
29
+ type: 'doc',
30
+ content: []
31
+ }
32
+ }
33
+ };
34
+ case RovoChatPromptKey.MESSAGE_2:
35
+ return {
36
+ icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
37
+ label: "",
38
+ spacing: "spacious"
39
+ }),
40
+ content: 'Action title 2',
41
+ tooltipMessage: 'Action tooltip 2',
42
+ data: {
43
+ name: 'Chat title 2',
44
+ dialogues: [],
45
+ prompt: {
46
+ version: 1,
47
+ type: 'doc',
48
+ content: []
49
+ }
50
+ }
51
+ };
52
+ }
53
+ };
54
+ const RovoChatAction = ({
55
+ onClick: onClickCallback,
56
+ prompts = DEFAULT_PROMPTS,
57
+ testId = 'smart-action-rovo-chat-action',
58
+ ...props
59
+ }) => {
60
+ const {
61
+ isRovoChatEnabled,
62
+ sendPromptMessage
63
+ } = useRovoChat();
64
+ const onClick = useCallback(promptData => {
65
+ if (promptData) {
66
+ sendPromptMessage(promptData);
67
+
68
+ // NAVX-3599: Add analytics event, possibly as useInvokeClientAction()
69
+
70
+ onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
71
+ }
72
+ }, [onClickCallback, sendPromptMessage]);
73
+ const promptActions = useMemo(() => {
74
+ return prompts.map((promptKey, idx) => {
75
+ const {
76
+ icon,
77
+ content,
78
+ tooltipMessage,
79
+ data: promptData
80
+ } = getPromptAction(promptKey) || {};
81
+ return promptData ? /*#__PURE__*/React.createElement(Action, _extends({
82
+ content: content,
83
+ icon: icon,
84
+ key: promptKey,
85
+ onClick: () => onClick(promptData),
86
+ testId: `${testId}-${idx + 1}`,
87
+ tooltipMessage: tooltipMessage
88
+ }, props)) : null;
89
+ });
90
+ }, [onClick, prompts, props, testId]);
91
+ return isRovoChatEnabled && (promptActions === null || promptActions === void 0 ? void 0 : promptActions.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, promptActions) : null;
92
+ };
93
+ export default RovoChatAction;
@@ -25,7 +25,8 @@ const LozengeAction = ({
25
25
  testId = 'smart-element-lozenge-action',
26
26
  text,
27
27
  zIndex,
28
- onAfterChanged
28
+ onAfterChanged,
29
+ shouldRenderToParent = false
29
30
  }) => {
30
31
  var _action$update;
31
32
  const [selected, setSelected] = useState({
@@ -153,7 +154,7 @@ const LozengeAction = ({
153
154
  testId: testId,
154
155
  trigger: trigger,
155
156
  zIndex: zIndex,
156
- shouldRenderToParent: true
157
+ shouldRenderToParent: shouldRenderToParent
157
158
  }, dropdownItemGroup);
158
159
  };
159
160
  export default withErrorBoundary(LozengeAction);
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "43.24.3",
15
+ packageVersion: "43.24.5",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/source-code/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/source-code/24';
3
1
  import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var AngleBracketsIconWithColor = renderIconTile(AngleBracketsIcon, 'blueBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var AngleBracketsIconWithColor = renderIconTile(AngleBracketsIcon, 'blueBold');
6
4
  AngleBracketsIconWithColor.displayName = 'AngleBracketsIconWithColor';
7
5
  export default AngleBracketsIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/audio/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/audio/24';
3
1
  import AudioIcon from '@atlaskit/icon/core/audio';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var AudioIconWithColor = renderIconTile(AudioIcon, 'redBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var AudioIconWithColor = renderIconTile(AudioIcon, 'redBold');
6
4
  AudioIconWithColor.displayName = 'AudioIconWithColor';
7
5
  export default AudioIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/presentation/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/presentation/24';
3
1
  import ChartBarIcon from '@atlaskit/icon/core/chart-bar';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var ChartBarIconWithColor = renderIconTile(ChartBarIcon, 'purpleBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var ChartBarIconWithColor = renderIconTile(ChartBarIcon, 'purpleBold');
6
4
  ChartBarIconWithColor.displayName = 'ChartBarIconWithColor';
7
5
  export default ChartBarIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/generic/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/generic/24';
3
1
  import FileIcon from '@atlaskit/icon/core/file';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var FileIconWithColor = renderIconTile(FileIcon, 'grayBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var FileIconWithColor = renderIconTile(FileIcon, 'grayBold');
6
4
  FileIconWithColor.displayName = 'FileIconWithColor';
7
5
  export default FileIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/folder/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/folder/24';
3
1
  import FolderClosedIcon from '@atlaskit/icon/core/folder-closed';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var FolderClosedIconWithColor = renderIconTile(FolderClosedIcon, 'blueBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var FolderClosedIconWithColor = renderIconTile(FolderClosedIcon, 'blueBold');
6
4
  FolderClosedIconWithColor.displayName = 'FolderClosedIconWithColor';
7
5
  export default FolderClosedIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/image/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/image/24';
3
1
  import ImageIcon from '@atlaskit/icon/core/image';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var ImageIconWithColor = renderIconTile(ImageIcon, 'yellowBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var ImageIconWithColor = renderIconTile(ImageIcon, 'yellowBold');
6
4
  ImageIconWithColor.displayName = 'ImageIconWithColor';
7
5
  export default ImageIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/spreadsheet/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/spreadsheet/24';
3
1
  import ListBulletedIcon from '@atlaskit/icon/core/list-bulleted';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var ListBulletedIconWithColor = renderIconTile(ListBulletedIcon, 'greenBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var ListBulletedIconWithColor = renderIconTile(ListBulletedIcon, 'greenBold');
6
4
  ListBulletedIconWithColor.displayName = 'ListBulletedIconWithColor';
7
5
  export default ListBulletedIconWithColor;
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/document/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/document/24';
3
1
  import PageIcon from '@atlaskit/icon/core/page';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var PageIconWithColor = renderIconTile(PageIcon, 'blueBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var PageIconWithColor = renderIconTile(PageIcon, 'blueBold');
6
4
  PageIconWithColor.displayName = 'PageIconWithColor';
7
5
  export default PageIconWithColor;
@@ -25,7 +25,7 @@ export var renderIconPerSize = function renderIconPerSize(IconSmall, IconLarge)
25
25
  return /*#__PURE__*/React.createElement(IconSmall, props);
26
26
  };
27
27
  };
28
- export var renderIconTile = function renderIconTile(Icon, appearance, LegacyIcon) {
28
+ export var renderIconTile = function renderIconTile(Icon, appearance) {
29
29
  return function (_ref2) {
30
30
  var size = _ref2.size,
31
31
  props = _objectWithoutProperties(_ref2, _excluded2);
@@ -33,10 +33,6 @@ export var renderIconTile = function renderIconTile(Icon, appearance, LegacyIcon
33
33
  appearance: appearance,
34
34
  icon: Icon,
35
35
  size: transformSmartLinkSizeToIconTileSize(size)
36
- }, props, {
37
- LEGACY_fallbackComponent: LegacyIcon && /*#__PURE__*/React.createElement(LegacyIcon, _extends({}, props, {
38
- size: size
39
- }))
40
- }));
36
+ }, props));
41
37
  };
42
38
  };
@@ -1,7 +1,5 @@
1
- import LegacyIcon from '@atlaskit/icon-file-type/glyph/video/16';
2
- import LegacyIconLarge from '@atlaskit/icon-file-type/glyph/video/24';
3
1
  import VideoIcon from '@atlaskit/icon/core/video';
4
- import { renderIconPerSize, renderIconTile } from './utils';
5
- var VideoIconWithColor = renderIconTile(VideoIcon, 'redBold', renderIconPerSize(LegacyIcon, LegacyIconLarge));
2
+ import { renderIconTile } from './utils';
3
+ var VideoIconWithColor = renderIconTile(VideoIcon, 'redBold');
6
4
  VideoIconWithColor.displayName = 'VideoIconWithColor';
7
5
  export default VideoIconWithColor;
@@ -3,10 +3,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { useCallback, useMemo } from 'react';
5
5
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
6
+ import useRovoConfig from '../use-rovo-config';
6
7
  var SMART_LINK_TO_ROVO_SOURCE = 'smart-link';
7
8
  var useRovoChat = function useRovoChat() {
9
+ var config = useRovoConfig();
8
10
  var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
9
11
  publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
12
+ var isRovoChatEnabled = config !== null && config !== void 0 && config.isRovoEnabled && config !== null && config !== void 0 && config.isRovoLLMEnabled ? true : false;
10
13
  var sendPromptMessage = useCallback(function (data) {
11
14
  var _window$parent;
12
15
  publishWithPostMessage({
@@ -29,8 +32,9 @@ var useRovoChat = function useRovoChat() {
29
32
  }, [publishWithPostMessage]);
30
33
  return useMemo(function () {
31
34
  return {
35
+ isRovoChatEnabled: isRovoChatEnabled,
32
36
  sendPromptMessage: sendPromptMessage
33
37
  };
34
- }, [sendPromptMessage]);
38
+ }, [isRovoChatEnabled, sendPromptMessage]);
35
39
  };
36
40
  export default useRovoChat;
@@ -0,0 +1,10 @@
1
+ import { useMemo } from 'react';
2
+ import { useSmartLinkContext } from '@atlaskit/link-provider';
3
+ var useRovoConfig = function useRovoConfig() {
4
+ var _useSmartLinkContext = useSmartLinkContext(),
5
+ rovoOptions = _useSmartLinkContext.rovoOptions;
6
+ return useMemo(function () {
7
+ return rovoOptions;
8
+ }, [rovoOptions]);
9
+ };
10
+ export default useRovoConfig;
@@ -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: "43.24.3"
7
+ packageVersion: "43.24.5"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -8,6 +8,7 @@ import { ax, ix } from "@compiled/react/runtime";
8
8
  import { useCallback, useMemo } from 'react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
11
+ import { fg } from "@atlaskit/platform-feature-flags";
11
12
  import { Box } from '@atlaskit/primitives/compiled';
12
13
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
13
14
  import { ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../constants';
@@ -126,22 +127,26 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
126
127
  var overrideUrl = data === null || data === void 0 || (_data$preview = data.preview) === null || _data$preview === void 0 ? void 0 : _data$preview.url;
127
128
  var isHardcodedImage = !overrideUrl;
128
129
  if (isHardcodedImage) {
129
- switch (extensionKey) {
130
- case 'figma-object-provider':
131
- overrideUrl = unauthIllustrationFigma;
132
- break;
133
- case 'google-object-provider':
134
- overrideUrl = unauthIllustrationGdrive;
135
- break;
136
- case 'onedrive-object-provider':
137
- overrideUrl = unauthIllustrationOnedrive;
138
- break;
139
- case 'slack-object-provider':
140
- overrideUrl = unauthIllustrationSlack;
141
- break;
142
- default:
143
- overrideUrl = unauthIllustrationGeneral;
144
- break;
130
+ if (fg('navx-3264-refactoring-unauth-provider-images-fe')) {
131
+ overrideUrl = unauthIllustrationGeneral;
132
+ } else {
133
+ switch (extensionKey) {
134
+ case 'figma-object-provider':
135
+ overrideUrl = unauthIllustrationFigma;
136
+ break;
137
+ case 'google-object-provider':
138
+ overrideUrl = unauthIllustrationGdrive;
139
+ break;
140
+ case 'onedrive-object-provider':
141
+ overrideUrl = unauthIllustrationOnedrive;
142
+ break;
143
+ case 'slack-object-provider':
144
+ overrideUrl = unauthIllustrationSlack;
145
+ break;
146
+ default:
147
+ overrideUrl = unauthIllustrationGeneral;
148
+ break;
149
+ }
145
150
  }
146
151
  }
147
152
  return /*#__PURE__*/React.createElement(Block, _extends({}, titleBlockOptions, {
@@ -170,7 +175,7 @@ var NewUnauthorisedBlock = function NewUnauthorisedBlock(_ref) {
170
175
  }, renderElementItems([{
171
176
  name: ElementName.HostName
172
177
  }])))), children, actionGroup), hasActions ? /*#__PURE__*/React.createElement("div", {
173
- className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", isHardcodedImage && "_1bsbo60d"])
178
+ className: ax(["_1reo15vq _18m915vq _1bsb1o87 _1wpz1fhb _1dptglyw", (isHardcodedImage || fg('navx-3264-refactoring-unauth-provider-images-fe')) && "_1bsbo60d"])
174
179
  }, /*#__PURE__*/React.createElement("div", {
175
180
  style: {
176
181
  backgroundImage: "url(".concat(overrideUrl, ")")
@@ -0,0 +1,96 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["onClick", "prompts", "testId"];
4
+ import React, { useCallback, useMemo } from 'react';
5
+ import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
6
+ import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
7
+ import Action from '../action';
8
+ // Replace this with actual message key, e.g. link-relevancy, link-summary, etc.
9
+ export var RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
10
+ RovoChatPromptKey["MESSAGE_1"] = "message-1";
11
+ RovoChatPromptKey["MESSAGE_2"] = "message-2";
12
+ return RovoChatPromptKey;
13
+ }({});
14
+ var DEFAULT_PROMPTS = [RovoChatPromptKey.MESSAGE_1, RovoChatPromptKey.MESSAGE_2];
15
+ var getPromptAction = function getPromptAction(promptKey) {
16
+ // NAVX-3581: Replace this with real prompt message
17
+ switch (promptKey) {
18
+ case RovoChatPromptKey.MESSAGE_1:
19
+ return {
20
+ icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
21
+ label: "",
22
+ spacing: "spacious"
23
+ }),
24
+ content: 'Action title 1',
25
+ tooltipMessage: 'Action tooltip 1',
26
+ data: {
27
+ name: 'Chat title 1',
28
+ dialogues: [],
29
+ prompt: {
30
+ version: 1,
31
+ type: 'doc',
32
+ content: []
33
+ }
34
+ }
35
+ };
36
+ case RovoChatPromptKey.MESSAGE_2:
37
+ return {
38
+ icon: /*#__PURE__*/React.createElement(RovoChatIcon, {
39
+ label: "",
40
+ spacing: "spacious"
41
+ }),
42
+ content: 'Action title 2',
43
+ tooltipMessage: 'Action tooltip 2',
44
+ data: {
45
+ name: 'Chat title 2',
46
+ dialogues: [],
47
+ prompt: {
48
+ version: 1,
49
+ type: 'doc',
50
+ content: []
51
+ }
52
+ }
53
+ };
54
+ }
55
+ };
56
+ var RovoChatAction = function RovoChatAction(_ref) {
57
+ var onClickCallback = _ref.onClick,
58
+ _ref$prompts = _ref.prompts,
59
+ prompts = _ref$prompts === void 0 ? DEFAULT_PROMPTS : _ref$prompts,
60
+ _ref$testId = _ref.testId,
61
+ testId = _ref$testId === void 0 ? 'smart-action-rovo-chat-action' : _ref$testId,
62
+ props = _objectWithoutProperties(_ref, _excluded);
63
+ var _useRovoChat = useRovoChat(),
64
+ isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
65
+ sendPromptMessage = _useRovoChat.sendPromptMessage;
66
+ var _onClick = useCallback(function (promptData) {
67
+ if (promptData) {
68
+ sendPromptMessage(promptData);
69
+
70
+ // NAVX-3599: Add analytics event, possibly as useInvokeClientAction()
71
+
72
+ onClickCallback === null || onClickCallback === void 0 || onClickCallback();
73
+ }
74
+ }, [onClickCallback, sendPromptMessage]);
75
+ var promptActions = useMemo(function () {
76
+ return prompts.map(function (promptKey, idx) {
77
+ var _ref2 = getPromptAction(promptKey) || {},
78
+ icon = _ref2.icon,
79
+ content = _ref2.content,
80
+ tooltipMessage = _ref2.tooltipMessage,
81
+ promptData = _ref2.data;
82
+ return promptData ? /*#__PURE__*/React.createElement(Action, _extends({
83
+ content: content,
84
+ icon: icon,
85
+ key: promptKey,
86
+ onClick: function onClick() {
87
+ return _onClick(promptData);
88
+ },
89
+ testId: "".concat(testId, "-").concat(idx + 1),
90
+ tooltipMessage: tooltipMessage
91
+ }, props)) : null;
92
+ });
93
+ }, [_onClick, prompts, props, testId]);
94
+ return isRovoChatEnabled && (promptActions === null || promptActions === void 0 ? void 0 : promptActions.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, promptActions) : null;
95
+ };
96
+ export default RovoChatAction;
@@ -34,7 +34,9 @@ var LozengeAction = function LozengeAction(_ref) {
34
34
  testId = _ref$testId === void 0 ? 'smart-element-lozenge-action' : _ref$testId,
35
35
  text = _ref.text,
36
36
  zIndex = _ref.zIndex,
37
- onAfterChanged = _ref.onAfterChanged;
37
+ onAfterChanged = _ref.onAfterChanged,
38
+ _ref$shouldRenderToPa = _ref.shouldRenderToParent,
39
+ shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa;
38
40
  var _useState = useState({
39
41
  appearance: appearance,
40
42
  text: text
@@ -230,7 +232,7 @@ var LozengeAction = function LozengeAction(_ref) {
230
232
  testId: testId,
231
233
  trigger: trigger,
232
234
  zIndex: zIndex,
233
- shouldRenderToParent: true
235
+ shouldRenderToParent: shouldRenderToParent
234
236
  }, dropdownItemGroup);
235
237
  };
236
238
  export default withErrorBoundary(LozengeAction);
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "43.24.3",
18
+ packageVersion: "43.24.5",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -11,5 +11,5 @@ export declare const renderIconPerSize: (IconSmall: ComponentType<IconProps>, Ic
11
11
  size?: SmartLinkSize;
12
12
  }>;
13
13
  type IconTileProps = ComponentPropsWithoutRef<typeof IconTile>;
14
- export declare const renderIconTile: (Icon: IconTileProps["icon"], appearance: IconTileProps["appearance"], LegacyIcon?: ComponentType<AtlaskitIconTileProps>) => React.FC<AtlaskitIconTileProps>;
14
+ export declare const renderIconTile: (Icon: IconTileProps["icon"], appearance: IconTileProps["appearance"]) => React.FC<AtlaskitIconTileProps>;
15
15
  export {};
@@ -1,5 +1,7 @@
1
1
  import type { ChatNewPayload } from '@atlaskit/rovo-triggers/types';
2
+ export type SendPromptMessageData = Partial<ChatNewPayload['data']>;
2
3
  declare const useRovoChat: () => {
3
- sendPromptMessage: (data: Partial<ChatNewPayload["data"]>) => void;
4
+ isRovoChatEnabled: boolean;
5
+ sendPromptMessage: (data: SendPromptMessageData) => void;
4
6
  };
5
7
  export default useRovoChat;
@@ -0,0 +1,2 @@
1
+ declare const useRovoConfig: () => import("packages/linking-platform/link-provider/dist/types/state/context/types").RovoOptions | undefined;
2
+ export default useRovoConfig;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { type LinkActionProps } from '../types';
3
+ export declare enum RovoChatPromptKey {
4
+ MESSAGE_1 = "message-1",
5
+ MESSAGE_2 = "message-2"
6
+ }
7
+ type RovoChatActionProps = LinkActionProps & {
8
+ prompts?: RovoChatPromptKey[];
9
+ };
10
+ declare const RovoChatAction: ({ onClick: onClickCallback, prompts, testId, ...props }: RovoChatActionProps) => React.JSX.Element | null;
11
+ export default RovoChatAction;
@@ -9,6 +9,7 @@ export type LozengeActionProps = {
9
9
  action: LinkLozengeInvokeActions;
10
10
  appearance?: ThemeAppearance;
11
11
  onAfterChanged?: () => void;
12
+ shouldRenderToParent?: boolean;
12
13
  testId?: string;
13
14
  text: string | React.ReactNode;
14
15
  zIndex?: number;
@@ -11,5 +11,5 @@ export declare const renderIconPerSize: (IconSmall: ComponentType<IconProps>, Ic
11
11
  size?: SmartLinkSize;
12
12
  }>;
13
13
  type IconTileProps = ComponentPropsWithoutRef<typeof IconTile>;
14
- export declare const renderIconTile: (Icon: IconTileProps["icon"], appearance: IconTileProps["appearance"], LegacyIcon?: ComponentType<AtlaskitIconTileProps>) => React.FC<AtlaskitIconTileProps>;
14
+ export declare const renderIconTile: (Icon: IconTileProps["icon"], appearance: IconTileProps["appearance"]) => React.FC<AtlaskitIconTileProps>;
15
15
  export {};
@@ -1,5 +1,7 @@
1
1
  import type { ChatNewPayload } from '@atlaskit/rovo-triggers/types';
2
+ export type SendPromptMessageData = Partial<ChatNewPayload['data']>;
2
3
  declare const useRovoChat: () => {
3
- sendPromptMessage: (data: Partial<ChatNewPayload["data"]>) => void;
4
+ isRovoChatEnabled: boolean;
5
+ sendPromptMessage: (data: SendPromptMessageData) => void;
4
6
  };
5
7
  export default useRovoChat;
@@ -0,0 +1,2 @@
1
+ declare const useRovoConfig: () => import("packages/linking-platform/link-provider/dist/types/state/context/types").RovoOptions | undefined;
2
+ export default useRovoConfig;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { type LinkActionProps } from '../types';
3
+ export declare enum RovoChatPromptKey {
4
+ MESSAGE_1 = "message-1",
5
+ MESSAGE_2 = "message-2"
6
+ }
7
+ type RovoChatActionProps = LinkActionProps & {
8
+ prompts?: RovoChatPromptKey[];
9
+ };
10
+ declare const RovoChatAction: ({ onClick: onClickCallback, prompts, testId, ...props }: RovoChatActionProps) => React.JSX.Element | null;
11
+ export default RovoChatAction;
@@ -9,6 +9,7 @@ export type LozengeActionProps = {
9
9
  action: LinkLozengeInvokeActions;
10
10
  appearance?: ThemeAppearance;
11
11
  onAfterChanged?: () => void;
12
+ shouldRenderToParent?: boolean;
12
13
  testId?: string;
13
14
  text: string | React.ReactNode;
14
15
  zIndex?: number;