@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
|
@@ -10,14 +10,13 @@ import { CardDisplay } from '../../constants';
|
|
|
10
10
|
import { useSmartLink } from '../../state';
|
|
11
11
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
12
12
|
import { getClickUrl, getDefinitionId, getExtensionKey, getFirstPartyIdentifier, getObjectAri, getObjectIconUrl, getObjectName, getResourceType, getServices, getThirdPartyARI, isFinalState } from '../../state/helpers';
|
|
13
|
-
import useInlineActionNudgeExperiment from '../../state/hooks/use-inline-action-nudge-experiment';
|
|
14
13
|
import { useSmartLinkCrossProductUrlWrapperGated } from '../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
15
14
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
16
15
|
import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
|
|
17
16
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
18
17
|
import { fireLinkClickedEvent } from '../../utils/analytics/click';
|
|
19
18
|
import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
20
|
-
import { isAuxClick } from '../../utils/click-helpers';
|
|
19
|
+
import { getAnchorAttributesFromEvent, isAuxClick } from '../../utils/click-helpers';
|
|
21
20
|
import { isFlexibleUiCard } from '../../utils/flexible';
|
|
22
21
|
import * as measure from '../../utils/performance';
|
|
23
22
|
import { BlockCard } from '../BlockCard';
|
|
@@ -84,16 +83,16 @@ function Component({
|
|
|
84
83
|
const services = getServices(state.details);
|
|
85
84
|
const thirdPartyARI = getThirdPartyARI(state.details);
|
|
86
85
|
const firstPartyIdentifier = getFirstPartyIdentifier();
|
|
87
|
-
const
|
|
86
|
+
const appendCrossProductAnalyticsParams = useSmartLinkCrossProductUrlWrapperGated({
|
|
88
87
|
details: state.details
|
|
89
88
|
});
|
|
90
89
|
const actionOptions = combineActionOptions({
|
|
91
90
|
actionOptions: actionOptionsProp,
|
|
92
91
|
platform
|
|
93
92
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
|
|
94
|
+
// TODO: [ZS] Add new experiment flag to determine if the Rovo Actions CTA should be shown
|
|
95
|
+
const rovoActionsCtaShown = false;
|
|
97
96
|
const fire3PClickEvent = fg('platform_smartlink_3pclick_analytics') ?
|
|
98
97
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
99
98
|
useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
|
|
@@ -118,56 +117,121 @@ function Component({
|
|
|
118
117
|
const isDisablePreviewPanel = disablePreviewPanel && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
119
118
|
exposure: true
|
|
120
119
|
});
|
|
120
|
+
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
121
|
+
var _appendCrossProductAn;
|
|
122
|
+
// FIXME: InlineCard, BlockCard and EmbedCard call event.preventDefault() internally
|
|
123
|
+
// before the event bubbles up to this handler. This forces us to snapshot
|
|
124
|
+
// event.defaultPrevented before calling onClick to detect whether the consumer
|
|
125
|
+
// specifically prevented navigation. Ideally those components should not call
|
|
126
|
+
// preventDefault so this workaround can be removed.
|
|
127
|
+
const isEventDefaultPrevented = event.defaultPrevented;
|
|
128
|
+
const canOpenPreviewPanel = !isModifierKeyPressed && ari && name && openPreviewPanel && (isPreviewPanelAvailable === null || isPreviewPanelAvailable === void 0 ? void 0 : isPreviewPanelAvailable({
|
|
129
|
+
ari
|
|
130
|
+
})) && !isDisablePreviewPanel;
|
|
121
131
|
|
|
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
|
-
const clickUrl = getClickUrl(url, state.details);
|
|
132
|
+
// Preview panel takes priority over link navigation when available.
|
|
133
|
+
if (canOpenPreviewPanel) {
|
|
134
|
+
var _extractSmartLinkEmbe;
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
openPreviewPanel({
|
|
138
|
+
url,
|
|
139
|
+
ari,
|
|
140
|
+
name,
|
|
141
|
+
iconUrl: getObjectIconUrl(state.details),
|
|
142
|
+
panelData: {
|
|
143
|
+
embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(state.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
147
|
+
attributes: {
|
|
148
|
+
clickOutcome: 'previewPanel'
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
147
153
|
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
// For FlexibleCard, read target from the clicked anchor element (e.g. _blank for links
|
|
155
|
+
// rendered with explicit target). For classic cards, default to _self
|
|
156
|
+
const {
|
|
157
|
+
target: anchorTarget
|
|
158
|
+
} = getAnchorAttributesFromEvent(event);
|
|
159
|
+
const 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
|
+
const preferredUrl = getClickUrl(url, state.details);
|
|
163
|
+
const 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 ? void 0 : onClick(event);
|
|
167
|
+
|
|
168
|
+
// Check if the event is prevented via onClick callback
|
|
169
|
+
const 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
|
+
const shouldOpenLink = isFlexibleUi || !onClick;
|
|
176
|
+
const 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
|
|
194
|
+
}) && !isDisablePreviewPanel) {
|
|
195
|
+
var _extractSmartLinkEmbe2;
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
event.stopPropagation();
|
|
198
|
+
openPreviewPanel({
|
|
199
|
+
url,
|
|
200
|
+
ari,
|
|
201
|
+
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
|
+
const 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
|
+
const 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(() => {
|
|
@@ -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)}
|
package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -9,18 +9,13 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
9
9
|
import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|
|
11
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
|
-
import { ActionName } from '../../../../../../constants';
|
|
13
|
-
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
14
12
|
import { getPrimitivesInlineSpaceBySize } from '../../../utils';
|
|
15
13
|
import ActionIcon from '../action-icon';
|
|
16
14
|
const styles = {
|
|
17
15
|
button: "_bfhksm61 _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66 _1bsb1osq _1ah31i6y _irr31dpa _1di6fcek",
|
|
18
|
-
pillButton: "_2rko1qi0 _189ee4h9 _1dqonqa1 _1h6d1l7x _kqswh2mm _bfhksm61 _u5f3u2gc _19bvv77o _1bsb1osq _1ah31i6y _irr31dpa _1di6fcek",
|
|
19
16
|
content: "_11c8wadc _syazi7uo",
|
|
20
|
-
pillContent: "_11c8wadc _syazi7uo _o5721q9c",
|
|
21
17
|
spinner: "_1bsb1tcg _4t3i1tcg _1e0c116y _4cvr1h6o _1bah1h6o"
|
|
22
18
|
};
|
|
23
|
-
const pillIconWrapperStyles = null;
|
|
24
19
|
const ActionButton = ({
|
|
25
20
|
content,
|
|
26
21
|
icon: iconOption,
|
|
@@ -34,7 +29,6 @@ const ActionButton = ({
|
|
|
34
29
|
style,
|
|
35
30
|
ariaLabel
|
|
36
31
|
}) => {
|
|
37
|
-
var _flexibleUiContext$ac;
|
|
38
32
|
const space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : getPrimitivesInlineSpaceBySize(size);
|
|
39
33
|
const onClick = useCallback(() => {
|
|
40
34
|
if (!isDisabled && !isLoading && onClickCallback) {
|
|
@@ -43,20 +37,7 @@ const ActionButton = ({
|
|
|
43
37
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
44
38
|
const is3pExperimentEnabled =
|
|
45
39
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
46
|
-
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true)
|
|
47
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
48
|
-
fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* NOTE: We only apply the pill variant when there's text label
|
|
52
|
-
* (textual `content`). Icon-only stack-item buttons (e.g. the link/expand
|
|
53
|
-
* icons in the hover card footer) are also rendered with `as="stack-item"`
|
|
54
|
-
* but pass `content=""` and should keep their original borderless styling.
|
|
55
|
-
*/
|
|
56
|
-
const hasTextualContent = typeof content === 'string' ? content.trim().length > 0 : Boolean(content);
|
|
57
|
-
const flexibleUiContext = useFlexibleUiContext();
|
|
58
|
-
const isInRovoActionStack = !!(flexibleUiContext !== null && flexibleUiContext !== void 0 && (_flexibleUiContext$ac = flexibleUiContext.actions) !== null && _flexibleUiContext$ac !== void 0 && _flexibleUiContext$ac[ActionName.RovoChatAction]);
|
|
59
|
-
const isInlineActionNudgeExperiment = hasTextualContent && isInRovoActionStack && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
40
|
+
fg('platform_sl_3p_auth_rovo_action_kill_switch') && expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true);
|
|
60
41
|
const icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
61
42
|
icon: is3pExperimentEnabled ? /*#__PURE__*/React.createElement(Box, {
|
|
62
43
|
xcss: styles.spinner
|
|
@@ -68,23 +49,21 @@ const ActionButton = ({
|
|
|
68
49
|
})
|
|
69
50
|
}) : iconOption;
|
|
70
51
|
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
71
|
-
xcss: cx(
|
|
52
|
+
xcss: cx(styles.button)
|
|
72
53
|
}, tooltipProps, {
|
|
73
54
|
onClick: onClick,
|
|
74
55
|
testId: testId
|
|
75
56
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
76
57
|
,
|
|
77
58
|
style: style
|
|
78
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
59
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
79
60
|
'aria-label': ariaLabel
|
|
80
61
|
} : {}), /*#__PURE__*/React.createElement(Inline, {
|
|
81
62
|
alignBlock: "center",
|
|
82
|
-
grow:
|
|
83
|
-
space:
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
}, icon) : icon, /*#__PURE__*/React.createElement(Box, {
|
|
87
|
-
xcss: cx(isInlineActionNudgeExperiment ? styles.pillContent : styles.content)
|
|
63
|
+
grow: "fill",
|
|
64
|
+
space: space
|
|
65
|
+
}, icon, /*#__PURE__*/React.createElement(Box, {
|
|
66
|
+
xcss: cx(styles.content)
|
|
88
67
|
}, content)));
|
|
89
68
|
};
|
|
90
69
|
export default ActionButton;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import { ActionName } from '../../../../../../constants';
|
|
7
|
-
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
8
4
|
import ActionButton from './action-button';
|
|
9
5
|
const ActionStackItem = ({
|
|
10
6
|
content,
|
|
@@ -14,17 +10,12 @@ const ActionStackItem = ({
|
|
|
14
10
|
hideTooltip,
|
|
15
11
|
...props
|
|
16
12
|
}) => {
|
|
17
|
-
var _flexibleUiContext$ac;
|
|
18
|
-
const flexibleUiContext = useFlexibleUiContext();
|
|
19
|
-
const isRovoAction = !!(flexibleUiContext !== null && flexibleUiContext !== void 0 && (_flexibleUiContext$ac = flexibleUiContext.actions) !== null && _flexibleUiContext$ac !== void 0 && _flexibleUiContext$ac[ActionName.RovoChatAction]);
|
|
20
|
-
const isRovoPillVariant = isRovoAction && fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
21
13
|
return hideTooltip ? /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
|
|
22
14
|
content: content
|
|
23
15
|
})) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
16
|
content: tooltipMessage || content,
|
|
25
17
|
onHide: tooltipOnHide,
|
|
26
|
-
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
27
|
-
position: isRovoPillVariant ? 'right' : undefined
|
|
18
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
28
19
|
}, tooltipProps => /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
|
|
29
20
|
content: content,
|
|
30
21
|
tooltipProps: tooltipProps
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -4,7 +4,6 @@ import { FormattedMessage } from 'react-intl';
|
|
|
4
4
|
import RovoIcon from '@atlaskit/icon-lab/core/rovo';
|
|
5
5
|
import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
7
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { messages } from '../../../../../messages';
|
|
10
9
|
import { useBlockCardRovoActionExperimentNoExposure } from '../../../../../state/hooks/use-block-card-rovo-action-experiment';
|
|
@@ -45,7 +44,7 @@ export function AISummariseAction({
|
|
|
45
44
|
spacing: "spacious",
|
|
46
45
|
color: "currentColor",
|
|
47
46
|
label: "Summarise with AI"
|
|
48
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled
|
|
47
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
|
|
49
48
|
size: props.iconSize
|
|
50
49
|
} : {})),
|
|
51
50
|
onClick: handleActionClick,
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { di } from 'react-magnetic-di';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
5
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
7
6
|
import { AISummariseAction } from './ai-summarise-action';
|
|
8
7
|
import { CopySummaryAction, CopySummaryActionNew } from './copy-summary-action';
|
|
@@ -22,7 +21,7 @@ export const AISummaryActionComponent = props => {
|
|
|
22
21
|
useEffect(() => {
|
|
23
22
|
onLoadingChange === null || onLoadingChange === void 0 ? void 0 : onLoadingChange(status === 'loading');
|
|
24
23
|
}, [onLoadingChange, status]);
|
|
25
|
-
return status === 'done' ? fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
24
|
+
return status === 'done' ? fg('platform_sl_3p_auth_rovo_action_kill_switch') ? /*#__PURE__*/React.createElement(CopySummaryActionNew, _extends({}, props, {
|
|
26
25
|
summary: content,
|
|
27
26
|
testId: testId
|
|
28
27
|
})) : /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
@@ -4,7 +4,6 @@ import { FormattedMessage, useIntl } from 'react-intl';
|
|
|
4
4
|
import AutomationIcon from '@atlaskit/icon/core/automation';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
8
7
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { ActionName } from '../../../../../constants';
|
|
10
9
|
import { messages } from '../../../../../messages';
|
|
@@ -79,7 +78,7 @@ const AutomationAction = props => {
|
|
|
79
78
|
spacing: "spacious",
|
|
80
79
|
color: "currentColor",
|
|
81
80
|
label: automationActionIconLabel
|
|
82
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled
|
|
81
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
|
|
83
82
|
size: props.iconSize
|
|
84
83
|
} : {})),
|
|
85
84
|
testId: "smart-action-automation-action",
|
|
@@ -3,7 +3,6 @@ import React, { useCallback, useState } from 'react';
|
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
6
|
import { ActionName } from '../../../../../constants';
|
|
8
7
|
import { messages } from '../../../../../messages';
|
|
9
8
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -39,7 +38,7 @@ const CopyLinkAction = ({
|
|
|
39
38
|
color: "currentColor",
|
|
40
39
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
|
|
41
40
|
spacing: "spacious"
|
|
42
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled
|
|
41
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
|
|
43
42
|
size: props.iconSize
|
|
44
43
|
} : {})),
|
|
45
44
|
onClick: onClick,
|
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
4
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
6
|
import { ActionName } from '../../../../../constants';
|
|
8
7
|
import { messages } from '../../../../../messages';
|
|
9
8
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -70,7 +69,7 @@ const FollowAction = props => {
|
|
|
70
69
|
};
|
|
71
70
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
72
71
|
content: /*#__PURE__*/React.createElement(FormattedMessage, label)
|
|
73
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
72
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
74
73
|
ariaLabel: intl.formatMessage(label)
|
|
75
74
|
} : {}, {
|
|
76
75
|
icon: followIcon,
|
|
@@ -5,7 +5,6 @@ import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
|
5
5
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
8
|
import { ActionName } from '../../../../../constants';
|
|
10
9
|
import { messages } from '../../../../../messages';
|
|
11
10
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -37,7 +36,7 @@ const PreviewAction = ({
|
|
|
37
36
|
color: "currentColor",
|
|
38
37
|
spacing: "spacious",
|
|
39
38
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
|
|
40
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled
|
|
39
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
|
|
41
40
|
size: props.iconSize
|
|
42
41
|
} : {}));
|
|
43
42
|
}
|
|
@@ -45,7 +44,7 @@ const PreviewAction = ({
|
|
|
45
44
|
color: "currentColor",
|
|
46
45
|
spacing: "spacious",
|
|
47
46
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
|
|
48
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled
|
|
47
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || isRovoBlockCardExperimentEnabled ? {
|
|
49
48
|
size: props.iconSize
|
|
50
49
|
} : {}));
|
|
51
50
|
}, [hasPreviewPanel, props.iconSize, isRovoBlockCardExperimentEnabled]);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
4
|
import { ActionName } from '../../../../../constants';
|
|
6
5
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
7
6
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
@@ -9,9 +8,6 @@ import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
|
9
8
|
import { getPromptAction, RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
|
|
10
9
|
import Action from '../action';
|
|
11
10
|
const GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
|
|
12
|
-
const GENERIC_3P_PROMPTS = [
|
|
13
|
-
// For rovogrowth-640-inline-action-nudge-exp only
|
|
14
|
-
RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT, RovoChatPromptKey.SUMMARIZE_THIS_FOR_ME, RovoChatPromptKey.ASK_A_SPECIFIC_QUESTION];
|
|
15
11
|
const DEFAULT_PROMPTS = GOOGLE_PROMPTS;
|
|
16
12
|
const RovoChatAction = ({
|
|
17
13
|
onClick: onClickCallback,
|
|
@@ -31,9 +27,6 @@ const RovoChatAction = ({
|
|
|
31
27
|
if (prompts) {
|
|
32
28
|
return prompts;
|
|
33
29
|
}
|
|
34
|
-
if (expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true)) {
|
|
35
|
-
return GENERIC_3P_PROMPTS;
|
|
36
|
-
}
|
|
37
30
|
return DEFAULT_PROMPTS;
|
|
38
31
|
}, [prompts]);
|
|
39
32
|
const invoke = useInvokeClientAction({});
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { lazy, useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
6
5
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
7
6
|
import { messages } from '../../../../../messages';
|
|
8
7
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -35,10 +34,10 @@ const ViewRelatedLinksAction = ({
|
|
|
35
34
|
}, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
|
|
36
35
|
return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
37
36
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
38
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
37
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
39
38
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_links)
|
|
40
39
|
} : {}, {
|
|
41
|
-
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
42
41
|
iconSize: props.iconSize
|
|
43
42
|
} : {}),
|
|
44
43
|
onClick: onClick,
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
._zulpu2gc{gap:var(--ds-space-100,8px)}._16jlkb7n{flex-grow:1}
|
|
1
|
+
._16jlkb7n{flex-grow:1}
|
|
3
2
|
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
4
3
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
5
|
-
._1bsb1osq{width:100%}
|
|
6
|
-
._1e0c11p5{display:grid}
|
|
7
4
|
._1e0c1txw{display:flex}
|
|
8
5
|
._2hwxc10g{margin-right:calc(var(--container-gap-right)*-1)}
|
|
9
6
|
._2lx21bp4{flex-direction:column}
|
|
10
|
-
._vchhusvi{box-sizing:border-box}
|
|
11
|
-
._yv0e1ris{grid-template-columns:max-content}
|
|
7
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -5,15 +5,11 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
8
|
import { ActionName, SmartLinkSize } from '../../../../../constants';
|
|
10
9
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
11
10
|
import * as Actions from '../../actions';
|
|
12
11
|
import { ActionFooter } from './action-footer';
|
|
13
|
-
import AskRovoSectionHeader from './ask-rovo-section-header';
|
|
14
12
|
const ignoreContainerPaddingStyles = null;
|
|
15
|
-
const inlineActionNudgePillWrapperStyles = null;
|
|
16
|
-
const inlineActionNudgeColumnStyles = null;
|
|
17
13
|
const DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
18
14
|
const sort = (a, b) => {
|
|
19
15
|
let idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
@@ -56,10 +52,7 @@ const ActionBlock = ({
|
|
|
56
52
|
var _context$actions;
|
|
57
53
|
const context = useFlexibleUiContext();
|
|
58
54
|
const ui = useFlexibleUiOptionContext();
|
|
59
|
-
const isRovoChatActionAvailable =
|
|
60
|
-
|
|
61
|
-
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
62
|
-
const isInlineActionNudgeExperiment = fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true);
|
|
55
|
+
const isRovoChatActionAvailable = isAny3pRovoActionsExperimentOn && fg('platform_sl_3p_auth_rovo_action_kill_switch') ? (context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.RovoChatAction]) !== undefined : undefined;
|
|
63
56
|
const [message, setMessage] = useState();
|
|
64
57
|
const [isLoading, setIsLoading] = useState(false);
|
|
65
58
|
const onLoadingChange = useCallback(isLoading => {
|
|
@@ -77,7 +70,7 @@ const ActionBlock = ({
|
|
|
77
70
|
if (!(context !== null && context !== void 0 && context.actions)) {
|
|
78
71
|
return;
|
|
79
72
|
}
|
|
80
|
-
const arr = fg('platform_sl_3p_auth_rovo_action_kill_switch')
|
|
73
|
+
const arr = fg('platform_sl_3p_auth_rovo_action_kill_switch') ? isRovoChatActionAvailable ? [ActionName.RovoChatAction] : Object.keys(context.actions).filter(name => name !== ActionName.RovoChatAction) : Object.keys(context.actions);
|
|
81
74
|
arr.sort(sort);
|
|
82
75
|
const renderAction = name => {
|
|
83
76
|
const Action = name in Actions ? Actions[name] : undefined;
|
|
@@ -94,32 +87,17 @@ const ActionBlock = ({
|
|
|
94
87
|
size: size || (ui === null || ui === void 0 ? void 0 : ui.size)
|
|
95
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
96
89
|
,
|
|
97
|
-
style:
|
|
90
|
+
style: padding ? {
|
|
98
91
|
paddingInline: padding
|
|
99
92
|
} : undefined,
|
|
100
93
|
hideTooltip: isLoading
|
|
101
94
|
});
|
|
102
95
|
};
|
|
103
96
|
return arr.map(name => renderAction(name));
|
|
104
|
-
}, [context === null || context === void 0 ? void 0 : context.actions, isRovoChatActionAvailable, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, onClick
|
|
105
|
-
const showRovoSectionHeader = isInlineActionNudgeExperiment && isRovoChatActionAvailable;
|
|
97
|
+
}, [context === null || context === void 0 ? void 0 : context.actions, isRovoChatActionAvailable, spaceInline, onError, onLoadingChange, size, ui === null || ui === void 0 ? void 0 : ui.size, padding, isLoading, onClick]);
|
|
106
98
|
if (!actions) {
|
|
107
99
|
return null;
|
|
108
100
|
}
|
|
109
|
-
if (isInlineActionNudgeExperiment && isRovoChatActionAvailable) {
|
|
110
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
ref: blockRef,
|
|
112
|
-
"data-testid": testId,
|
|
113
|
-
className: ax(["_1e0c1txw _2lx21bp4 _vchhusvi _1bsb1osq"])
|
|
114
|
-
}, showRovoSectionHeader && /*#__PURE__*/React.createElement(AskRovoSectionHeader, {
|
|
115
|
-
testId: testId ? `${testId}-rovo-section-header` : undefined
|
|
116
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: ax(["_zulpu2gc _1e0c11p5 _yv0e1ris"])
|
|
118
|
-
}, actions), /*#__PURE__*/React.createElement(ActionFooter, {
|
|
119
|
-
message: message,
|
|
120
|
-
testId: testId
|
|
121
|
-
}));
|
|
122
|
-
}
|
|
123
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
102
|
ref: blockRef,
|
|
125
103
|
"data-testid": testId
|
package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
11
11
|
._18u01wug{margin-left:auto}
|
|
12
12
|
._19p4ze3t *{padding-right:var(--ds-space-0,0)}
|
|
13
|
-
._19pkutpp{margin-top:var(--ds-space-150,9pt)}
|
|
14
13
|
._1bah1y6m{justify-content:flex-start}
|
|
15
14
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
16
15
|
._1e0c1txw{display:flex}
|
|
@@ -4,8 +4,6 @@ import "./index.compiled.css";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
7
|
import { ActionName } from '../../../../../constants';
|
|
10
8
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
11
9
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -18,7 +16,6 @@ import Block from '../block';
|
|
|
18
16
|
*/
|
|
19
17
|
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
20
18
|
const ignoreContainerMarginStyles = null;
|
|
21
|
-
const inlineActionNudgeFooterMarginStyles = null;
|
|
22
19
|
const elevatedFooterStyles = null;
|
|
23
20
|
const providerStyles = null;
|
|
24
21
|
const actionsStyles = null;
|
|
@@ -60,7 +57,7 @@ const ResolvedHoverCardFooterBlock = ({
|
|
|
60
57
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
61
58
|
size: size,
|
|
62
59
|
testId: `${testId}-resolved-view`,
|
|
63
|
-
className: ax(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok"
|
|
60
|
+
className: ax(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok"])
|
|
64
61
|
}), !hideProvider && /*#__PURE__*/React.createElement("div", {
|
|
65
62
|
className: ax(["_4t3i1ejb _1e0c1txw _4cvr1h6o _1bah1y6m _vchhusvi _16jlkb7n"])
|
|
66
63
|
}, /*#__PURE__*/React.createElement(Provider, {
|