@atlaskit/smart-card 46.22.3 → 46.23.1

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 (146) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/analytics.spec.yaml +6 -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 +11 -1
  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 +3 -3
  125. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  126. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  127. package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  128. package/dist/cjs/utils/is-rovo-chat-action-visualize-enabled.js +0 -43
  129. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  130. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  131. package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  132. package/dist/es2019/utils/is-rovo-chat-action-visualize-enabled.js +0 -34
  133. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  134. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  135. package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
  136. package/dist/esm/utils/is-rovo-chat-action-visualize-enabled.js +0 -37
  137. package/dist/types/utils/is-rovo-chat-action-visualize-enabled.d.ts +0 -18
  138. /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
  139. /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
  140. /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
  141. /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
  142. /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
  143. /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
  144. /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
  145. /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
  146. /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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "46.22.3",
3
+ "version": "46.23.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/link-analytics": "^13.0.0",
68
68
  "@atlaskit/link-client-extension": "^8.0.0",
69
69
  "@atlaskit/link-extractors": "^5.0.0",
70
- "@atlaskit/linking-common": "^13.1.0",
70
+ "@atlaskit/linking-common": "^13.2.0",
71
71
  "@atlaskit/linking-types": "^16.1.0",
72
72
  "@atlaskit/logo": "^23.3.0",
73
73
  "@atlaskit/lozenge": "^17.0.0",
@@ -93,7 +93,7 @@
93
93
  "@atlaskit/textfield": "^11.0.0",
94
94
  "@atlaskit/theme": "^28.2.0",
95
95
  "@atlaskit/tile": "^5.0.0",
96
- "@atlaskit/tmp-editor-statsig": "^279.0.0",
96
+ "@atlaskit/tmp-editor-statsig": "^281.0.0",
97
97
  "@atlaskit/tokens": "^20.15.0",
98
98
  "@atlaskit/tooltip": "^24.4.0",
99
99
  "@atlaskit/top-layer": "^8.2.0",
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0ee0b8e92f9b9c2b3ef643ddd4e755acaff8fd52fb3006b4f413390039d170dc
3
- size 15497
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1bf87dae2a7cbfdef18c8a87fb2c733aa37ed1f1b073966035c98a06dc7c9033
3
- size 13712
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:db641c996de33386cdc38f5196e715e29fb02c19557707ee2ff3e7b7298b3327
3
- size 3898
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isRovoChatActionVisualizeEnabled = void 0;
7
- var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
8
- var _fg = require("@atlaskit/platform-feature-flags/fg");
9
- /**
10
- * Rollout state only (kill switch, then experiment). Evaluating the experiment
11
- * fires exposure, so this must run after every business rule has passed.
12
- * Remove this function on experiment cleanup; the business rules stay.
13
- */
14
- var isVisualizeExperimentEnabled = function isVisualizeExperimentEnabled() {
15
- return (0, _fg.fg)('platform_sl_3p_auth_visualize_killswitch') && (0, _expVal.expVal)('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
16
- };
17
-
18
- /**
19
- * `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
20
- * against any other shape rather than calling `.includes` on it directly.
21
- */
22
- var isGoogleSheetsType = function isGoogleSheetsType(response) {
23
- var _response$data;
24
- var type = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
25
- var types = Array.isArray(type) ? type : [type];
26
- return types.includes('schema:SpreadsheetDigitalDocument');
27
- };
28
-
29
- /**
30
- * Whether the Rovo chat "Visualize" action is offered for a resolved link.
31
- *
32
- * Business rules: Google Sheets links in Confluence.
33
- *
34
- * Callers must only call this once the Rovo chat action will be shown for the
35
- * link (resolved, Rovo chat enabled, opted in and not hidden), so experiment
36
- * exposure matches what the user sees.
37
- */
38
- var isRovoChatActionVisualizeEnabled = exports.isRovoChatActionVisualizeEnabled = function isRovoChatActionVisualizeEnabled(_ref) {
39
- var extensionKey = _ref.extensionKey,
40
- product = _ref.product,
41
- response = _ref.response;
42
- return product === 'CONFLUENCE' && extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isVisualizeExperimentEnabled();
43
- };
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0ee0b8e92f9b9c2b3ef643ddd4e755acaff8fd52fb3006b4f413390039d170dc
3
- size 15497
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1bf87dae2a7cbfdef18c8a87fb2c733aa37ed1f1b073966035c98a06dc7c9033
3
- size 13712
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:db641c996de33386cdc38f5196e715e29fb02c19557707ee2ff3e7b7298b3327
3
- size 3898
@@ -1,34 +0,0 @@
1
- import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
- /**
4
- * Rollout state only (kill switch, then experiment). Evaluating the experiment
5
- * fires exposure, so this must run after every business rule has passed.
6
- * Remove this function on experiment cleanup; the business rules stay.
7
- */
8
- const isVisualizeExperimentEnabled = () => fg('platform_sl_3p_auth_visualize_killswitch') && expVal('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
9
-
10
- /**
11
- * `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
12
- * against any other shape rather than calling `.includes` on it directly.
13
- */
14
- const isGoogleSheetsType = response => {
15
- var _response$data;
16
- const type = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
17
- const types = Array.isArray(type) ? type : [type];
18
- return types.includes('schema:SpreadsheetDigitalDocument');
19
- };
20
-
21
- /**
22
- * Whether the Rovo chat "Visualize" action is offered for a resolved link.
23
- *
24
- * Business rules: Google Sheets links in Confluence.
25
- *
26
- * Callers must only call this once the Rovo chat action will be shown for the
27
- * link (resolved, Rovo chat enabled, opted in and not hidden), so experiment
28
- * exposure matches what the user sees.
29
- */
30
- export const isRovoChatActionVisualizeEnabled = ({
31
- extensionKey,
32
- product,
33
- response
34
- }) => product === 'CONFLUENCE' && extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isVisualizeExperimentEnabled();
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0ee0b8e92f9b9c2b3ef643ddd4e755acaff8fd52fb3006b4f413390039d170dc
3
- size 15497
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:1bf87dae2a7cbfdef18c8a87fb2c733aa37ed1f1b073966035c98a06dc7c9033
3
- size 13712
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:db641c996de33386cdc38f5196e715e29fb02c19557707ee2ff3e7b7298b3327
3
- size 3898
@@ -1,37 +0,0 @@
1
- import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
- /**
4
- * Rollout state only (kill switch, then experiment). Evaluating the experiment
5
- * fires exposure, so this must run after every business rule has passed.
6
- * Remove this function on experiment cleanup; the business rules stay.
7
- */
8
- var isVisualizeExperimentEnabled = function isVisualizeExperimentEnabled() {
9
- return fg('platform_sl_3p_auth_visualize_killswitch') && expVal('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
10
- };
11
-
12
- /**
13
- * `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
14
- * against any other shape rather than calling `.includes` on it directly.
15
- */
16
- var isGoogleSheetsType = function isGoogleSheetsType(response) {
17
- var _response$data;
18
- var type = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
19
- var types = Array.isArray(type) ? type : [type];
20
- return types.includes('schema:SpreadsheetDigitalDocument');
21
- };
22
-
23
- /**
24
- * Whether the Rovo chat "Visualize" action is offered for a resolved link.
25
- *
26
- * Business rules: Google Sheets links in Confluence.
27
- *
28
- * Callers must only call this once the Rovo chat action will be shown for the
29
- * link (resolved, Rovo chat enabled, opted in and not hidden), so experiment
30
- * exposure matches what the user sees.
31
- */
32
- export var isRovoChatActionVisualizeEnabled = function isRovoChatActionVisualizeEnabled(_ref) {
33
- var extensionKey = _ref.extensionKey,
34
- product = _ref.product,
35
- response = _ref.response;
36
- return product === 'CONFLUENCE' && extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isVisualizeExperimentEnabled();
37
- };
@@ -1,18 +0,0 @@
1
- import type { JsonLd } from '@atlaskit/json-ld-types/jsonld';
2
- import type { ProductType } from '@atlaskit/linking-common/types';
3
- type IsRovoChatActionVisualizeEnabledOptions = {
4
- extensionKey?: string;
5
- product?: ProductType;
6
- response?: JsonLd.Response;
7
- };
8
- /**
9
- * Whether the Rovo chat "Visualize" action is offered for a resolved link.
10
- *
11
- * Business rules: Google Sheets links in Confluence.
12
- *
13
- * Callers must only call this once the Rovo chat action will be shown for the
14
- * link (resolved, Rovo chat enabled, opted in and not hidden), so experiment
15
- * exposure matches what the user sees.
16
- */
17
- export declare const isRovoChatActionVisualizeEnabled: ({ extensionKey, product, response, }: IsRovoChatActionVisualizeEnabledOptions) => boolean;
18
- export {};