@atlaskit/smart-card 46.22.2 → 46.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/analytics.spec.yaml +23 -0
  3. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  4. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  5. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  6. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  7. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  8. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  9. package/dist/cjs/constants.js +2 -0
  10. package/dist/cjs/extractors/flexible/actions/extract-remix-action.js +53 -0
  11. package/dist/cjs/extractors/flexible/actions/index.js +11 -2
  12. package/dist/cjs/extractors/flexible/index.js +7 -3
  13. package/dist/cjs/messages.js +4 -9
  14. package/dist/cjs/utils/analytics/analytics.js +1 -1
  15. package/dist/cjs/utils/is-remix-action-enabled.js +48 -0
  16. package/dist/cjs/utils/use-remix-action-exposure.js +16 -0
  17. package/dist/cjs/view/BlockCard/views/ResolvedView.js +18 -13
  18. package/dist/cjs/view/EmbedCard/components/rovo-actions-footer/index.js +58 -10
  19. package/dist/cjs/view/EmbedCard/index.js +2 -0
  20. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +23 -7
  21. package/dist/cjs/view/FlexibleCard/components/actions/remix-action/index.js +81 -0
  22. package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +3 -2
  23. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -1
  24. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +5 -1
  25. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -3
  26. package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
  27. package/dist/cjs/view/FlexibleCard/index.js +9 -3
  28. package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
  29. package/dist/cjs/view/InlineCard/common/inline-card-action/index.js +70 -0
  30. package/dist/cjs/view/InlineCard/common/remix-action/index.compiled.css +5 -0
  31. package/dist/cjs/view/InlineCard/common/remix-action/index.js +77 -0
  32. package/dist/cjs/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
  33. package/dist/cjs/view/LinkUrl/index.js +1 -1
  34. package/dist/cjs/view/common/rovo-chat-utils/index.js +0 -28
  35. package/dist/cjs/view/common/rovo-post-auth-prompts/index.js +1 -16
  36. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  37. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  38. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  39. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  40. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  41. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  42. package/dist/es2019/constants.js +2 -0
  43. package/dist/es2019/extractors/flexible/actions/extract-remix-action.js +48 -0
  44. package/dist/es2019/extractors/flexible/actions/index.js +12 -0
  45. package/dist/es2019/extractors/flexible/index.js +4 -0
  46. package/dist/es2019/messages.js +4 -9
  47. package/dist/es2019/utils/analytics/analytics.js +1 -1
  48. package/dist/es2019/utils/is-remix-action-enabled.js +39 -0
  49. package/dist/es2019/utils/use-remix-action-exposure.js +11 -0
  50. package/dist/es2019/view/BlockCard/views/ResolvedView.js +19 -14
  51. package/dist/es2019/view/EmbedCard/components/rovo-actions-footer/index.js +43 -11
  52. package/dist/es2019/view/EmbedCard/index.js +2 -0
  53. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +22 -7
  54. package/dist/es2019/view/FlexibleCard/components/actions/remix-action/index.js +54 -0
  55. package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +3 -1
  56. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -0
  57. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +4 -1
  58. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +9 -4
  59. package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
  60. package/dist/es2019/view/FlexibleCard/index.js +8 -1
  61. package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
  62. package/dist/es2019/view/InlineCard/common/inline-card-action/index.js +61 -0
  63. package/dist/es2019/view/InlineCard/common/remix-action/index.compiled.css +5 -0
  64. package/dist/es2019/view/InlineCard/common/remix-action/index.js +50 -0
  65. package/dist/es2019/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
  66. package/dist/es2019/view/LinkUrl/index.js +1 -1
  67. package/dist/es2019/view/common/rovo-chat-utils/index.js +0 -26
  68. package/dist/es2019/view/common/rovo-post-auth-prompts/index.js +1 -15
  69. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  70. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  71. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  72. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  73. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
  74. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
  75. package/dist/esm/constants.js +2 -0
  76. package/dist/esm/extractors/flexible/actions/extract-remix-action.js +47 -0
  77. package/dist/esm/extractors/flexible/actions/index.js +11 -2
  78. package/dist/esm/extractors/flexible/index.js +7 -3
  79. package/dist/esm/messages.js +4 -9
  80. package/dist/esm/utils/analytics/analytics.js +1 -1
  81. package/dist/esm/utils/is-remix-action-enabled.js +42 -0
  82. package/dist/esm/utils/use-remix-action-exposure.js +11 -0
  83. package/dist/esm/view/BlockCard/views/ResolvedView.js +19 -14
  84. package/dist/esm/view/EmbedCard/components/rovo-actions-footer/index.js +59 -11
  85. package/dist/esm/view/EmbedCard/index.js +2 -0
  86. package/dist/esm/view/EmbedCard/views/ResolvedView.js +23 -7
  87. package/dist/esm/view/FlexibleCard/components/actions/remix-action/index.js +72 -0
  88. package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +3 -2
  89. package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -1
  90. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +5 -1
  91. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +11 -4
  92. package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
  93. package/dist/esm/view/FlexibleCard/index.js +9 -3
  94. package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
  95. package/dist/esm/view/InlineCard/common/inline-card-action/index.js +61 -0
  96. package/dist/esm/view/InlineCard/common/remix-action/index.compiled.css +5 -0
  97. package/dist/esm/view/InlineCard/common/remix-action/index.js +70 -0
  98. package/dist/esm/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
  99. package/dist/esm/view/LinkUrl/index.js +1 -1
  100. package/dist/esm/view/common/rovo-chat-utils/index.js +0 -28
  101. package/dist/esm/view/common/rovo-post-auth-prompts/index.js +1 -16
  102. package/dist/types/common/analytics/generated/analytics.types.d.ts +17 -2
  103. package/dist/types/constants.d.ts +2 -0
  104. package/dist/types/extractors/flexible/actions/extract-remix-action.d.ts +15 -0
  105. package/dist/types/extractors/flexible/actions/index.d.ts +3 -1
  106. package/dist/types/extractors/flexible/index.d.ts +1 -1
  107. package/dist/types/messages.d.ts +1 -1
  108. package/dist/types/state/flexible-ui-context/types.d.ts +5 -0
  109. package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +1 -1
  110. package/dist/types/utils/is-remix-action-enabled.d.ts +15 -0
  111. package/dist/types/utils/use-remix-action-exposure.d.ts +2 -0
  112. package/dist/types/view/Card/types.d.ts +10 -1
  113. package/dist/types/view/EmbedCard/components/rovo-actions-footer/index.d.ts +5 -4
  114. package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +2 -0
  115. package/dist/types/view/FlexibleCard/components/actions/remix-action/index.d.ts +4 -0
  116. package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -1
  117. package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +4 -0
  118. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +8 -2
  119. package/dist/types/view/FlexibleCard/types.d.ts +2 -1
  120. package/dist/types/view/InlineCard/common/inline-card-action/index.d.ts +11 -0
  121. package/dist/types/view/InlineCard/common/remix-action/index.d.ts +9 -0
  122. package/dist/types/view/common/rovo-chat-utils/index.d.ts +1 -2
  123. package/dist/types/view/common/rovo-post-auth-prompts/index.d.ts +1 -10
  124. package/package.json +2 -2
  125. package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-forbidden-view--default.png +0 -3
  126. package/dist/cjs/__tests__/vr-tests/__snapshots__/embed-card/embed-card-not-found-default--default.png +0 -3
  127. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  128. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  129. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  130. package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-with-default-legacy-icon--default.png +0 -3
  131. package/dist/cjs/utils/is-rovo-chat-action-visualize-enabled.js +0 -43
  132. package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-forbidden-view--default.png +0 -3
  133. package/dist/es2019/__tests__/vr-tests/__snapshots__/embed-card/embed-card-not-found-default--default.png +0 -3
  134. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  135. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  136. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  137. package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-with-default-legacy-icon--default.png +0 -3
  138. package/dist/es2019/utils/is-rovo-chat-action-visualize-enabled.js +0 -34
  139. package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-forbidden-view--default.png +0 -3
  140. package/dist/esm/__tests__/vr-tests/__snapshots__/embed-card/embed-card-not-found-default--default.png +0 -3
  141. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  142. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  143. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  144. package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-forbidden-view-with-default-legacy-icon--default.png +0 -3
  145. package/dist/esm/utils/is-rovo-chat-action-visualize-enabled.js +0 -37
  146. package/dist/types/utils/is-rovo-chat-action-visualize-enabled.d.ts +0 -18
  147. /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  148. /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  149. /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  150. /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  151. /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  152. /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  153. /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  154. /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
  155. /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getPromptAction = exports.RovoChatPromptKey = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _aiSearch = _interopRequireDefault(require("@atlaskit/icon-lab/core/ai-search"));
11
10
  var _aiChat = _interopRequireDefault(require("@atlaskit/icon/core/ai-chat"));
12
11
  var _aiGenerativeTextSummary = _interopRequireDefault(require("@atlaskit/icon/core/ai-generative-text-summary"));
13
- var _chartBar = _interopRequireDefault(require("@atlaskit/icon/core/chart-bar"));
14
12
  var _rovoChat = _interopRequireDefault(require("@atlaskit/icon/core/rovo-chat"));
15
13
  var _icon = require("@atlaskit/logo/rovo/icon");
16
14
  var _fg = require("@atlaskit/platform-feature-flags/fg");
@@ -19,8 +17,6 @@ var _messages = require("../../../messages");
19
17
  var _aiChapterIcon = _interopRequireDefault(require("../../FlexibleCard/assets/ai-chapter-icon"));
20
18
  var _aiSearchIcon = _interopRequireDefault(require("../../FlexibleCard/assets/ai-search-icon"));
21
19
  var _htmlToAdf = _interopRequireDefault(require("../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf"));
22
- 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; }
23
- 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; }
24
20
  var RovoChatPromptKey = exports.RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
25
21
  RovoChatPromptKey["SUMMARIZE_LINK"] = "summarize-link";
26
22
  RovoChatPromptKey["KEY_HIGHLIGHTS"] = "key-highlights";
@@ -37,7 +33,6 @@ var RovoChatPromptKey = exports.RovoChatPromptKey = /*#__PURE__*/function (RovoC
37
33
  RovoChatPromptKey["EXPLAIN_CODE"] = "explain-code";
38
34
  RovoChatPromptKey["CATCH_UP"] = "catch-up";
39
35
  RovoChatPromptKey["SALESFORCE_PREP"] = "salesforce-prep";
40
- RovoChatPromptKey["VISUALIZE"] = "visualize";
41
36
  return RovoChatPromptKey;
42
37
  }({});
43
38
  var getContext = function getContext(intl, product) {
@@ -380,28 +375,5 @@ var getPromptAction = exports.getPromptAction = function getPromptAction(_ref) {
380
375
  size: iconSize
381
376
  })
382
377
  };
383
- case RovoChatPromptKey.VISUALIZE:
384
- var label_visualize = intl.formatMessage(_messages.messages.rovo_prompt_button_visualize);
385
- var html_visualize = intl.formatMessage(_messages.messages.rovo_prompt_message_visualize, {
386
- url: url
387
- }, {
388
- ignoreTag: true
389
- });
390
- var visualizeIconProps = _objectSpread({
391
- label: label_visualize,
392
- size: iconSize
393
- }, cardAppearance === _constants.CardDisplay.HoverCardPreview ? {
394
- spacing: 'spacious'
395
- } : {});
396
- return {
397
- content: label_visualize,
398
- tooltipMessage: label_visualize,
399
- data: {
400
- name: label_visualize,
401
- dialogues: [],
402
- prompt: (0, _htmlToAdf.default)(html_visualize)
403
- },
404
- icon: /*#__PURE__*/_react.default.createElement(_chartBar.default, visualizeIconProps)
405
- };
406
378
  }
407
379
  };
@@ -4,27 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getRovoPostAuthPromptKeys = void 0;
7
- var _isRovoChatActionVisualizeEnabled = require("../../../utils/is-rovo-chat-action-visualize-enabled");
8
7
  var _rovoChatUtils = require("../rovo-chat-utils");
9
8
  var getRovoPostAuthPromptKeys = exports.getRovoPostAuthPromptKeys = function getRovoPostAuthPromptKeys(_ref) {
10
- var extensionKey = _ref.extensionKey,
11
- _ref$isRovoChatAction = _ref.isRovoChatActionShown,
12
- isRovoChatActionShown = _ref$isRovoChatAction === void 0 ? false : _ref$isRovoChatAction,
13
- product = _ref.product,
14
- response = _ref.response;
9
+ var extensionKey = _ref.extensionKey;
15
10
  var defaultPrompts = [_rovoChatUtils.RovoChatPromptKey.KEY_HIGHLIGHTS];
16
11
  if (extensionKey === 'github-object-provider' || extensionKey === 'gitlab-object-provider') {
17
12
  return [_rovoChatUtils.RovoChatPromptKey.EXPLAIN_CODE].concat(defaultPrompts);
18
13
  }
19
- if (isRovoChatActionShown && (0, _isRovoChatActionVisualizeEnabled.isRovoChatActionVisualizeEnabled)({
20
- extensionKey: extensionKey,
21
- product: product,
22
- response: response
23
- })) {
24
- // Visualize goes first (PM decision). The embed Rovo actions footer hides every prompt after
25
- // the first below 320px (HIDE_SECONDARY_ACTIONS_WIDTH), so this keeps Visualize visible on
26
- // narrow embeds whenever exposure fires.
27
- return [_rovoChatUtils.RovoChatPromptKey.VISUALIZE, _rovoChatUtils.RovoChatPromptKey.SUMMARIZE_DOCUMENT].concat(defaultPrompts);
28
- }
29
14
  return [_rovoChatUtils.RovoChatPromptKey.SUMMARIZE_DOCUMENT].concat(defaultPrompts);
30
15
  };
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:663376f0c66bd0598b00336aa8f71781fd51bb8b9a2b78ba3d56e271de1568af
3
+ size 12644
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52ac27aba4848d90135696ffee9b082bdf037848367a8458f433e959daedfb37
3
+ size 15292
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:045ed9024b909abebae17b20d05878dbd38f02cae3e3bfbb97788ab329706a6c
3
+ size 10627
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:103e5fc11fd9240f587eb74d4922997a7b6b6037e6d7b4b1b849868f524b9436
3
+ size 13698
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:236836ff55573fe8094119fe1306281c0c711a2cb00d55101d0bfaf1accdc438
3
+ size 3764
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:236836ff55573fe8094119fe1306281c0c711a2cb00d55101d0bfaf1accdc438
3
+ size 3764
@@ -164,6 +164,7 @@ export let ActionName = /*#__PURE__*/function (ActionName) {
164
164
  }({});
165
165
  export let InternalActionName = /*#__PURE__*/function (InternalActionName) {
166
166
  InternalActionName["AISummaryAction"] = "AISummaryAction";
167
+ InternalActionName["RemixAction"] = "RemixAction";
167
168
  InternalActionName["UnresolvedAction"] = "UnresolvedAction";
168
169
  InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
169
170
  return InternalActionName;
@@ -267,6 +268,7 @@ export let CardAction = /*#__PURE__*/function (CardAction) {
267
268
  CardAction["DownloadAction"] = "DownloadAction";
268
269
  CardAction["FollowAction"] = "FollowAction";
269
270
  CardAction["PreviewAction"] = "PreviewAction";
271
+ CardAction["RemixAction"] = "RemixAction";
270
272
  CardAction["RovoChatAction"] = "RovoChatAction";
271
273
  CardAction["ViewAction"] = "ViewAction";
272
274
  return CardAction;
@@ -0,0 +1,48 @@
1
+ import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
2
+ import { CardAction, InternalActionName } from '../../../constants';
3
+ import { getDefinitionId } from '../../../state/getDefinitionId';
4
+ import { getExtensionKey } from '../../../state/getExtensionKey';
5
+ import { getResourceType } from '../../../state/getResourceType';
6
+ import { canShowAction } from '../../../utils/actions/can-show-action';
7
+ import { isRemixActionEnabled } from '../../../utils/is-remix-action-enabled';
8
+ const extractRemixAction = ({
9
+ actionOptions,
10
+ appearance,
11
+ id,
12
+ remix,
13
+ response,
14
+ url
15
+ }) => {
16
+ var _actionOptions$remixA, _extractSmartLinkUrl;
17
+ if (!canShowAction(CardAction.RemixAction, actionOptions)) {
18
+ return;
19
+ }
20
+ if (!(actionOptions !== null && actionOptions !== void 0 && (_actionOptions$remixA = actionOptions.remixAction) !== null && _actionOptions$remixA !== void 0 && _actionOptions$remixA.optIn)) {
21
+ return;
22
+ }
23
+ const remixUrl = (_extractSmartLinkUrl = extractSmartLinkUrl(response)) !== null && _extractSmartLinkUrl !== void 0 ? _extractSmartLinkUrl : url;
24
+ if (!remixUrl) {
25
+ return;
26
+ }
27
+ const extensionKey = getExtensionKey(response);
28
+ if (!isRemixActionEnabled({
29
+ extensionKey,
30
+ remix,
31
+ response
32
+ })) {
33
+ return;
34
+ }
35
+ return {
36
+ invokeAction: {
37
+ actionSubjectId: 'remix',
38
+ actionType: InternalActionName.RemixAction,
39
+ definitionId: getDefinitionId(response),
40
+ display: appearance,
41
+ extensionKey,
42
+ id,
43
+ resourceType: getResourceType(response)
44
+ },
45
+ url: remixUrl
46
+ };
47
+ };
48
+ export default extractRemixAction;
@@ -6,6 +6,7 @@ import { extractCopyLinkClientAction } from './extract-copy-link-action';
6
6
  import { extractDownloadClientAction } from './extract-download-action';
7
7
  import extractFollowAction from './extract-follow-action';
8
8
  import { extractPreviewClientAction } from './extract-preview-action';
9
+ import extractRemixAction from './extract-remix-action';
9
10
  import extractRovoChatAction from './extract-rovo-chat-action';
10
11
  import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
11
12
  export const extractFlexibleCardActions = ({
@@ -16,6 +17,7 @@ export const extractFlexibleCardActions = ({
16
17
  id,
17
18
  origin,
18
19
  product,
20
+ remix,
19
21
  response,
20
22
  rovoConfig,
21
23
  transformUrl,
@@ -62,6 +64,16 @@ export const extractFlexibleCardActions = ({
62
64
  response,
63
65
  rovoConfig
64
66
  }),
67
+ ...(fg('platform_sl_3p_auth_visualize_killswitch') ? {
68
+ [InternalActionName.RemixAction]: extractRemixAction({
69
+ actionOptions,
70
+ appearance,
71
+ id,
72
+ remix,
73
+ response,
74
+ url
75
+ })
76
+ } : undefined),
65
77
  [InternalActionName.ViewRelatedLinksAction]: extractViewRelatedLinksAction(response)
66
78
  };
67
79
  return Object.values(action).some(value => Boolean(value)) ? action : undefined;
@@ -55,6 +55,7 @@ const extractFlexibleUiContext = ({
55
55
  product,
56
56
  resolve,
57
57
  rovoConfig,
58
+ remix,
58
59
  actionOptions,
59
60
  response,
60
61
  status,
@@ -84,6 +85,9 @@ const extractFlexibleUiContext = ({
84
85
  origin,
85
86
  product,
86
87
  rovoConfig,
88
+ ...(fg('platform_sl_3p_auth_visualize_killswitch') ? {
89
+ remix
90
+ } : undefined),
87
91
  response,
88
92
  url: props.url,
89
93
  // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
@@ -1111,14 +1111,9 @@ export const messages = defineMessages({
1111
1111
  defaultMessage: 'Your team sees richer <b>{provider}</b> previews.',
1112
1112
  description: 'Social proof message shown on unauthorized 3P block cards when less than 30% of the tenant has connected the provider. {provider} is the 3P app name (e.g. OneDrive).'
1113
1113
  },
1114
- rovo_prompt_button_visualize: {
1115
- id: 'fabric.linking.rovo_prompt_button_visualize.non-final',
1116
- defaultMessage: 'Visualize',
1117
- description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
1118
- },
1119
- rovo_prompt_message_visualize: {
1120
- id: 'fabric.linking.rovo_prompt_message_visualize.non-final',
1121
- defaultMessage: '<p>Visualize this link <a>{url}</a></p>',
1122
- description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
1114
+ rovo_prompt_button_remix: {
1115
+ id: 'fabric.linking.rovo_prompt_button_remix.non-final',
1116
+ defaultMessage: 'Remix',
1117
+ description: 'Button that opens the Remix chooser for this Smart Link.'
1123
1118
  }
1124
1119
  });
@@ -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.22.1" || ''
7
+ packageVersion: "46.22.3" || ''
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,39 @@
1
+ import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
2
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
+ /**
4
+ * Check rollout without exposure: the action may never be rendered, e.g. in a hover preview.
5
+ * Remove this function on experiment cleanup; the business rules stay.
6
+ */
7
+ const isRemixExperimentEnabled = () => fg('platform_sl_3p_auth_visualize_killswitch') && UNSAFE_expValNoExposure('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
8
+
9
+ /**
10
+ * `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
11
+ * against any other shape rather than calling `.includes` on it directly.
12
+ */
13
+ const isGoogleSheetsType = response => {
14
+ var _response$data;
15
+ const type = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
16
+ const types = Array.isArray(type) ? type : [type];
17
+ return types.includes('schema:SpreadsheetDigitalDocument');
18
+ };
19
+
20
+ // Capability callbacks are implemented outside smart-card. Treat a failure as
21
+ // unavailable instead of failing card extraction/rendering.
22
+ const isRemixAvailable = remix => {
23
+ try {
24
+ return Boolean(remix === null || remix === void 0 ? void 0 : remix.isAvailable());
25
+ } catch {
26
+ return false;
27
+ }
28
+ };
29
+
30
+ /**
31
+ * Whether the Remix action is offered for a resolved link.
32
+ *
33
+ * This check does not record exposure. The rendered Remix control owns exposure.
34
+ */
35
+ export const isRemixActionEnabled = ({
36
+ extensionKey,
37
+ remix,
38
+ response
39
+ }) => extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isRemixAvailable(remix) && isRemixExperimentEnabled();
@@ -0,0 +1,11 @@
1
+ import { useEffect } from 'react';
2
+ import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
3
+
4
+ /** Record exposure only once the eligible Remix control has been committed. */
5
+ export const useRemixActionExposure = isRendered => {
6
+ useEffect(() => {
7
+ if (isRendered) {
8
+ expVal('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
9
+ }
10
+ }, [isRendered]);
11
+ };
@@ -5,12 +5,12 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useEffect, useMemo, useState } from 'react';
7
7
  import { browser } from '@atlaskit/linking-common/user-agent';
8
- import { ActionName, CardDisplay, ElementName, SmartLinkPosition } from '../../../constants';
8
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
9
+ import { ActionName, CardDisplay, ElementName, InternalActionName, SmartLinkPosition } from '../../../constants';
9
10
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
10
11
  import { getExtensionKey } from '../../../state/getExtensionKey';
11
12
  import useBlockCardRovoAction from '../../../state/hooks/use-block-card-rovo-action-experiment';
12
13
  import useRovoConfig from '../../../state/hooks/use-rovo-config';
13
- import { isRovoChatActionVisualizeEnabled } from '../../../utils/is-rovo-chat-action-visualize-enabled';
14
14
  import { RovoChatPromptKey } from '../../common/rovo-chat-utils';
15
15
  import FlexibleCard from '../../FlexibleCard';
16
16
  import { default as FooterBlock } from '../../FlexibleCard/components/blocks/footer-block';
@@ -32,6 +32,7 @@ const footerBlockSafariStyles = null;
32
32
  */
33
33
  const ResolvedView = ({
34
34
  cardState,
35
+ id,
35
36
  onClick,
36
37
  onAuxClick,
37
38
  onContextMenu,
@@ -72,26 +73,20 @@ const ResolvedView = ({
72
73
  return [RovoChatPromptKey.IDENTIFY_KEY_POINTS, ...defaultPrompts];
73
74
  }
74
75
  if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:SpreadsheetDigitalDocument')) {
75
- if (isRovoChatActionVisualizeEnabled({
76
- extensionKey,
77
- product: rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product,
78
- response: cardState === null || cardState === void 0 ? void 0 : cardState.details
79
- })) {
80
- return [RovoChatPromptKey.IDENTIFY_KEY_TRENDS, RovoChatPromptKey.VISUALIZE, ...defaultPrompts];
81
- }
82
76
  return [RovoChatPromptKey.IDENTIFY_KEY_TRENDS, ...defaultPrompts];
83
77
  }
84
78
  return [RovoChatPromptKey.SUMMARIZE_LINK, ...defaultPrompts];
85
79
  }
86
80
  return [];
87
- }, [cardState === null || cardState === void 0 ? void 0 : cardState.details, extensionKey, is3PRovoBlockRovoActionEnabled, rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product]);
81
+ }, [cardState === null || cardState === void 0 ? void 0 : cardState.details, extensionKey, is3PRovoBlockRovoActionEnabled]);
88
82
  const footerActions = useMemo(() => {
89
83
  const showRovoResolvedView = (cardState === null || cardState === void 0 ? void 0 : cardState.status) === 'resolved' && cardState.details && extractRovoChatAction({
90
84
  response: cardState.details,
91
85
  rovoConfig,
92
86
  actionOptions: actionOptions
93
87
  }) !== undefined;
94
- return showRovoResolvedView && is3PRovoBlockRovoActionEnabled ? [{
88
+ const usesIconFooter = showRovoResolvedView && is3PRovoBlockRovoActionEnabled;
89
+ const actions = usesIconFooter ? [{
95
90
  name: ActionName.RovoChatAction,
96
91
  prompts: prompts,
97
92
  iconSize: 'small',
@@ -112,13 +107,23 @@ const ResolvedView = ({
112
107
  name: ActionName.DownloadAction,
113
108
  hideIcon: true
114
109
  }];
110
+ return fg('platform_sl_3p_auth_visualize_killswitch') ? [usesIconFooter ? {
111
+ name: InternalActionName.RemixAction,
112
+ iconSize: 'small'
113
+ } : {
114
+ name: InternalActionName.RemixAction,
115
+ hideIcon: true
116
+ }, ...actions] : actions;
115
117
  }, [prompts, is3PRovoBlockRovoActionEnabled, cardState, rovoConfig, actionOptions]);
116
118
  const uiOptions = FlexibleCardUiOptions;
117
119
  uiOptions.enableSnippetRenderer = true;
118
120
  uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
119
- return /*#__PURE__*/React.createElement(FlexibleCard, {
121
+ return /*#__PURE__*/React.createElement(FlexibleCard, _extends({
120
122
  appearance: "block",
121
- cardState: cardState,
123
+ cardState: cardState
124
+ }, fg('platform_sl_3p_auth_visualize_killswitch') ? {
125
+ id
126
+ } : undefined, {
122
127
  onClick: onClick,
123
128
  onAuxClick: onAuxClick,
124
129
  onContextMenu: onContextMenu,
@@ -129,7 +134,7 @@ const ResolvedView = ({
129
134
  testId: testId,
130
135
  ui: uiOptions,
131
136
  url: url
132
- }, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
137
+ }), /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
133
138
  metadata: titleMetadata,
134
139
  subtitle: [{
135
140
  name: ElementName.Location
@@ -4,11 +4,15 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback, useMemo, useState } from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import Button from '@atlaskit/button/default/button';
7
+ import RemixIcon from '@atlaskit/icon-lab/core/ai-generative-remix';
8
+ import { usePlugins } from '@atlaskit/link-provider/use-plugins';
7
9
  import { fg } from '@atlaskit/platform-feature-flags/fg';
8
10
  import { WidthObserver } from '@atlaskit/width-detector/width-observer';
11
+ import { messages } from '../../../../messages';
9
12
  import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
10
13
  import useRovoChat from '../../../../state/hooks/use-rovo-chat';
11
- import { getPromptAction, RovoChatPromptKey } from '../../../common/rovo-chat-utils';
14
+ import { useRemixActionExposure } from '../../../../utils/use-remix-action-exposure';
15
+ import { getPromptAction } from '../../../common/rovo-chat-utils';
12
16
  import AIEditIcon from '../../../FlexibleCard/assets/ai-edit-icon';
13
17
  const HIDE_SECONDARY_ACTIONS_WIDTH = 320;
14
18
  const PRIMARY_ACTION_ICON_ONLY_WIDTH = 220;
@@ -39,10 +43,14 @@ const RovoPromptButton = ({
39
43
  };
40
44
  const EmbedRovoActionsFooter = ({
41
45
  actionData,
46
+ remixActionData,
42
47
  prompts,
43
48
  testId = 'embed-rovo-actions-footer'
44
49
  }) => {
45
50
  const intl = useIntl();
51
+ const {
52
+ remix
53
+ } = usePlugins();
46
54
  const invoke = useInvokeClientAction({});
47
55
  const {
48
56
  isRovoChatEnabled,
@@ -51,15 +59,20 @@ const EmbedRovoActionsFooter = ({
51
59
  const [containerWidth, setContainerWidth] = useState(undefined);
52
60
  const shouldHideSecondaryActions = containerWidth !== undefined && containerWidth < HIDE_SECONDARY_ACTIONS_WIDTH;
53
61
  const shouldHidePrimaryActionContent = containerWidth !== undefined && containerWidth < PRIMARY_ACTION_ICON_ONLY_WIDTH;
62
+ const isRemixVisible = Boolean(remixActionData && remix);
63
+ useRemixActionExposure(isRemixVisible);
54
64
  const onClick = useCallback((event, promptData, promptKey) => {
55
65
  event.preventDefault();
56
66
  event.stopPropagation();
67
+ if (!actionData) {
68
+ return;
69
+ }
57
70
  invoke({
58
71
  ...actionData.invokeAction,
59
72
  actionFn: async () => sendPromptMessage(promptData),
60
73
  prompt: promptKey
61
74
  });
62
- }, [actionData.invokeAction, invoke, sendPromptMessage]);
75
+ }, [actionData, invoke, sendPromptMessage]);
63
76
  const promptActions = useMemo(() => prompts.reduce((actions, promptKey) => {
64
77
  if (shouldHideSecondaryActions && actions.length > 0) {
65
78
  return actions;
@@ -67,21 +80,20 @@ const EmbedRovoActionsFooter = ({
67
80
  const promptAction = getPromptAction({
68
81
  promptKey,
69
82
  intl,
70
- url: actionData.url,
71
- product: actionData.product,
83
+ url: actionData === null || actionData === void 0 ? void 0 : actionData.url,
84
+ product: actionData === null || actionData === void 0 ? void 0 : actionData.product,
72
85
  iconSize: 'small'
73
86
  });
74
87
  if (!promptAction) {
75
88
  return actions;
76
89
  }
77
90
  const isPrimaryAction = actions.length === 0;
78
- // The primary action normally uses the branded AI icon. Visualize keeps its own
79
- // chart icon so the action stays recognisable, including in the icon-only view.
91
+ // The primary chat action normally uses the branded AI icon.
80
92
  // With platform_sl_rovo_summarize_icon_consistency on, every action keeps its own
81
93
  // prompt icon so Summarize matches the inline and block cards.
82
- const shouldUseBrandedIcon = fg('platform_sl_rovo_summarize_icon_consistency') ? false : isPrimaryAction && promptKey !== RovoChatPromptKey.VISUALIZE;
94
+ const shouldUseBrandedIcon = fg('platform_sl_rovo_summarize_icon_consistency') ? false : isPrimaryAction;
83
95
  actions.push( /*#__PURE__*/React.createElement(RovoPromptButton, {
84
- hideContent: isPrimaryAction && shouldHidePrimaryActionContent,
96
+ hideContent: isPrimaryAction && !remixActionData && shouldHidePrimaryActionContent,
85
97
  icon: shouldUseBrandedIcon ? /*#__PURE__*/React.createElement(AIEditIcon, null) : promptAction.icon,
86
98
  key: promptKey,
87
99
  onClick: onClick,
@@ -90,8 +102,8 @@ const EmbedRovoActionsFooter = ({
90
102
  testId: testId
91
103
  }));
92
104
  return actions;
93
- }, []), [actionData.product, actionData.url, intl, onClick, prompts, shouldHidePrimaryActionContent, shouldHideSecondaryActions, testId]);
94
- if (!isRovoChatEnabled || promptActions.length === 0) {
105
+ }, []), [actionData === null || actionData === void 0 ? void 0 : actionData.product, actionData === null || actionData === void 0 ? void 0 : actionData.url, intl, onClick, prompts, remixActionData, shouldHidePrimaryActionContent, shouldHideSecondaryActions, testId]);
106
+ if (!isRemixVisible && (!isRovoChatEnabled || !actionData || promptActions.length === 0)) {
95
107
  return null;
96
108
  }
97
109
  return /*#__PURE__*/React.createElement("div", {
@@ -101,6 +113,26 @@ const EmbedRovoActionsFooter = ({
101
113
  offscreen: true
102
114
  }), /*#__PURE__*/React.createElement("div", {
103
115
  className: ax([styles.actionGroup])
104
- }, promptActions));
116
+ }, remixActionData && remix ? /*#__PURE__*/React.createElement(Button, {
117
+ appearance: "subtle",
118
+ spacing: "compact",
119
+ "aria-label": intl.formatMessage(messages.rovo_prompt_button_remix),
120
+ iconBefore: () => /*#__PURE__*/React.createElement(RemixIcon, {
121
+ label: "",
122
+ size: "small"
123
+ }),
124
+ onClick: event => {
125
+ event.preventDefault();
126
+ event.stopPropagation();
127
+ const anchorElement = event.currentTarget;
128
+ void invoke({
129
+ ...remixActionData.invokeAction,
130
+ actionFn: async () => remix.open({
131
+ anchorElement,
132
+ url: remixActionData.url
133
+ })
134
+ });
135
+ }
136
+ }, shouldHidePrimaryActionContent ? undefined : intl.formatMessage(messages.rovo_prompt_button_remix)) : null, isRovoChatEnabled && actionData && !(remixActionData && shouldHideSecondaryActions) ? promptActions : null));
105
137
  };
106
138
  export default EmbedRovoActionsFooter;
@@ -24,6 +24,7 @@ const UFOLoadHoldWrapper = ({
24
24
  }), children);
25
25
  export const EmbedCard = /*#__PURE__*/React.forwardRef(({
26
26
  url,
27
+ id,
27
28
  cardState,
28
29
  handleAuthorize,
29
30
  handleErrorRetry,
@@ -101,6 +102,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
101
102
  }
102
103
  if (resolvedViewProps.preview) {
103
104
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
105
+ id: id,
104
106
  actionOptions: actionOptions,
105
107
  details: details,
106
108
  isSelected: isSelected,
@@ -3,9 +3,12 @@ import "./ResolvedView.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { lazy } from 'react';
5
5
  import LinkGlyph from '@atlaskit/icon/core/link';
6
+ import { usePlugins } from '@atlaskit/link-provider/use-plugins';
6
7
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
8
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
9
  import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
8
10
  import { CardDisplay } from '../../../constants';
11
+ import extractRemixAction from '../../../extractors/flexible/actions/extract-remix-action';
9
12
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
10
13
  import { getExtensionKey } from '../../../state/getExtensionKey';
11
14
  import useEmbedRovoActionsFooterExperiment from '../../../state/hooks/use-embed-rovo-actions-footer-experiment';
@@ -30,6 +33,7 @@ const EmbedFrameWithRovoFooter = ({
30
33
  actionOptions,
31
34
  details,
32
35
  frame,
36
+ id,
33
37
  link,
34
38
  testId
35
39
  }) => {
@@ -37,6 +41,9 @@ const EmbedFrameWithRovoFooter = ({
37
41
  rovoOptions,
38
42
  product
39
43
  } = useRovoConfig();
44
+ const {
45
+ remix
46
+ } = usePlugins();
40
47
  const {
41
48
  isEnabled: isEmbedRovoActionsFooterEnabled
42
49
  } = useEmbedRovoActionsFooterExperiment(link, actionOptions, rovoOptions, product);
@@ -50,22 +57,28 @@ const EmbedFrameWithRovoFooter = ({
50
57
  actionOptions,
51
58
  appearance: CardDisplay.Embed
52
59
  }) : undefined, [actionOptions, details, isEmbedRovoActionsFooterEnabled, product, rovoOptions]);
60
+ const remixActionData = React.useMemo(() => details && fg('platform_sl_3p_auth_visualize_killswitch') ? extractRemixAction({
61
+ response: details,
62
+ url: link,
63
+ remix,
64
+ actionOptions,
65
+ appearance: 'embed',
66
+ id
67
+ }) : undefined, [details, link, remix, actionOptions, id]);
53
68
  const prompts = React.useMemo(() => {
54
69
  if (!isEmbedRovoActionsFooterEnabled) {
55
70
  return [];
56
71
  }
57
72
  return getRovoPostAuthPromptKeys({
58
- extensionKey: getExtensionKey(details),
59
- isRovoChatActionShown: !!rovoActionData,
60
- product,
61
- response: details
73
+ extensionKey: getExtensionKey(details)
62
74
  });
63
- }, [details, isEmbedRovoActionsFooterEnabled, product, rovoActionData]);
64
- const footer = React.useMemo(() => rovoActionData && prompts.length > 0 ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
75
+ }, [details, isEmbedRovoActionsFooterEnabled]);
76
+ const footer = React.useMemo(() => rovoActionData && prompts.length > 0 || remixActionData ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
65
77
  actionData: rovoActionData,
78
+ remixActionData: remixActionData,
66
79
  prompts: prompts,
67
80
  testId: `${testId}-rovo-actions-footer`
68
- }) : undefined, [prompts, rovoActionData, testId]);
81
+ }) : undefined, [prompts, rovoActionData, remixActionData, testId]);
69
82
  return footer ? /*#__PURE__*/React.createElement("div", {
70
83
  className: ax([styles.contentWithFooter])
71
84
  }, /*#__PURE__*/React.createElement("div", {
@@ -79,6 +92,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
79
92
  link,
80
93
  context,
81
94
  details,
95
+ id,
82
96
  onClick,
83
97
  onAuxClick,
84
98
  onContextMenu,
@@ -155,6 +169,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
155
169
  actionOptions: actionOptions,
156
170
  details: details,
157
171
  frame: frame,
172
+ id: id,
158
173
  link: link,
159
174
  testId: testId
160
175
  });