@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
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
3
+ var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "remix", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
4
4
  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; }
5
5
  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; }
6
6
  import { extractPersonOwnedBy } from '@atlaskit/link-extractors/extract-person-owned-by';
@@ -62,6 +62,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
62
62
  product = _ref.product,
63
63
  resolve = _ref.resolve,
64
64
  rovoConfig = _ref.rovoConfig,
65
+ remix = _ref.remix,
65
66
  actionOptions = _ref.actionOptions,
66
67
  response = _ref.response,
67
68
  status = _ref.status,
@@ -80,7 +81,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
80
81
  var meta = (_response$meta = response.meta) !== null && _response$meta !== void 0 ? _response$meta : {};
81
82
  var url = extractSmartLinkUrl(response);
82
83
  return {
83
- actions: extractFlexibleCardActions(_objectSpread(_objectSpread({
84
+ actions: extractFlexibleCardActions(_objectSpread(_objectSpread(_objectSpread({
84
85
  actionOptions: actionOptions,
85
86
  aiSummaryConfig: aiSummaryConfig,
86
87
  appearance: appearance,
@@ -88,7 +89,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
88
89
  id: id,
89
90
  origin: origin,
90
91
  product: product,
91
- rovoConfig: rovoConfig,
92
+ rovoConfig: rovoConfig
93
+ }, fg('platform_sl_3p_auth_visualize_killswitch') ? {
94
+ remix: remix
95
+ } : undefined), {}, {
92
96
  response: response,
93
97
  url: props.url,
94
98
  // Use the original URL in edge cases, such as short links for AI summary and copy link actions.
@@ -1111,14 +1111,9 @@ export var 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 var ANALYTICS_CHANNEL = 'media';
4
4
  export var 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 var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,42 @@
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
+ var isRemixExperimentEnabled = function isRemixExperimentEnabled() {
8
+ return fg('platform_sl_3p_auth_visualize_killswitch') && UNSAFE_expValNoExposure('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
9
+ };
10
+
11
+ /**
12
+ * `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
13
+ * against any other shape rather than calling `.includes` on it directly.
14
+ */
15
+ var isGoogleSheetsType = function isGoogleSheetsType(response) {
16
+ var _response$data;
17
+ var type = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
18
+ var types = Array.isArray(type) ? type : [type];
19
+ return types.includes('schema:SpreadsheetDigitalDocument');
20
+ };
21
+
22
+ // Capability callbacks are implemented outside smart-card. Treat a failure as
23
+ // unavailable instead of failing card extraction/rendering.
24
+ var isRemixAvailable = function isRemixAvailable(remix) {
25
+ try {
26
+ return Boolean(remix === null || remix === void 0 ? void 0 : remix.isAvailable());
27
+ } catch (_unused) {
28
+ return false;
29
+ }
30
+ };
31
+
32
+ /**
33
+ * Whether the Remix action is offered for a resolved link.
34
+ *
35
+ * This check does not record exposure. The rendered Remix control owns exposure.
36
+ */
37
+ export var isRemixActionEnabled = function isRemixActionEnabled(_ref) {
38
+ var extensionKey = _ref.extensionKey,
39
+ remix = _ref.remix,
40
+ response = _ref.response;
41
+ return extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isRemixAvailable(remix) && isRemixExperimentEnabled();
42
+ };
@@ -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 var useRemixActionExposure = function useRemixActionExposure(isRendered) {
6
+ useEffect(function () {
7
+ if (isRendered) {
8
+ expVal('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
9
+ }
10
+ }, [isRendered]);
11
+ };
@@ -6,12 +6,12 @@ import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import { useEffect, useMemo, useState } from 'react';
8
8
  import { browser } from '@atlaskit/linking-common/user-agent';
9
- import { ActionName, CardDisplay, ElementName, SmartLinkPosition } from '../../../constants';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
+ import { ActionName, CardDisplay, ElementName, InternalActionName, SmartLinkPosition } from '../../../constants';
10
11
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
11
12
  import { getExtensionKey } from '../../../state/getExtensionKey';
12
13
  import useBlockCardRovoAction from '../../../state/hooks/use-block-card-rovo-action-experiment';
13
14
  import useRovoConfig from '../../../state/hooks/use-rovo-config';
14
- import { isRovoChatActionVisualizeEnabled } from '../../../utils/is-rovo-chat-action-visualize-enabled';
15
15
  import { RovoChatPromptKey } from '../../common/rovo-chat-utils';
16
16
  import FlexibleCard from '../../FlexibleCard';
17
17
  import { default as FooterBlock } from '../../FlexibleCard/components/blocks/footer-block';
@@ -33,6 +33,7 @@ var footerBlockSafariStyles = null;
33
33
  */
34
34
  var ResolvedView = function ResolvedView(_ref) {
35
35
  var cardState = _ref.cardState,
36
+ id = _ref.id,
36
37
  onClick = _ref.onClick,
37
38
  onAuxClick = _ref.onAuxClick,
38
39
  onContextMenu = _ref.onContextMenu,
@@ -77,26 +78,20 @@ var ResolvedView = function ResolvedView(_ref) {
77
78
  return [RovoChatPromptKey.IDENTIFY_KEY_POINTS].concat(defaultPrompts);
78
79
  }
79
80
  if (extensionKey === 'google-object-provider' && linkType !== null && linkType !== void 0 && linkType.includes('schema:SpreadsheetDigitalDocument')) {
80
- if (isRovoChatActionVisualizeEnabled({
81
- extensionKey: extensionKey,
82
- product: rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product,
83
- response: cardState === null || cardState === void 0 ? void 0 : cardState.details
84
- })) {
85
- return [RovoChatPromptKey.IDENTIFY_KEY_TRENDS, RovoChatPromptKey.VISUALIZE].concat(defaultPrompts);
86
- }
87
81
  return [RovoChatPromptKey.IDENTIFY_KEY_TRENDS].concat(defaultPrompts);
88
82
  }
89
83
  return [RovoChatPromptKey.SUMMARIZE_LINK].concat(defaultPrompts);
90
84
  }
91
85
  return [];
92
- }, [cardState === null || cardState === void 0 ? void 0 : cardState.details, extensionKey, is3PRovoBlockRovoActionEnabled, rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product]);
86
+ }, [cardState === null || cardState === void 0 ? void 0 : cardState.details, extensionKey, is3PRovoBlockRovoActionEnabled]);
93
87
  var footerActions = useMemo(function () {
94
88
  var showRovoResolvedView = (cardState === null || cardState === void 0 ? void 0 : cardState.status) === 'resolved' && cardState.details && extractRovoChatAction({
95
89
  response: cardState.details,
96
90
  rovoConfig: rovoConfig,
97
91
  actionOptions: actionOptions
98
92
  }) !== undefined;
99
- return showRovoResolvedView && is3PRovoBlockRovoActionEnabled ? [{
93
+ var usesIconFooter = showRovoResolvedView && is3PRovoBlockRovoActionEnabled;
94
+ var actions = usesIconFooter ? [{
100
95
  name: ActionName.RovoChatAction,
101
96
  prompts: prompts,
102
97
  iconSize: 'small',
@@ -117,13 +112,23 @@ var ResolvedView = function ResolvedView(_ref) {
117
112
  name: ActionName.DownloadAction,
118
113
  hideIcon: true
119
114
  }];
115
+ return fg('platform_sl_3p_auth_visualize_killswitch') ? [usesIconFooter ? {
116
+ name: InternalActionName.RemixAction,
117
+ iconSize: 'small'
118
+ } : {
119
+ name: InternalActionName.RemixAction,
120
+ hideIcon: true
121
+ }].concat(actions) : actions;
120
122
  }, [prompts, is3PRovoBlockRovoActionEnabled, cardState, rovoConfig, actionOptions]);
121
123
  var uiOptions = FlexibleCardUiOptions;
122
124
  uiOptions.enableSnippetRenderer = true;
123
125
  uiOptions.hideLoadingSkeleton = hideIconLoadingSkeleton;
124
- return /*#__PURE__*/React.createElement(FlexibleCard, {
126
+ return /*#__PURE__*/React.createElement(FlexibleCard, _extends({
125
127
  appearance: "block",
126
- cardState: cardState,
128
+ cardState: cardState
129
+ }, fg('platform_sl_3p_auth_visualize_killswitch') ? {
130
+ id: id
131
+ } : undefined, {
127
132
  onClick: onClick,
128
133
  onAuxClick: onAuxClick,
129
134
  onContextMenu: onContextMenu,
@@ -134,7 +139,7 @@ var ResolvedView = function ResolvedView(_ref) {
134
139
  testId: testId,
135
140
  ui: uiOptions,
136
141
  url: url
137
- }, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
142
+ }), /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
138
143
  metadata: titleMetadata,
139
144
  subtitle: [{
140
145
  name: ElementName.Location
@@ -10,11 +10,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
10
10
  import React, { useCallback, useMemo, useState } from 'react';
11
11
  import { useIntl } from 'react-intl';
12
12
  import Button from '@atlaskit/button/default/button';
13
+ import RemixIcon from '@atlaskit/icon-lab/core/ai-generative-remix';
14
+ import { usePlugins } from '@atlaskit/link-provider/use-plugins';
13
15
  import { fg } from '@atlaskit/platform-feature-flags/fg';
14
16
  import { WidthObserver } from '@atlaskit/width-detector/width-observer';
17
+ import { messages } from '../../../../messages';
15
18
  import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
16
19
  import useRovoChat from '../../../../state/hooks/use-rovo-chat';
17
- import { getPromptAction, RovoChatPromptKey } from '../../../common/rovo-chat-utils';
20
+ import { useRemixActionExposure } from '../../../../utils/use-remix-action-exposure';
21
+ import { getPromptAction } from '../../../common/rovo-chat-utils';
18
22
  import AIEditIcon from '../../../FlexibleCard/assets/ai-edit-icon';
19
23
  var HIDE_SECONDARY_ACTIONS_WIDTH = 320;
20
24
  var PRIMARY_ACTION_ICON_ONLY_WIDTH = 220;
@@ -49,10 +53,13 @@ var RovoPromptButton = function RovoPromptButton(_ref) {
49
53
  };
50
54
  var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
51
55
  var actionData = _ref2.actionData,
56
+ remixActionData = _ref2.remixActionData,
52
57
  prompts = _ref2.prompts,
53
58
  _ref2$testId = _ref2.testId,
54
59
  testId = _ref2$testId === void 0 ? 'embed-rovo-actions-footer' : _ref2$testId;
55
60
  var intl = useIntl();
61
+ var _usePlugins = usePlugins(),
62
+ remix = _usePlugins.remix;
56
63
  var invoke = useInvokeClientAction({});
57
64
  var _useRovoChat = useRovoChat(),
58
65
  isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
@@ -63,9 +70,14 @@ var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
63
70
  setContainerWidth = _useState2[1];
64
71
  var shouldHideSecondaryActions = containerWidth !== undefined && containerWidth < HIDE_SECONDARY_ACTIONS_WIDTH;
65
72
  var shouldHidePrimaryActionContent = containerWidth !== undefined && containerWidth < PRIMARY_ACTION_ICON_ONLY_WIDTH;
73
+ var isRemixVisible = Boolean(remixActionData && remix);
74
+ useRemixActionExposure(isRemixVisible);
66
75
  var onClick = useCallback(function (event, promptData, promptKey) {
67
76
  event.preventDefault();
68
77
  event.stopPropagation();
78
+ if (!actionData) {
79
+ return;
80
+ }
69
81
  invoke(_objectSpread(_objectSpread({}, actionData.invokeAction), {}, {
70
82
  actionFn: function () {
71
83
  var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -86,7 +98,7 @@ var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
86
98
  }(),
87
99
  prompt: promptKey
88
100
  }));
89
- }, [actionData.invokeAction, invoke, sendPromptMessage]);
101
+ }, [actionData, invoke, sendPromptMessage]);
90
102
  var promptActions = useMemo(function () {
91
103
  return prompts.reduce(function (actions, promptKey) {
92
104
  if (shouldHideSecondaryActions && actions.length > 0) {
@@ -95,21 +107,20 @@ var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
95
107
  var promptAction = getPromptAction({
96
108
  promptKey: promptKey,
97
109
  intl: intl,
98
- url: actionData.url,
99
- product: actionData.product,
110
+ url: actionData === null || actionData === void 0 ? void 0 : actionData.url,
111
+ product: actionData === null || actionData === void 0 ? void 0 : actionData.product,
100
112
  iconSize: 'small'
101
113
  });
102
114
  if (!promptAction) {
103
115
  return actions;
104
116
  }
105
117
  var isPrimaryAction = actions.length === 0;
106
- // The primary action normally uses the branded AI icon. Visualize keeps its own
107
- // chart icon so the action stays recognisable, including in the icon-only view.
118
+ // The primary chat action normally uses the branded AI icon.
108
119
  // With platform_sl_rovo_summarize_icon_consistency on, every action keeps its own
109
120
  // prompt icon so Summarize matches the inline and block cards.
110
- var shouldUseBrandedIcon = fg('platform_sl_rovo_summarize_icon_consistency') ? false : isPrimaryAction && promptKey !== RovoChatPromptKey.VISUALIZE;
121
+ var shouldUseBrandedIcon = fg('platform_sl_rovo_summarize_icon_consistency') ? false : isPrimaryAction;
111
122
  actions.push( /*#__PURE__*/React.createElement(RovoPromptButton, {
112
- hideContent: isPrimaryAction && shouldHidePrimaryActionContent,
123
+ hideContent: isPrimaryAction && !remixActionData && shouldHidePrimaryActionContent,
113
124
  icon: shouldUseBrandedIcon ? /*#__PURE__*/React.createElement(AIEditIcon, null) : promptAction.icon,
114
125
  key: promptKey,
115
126
  onClick: onClick,
@@ -119,8 +130,8 @@ var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
119
130
  }));
120
131
  return actions;
121
132
  }, []);
122
- }, [actionData.product, actionData.url, intl, onClick, prompts, shouldHidePrimaryActionContent, shouldHideSecondaryActions, testId]);
123
- if (!isRovoChatEnabled || promptActions.length === 0) {
133
+ }, [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]);
134
+ if (!isRemixVisible && (!isRovoChatEnabled || !actionData || promptActions.length === 0)) {
124
135
  return null;
125
136
  }
126
137
  return /*#__PURE__*/React.createElement("div", {
@@ -130,6 +141,43 @@ var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
130
141
  offscreen: true
131
142
  }), /*#__PURE__*/React.createElement("div", {
132
143
  className: ax([styles.actionGroup])
133
- }, promptActions));
144
+ }, remixActionData && remix ? /*#__PURE__*/React.createElement(Button, {
145
+ appearance: "subtle",
146
+ spacing: "compact",
147
+ "aria-label": intl.formatMessage(messages.rovo_prompt_button_remix),
148
+ iconBefore: function iconBefore() {
149
+ return /*#__PURE__*/React.createElement(RemixIcon, {
150
+ label: "",
151
+ size: "small"
152
+ });
153
+ },
154
+ onClick: function onClick(event) {
155
+ event.preventDefault();
156
+ event.stopPropagation();
157
+ var anchorElement = event.currentTarget;
158
+ void invoke(_objectSpread(_objectSpread({}, remixActionData.invokeAction), {}, {
159
+ actionFn: function () {
160
+ var _actionFn2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
161
+ return _regeneratorRuntime.wrap(function (_context2) {
162
+ while (1) switch (_context2.prev = _context2.next) {
163
+ case 0:
164
+ return _context2.abrupt("return", remix.open({
165
+ anchorElement: anchorElement,
166
+ url: remixActionData.url
167
+ }));
168
+ case 1:
169
+ case "end":
170
+ return _context2.stop();
171
+ }
172
+ }, _callee2);
173
+ }));
174
+ function actionFn() {
175
+ return _actionFn2.apply(this, arguments);
176
+ }
177
+ return actionFn;
178
+ }()
179
+ }));
180
+ }
181
+ }, shouldHidePrimaryActionContent ? undefined : intl.formatMessage(messages.rovo_prompt_button_remix)) : null, isRovoChatEnabled && actionData && !(remixActionData && shouldHideSecondaryActions) ? promptActions : null));
134
182
  };
135
183
  export default EmbedRovoActionsFooter;
@@ -26,6 +26,7 @@ var UFOLoadHoldWrapper = function UFOLoadHoldWrapper(_ref) {
26
26
  export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef) {
27
27
  var _details$meta2, _forbiddenViewProps$c, _forbiddenViewProps$c2, _notFoundViewProps$co, _notFoundViewProps$co2;
28
28
  var url = _ref2.url,
29
+ id = _ref2.id,
29
30
  cardState = _ref2.cardState,
30
31
  handleAuthorize = _ref2.handleAuthorize,
31
32
  handleErrorRetry = _ref2.handleErrorRetry,
@@ -98,6 +99,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef)
98
99
  }
99
100
  if (resolvedViewProps.preview) {
100
101
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
102
+ id: id,
101
103
  actionOptions: actionOptions,
102
104
  details: details,
103
105
  isSelected: isSelected,
@@ -4,9 +4,12 @@ import "./ResolvedView.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { lazy } from 'react';
6
6
  import LinkGlyph from '@atlaskit/icon/core/link';
7
+ import { usePlugins } from '@atlaskit/link-provider/use-plugins';
7
8
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
8
10
  import { useThemeObserver } from '@atlaskit/tokens/use-theme-observer';
9
11
  import { CardDisplay } from '../../../constants';
12
+ import extractRemixAction from '../../../extractors/flexible/actions/extract-remix-action';
10
13
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
11
14
  import { getExtensionKey } from '../../../state/getExtensionKey';
12
15
  import useEmbedRovoActionsFooterExperiment from '../../../state/hooks/use-embed-rovo-actions-footer-experiment';
@@ -33,11 +36,14 @@ var EmbedFrameWithRovoFooter = function EmbedFrameWithRovoFooter(_ref) {
33
36
  var actionOptions = _ref.actionOptions,
34
37
  details = _ref.details,
35
38
  frame = _ref.frame,
39
+ id = _ref.id,
36
40
  link = _ref.link,
37
41
  testId = _ref.testId;
38
42
  var _useRovoConfig = useRovoConfig(),
39
43
  rovoOptions = _useRovoConfig.rovoOptions,
40
44
  product = _useRovoConfig.product;
45
+ var _usePlugins = usePlugins(),
46
+ remix = _usePlugins.remix;
41
47
  var _useEmbedRovoActionsF = useEmbedRovoActionsFooterExperiment(link, actionOptions, rovoOptions, product),
42
48
  isEmbedRovoActionsFooterEnabled = _useEmbedRovoActionsF.isEnabled;
43
49
  var rovoActionData = React.useMemo(function () {
@@ -52,24 +58,32 @@ var EmbedFrameWithRovoFooter = function EmbedFrameWithRovoFooter(_ref) {
52
58
  appearance: CardDisplay.Embed
53
59
  }) : undefined;
54
60
  }, [actionOptions, details, isEmbedRovoActionsFooterEnabled, product, rovoOptions]);
61
+ var remixActionData = React.useMemo(function () {
62
+ return details && fg('platform_sl_3p_auth_visualize_killswitch') ? extractRemixAction({
63
+ response: details,
64
+ url: link,
65
+ remix: remix,
66
+ actionOptions: actionOptions,
67
+ appearance: 'embed',
68
+ id: id
69
+ }) : undefined;
70
+ }, [details, link, remix, actionOptions, id]);
55
71
  var prompts = React.useMemo(function () {
56
72
  if (!isEmbedRovoActionsFooterEnabled) {
57
73
  return [];
58
74
  }
59
75
  return getRovoPostAuthPromptKeys({
60
- extensionKey: getExtensionKey(details),
61
- isRovoChatActionShown: !!rovoActionData,
62
- product: product,
63
- response: details
76
+ extensionKey: getExtensionKey(details)
64
77
  });
65
- }, [details, isEmbedRovoActionsFooterEnabled, product, rovoActionData]);
78
+ }, [details, isEmbedRovoActionsFooterEnabled]);
66
79
  var footer = React.useMemo(function () {
67
- return rovoActionData && prompts.length > 0 ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
80
+ return rovoActionData && prompts.length > 0 || remixActionData ? /*#__PURE__*/React.createElement(LazyEmbedRovoActionsFooter, {
68
81
  actionData: rovoActionData,
82
+ remixActionData: remixActionData,
69
83
  prompts: prompts,
70
84
  testId: "".concat(testId, "-rovo-actions-footer")
71
85
  }) : undefined;
72
- }, [prompts, rovoActionData, testId]);
86
+ }, [prompts, rovoActionData, remixActionData, testId]);
73
87
  return footer ? /*#__PURE__*/React.createElement("div", {
74
88
  className: ax([styles.contentWithFooter])
75
89
  }, /*#__PURE__*/React.createElement("div", {
@@ -83,6 +97,7 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref2
83
97
  link = _ref2.link,
84
98
  context = _ref2.context,
85
99
  details = _ref2.details,
100
+ id = _ref2.id,
86
101
  onClick = _ref2.onClick,
87
102
  onAuxClick = _ref2.onAuxClick,
88
103
  onContextMenu = _ref2.onContextMenu,
@@ -163,6 +178,7 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref2
163
178
  actionOptions: actionOptions,
164
179
  details: details,
165
180
  frame: frame,
181
+ id: id,
166
182
  link: link,
167
183
  testId: testId
168
184
  });
@@ -0,0 +1,72 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["onClick"];
6
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
+ 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; }
8
+ 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; }
9
+ import React, { useCallback } from 'react';
10
+ import { useIntl } from 'react-intl';
11
+ import AiGenerativeRemixIcon from '@atlaskit/icon-lab/core/ai-generative-remix';
12
+ import { usePlugins } from '@atlaskit/link-provider/use-plugins';
13
+ import { InternalActionName } from '../../../../../constants';
14
+ import { messages } from '../../../../../messages';
15
+ import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context/useFlexibleUiContext';
16
+ import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
17
+ import { useRemixActionExposure } from '../../../../../utils/use-remix-action-exposure';
18
+ import Action from '../action';
19
+ var RemixAction = function RemixAction(_ref) {
20
+ var _context$actions;
21
+ var onClickCallback = _ref.onClick,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ var intl = useIntl();
24
+ var context = useFlexibleUiContext();
25
+ var _usePlugins = usePlugins(),
26
+ remix = _usePlugins.remix;
27
+ var invoke = useInvokeClientAction({});
28
+ var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.RemixAction];
29
+ var actionMessage = intl.formatMessage(messages.rovo_prompt_button_remix);
30
+ var isRemixVisible = Boolean(data && remix);
31
+ useRemixActionExposure(isRemixVisible);
32
+ var onClick = useCallback(function () {
33
+ if (data !== null && data !== void 0 && data.invokeAction && remix) {
34
+ var url = data.url;
35
+ invoke(_objectSpread(_objectSpread({}, data.invokeAction), {}, {
36
+ actionFn: function () {
37
+ var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
+ return _regeneratorRuntime.wrap(function (_context) {
39
+ while (1) switch (_context.prev = _context.next) {
40
+ case 0:
41
+ return _context.abrupt("return", remix.open({
42
+ url: url
43
+ }));
44
+ case 1:
45
+ case "end":
46
+ return _context.stop();
47
+ }
48
+ }, _callee);
49
+ }));
50
+ function actionFn() {
51
+ return _actionFn.apply(this, arguments);
52
+ }
53
+ return actionFn;
54
+ }()
55
+ }));
56
+ onClickCallback === null || onClickCallback === void 0 || onClickCallback();
57
+ }
58
+ }, [data, invoke, onClickCallback, remix]);
59
+ return isRemixVisible ? /*#__PURE__*/React.createElement(Action, _extends({
60
+ ariaLabel: actionMessage,
61
+ content: actionMessage,
62
+ icon: /*#__PURE__*/React.createElement(AiGenerativeRemixIcon, {
63
+ color: "currentColor",
64
+ label: "",
65
+ size: props.iconSize
66
+ }),
67
+ onClick: onClick,
68
+ testId: "smart-action-remix-action",
69
+ tooltipMessage: actionMessage
70
+ }, props)) : null;
71
+ };
72
+ export default RemixAction;
@@ -20,12 +20,13 @@ import DownloadAction from '../../actions/download-action';
20
20
  import EditAction from '../../actions/edit-action';
21
21
  import FollowAction from '../../actions/follow-action';
22
22
  import PreviewAction from '../../actions/preview-action';
23
+ import RemixAction from '../../actions/remix-action';
23
24
  import RovoChatAction from '../../actions/rovo-chat-action';
24
25
  import ViewRelatedLinksAction from '../../actions/view-related-links-action';
25
26
  import { ActionFooter } from './action-footer';
26
27
  import { getPrimitivesPaddingSpaceBySize } from './getPrimitivesPaddingSpaceBySize';
27
28
  var ignoreContainerPaddingStyles = null;
28
- var Actions = (_Actions = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Actions, ActionName.AutomationAction, AutomationAction), ActionName.CopyLinkAction, CopyLinkAction), ActionName.CustomAction, Action), ActionName.DeleteAction, DeleteAction), ActionName.DownloadAction, DownloadAction), ActionName.EditAction, EditAction), ActionName.FollowAction, FollowAction), ActionName.PreviewAction, PreviewAction), ActionName.RovoChatAction, RovoChatAction), InternalActionName.AISummaryAction, AISummaryAction), _defineProperty(_defineProperty(_Actions, InternalActionName.UnresolvedAction, CustomUnresolvedAction), InternalActionName.ViewRelatedLinksAction, ViewRelatedLinksAction));
29
+ var Actions = (_Actions = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Actions, ActionName.AutomationAction, AutomationAction), ActionName.CopyLinkAction, CopyLinkAction), ActionName.CustomAction, Action), ActionName.DeleteAction, DeleteAction), ActionName.DownloadAction, DownloadAction), ActionName.EditAction, EditAction), ActionName.FollowAction, FollowAction), ActionName.PreviewAction, PreviewAction), ActionName.RovoChatAction, RovoChatAction), InternalActionName.AISummaryAction, AISummaryAction), _defineProperty(_defineProperty(_defineProperty(_Actions, InternalActionName.RemixAction, RemixAction), InternalActionName.UnresolvedAction, CustomUnresolvedAction), InternalActionName.ViewRelatedLinksAction, ViewRelatedLinksAction));
29
30
  var DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
30
31
  var sort = function sort(a, b) {
31
32
  var idxA = DEFAULT_SORT_ORDER.indexOf(a);
@@ -72,7 +73,7 @@ var ActionBlock = function ActionBlock(_ref) {
72
73
  return;
73
74
  }
74
75
  var arr = Object.keys(context.actions).filter(function (name) {
75
- return name !== ActionName.RovoChatAction;
76
+ return name !== ActionName.RovoChatAction && name !== InternalActionName.RemixAction;
76
77
  });
77
78
  arr.sort(sort);
78
79
  var renderAction = function renderAction(name) {
@@ -17,9 +17,10 @@ import DownloadAction from '../../../actions/download-action';
17
17
  import EditAction from '../../../actions/edit-action';
18
18
  import FollowAction from '../../../actions/follow-action';
19
19
  import PreviewAction from '../../../actions/preview-action';
20
+ import RemixAction from '../../../actions/remix-action';
20
21
  import RovoChatAction from '../../../actions/rovo-chat-action';
21
22
  import ViewRelatedLinksAction from '../../../actions/view-related-links-action';
22
- var Actions = (_Actions = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Actions, ActionName.AutomationAction, AutomationAction), ActionName.CopyLinkAction, CopyLinkAction), ActionName.CustomAction, Action), ActionName.DeleteAction, DeleteAction), ActionName.DownloadAction, DownloadAction), ActionName.EditAction, EditAction), ActionName.FollowAction, FollowAction), ActionName.PreviewAction, PreviewAction), ActionName.RovoChatAction, RovoChatAction), InternalActionName.AISummaryAction, AISummaryAction), _defineProperty(_defineProperty(_Actions, InternalActionName.UnresolvedAction, CustomUnresolvedAction), InternalActionName.ViewRelatedLinksAction, ViewRelatedLinksAction));
23
+ var Actions = (_Actions = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Actions, ActionName.AutomationAction, AutomationAction), ActionName.CopyLinkAction, CopyLinkAction), ActionName.CustomAction, Action), ActionName.DeleteAction, DeleteAction), ActionName.DownloadAction, DownloadAction), ActionName.EditAction, EditAction), ActionName.FollowAction, FollowAction), ActionName.PreviewAction, PreviewAction), ActionName.RovoChatAction, RovoChatAction), InternalActionName.AISummaryAction, AISummaryAction), _defineProperty(_defineProperty(_defineProperty(_Actions, InternalActionName.RemixAction, RemixAction), InternalActionName.UnresolvedAction, CustomUnresolvedAction), InternalActionName.ViewRelatedLinksAction, ViewRelatedLinksAction));
23
24
  var ActionGroupItem = function ActionGroupItem(_ref) {
24
25
  var item = _ref.item,
25
26
  size = _ref.size,
@@ -64,6 +64,8 @@ var ActionGroup = function ActionGroup(_ref) {
64
64
  appearance = _ref.appearance,
65
65
  _ref$visibleButtonsNu = _ref.visibleButtonsNum,
66
66
  visibleButtonsNum = _ref$visibleButtonsNu === void 0 ? 2 : _ref$visibleButtonsNu,
67
+ _ref$showRemainingAct = _ref.showRemainingActionsInOverflow,
68
+ showRemainingActionsInOverflow = _ref$showRemainingAct === void 0 ? false : _ref$showRemainingAct,
67
69
  onDropdownOpenChange = _ref.onDropdownOpenChange,
68
70
  _ref$containerWidth = _ref.containerWidth,
69
71
  containerWidth = _ref$containerWidth === void 0 ? Infinity : _ref$containerWidth;
@@ -137,6 +139,8 @@ var ActionGroup = function ActionGroup(_ref) {
137
139
  }]);
138
140
  } else if (isRovoActionsEnabled && containerWidth < REDUCED_ACTIONS_SIZE) {
139
141
  actionItems = renderableActionItems;
142
+ } else if (isRovoActionsEnabled && showRemainingActionsInOverflow) {
143
+ actionItems = renderableActionItems.slice(visibleButtonsNum - 1);
140
144
  } else {
141
145
  actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
142
146
  }
@@ -170,7 +174,7 @@ var ActionGroup = function ActionGroup(_ref) {
170
174
  }, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
171
175
  }
172
176
  return null;
173
- }, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, isRovoActionsEnabled, containerWidth]);
177
+ }, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, showRemainingActionsInOverflow, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, isRovoActionsEnabled, containerWidth]);
174
178
  return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
175
179
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
176
180
  className: ax(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
@@ -6,8 +6,9 @@ import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import { useCallback, useMemo, useState } from 'react';
8
8
  import { browser } from '@atlaskit/linking-common/user-agent';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
9
10
  import { WidthObserver } from '@atlaskit/width-detector/width-observer';
10
- import { ActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
11
+ import { ActionName, InternalActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
11
12
  import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context/useFlexibleUiContext';
12
13
  import { default as Provider } from '../../../elements/provider-element';
13
14
  import ActionGroup from '../../action-group';
@@ -19,7 +20,7 @@ var safariStyles = null;
19
20
  var providerStyles = null;
20
21
  var rovoActionStyles = null;
21
22
  var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
22
- var _context$actions;
23
+ var _context$actions, _context$actions2;
23
24
  var actions = props.actions,
24
25
  testId = props.testId,
25
26
  onActionMenuOpenChange = props.onActionMenuOpenChange,
@@ -34,6 +35,9 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
34
35
  return action.name === 'RovoChatAction';
35
36
  }));
36
37
  }, [rovoChatAction, actions]);
38
+ var hasExtraActionSlot = isRovoActionsEnabled && !!(context !== null && context !== void 0 && (_context$actions2 = context.actions) !== null && _context$actions2 !== void 0 && _context$actions2[InternalActionName.RemixAction]) && !!(actions !== null && actions !== void 0 && actions.some(function (action) {
39
+ return action.name === InternalActionName.RemixAction;
40
+ })) && fg('platform_sl_3p_auth_visualize_killswitch');
37
41
  var hasPreview = isRovoActionsEnabled && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
38
42
  var hasActions = useMemo(function () {
39
43
  var _filterActionItems;
@@ -75,12 +79,15 @@ var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
75
79
  }, !!rovoChatAction && (rovoChatAction === null || rovoChatAction === void 0 ? void 0 : rovoChatAction.product) === 'CONFLUENCE' && /*#__PURE__*/React.createElement(WidthObserver, {
76
80
  setWidth: setContainerWidth,
77
81
  offscreen: true
78
- }), /*#__PURE__*/React.createElement(ActionGroup, {
82
+ }), /*#__PURE__*/React.createElement(ActionGroup, _extends({}, fg('platform_sl_3p_auth_visualize_killswitch') ? {
83
+ visibleButtonsNum: hasExtraActionSlot ? 3 : undefined,
84
+ showRemainingActionsInOverflow: hasExtraActionSlot
85
+ } : undefined, {
79
86
  onDropdownOpenChange: onDropdownOpenChange,
80
87
  items: actions,
81
88
  appearance: isRovoActionsEnabled ? 'subtle' : 'default',
82
89
  size: isRovoActionsEnabled ? SmartLinkSize.Small : size,
83
90
  containerWidth: isRovoActionsEnabled ? containerWidth : undefined
84
- })) : null);
91
+ }))) : null);
85
92
  };
86
93
  export default FooterBlockResolvedView;