@atlaskit/smart-card 44.23.1 → 44.23.3
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 +15 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/cjs/extractors/flexible/actions/index.js +1 -1
- package/dist/cjs/extractors/flexible/index.js +1 -1
- package/dist/cjs/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/click-helpers.js +30 -1
- package/dist/cjs/view/CardWithUrl/component.js +109 -45
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/index.js +2 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +31 -16
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +4 -11
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +2 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/ai-summary/index.js +1 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/es2019/extractors/flexible/actions/index.js +1 -1
- package/dist/es2019/extractors/flexible/index.js +1 -1
- package/dist/es2019/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/click-helpers.js +29 -0
- package/dist/es2019/view/CardWithUrl/component.js +111 -47
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/index.js +2 -2
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +31 -17
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -11
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +3 -10
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +1 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-with-entity-support--default.png +2 -2
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +2 -4
- package/dist/esm/extractors/flexible/actions/index.js +1 -1
- package/dist/esm/extractors/flexible/index.js +1 -1
- package/dist/esm/state/hooks/use-rovo-chat/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/click-helpers.js +29 -0
- package/dist/esm/view/CardWithUrl/component.js +110 -46
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -9
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +7 -28
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -10
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +0 -7
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -3
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.compiled.css +2 -6
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +4 -26
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +0 -1
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -4
- package/dist/esm/view/FlexibleCard/index.js +2 -2
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +31 -16
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +4 -11
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +3 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +1 -3
- package/dist/types/utils/click-helpers.d.ts +20 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -2
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/click-helpers.d.ts +20 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/package.json +1 -4
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/cjs/state/hooks/use-inline-action-nudge-experiment/index.js +0 -54
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -44
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/es2019/state/hooks/use-inline-action-nudge-experiment/index.js +0 -48
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -36
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-false.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-google-rovo-chat-action--default--rovogrowth-640-inline-action-nudge-exp-true.png +0 -3
- package/dist/esm/state/hooks/use-inline-action-nudge-experiment/index.js +0 -47
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +0 -15
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +0 -35
- package/dist/types/state/hooks/use-inline-action-nudge-experiment/index.d.ts +0 -24
- package/dist/types/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.d.ts +0 -12
- package/dist/types-ts4.5/state/hooks/use-inline-action-nudge-experiment/index.d.ts +0 -24
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.d.ts +0 -12
|
@@ -49,7 +49,7 @@ const FlexibleCard = ({
|
|
|
49
49
|
openPreviewPanel,
|
|
50
50
|
product
|
|
51
51
|
} = useSmartLinkContext();
|
|
52
|
-
const rovoConfig = fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
52
|
+
const rovoConfig = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
53
53
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
54
54
|
useRovoConfig() : undefined;
|
|
55
55
|
const {
|
|
@@ -78,7 +78,7 @@ const FlexibleCard = ({
|
|
|
78
78
|
origin,
|
|
79
79
|
renderers,
|
|
80
80
|
resolve,
|
|
81
|
-
...(fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
81
|
+
...(fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
82
82
|
product,
|
|
83
83
|
rovoConfig
|
|
84
84
|
} : undefined),
|
|
@@ -10,12 +10,13 @@ import { useAnalyticsEvents } from '../../../common/analytics/generated/use-anal
|
|
|
10
10
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
11
11
|
import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
|
|
12
12
|
import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
13
|
-
import useInlineActionNudgeExperiment from '../../../state/hooks/use-inline-action-nudge-experiment';
|
|
14
13
|
import useRovoConfig from '../../../state/hooks/use-rovo-config';
|
|
14
|
+
import { useSmartLinkCrossProductUrlWrapperGated } from '../../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
15
15
|
import { useSmartCardState } from '../../../state/store';
|
|
16
16
|
import { isSpecialEvent } from '../../../utils';
|
|
17
17
|
import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
|
|
18
18
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
19
|
+
import { getAnchorAttributesFromEvent } from '../../../utils/click-helpers';
|
|
19
20
|
import { flexibleUiOptions } from '../styled';
|
|
20
21
|
import { getMetadata } from '../utils';
|
|
21
22
|
import ContentContainer from './ContentContainer';
|
|
@@ -87,6 +88,9 @@ const HoverCardContent = ({
|
|
|
87
88
|
} = useSmartLinkContext();
|
|
88
89
|
const isAISummaryEnabled = getIsAISummaryEnabled(isAdminHubAIEnabled, cardState.details);
|
|
89
90
|
const services = getServices(linkState.details);
|
|
91
|
+
const appendCrossProductAnalyticsParams = useSmartLinkCrossProductUrlWrapperGated({
|
|
92
|
+
details: linkState.details
|
|
93
|
+
});
|
|
90
94
|
const statusRef = useRef(linkStatus);
|
|
91
95
|
const fireEventRef = useRef(fireEvent);
|
|
92
96
|
const definitionIdRef = useRef(definitionId);
|
|
@@ -128,6 +132,24 @@ const HoverCardContent = ({
|
|
|
128
132
|
};
|
|
129
133
|
}, []);
|
|
130
134
|
const onClick = useCallback(event => {
|
|
135
|
+
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
136
|
+
// Prevent the anchor's native navigation so we can open the destination URL
|
|
137
|
+
// with cross-product analytics query parameters appended.
|
|
138
|
+
// The href is read from the anchor element at click time rather than at render
|
|
139
|
+
// time because the URL for the anchor may be different from original URL.
|
|
140
|
+
// The component may use the URL from the resolved response which can be a redirect URL
|
|
141
|
+
// or other preferred URL based on link extractor.
|
|
142
|
+
// The cross-product params are client-only and cannot be rendered
|
|
143
|
+
// server-side. Falls back to the original `url` prop if the event target is
|
|
144
|
+
// not an anchor element.
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
const {
|
|
147
|
+
href = url,
|
|
148
|
+
target
|
|
149
|
+
} = getAnchorAttributesFromEvent(event);
|
|
150
|
+
const destinationUrl = appendCrossProductAnalyticsParams(href);
|
|
151
|
+
window.open(destinationUrl, target);
|
|
152
|
+
}
|
|
131
153
|
const isModifierKeyPressed = isSpecialEvent(event);
|
|
132
154
|
fireEvent('ui.smartLink.clicked.titleGoToLink', {
|
|
133
155
|
id,
|
|
@@ -136,7 +158,7 @@ const HoverCardContent = ({
|
|
|
136
158
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
137
159
|
});
|
|
138
160
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
139
|
-
}, [createAnalyticsEvent, id, fireEvent, definitionId]);
|
|
161
|
+
}, [createAnalyticsEvent, appendCrossProductAnalyticsParams, id, fireEvent, definitionId, url]);
|
|
140
162
|
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
141
163
|
const {
|
|
142
164
|
subtitle
|
|
@@ -224,9 +246,8 @@ const HoverCardContent = ({
|
|
|
224
246
|
flexibleCardProps: flexibleCardProps
|
|
225
247
|
});
|
|
226
248
|
}
|
|
227
|
-
const is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
228
249
|
if (isResolved) {
|
|
229
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
250
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
230
251
|
actionOptions,
|
|
231
252
|
showRovoResolvedView
|
|
232
253
|
} : undefined, {
|
|
@@ -277,9 +298,8 @@ const HoverCardContent = ({
|
|
|
277
298
|
flexibleCardProps: flexibleCardProps
|
|
278
299
|
});
|
|
279
300
|
}
|
|
280
|
-
const is3PInlinePostAuthActionsEnabled = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
281
301
|
if (cardState.status === 'resolved') {
|
|
282
|
-
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
302
|
+
return /*#__PURE__*/React.createElement(HoverCardResolvedView, _extends({}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
283
303
|
actionOptions,
|
|
284
304
|
showRovoResolvedView
|
|
285
305
|
} : undefined, {
|
|
@@ -306,8 +326,7 @@ const HoverCardContent = ({
|
|
|
306
326
|
const HoverCardContentWithViewVariant = props => {
|
|
307
327
|
const {
|
|
308
328
|
cardState,
|
|
309
|
-
actionOptions
|
|
310
|
-
url
|
|
329
|
+
actionOptions
|
|
311
330
|
} = props;
|
|
312
331
|
const rovoConfig = useRovoConfig();
|
|
313
332
|
const isResolved = useIsResolvedView(props);
|
|
@@ -317,23 +336,19 @@ const HoverCardContentWithViewVariant = props => {
|
|
|
317
336
|
rovoConfig,
|
|
318
337
|
actionOptions
|
|
319
338
|
}) !== undefined, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
320
|
-
const {
|
|
321
|
-
isEnabled: rovoActionsCtaShown
|
|
322
|
-
} = useInlineActionNudgeExperiment(url, true, actionOptions);
|
|
323
339
|
const data = useMemo(() => {
|
|
324
340
|
let viewVariant = 'default';
|
|
325
|
-
if (showRovoResolvedView &&
|
|
341
|
+
if (showRovoResolvedView && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true)) {
|
|
326
342
|
viewVariant = 'rovo-resolved-view';
|
|
327
343
|
} else if (showPreauthBetterHovercard) {
|
|
328
344
|
viewVariant = 'rovo-unauthorised-view';
|
|
329
345
|
}
|
|
330
346
|
return {
|
|
331
347
|
attributes: {
|
|
332
|
-
viewVariant
|
|
333
|
-
rovoActionsCtaShown
|
|
348
|
+
viewVariant
|
|
334
349
|
}
|
|
335
350
|
};
|
|
336
|
-
}, [showRovoResolvedView, showPreauthBetterHovercard
|
|
351
|
+
}, [showRovoResolvedView, showPreauthBetterHovercard]);
|
|
337
352
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
338
353
|
data: data
|
|
339
354
|
}, /*#__PURE__*/React.createElement(HoverCardContent, _extends({}, props, {
|
|
@@ -344,7 +359,6 @@ const _default_1 = componentWithCondition(() => {
|
|
|
344
359
|
// We need to read both of them to sutisfy some of the tests that expect both to be checked.
|
|
345
360
|
const flagA = fg('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
346
361
|
const flagB = fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
347
|
-
|
|
348
|
-
return flagA || flagB || flagC;
|
|
362
|
+
return flagA || flagB;
|
|
349
363
|
}, HoverCardContentWithViewVariant, HoverCardContent);
|
|
350
364
|
export default _default_1;
|
|
@@ -9,7 +9,6 @@ import { useAnalyticsEvents } from '../../../../../common/analytics/generated/us
|
|
|
9
9
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
10
10
|
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
11
11
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
12
|
-
import useInlineActionNudgeExperiment from '../../../../../state/hooks/use-inline-action-nudge-experiment';
|
|
13
12
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
14
13
|
import { ActionBlock, AIFooterBlock, AISummaryBlock, ResolvedHoverCardFooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
15
14
|
import { getMetadata } from '../../../utils';
|
|
@@ -19,7 +18,6 @@ const titleBlockStyles = null;
|
|
|
19
18
|
const snippetBlockCss = null;
|
|
20
19
|
const actionBlockCss = null;
|
|
21
20
|
const HoverCardResolvedView = ({
|
|
22
|
-
actionOptions,
|
|
23
21
|
cardState,
|
|
24
22
|
extensionKey,
|
|
25
23
|
flexibleCardProps,
|
|
@@ -33,15 +31,9 @@ const HoverCardResolvedView = ({
|
|
|
33
31
|
const {
|
|
34
32
|
fireEvent
|
|
35
33
|
} = useAnalyticsEvents();
|
|
36
|
-
const {
|
|
37
|
-
isEnabled: InlineActionNudgeExperimentValue
|
|
38
|
-
} = useInlineActionNudgeExperiment(flexibleCardProps.url, true, actionOptions);
|
|
39
|
-
|
|
40
34
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
41
35
|
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
42
36
|
const is3PAuthRovoActionsExperimentOn = showRovoResolvedView && expValEquals('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
43
|
-
const is3PInlinePostAuthActionsExperimentOn = showRovoResolvedView && InlineActionNudgeExperimentValue;
|
|
44
|
-
const isAny3pRovoActionsExperimentOn = is3PAuthRovoActionsExperimentOn || is3PInlinePostAuthActionsExperimentOn;
|
|
45
37
|
useEffect(() => {
|
|
46
38
|
// Since this hover view is only rendered on resolved status,
|
|
47
39
|
// there is no need to check for statuses.
|
|
@@ -90,7 +82,7 @@ const HoverCardResolvedView = ({
|
|
|
90
82
|
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
91
83
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
92
84
|
placeholder: snippet,
|
|
93
|
-
isAny3pRovoActionsExperimentOn:
|
|
85
|
+
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
94
86
|
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
95
87
|
testId: "hidden-snippet",
|
|
96
88
|
onRender: onSnippetRender,
|
|
@@ -100,9 +92,9 @@ const HoverCardResolvedView = ({
|
|
|
100
92
|
}), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
101
93
|
onClick: onActionClick,
|
|
102
94
|
spaceInline: "space.100",
|
|
103
|
-
isAny3pRovoActionsExperimentOn:
|
|
95
|
+
isAny3pRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn,
|
|
104
96
|
className: ax(["_n3td1b66"])
|
|
105
|
-
}),
|
|
97
|
+
}), is3PAuthRovoActionsExperimentOn ? /*#__PURE__*/React.createElement(ResolvedHoverCardFooterBlock, {
|
|
106
98
|
onActionClick: onActionClick
|
|
107
99
|
}) : /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
108
100
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { fg } from "@atlaskit/platform-feature-flags";
|
|
3
2
|
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
4
|
-
import useInlineActionNudgeExperiment from '../../../state/hooks/use-inline-action-nudge-experiment';
|
|
5
3
|
import useInlineTailoredActionExperiment from '../../../state/hooks/use-inline-tailored-action-experiment';
|
|
6
4
|
import { HoverCard } from '../../HoverCard';
|
|
7
|
-
import {
|
|
5
|
+
import { InlineRovoActionButton } from '../common/rovo-actions-cta';
|
|
8
6
|
import { Frame } from '../Frame';
|
|
9
7
|
import { IconAndTitleLayout } from '../IconAndTitleLayout';
|
|
10
8
|
import { renderLozenge } from './renderLozenge';
|
|
@@ -77,9 +75,6 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
77
75
|
hideIconLoadingSkeleton,
|
|
78
76
|
lozenge
|
|
79
77
|
}) {
|
|
80
|
-
const {
|
|
81
|
-
isEnabled
|
|
82
|
-
} = useInlineActionNudgeExperiment(link, showHoverPreview, actionOptions);
|
|
83
78
|
const {
|
|
84
79
|
isEnabled: isInlineTailoredRovoActionEnabled
|
|
85
80
|
} = useInlineTailoredActionExperiment(link, showHoverPreview, actionOptions);
|
|
@@ -101,9 +96,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
101
96
|
titleTextColor: titleTextColor,
|
|
102
97
|
type: type,
|
|
103
98
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
104
|
-
}), renderLozenge(lozenge),
|
|
105
|
-
testId: `${testId}-rovo-actions-cta`
|
|
106
|
-
}), isInlineTailoredRovoActionEnabled && /*#__PURE__*/React.createElement(InlineRovoActionButton, {
|
|
99
|
+
}), renderLozenge(lozenge), isInlineTailoredRovoActionEnabled && /*#__PURE__*/React.createElement(InlineRovoActionButton, {
|
|
107
100
|
testId: `${testId}-rovo-actions-cta`,
|
|
108
101
|
url: link
|
|
109
102
|
}));
|
|
@@ -119,4 +112,4 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
119
112
|
}
|
|
120
113
|
|
|
121
114
|
// Todo: replace with platform_sl_3p_auth_inline_tailored_cta_killswitch after cleanup of rovogrowth-640-inline-action-nudge-fg
|
|
122
|
-
export const InlineCardResolvedViewFunctional = componentWithFG('
|
|
115
|
+
export const InlineCardResolvedViewFunctional = componentWithFG('platform_sl_3p_auth_inline_tailored_cta_killswitch', InlineCardResolvedViewFunctionalWithRovoActions, InlineCardResolvedViewBase);
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "44.23.
|
|
12
|
+
packageVersion: "44.23.2",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -26,9 +26,7 @@ const AISummary = ({
|
|
|
26
26
|
}
|
|
27
27
|
const is3pExperimentEnabled =
|
|
28
28
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
29
|
-
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true)
|
|
30
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
31
|
-
fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
29
|
+
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
32
30
|
return /*#__PURE__*/React.createElement(Markdown, {
|
|
33
31
|
"data-testid": testId
|
|
34
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:13d8e863b7dcc6b41eef967c98a4e961078c5442a20e9d14ce373567ec6ea6f9
|
|
3
|
+
size 12894
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:79dfaed74e187a22da54cdf220a9f681e089542858ba84b0ffeb7e77b787f626
|
|
3
|
+
size 2111
|
|
@@ -1,12 +1,11 @@
|
|
|
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';
|
|
4
3
|
import { ActionName, CardAction } from '../../../constants';
|
|
5
4
|
import { getDefinitionId, getExtensionKey, getResourceType } from '../../../state/helpers';
|
|
6
5
|
import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
7
6
|
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
8
7
|
import { getIsRovoChatEnabled } from '../../../utils/rovo';
|
|
9
|
-
// For
|
|
8
|
+
// For block card experiment (NAVX-4814)
|
|
10
9
|
var ELIGIBLE_EXTENSION_KEYS = new Set(['slack-object-provider', 'google-object-provider', 'onedrive-object-provider', 'github-object-provider', 'ms-teams-object-provider', 'gitlab-object-provider', 'salesforce-object-provider']);
|
|
11
10
|
var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
12
11
|
var _rovoConfig$product, _actionOptions$rovoCh;
|
|
@@ -27,9 +26,8 @@ var extractRovoChatAction = function extractRovoChatAction(_ref) {
|
|
|
27
26
|
var isGoogleProvider = extensionKey === 'google-object-provider';
|
|
28
27
|
var is3PBlockExperimentEnabled = isBlockCardRovoActionExperimentEnabled((_rovoConfig$product = rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product) !== null && _rovoConfig$product !== void 0 ? _rovoConfig$product : product);
|
|
29
28
|
var is3PAuthRovoActionEnabled = isGoogleProvider && fg('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
30
|
-
var is3PInlinePostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
31
29
|
var is3PBlockPostAuthActionsEnabled = extensionKey !== undefined && ELIGIBLE_EXTENSION_KEYS.has(extensionKey) && is3PBlockExperimentEnabled;
|
|
32
|
-
var isSupportedFeature =
|
|
30
|
+
var isSupportedFeature = is3PAuthRovoActionEnabled || is3PBlockPostAuthActionsEnabled;
|
|
33
31
|
var isOptIn = (actionOptions === null || actionOptions === void 0 || (_actionOptions$rovoCh = actionOptions.rovoChatAction) === null || _actionOptions$rovoCh === void 0 ? void 0 : _actionOptions$rovoCh.optIn) === true;
|
|
34
32
|
var url = extractSmartLinkUrl(response);
|
|
35
33
|
return isSupportedFeature && isOptIn ? {
|
|
@@ -43,7 +43,7 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
|
|
|
43
43
|
response: response,
|
|
44
44
|
isPreviewPanelAvailable: isPreviewPanelAvailable,
|
|
45
45
|
openPreviewPanel: openPreviewPanel
|
|
46
|
-
})), ActionName.AutomationAction, extractAutomationAction(response)), InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
46
|
+
})), ActionName.AutomationAction, extractAutomationAction(response)), InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), fg('platform_sl_3p_auth_rovo_action_kill_switch') ? _defineProperty({}, ActionName.RovoChatAction, extractRovoChatAction({
|
|
47
47
|
actionOptions: actionOptions,
|
|
48
48
|
appearance: appearance,
|
|
49
49
|
id: id,
|
|
@@ -49,7 +49,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
49
49
|
fireEvent: fireEvent,
|
|
50
50
|
id: id,
|
|
51
51
|
origin: origin
|
|
52
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
52
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
53
53
|
product: product,
|
|
54
54
|
rovoConfig: rovoConfig
|
|
55
55
|
} : undefined), {}, {
|
|
@@ -29,7 +29,7 @@ var useRovoChat = function useRovoChat() {
|
|
|
29
29
|
agentId: undefined
|
|
30
30
|
}),
|
|
31
31
|
openChat: true,
|
|
32
|
-
openChatMode: isJiraProduct &&
|
|
32
|
+
openChatMode: isJiraProduct && fg('platform_sl_3p_auth_rovo_block_jira_kill_switch') ? 'mini-modal' : 'sidebar'
|
|
33
33
|
},
|
|
34
34
|
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
35
35
|
// NAVX-3599: Add analytics event
|
|
@@ -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.23.
|
|
7
|
+
packageVersion: "44.23.2" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,4 +5,33 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export var isAuxClick = function isAuxClick(e) {
|
|
7
7
|
return e.button === 1;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Extracts `href` and `target` from the anchor element that is the event's `currentTarget`.
|
|
12
|
+
*
|
|
13
|
+
* Smart Link click handlers are attached to multiple card renderers (InlineCard, BlockCard,
|
|
14
|
+
* EmbedCard, FlexibleCard). When the handler needs to manually open a link — for example,
|
|
15
|
+
* when native anchor navigation has been prevented — it uses this helper to read the
|
|
16
|
+
* anchor's resolved URL and intended target from the event rather than re-deriving them.
|
|
17
|
+
*
|
|
18
|
+
* Returns `{ href: undefined, target: '_self' }` when `currentTarget` is not an anchor
|
|
19
|
+
* element (e.g. a button or wrapper div), so callers can safely fall back to a default target.
|
|
20
|
+
*
|
|
21
|
+
* @param event - A React mouse or keyboard event whose `currentTarget` may be an anchor.
|
|
22
|
+
* @returns The resolved absolute `href` and `target` attribute of the anchor, or safe
|
|
23
|
+
* defaults if `currentTarget` is not an anchor.
|
|
24
|
+
*/
|
|
25
|
+
export var getAnchorAttributesFromEvent = function getAnchorAttributesFromEvent(event) {
|
|
26
|
+
var currentTarget = event.currentTarget;
|
|
27
|
+
if (!(currentTarget instanceof HTMLAnchorElement)) {
|
|
28
|
+
return {
|
|
29
|
+
href: undefined,
|
|
30
|
+
target: '_self'
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
href: currentTarget.href,
|
|
35
|
+
target: currentTarget.target || '_self'
|
|
36
|
+
};
|
|
8
37
|
};
|
|
@@ -13,14 +13,13 @@ import { CardDisplay } from '../../constants';
|
|
|
13
13
|
import { useSmartLink } from '../../state';
|
|
14
14
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
15
15
|
import { getClickUrl, getDefinitionId, getExtensionKey, getFirstPartyIdentifier, getObjectAri, getObjectIconUrl, getObjectName, getResourceType, getServices, getThirdPartyARI, isFinalState } from '../../state/helpers';
|
|
16
|
-
import useInlineActionNudgeExperiment from '../../state/hooks/use-inline-action-nudge-experiment';
|
|
17
16
|
import { useSmartLinkCrossProductUrlWrapperGated } from '../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
18
17
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
19
18
|
import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
|
|
20
19
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
21
20
|
import { fireLinkClickedEvent } from '../../utils/analytics/click';
|
|
22
21
|
import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
23
|
-
import { isAuxClick } from '../../utils/click-helpers';
|
|
22
|
+
import { getAnchorAttributesFromEvent, isAuxClick } from '../../utils/click-helpers';
|
|
24
23
|
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
25
24
|
import * as measure from '../../utils/performance';
|
|
26
25
|
import { BlockCard } from '../BlockCard';
|
|
@@ -85,15 +84,16 @@ function Component(_ref) {
|
|
|
85
84
|
var services = getServices(state.details);
|
|
86
85
|
var thirdPartyARI = getThirdPartyARI(state.details);
|
|
87
86
|
var firstPartyIdentifier = getFirstPartyIdentifier();
|
|
88
|
-
var
|
|
87
|
+
var appendCrossProductAnalyticsParams = useSmartLinkCrossProductUrlWrapperGated({
|
|
89
88
|
details: state.details
|
|
90
89
|
});
|
|
91
90
|
var actionOptions = combineActionOptions({
|
|
92
91
|
actionOptions: actionOptionsProp,
|
|
93
92
|
platform: platform
|
|
94
93
|
});
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
|
|
95
|
+
// TODO: [ZS] Add new experiment flag to determine if the Rovo Actions CTA should be shown
|
|
96
|
+
var rovoActionsCtaShown = false;
|
|
97
97
|
var fire3PClickEvent = fg('platform_smartlink_3pclick_analytics') ?
|
|
98
98
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
99
99
|
useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
|
|
@@ -118,56 +118,120 @@ function Component(_ref) {
|
|
|
118
118
|
var isDisablePreviewPanel = disablePreviewPanel && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
119
119
|
exposure: true
|
|
120
120
|
});
|
|
121
|
+
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
122
|
+
var _appendCrossProductAn;
|
|
123
|
+
// FIXME: InlineCard, BlockCard and EmbedCard call event.preventDefault() internally
|
|
124
|
+
// before the event bubbles up to this handler. This forces us to snapshot
|
|
125
|
+
// event.defaultPrevented before calling onClick to detect whether the consumer
|
|
126
|
+
// specifically prevented navigation. Ideally those components should not call
|
|
127
|
+
// preventDefault so this workaround can be removed.
|
|
128
|
+
var isEventDefaultPrevented = event.defaultPrevented;
|
|
129
|
+
var canOpenPreviewPanel = !isModifierKeyPressed && ari && name && openPreviewPanel && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
130
|
+
ari: ari
|
|
131
|
+
})) && !isDisablePreviewPanel;
|
|
121
132
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
144
|
-
return;
|
|
145
|
-
} else if (!onClick && !isFlexibleUi) {
|
|
146
|
-
var clickUrl = getClickUrl(url, state.details);
|
|
133
|
+
// Preview panel takes priority over link navigation when available.
|
|
134
|
+
if (canOpenPreviewPanel) {
|
|
135
|
+
var _extractSmartLinkEmbe;
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
event.stopPropagation();
|
|
138
|
+
openPreviewPanel({
|
|
139
|
+
url: url,
|
|
140
|
+
ari: ari,
|
|
141
|
+
name: name,
|
|
142
|
+
iconUrl: getObjectIconUrl(state.details),
|
|
143
|
+
panelData: {
|
|
144
|
+
embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(state.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
148
|
+
attributes: {
|
|
149
|
+
clickOutcome: 'previewPanel'
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
147
154
|
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var target = isSpecialEvent(event) ? '_blank' : '_self';
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
// For FlexibleCard, read target from the clicked anchor element (e.g. _blank for links
|
|
156
|
+
// rendered with explicit target). For classic cards, default to _self
|
|
157
|
+
var _getAnchorAttributesF = getAnchorAttributesFromEvent(event),
|
|
158
|
+
anchorTarget = _getAnchorAttributesF.target;
|
|
159
|
+
var target = isSpecialEvent(event) ? '_blank' : isFlexibleUi ? anchorTarget : '_self';
|
|
160
|
+
|
|
161
|
+
// FIXME: preferredUrl should be rendered in the DOM anchor href instead of derived at click time
|
|
162
|
+
var preferredUrl = getClickUrl(url, state.details);
|
|
163
|
+
var destinationUrl = (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
|
|
164
|
+
|
|
165
|
+
// FIXME: Consumer that handle click even themselves via callback won't have the decorated URL
|
|
166
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
167
|
+
|
|
168
|
+
// Check if the event is prevented via onClick callback
|
|
169
|
+
var consumerPreventedNavigation = event.defaultPrevented && !isEventDefaultPrevented;
|
|
170
|
+
|
|
171
|
+
// Classic cards (InlineCard, BlockCard, EmbedCard) rely on their own anchor navigation
|
|
172
|
+
// when onClick is provided, so this handler should not open the link for them.
|
|
173
|
+
// FlexibleCard's anchor is prevented from native navigation, so this handler always
|
|
174
|
+
// opens the link for FlexibleCard unless the consumer's onClick called preventDefault.
|
|
175
|
+
var shouldOpenLink = isFlexibleUi || !onClick;
|
|
176
|
+
var doOpenLink = shouldOpenLink && !consumerPreventedNavigation;
|
|
177
|
+
if (doOpenLink) {
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
window.open(destinationUrl, target);
|
|
158
180
|
}
|
|
159
|
-
|
|
181
|
+
|
|
182
|
+
// Only set clickOutcome when this handler actually opened the link.
|
|
183
|
+
// If a parent onClick handled navigation, fire a generic click event instead.
|
|
184
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event, doOpenLink ? {
|
|
160
185
|
attributes: {
|
|
161
186
|
clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
|
|
162
187
|
}
|
|
163
|
-
});
|
|
188
|
+
} : undefined);
|
|
164
189
|
} else {
|
|
165
|
-
|
|
166
|
-
|
|
190
|
+
// If preview panel is available and the user clicked on the link,
|
|
191
|
+
// delegate the click to the preview panel handler
|
|
192
|
+
if (!isModifierKeyPressed && ari && name && openPreviewPanel && isPreviewPanelAvailable !== null && isPreviewPanelAvailable !== void 0 && isPreviewPanelAvailable({
|
|
193
|
+
ari: ari
|
|
194
|
+
}) && !isDisablePreviewPanel) {
|
|
195
|
+
var _extractSmartLinkEmbe2;
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
event.stopPropagation();
|
|
198
|
+
openPreviewPanel({
|
|
199
|
+
url: url,
|
|
200
|
+
ari: ari,
|
|
201
|
+
name: name,
|
|
202
|
+
iconUrl: getObjectIconUrl(state.details),
|
|
203
|
+
panelData: {
|
|
204
|
+
embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe2 = extractSmartLinkEmbed(state.details)) === null || _extractSmartLinkEmbe2 === void 0 ? void 0 : _extractSmartLinkEmbe2.src : undefined
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
208
|
+
attributes: {
|
|
209
|
+
clickOutcome: 'previewPanel'
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
} else if (!onClick && !isFlexibleUi) {
|
|
214
|
+
var clickUrl = getClickUrl(url, state.details);
|
|
215
|
+
|
|
216
|
+
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
217
|
+
// The event could have potentially had `e.preventDefault()` called on it by now
|
|
218
|
+
// event by smart card internally
|
|
219
|
+
// If it has been called then only then can `isSpecialEvent` be true.
|
|
220
|
+
var _target = isSpecialEvent(event) ? '_blank' : '_self';
|
|
221
|
+
window.open(clickUrl, _target);
|
|
222
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
223
|
+
attributes: {
|
|
224
|
+
clickOutcome: _target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
} else {
|
|
228
|
+
if (onClick) {
|
|
229
|
+
onClick(event);
|
|
230
|
+
}
|
|
231
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
167
232
|
}
|
|
168
|
-
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
169
233
|
}
|
|
170
|
-
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url,
|
|
234
|
+
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, appendCrossProductAnalyticsParams, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
171
235
|
|
|
172
236
|
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
173
237
|
useEffect(function () {
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
4
|
-
._1dqonqa1{border-style:solid}
|
|
5
|
-
._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
|
|
6
2
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
7
|
-
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
8
3
|
._1bah1h6o{justify-content:center}
|
|
9
4
|
._1bsb1osq{width:100%}
|
|
10
5
|
._1bsb1tcg{width:24px}
|
|
11
6
|
._1e0c116y{display:inline-flex}
|
|
12
|
-
._1o9zidpf{flex-shrink:0}
|
|
13
7
|
._4cvr1h6o{align-items:center}
|
|
14
8
|
._4t3i1tcg{height:24px}
|
|
15
9
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
16
10
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
17
|
-
._kqswh2mm{position:relative}
|
|
18
11
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
19
|
-
._o5721q9c{white-space:nowrap}
|
|
20
12
|
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
21
13
|
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
22
|
-
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
23
14
|
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
24
15
|
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
25
16
|
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|