@atlaskit/smart-card 44.3.6 → 44.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +3 -2
- package/dist/cjs/state/hooks/use-inline-action-nudge-experiment/index.js +9 -6
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +4 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +3 -2
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +3 -2
- package/dist/es2019/state/hooks/use-inline-action-nudge-experiment/index.js +9 -6
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +4 -2
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +2 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +3 -2
- package/dist/esm/state/hooks/use-inline-action-nudge-experiment/index.js +9 -6
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +4 -2
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -2
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-inline-action-nudge-experiment/index.d.ts +6 -3
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-inline-action-nudge-experiment/index.d.ts +6 -3
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.3.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 44.3.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`0633bc5742435`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0633bc5742435) -
|
|
14
|
+
Tightening the FG/EXP checks for post auth inline SL Experiment so there is no contanimation from
|
|
15
|
+
related gates/exp
|
|
16
|
+
- [`a16758c61f0ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a16758c61f0ac) -
|
|
17
|
+
[ux] Adds rovoChatAction: { optIn: true } for Confluence smart card provider when
|
|
18
|
+
rovogrowth-640-inline-action-nudge-fg killswitch enabled.
|
|
19
|
+
|
|
3
20
|
## 44.3.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
8
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
9
10
|
var _constants = require("../../../constants");
|
|
10
11
|
var _helpers = require("../../../state/helpers");
|
|
11
12
|
var _canShowAction = require("../../../utils/actions/can-show-action");
|
|
@@ -29,9 +30,9 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
29
30
|
var supportsRovoActions = response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('RovoActions');
|
|
30
31
|
var isGoogleProvider = (0, _helpers.getExtensionKey)(response) === 'google-object-provider';
|
|
31
32
|
var is3PAuthRovoActionEnabled = isGoogleProvider && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
32
|
-
var is3PInlinePostAuthActionsEnabled = !isGoogleProvider && (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg');
|
|
33
|
+
var is3PInlinePostAuthActionsEnabled = supportsRovoActions && !isGoogleProvider && (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
33
34
|
var is3PBlockPostAuthActionsEnabled = supportsRovoActions && (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
34
|
-
var isSupportedFeature =
|
|
35
|
+
var isSupportedFeature = is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
35
36
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
36
37
|
var url = (0, _linkExtractors.extractSmartLinkUrl)(response);
|
|
37
38
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -22,21 +22,24 @@ var NOT_ENABLED_RESULT = {
|
|
|
22
22
|
*
|
|
23
23
|
* All eligibility criteria are consolidated here:
|
|
24
24
|
* 1. Rovo chat must be enabled for the tenant.
|
|
25
|
-
* 2. The
|
|
26
|
-
* 3. The
|
|
25
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
26
|
+
* 3. The link must support the RovoActions feature.
|
|
27
|
+
* 4. The extension key must not be excluded (Figma and Google links are excluded).
|
|
28
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
27
29
|
*
|
|
28
30
|
* The extension key is derived from the card store via the resolved URL,
|
|
29
31
|
* so callers don't need to thread it as a prop.
|
|
30
32
|
*/
|
|
31
|
-
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview) {
|
|
32
|
-
var _cardState$details$me, _cardState$details;
|
|
33
|
+
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview, actionOptions) {
|
|
34
|
+
var _cardState$details$me, _cardState$details, _actionOptions$rovoCh, _actionOptions$rovoCh2;
|
|
33
35
|
var rovoConfig = (0, _useRovoConfig.default)();
|
|
34
36
|
var isRovoChatEnabled = (0, _rovo.getIsRovoChatEnabled)(rovoConfig);
|
|
35
37
|
var cardState = (0, _store.useSmartCardState)(url !== null && url !== void 0 ? url : '');
|
|
36
38
|
var supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 || (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.meta) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.supportedFeature) === null || _cardState$details === void 0 ? void 0 : _cardState$details.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
37
39
|
var extensionKey = (0, _helpers.getExtensionKey)(cardState.details);
|
|
40
|
+
var isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
|
|
38
41
|
return (0, _react.useMemo)(function () {
|
|
39
|
-
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
42
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url || !isRovoChatActionOptedIn) {
|
|
40
43
|
return NOT_ENABLED_RESULT;
|
|
41
44
|
}
|
|
42
45
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -46,6 +49,6 @@ var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url
|
|
|
46
49
|
return {
|
|
47
50
|
isEnabled: isEnabled
|
|
48
51
|
};
|
|
49
|
-
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
52
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url, isRovoChatActionOptedIn]);
|
|
50
53
|
};
|
|
51
54
|
var _default = exports.default = useInlineActionNudgeExperiment;
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "44.3.
|
|
14
|
+
packageVersion: "44.3.7"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -243,8 +243,9 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
243
243
|
flexibleCardProps: flexibleCardProps
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
+
var is3PInlinePostAuthActionsEnabled = (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
246
247
|
if (isResolved) {
|
|
247
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
248
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
248
249
|
actionOptions: actionOptions,
|
|
249
250
|
showRovoResolvedView: showRovoResolvedView
|
|
250
251
|
} : undefined, {
|
|
@@ -295,8 +296,9 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
295
296
|
flexibleCardProps: flexibleCardProps
|
|
296
297
|
});
|
|
297
298
|
}
|
|
299
|
+
var is3PInlinePostAuthActionsEnabled = (0, _platformFeatureFlags.fg)('rovogrowth-640-inline-action-nudge-fg') && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
298
300
|
if (cardState.status === 'resolved') {
|
|
299
|
-
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
301
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
300
302
|
actionOptions: actionOptions,
|
|
301
303
|
showRovoResolvedView: showRovoResolvedView
|
|
302
304
|
} : undefined, {
|
|
@@ -29,7 +29,8 @@ var snippetBlockCss = null;
|
|
|
29
29
|
var actionBlockCss = null;
|
|
30
30
|
var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
31
31
|
var _cardState$details;
|
|
32
|
-
var
|
|
32
|
+
var actionOptions = _ref.actionOptions,
|
|
33
|
+
cardState = _ref.cardState,
|
|
33
34
|
extensionKey = _ref.extensionKey,
|
|
34
35
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
35
36
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
@@ -39,7 +40,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
39
40
|
id = _ref.id;
|
|
40
41
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
41
42
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
42
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(flexibleCardProps.url, true),
|
|
43
|
+
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(flexibleCardProps.url, true, actionOptions),
|
|
43
44
|
InlineActionNudgeExperimentValue = _useInlineActionNudge.isEnabled;
|
|
44
45
|
|
|
45
46
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
@@ -82,7 +82,7 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
82
82
|
type = _ref2.type,
|
|
83
83
|
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
84
84
|
lozenge = _ref2.lozenge;
|
|
85
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link, showHoverPreview),
|
|
85
|
+
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link, showHoverPreview, actionOptions),
|
|
86
86
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
87
87
|
|
|
88
88
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "44.3.
|
|
25
|
+
packageVersion: "44.3.7",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
import { ActionName } from '../../../constants';
|
|
4
5
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
5
6
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
@@ -24,9 +25,9 @@ const extractRovoChatAction = ({
|
|
|
24
25
|
const supportsRovoActions = response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('RovoActions');
|
|
25
26
|
const isGoogleProvider = getExtensionKey(response) === 'google-object-provider';
|
|
26
27
|
const is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
27
|
-
const is3PInlinePostAuthActionsEnabled = !isGoogleProvider && fg('rovogrowth-640-inline-action-nudge-fg');
|
|
28
|
+
const is3PInlinePostAuthActionsEnabled = supportsRovoActions && !isGoogleProvider && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
28
29
|
const is3PBlockPostAuthActionsEnabled = supportsRovoActions && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
29
|
-
const isSupportedFeature =
|
|
30
|
+
const isSupportedFeature = is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
30
31
|
const isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
31
32
|
const url = extractSmartLinkUrl(response);
|
|
32
33
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -15,21 +15,24 @@ const NOT_ENABLED_RESULT = {
|
|
|
15
15
|
*
|
|
16
16
|
* All eligibility criteria are consolidated here:
|
|
17
17
|
* 1. Rovo chat must be enabled for the tenant.
|
|
18
|
-
* 2. The
|
|
19
|
-
* 3. The
|
|
18
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
19
|
+
* 3. The link must support the RovoActions feature.
|
|
20
|
+
* 4. The extension key must not be excluded (Figma and Google links are excluded).
|
|
21
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
20
22
|
*
|
|
21
23
|
* The extension key is derived from the card store via the resolved URL,
|
|
22
24
|
* so callers don't need to thread it as a prop.
|
|
23
25
|
*/
|
|
24
|
-
const useInlineActionNudgeExperiment = (url, showHoverPreview) => {
|
|
25
|
-
var _cardState$details$me, _cardState$details, _cardState$details$me2, _cardState$details$me3;
|
|
26
|
+
const useInlineActionNudgeExperiment = (url, showHoverPreview, actionOptions) => {
|
|
27
|
+
var _cardState$details$me, _cardState$details, _cardState$details$me2, _cardState$details$me3, _actionOptions$rovoCh, _actionOptions$rovoCh2;
|
|
26
28
|
const rovoConfig = useRovoConfig();
|
|
27
29
|
const isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
|
|
28
30
|
const cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
29
31
|
const supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 ? void 0 : (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : (_cardState$details$me2 = _cardState$details.meta) === null || _cardState$details$me2 === void 0 ? void 0 : (_cardState$details$me3 = _cardState$details$me2.supportedFeature) === null || _cardState$details$me3 === void 0 ? void 0 : _cardState$details$me3.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
30
32
|
const extensionKey = getExtensionKey(cardState.details);
|
|
33
|
+
const isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 ? void 0 : (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
|
|
31
34
|
return useMemo(() => {
|
|
32
|
-
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
35
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url || !isRovoChatActionOptedIn) {
|
|
33
36
|
return NOT_ENABLED_RESULT;
|
|
34
37
|
}
|
|
35
38
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -39,6 +42,6 @@ const useInlineActionNudgeExperiment = (url, showHoverPreview) => {
|
|
|
39
42
|
return {
|
|
40
43
|
isEnabled
|
|
41
44
|
};
|
|
42
|
-
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
45
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url, isRovoChatActionOptedIn]);
|
|
43
46
|
};
|
|
44
47
|
export default useInlineActionNudgeExperiment;
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "44.3.
|
|
5
|
+
packageVersion: "44.3.7"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -221,8 +221,9 @@ const HoverCardContent = ({
|
|
|
221
221
|
flexibleCardProps: flexibleCardProps
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
+
const is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
224
225
|
if (isResolved) {
|
|
225
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
226
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
226
227
|
actionOptions,
|
|
227
228
|
showRovoResolvedView
|
|
228
229
|
} : undefined, {
|
|
@@ -273,8 +274,9 @@ const HoverCardContent = ({
|
|
|
273
274
|
flexibleCardProps: flexibleCardProps
|
|
274
275
|
});
|
|
275
276
|
}
|
|
277
|
+
const is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
276
278
|
if (cardState.status === 'resolved') {
|
|
277
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
279
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
278
280
|
actionOptions,
|
|
279
281
|
showRovoResolvedView
|
|
280
282
|
} : undefined, {
|
|
@@ -19,6 +19,7 @@ const titleBlockStyles = null;
|
|
|
19
19
|
const snippetBlockCss = null;
|
|
20
20
|
const actionBlockCss = null;
|
|
21
21
|
const HoverCardResolvedView = ({
|
|
22
|
+
actionOptions,
|
|
22
23
|
cardState,
|
|
23
24
|
extensionKey,
|
|
24
25
|
flexibleCardProps,
|
|
@@ -34,7 +35,7 @@ const HoverCardResolvedView = ({
|
|
|
34
35
|
} = useAnalyticsEvents();
|
|
35
36
|
const {
|
|
36
37
|
isEnabled: InlineActionNudgeExperimentValue
|
|
37
|
-
} = useInlineActionNudgeExperiment(flexibleCardProps.url, true);
|
|
38
|
+
} = useInlineActionNudgeExperiment(flexibleCardProps.url, true, actionOptions);
|
|
38
39
|
|
|
39
40
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
40
41
|
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
@@ -71,7 +71,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
71
71
|
}) {
|
|
72
72
|
const {
|
|
73
73
|
isEnabled
|
|
74
|
-
} = useInlineActionNudgeExperiment(link, showHoverPreview);
|
|
74
|
+
} = useInlineActionNudgeExperiment(link, showHoverPreview, actionOptions);
|
|
75
75
|
|
|
76
76
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
77
77
|
const frame = /*#__PURE__*/React.createElement(Frame, {
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "44.3.
|
|
15
|
+
packageVersion: "44.3.7",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
import { ActionName } from '../../../constants';
|
|
4
5
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
5
6
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
@@ -23,9 +24,9 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
23
24
|
var supportsRovoActions = response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('RovoActions');
|
|
24
25
|
var isGoogleProvider = getExtensionKey(response) === 'google-object-provider';
|
|
25
26
|
var is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
26
|
-
var is3PInlinePostAuthActionsEnabled = !isGoogleProvider && fg('rovogrowth-640-inline-action-nudge-fg');
|
|
27
|
+
var is3PInlinePostAuthActionsEnabled = supportsRovoActions && !isGoogleProvider && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
27
28
|
var is3PBlockPostAuthActionsEnabled = supportsRovoActions && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
28
|
-
var isSupportedFeature =
|
|
29
|
+
var isSupportedFeature = is3PInlinePostAuthActionsEnabled || is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
29
30
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
30
31
|
var url = extractSmartLinkUrl(response);
|
|
31
32
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -15,21 +15,24 @@ var NOT_ENABLED_RESULT = {
|
|
|
15
15
|
*
|
|
16
16
|
* All eligibility criteria are consolidated here:
|
|
17
17
|
* 1. Rovo chat must be enabled for the tenant.
|
|
18
|
-
* 2. The
|
|
19
|
-
* 3. The
|
|
18
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
19
|
+
* 3. The link must support the RovoActions feature.
|
|
20
|
+
* 4. The extension key must not be excluded (Figma and Google links are excluded).
|
|
21
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
20
22
|
*
|
|
21
23
|
* The extension key is derived from the card store via the resolved URL,
|
|
22
24
|
* so callers don't need to thread it as a prop.
|
|
23
25
|
*/
|
|
24
|
-
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview) {
|
|
25
|
-
var _cardState$details$me, _cardState$details;
|
|
26
|
+
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview, actionOptions) {
|
|
27
|
+
var _cardState$details$me, _cardState$details, _actionOptions$rovoCh, _actionOptions$rovoCh2;
|
|
26
28
|
var rovoConfig = useRovoConfig();
|
|
27
29
|
var isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
|
|
28
30
|
var cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
29
31
|
var supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 || (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.meta) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.supportedFeature) === null || _cardState$details === void 0 ? void 0 : _cardState$details.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
30
32
|
var extensionKey = getExtensionKey(cardState.details);
|
|
33
|
+
var isRovoChatActionOptedIn = (_actionOptions$rovoCh = actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh2 = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh2 === void 0 ? void 0 : _actionOptions$rovoCh2.optIn) !== null && _actionOptions$rovoCh !== void 0 ? _actionOptions$rovoCh : false;
|
|
31
34
|
return useMemo(function () {
|
|
32
|
-
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
35
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url || !isRovoChatActionOptedIn) {
|
|
33
36
|
return NOT_ENABLED_RESULT;
|
|
34
37
|
}
|
|
35
38
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -39,6 +42,6 @@ var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url
|
|
|
39
42
|
return {
|
|
40
43
|
isEnabled: isEnabled
|
|
41
44
|
};
|
|
42
|
-
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
45
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url, isRovoChatActionOptedIn]);
|
|
43
46
|
};
|
|
44
47
|
export default useInlineActionNudgeExperiment;
|
|
@@ -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: "44.3.
|
|
7
|
+
packageVersion: "44.3.7"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -234,8 +234,9 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
234
234
|
flexibleCardProps: flexibleCardProps
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
+
var is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
237
238
|
if (isResolved) {
|
|
238
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
239
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
239
240
|
actionOptions: actionOptions,
|
|
240
241
|
showRovoResolvedView: showRovoResolvedView
|
|
241
242
|
} : undefined, {
|
|
@@ -286,8 +287,9 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
286
287
|
flexibleCardProps: flexibleCardProps
|
|
287
288
|
});
|
|
288
289
|
}
|
|
290
|
+
var is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
289
291
|
if (cardState.status === 'resolved') {
|
|
290
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ||
|
|
292
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || is3PInlinePostAuthActionsEnabled ? {
|
|
291
293
|
actionOptions: actionOptions,
|
|
292
294
|
showRovoResolvedView: showRovoResolvedView
|
|
293
295
|
} : undefined, {
|
|
@@ -20,7 +20,8 @@ var snippetBlockCss = null;
|
|
|
20
20
|
var actionBlockCss = null;
|
|
21
21
|
var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
22
22
|
var _cardState$details;
|
|
23
|
-
var
|
|
23
|
+
var actionOptions = _ref.actionOptions,
|
|
24
|
+
cardState = _ref.cardState,
|
|
24
25
|
extensionKey = _ref.extensionKey,
|
|
25
26
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
26
27
|
isAISummaryEnabled = _ref.isAISummaryEnabled,
|
|
@@ -30,7 +31,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
30
31
|
id = _ref.id;
|
|
31
32
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
32
33
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
33
|
-
var _useInlineActionNudge = useInlineActionNudgeExperiment(flexibleCardProps.url, true),
|
|
34
|
+
var _useInlineActionNudge = useInlineActionNudgeExperiment(flexibleCardProps.url, true, actionOptions),
|
|
34
35
|
InlineActionNudgeExperimentValue = _useInlineActionNudge.isEnabled;
|
|
35
36
|
|
|
36
37
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
@@ -73,7 +73,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
73
73
|
type = _ref2.type,
|
|
74
74
|
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
75
75
|
lozenge = _ref2.lozenge;
|
|
76
|
-
var _useInlineActionNudge = useInlineActionNudgeExperiment(link, showHoverPreview),
|
|
76
|
+
var _useInlineActionNudge = useInlineActionNudgeExperiment(link, showHoverPreview, actionOptions),
|
|
77
77
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
78
78
|
|
|
79
79
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "44.3.
|
|
18
|
+
packageVersion: "44.3.7",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CardActionOptions } from '../../../view/Card/types';
|
|
1
2
|
export interface InlineActionNudgeExperiment {
|
|
2
3
|
/**
|
|
3
4
|
* True when the user is in the treatment cohort and should see the
|
|
@@ -11,11 +12,13 @@ export interface InlineActionNudgeExperiment {
|
|
|
11
12
|
*
|
|
12
13
|
* All eligibility criteria are consolidated here:
|
|
13
14
|
* 1. Rovo chat must be enabled for the tenant.
|
|
14
|
-
* 2. The
|
|
15
|
-
* 3. The
|
|
15
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
16
|
+
* 3. The link must support the RovoActions feature.
|
|
17
|
+
* 4. The extension key must not be excluded (Figma and Google links are excluded).
|
|
18
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
16
19
|
*
|
|
17
20
|
* The extension key is derived from the card store via the resolved URL,
|
|
18
21
|
* so callers don't need to thread it as a prop.
|
|
19
22
|
*/
|
|
20
|
-
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean) => InlineActionNudgeExperiment;
|
|
23
|
+
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean, actionOptions?: CardActionOptions) => InlineActionNudgeExperiment;
|
|
21
24
|
export default useInlineActionNudgeExperiment;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HoverCardResolvedProps } from './types';
|
|
2
|
-
declare const HoverCardResolvedView: ({ cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, }: HoverCardResolvedProps) => JSX.Element;
|
|
2
|
+
declare const HoverCardResolvedView: ({ actionOptions, cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, }: HoverCardResolvedProps) => JSX.Element;
|
|
3
3
|
export default HoverCardResolvedView;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CardActionOptions } from '../../../view/Card/types';
|
|
1
2
|
export interface InlineActionNudgeExperiment {
|
|
2
3
|
/**
|
|
3
4
|
* True when the user is in the treatment cohort and should see the
|
|
@@ -11,11 +12,13 @@ export interface InlineActionNudgeExperiment {
|
|
|
11
12
|
*
|
|
12
13
|
* All eligibility criteria are consolidated here:
|
|
13
14
|
* 1. Rovo chat must be enabled for the tenant.
|
|
14
|
-
* 2. The
|
|
15
|
-
* 3. The
|
|
15
|
+
* 2. The consumer must have opted in via actionOptions.rovoChatAction.optIn.
|
|
16
|
+
* 3. The link must support the RovoActions feature.
|
|
17
|
+
* 4. The extension key must not be excluded (Figma and Google links are excluded).
|
|
18
|
+
* 5. The experiment value must be true (via tmp-editor-statsig).
|
|
16
19
|
*
|
|
17
20
|
* The extension key is derived from the card store via the resolved URL,
|
|
18
21
|
* so callers don't need to thread it as a prop.
|
|
19
22
|
*/
|
|
20
|
-
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean) => InlineActionNudgeExperiment;
|
|
23
|
+
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean, actionOptions?: CardActionOptions) => InlineActionNudgeExperiment;
|
|
21
24
|
export default useInlineActionNudgeExperiment;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HoverCardResolvedProps } from './types';
|
|
2
|
-
declare const HoverCardResolvedView: ({ cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, }: HoverCardResolvedProps) => JSX.Element;
|
|
2
|
+
declare const HoverCardResolvedView: ({ actionOptions, cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, showRovoResolvedView, titleBlockProps, id, }: HoverCardResolvedProps) => JSX.Element;
|
|
3
3
|
export default HoverCardResolvedView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.3.
|
|
3
|
+
"version": "44.3.8",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@atlaskit/logo": "^20.0.0",
|
|
69
69
|
"@atlaskit/lozenge": "^13.7.0",
|
|
70
70
|
"@atlaskit/menu": "^8.5.0",
|
|
71
|
-
"@atlaskit/modal-dialog": "^14.
|
|
71
|
+
"@atlaskit/modal-dialog": "^14.18.0",
|
|
72
72
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
73
73
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
74
74
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"@atlaskit/textfield": "^8.3.0",
|
|
85
85
|
"@atlaskit/theme": "^23.1.0",
|
|
86
86
|
"@atlaskit/tile": "^1.0.0",
|
|
87
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
87
|
+
"@atlaskit/tmp-editor-statsig": "^67.0.0",
|
|
88
88
|
"@atlaskit/tokens": "^13.0.0",
|
|
89
|
-
"@atlaskit/tooltip": "^21.
|
|
89
|
+
"@atlaskit/tooltip": "^21.2.0",
|
|
90
90
|
"@atlaskit/ufo": "^0.4.0",
|
|
91
91
|
"@babel/runtime": "^7.0.0",
|
|
92
92
|
"@compiled/react": "^0.20.0",
|