@atlaskit/smart-card 44.3.24 → 44.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/analytics.spec.yaml +5 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +2 -2
- 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 +2 -2
- package/dist/cjs/common/analytics/generated/create-event-payload.js +7 -7
- package/dist/cjs/common/analytics/generated/use-analytics-events.js +1 -1
- package/dist/cjs/messages.js +59 -49
- package/dist/cjs/preloadLazyCardWithUrlContent.js +15 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +17 -11
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +10 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +10 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +41 -26
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.compiled.css +4 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +29 -11
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +25 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +4 -1
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-badge-element/index.js +6 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +2 -2
- 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 +2 -2
- package/dist/es2019/common/analytics/generated/create-event-payload.js +6 -6
- package/dist/es2019/common/analytics/generated/use-analytics-events.js +2 -2
- package/dist/es2019/messages.js +59 -49
- package/dist/es2019/preloadLazyCardWithUrlContent.js +2 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +29 -21
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +12 -3
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +21 -10
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +41 -28
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.compiled.css +4 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +29 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +22 -8
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js +5 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/vrblock-card-resolved-rovo-actions--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-with-generic-3p-rovo-chat-action--default.png +2 -2
- 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 +2 -2
- package/dist/esm/common/analytics/generated/create-event-payload.js +7 -7
- package/dist/esm/common/analytics/generated/use-analytics-events.js +1 -1
- package/dist/esm/messages.js +59 -49
- package/dist/esm/preloadLazyCardWithUrlContent.js +4 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +18 -12
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.compiled.css +4 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +12 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +0 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +10 -1
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +42 -27
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.compiled.css +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.compiled.css +4 -3
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +30 -12
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.compiled.css +3 -1
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +26 -8
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +4 -1
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-badge-element/index.js +6 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +116 -114
- package/dist/types/common/analytics/generated/create-event-payload.d.ts +1 -1
- package/dist/types/common/analytics/generated/use-analytics-events.d.ts +4 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/preloadLazyCardWithUrlContent.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +6 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +7 -2
- package/dist/types/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +5 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +116 -114
- package/dist/types-ts4.5/common/analytics/generated/create-event-payload.d.ts +1 -1
- package/dist/types-ts4.5/common/analytics/generated/use-analytics-events.d.ts +4 -5
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/preloadLazyCardWithUrlContent.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +6 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-group/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +7 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +5 -0
- package/package.json +5 -4
- package/preload-lazy-card-with-url-content/package.json +17 -0
|
@@ -1,6 +1,10 @@
|
|
|
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';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
+
import { ActionName } from '../../../../../../constants';
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
4
8
|
import ActionButton from './action-button';
|
|
5
9
|
const ActionStackItem = ({
|
|
6
10
|
content,
|
|
@@ -9,14 +13,21 @@ const ActionStackItem = ({
|
|
|
9
13
|
hideTooltipOnMouseDown,
|
|
10
14
|
hideTooltip,
|
|
11
15
|
...props
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
}) => {
|
|
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
|
+
return hideTooltip ? /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
|
|
22
|
+
content: content
|
|
23
|
+
})) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
|
+
content: tooltipMessage || content,
|
|
25
|
+
onHide: tooltipOnHide,
|
|
26
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown,
|
|
27
|
+
position: isRovoPillVariant ? 'right' : undefined
|
|
28
|
+
}, tooltipProps => /*#__PURE__*/React.createElement(ActionButton, _extends({}, props, {
|
|
29
|
+
content: content,
|
|
30
|
+
tooltipProps: tooltipProps
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
22
33
|
export default ActionStackItem;
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -40,7 +40,7 @@ export function AISummariseAction({
|
|
|
40
40
|
spacing: "spacious",
|
|
41
41
|
color: "currentColor",
|
|
42
42
|
label: "Summarise with AI"
|
|
43
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
43
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
44
44
|
size: props.iconSize
|
|
45
45
|
} : {})),
|
|
46
46
|
onClick: handleActionClick,
|
|
@@ -76,7 +76,7 @@ const AutomationAction = props => {
|
|
|
76
76
|
spacing: "spacious",
|
|
77
77
|
color: "currentColor",
|
|
78
78
|
label: automationActionIconLabel
|
|
79
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
79
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
80
80
|
size: props.iconSize
|
|
81
81
|
} : {})),
|
|
82
82
|
testId: "smart-action-automation-action",
|
|
@@ -36,7 +36,7 @@ const CopyLinkAction = ({
|
|
|
36
36
|
color: "currentColor",
|
|
37
37
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
|
|
38
38
|
spacing: "spacious"
|
|
39
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
39
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
40
40
|
size: props.iconSize
|
|
41
41
|
} : {})),
|
|
42
42
|
onClick: onClick,
|
|
@@ -34,7 +34,7 @@ const PreviewAction = ({
|
|
|
34
34
|
color: "currentColor",
|
|
35
35
|
spacing: "spacious",
|
|
36
36
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
|
|
37
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
37
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
38
38
|
size: props.iconSize
|
|
39
39
|
} : {}));
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@ const PreviewAction = ({
|
|
|
42
42
|
color: "currentColor",
|
|
43
43
|
spacing: "spacious",
|
|
44
44
|
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
|
|
45
|
-
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
45
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') || fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? {
|
|
46
46
|
size: props.iconSize
|
|
47
47
|
} : {}));
|
|
48
48
|
}, [hasPreviewPanel, props.iconSize]);
|
|
@@ -1,12 +1,14 @@
|
|
|
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 AiGenerativeTextIcon from '@atlaskit/icon-lab/core/ai-generative-text';
|
|
5
4
|
import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
|
|
5
|
+
import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
6
6
|
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
7
7
|
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
8
|
+
import { RovoIcon } from '@atlaskit/logo';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
|
-
import { ActionName } from '../../../../../constants';
|
|
11
|
+
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
10
12
|
import { messages } from '../../../../../messages';
|
|
11
13
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
12
14
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
@@ -54,7 +56,7 @@ const getContext = (intl, product) => {
|
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
|
-
const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
59
|
+
const getPromptAction = (promptKey, intl, url = '', product, iconSize, cardAppearance) => {
|
|
58
60
|
var _getContext;
|
|
59
61
|
const {
|
|
60
62
|
contextLong,
|
|
@@ -128,7 +130,10 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
128
130
|
ignoreTag: true
|
|
129
131
|
});
|
|
130
132
|
return {
|
|
131
|
-
icon: /*#__PURE__*/React.createElement(
|
|
133
|
+
icon: cardAppearance === CardDisplay.Block && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
134
|
+
label: label_summarize,
|
|
135
|
+
size: iconSize
|
|
136
|
+
}) : /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
132
137
|
content: label_summarize,
|
|
133
138
|
tooltipMessage: label_summarize,
|
|
134
139
|
data: {
|
|
@@ -162,9 +167,9 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
169
|
};
|
|
165
|
-
case RovoChatPromptKey.
|
|
166
|
-
const
|
|
167
|
-
const
|
|
170
|
+
case RovoChatPromptKey.HIGHLIGHT_RELEVANT_CONTENT:
|
|
171
|
+
const label_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_button_highlight_relevant_content);
|
|
172
|
+
const html_highlight_relevant_content = intl.formatMessage(messages.rovo_prompt_message_highlight_relevant_content, {
|
|
168
173
|
context: contextLong,
|
|
169
174
|
url
|
|
170
175
|
}, {
|
|
@@ -172,12 +177,12 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
172
177
|
});
|
|
173
178
|
return {
|
|
174
179
|
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
175
|
-
content:
|
|
176
|
-
tooltipMessage:
|
|
180
|
+
content: label_highlight_relevant_content,
|
|
181
|
+
tooltipMessage: label_highlight_relevant_content,
|
|
177
182
|
data: {
|
|
178
|
-
name:
|
|
183
|
+
name: label_highlight_relevant_content,
|
|
179
184
|
dialogues: [],
|
|
180
|
-
prompt: htmlToAdf(
|
|
185
|
+
prompt: htmlToAdf(html_highlight_relevant_content),
|
|
181
186
|
mode: {
|
|
182
187
|
fastModeEnabled: true
|
|
183
188
|
}
|
|
@@ -189,7 +194,11 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
189
194
|
url
|
|
190
195
|
});
|
|
191
196
|
return {
|
|
192
|
-
icon: /*#__PURE__*/React.createElement(
|
|
197
|
+
icon: cardAppearance === CardDisplay.Block && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? /*#__PURE__*/React.createElement(RovoIcon, {
|
|
198
|
+
label: label_ask_rovo_anything,
|
|
199
|
+
size: 'xxsmall',
|
|
200
|
+
shouldUseHexLogo: true
|
|
201
|
+
}) : /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
193
202
|
content: label_ask_rovo_anything,
|
|
194
203
|
tooltipMessage: label_ask_rovo_anything,
|
|
195
204
|
data: {
|
|
@@ -219,24 +228,25 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
219
228
|
placeholderType: 'generic'
|
|
220
229
|
}
|
|
221
230
|
};
|
|
222
|
-
case RovoChatPromptKey.
|
|
223
|
-
const
|
|
224
|
-
const
|
|
231
|
+
case RovoChatPromptKey.KEY_HIGHLIGHTS:
|
|
232
|
+
const label_key_highlights = intl.formatMessage(messages.rovo_prompt_button_key_highlights);
|
|
233
|
+
const html_key_highlights = intl.formatMessage(messages.rovo_prompt_message_key_highlights, {
|
|
225
234
|
context: contextLong,
|
|
226
235
|
url
|
|
227
236
|
}, {
|
|
228
237
|
ignoreTag: true
|
|
229
238
|
});
|
|
230
239
|
return {
|
|
231
|
-
icon: /*#__PURE__*/React.createElement(
|
|
232
|
-
label:
|
|
240
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
241
|
+
label: label_key_highlights,
|
|
242
|
+
size: iconSize
|
|
233
243
|
}),
|
|
234
|
-
content:
|
|
235
|
-
tooltipMessage:
|
|
244
|
+
content: label_key_highlights,
|
|
245
|
+
tooltipMessage: label_key_highlights,
|
|
236
246
|
data: {
|
|
237
|
-
name:
|
|
247
|
+
name: label_key_highlights,
|
|
238
248
|
dialogues: [],
|
|
239
|
-
prompt: htmlToAdf(
|
|
249
|
+
prompt: htmlToAdf(html_key_highlights)
|
|
240
250
|
}
|
|
241
251
|
};
|
|
242
252
|
case RovoChatPromptKey.SHOW_ME_WHATS_RELEVANT:
|
|
@@ -267,8 +277,9 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
267
277
|
ignoreTag: true
|
|
268
278
|
});
|
|
269
279
|
return {
|
|
270
|
-
icon: /*#__PURE__*/React.createElement(
|
|
271
|
-
label: label_identify_key_trends
|
|
280
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
281
|
+
label: label_identify_key_trends,
|
|
282
|
+
size: iconSize
|
|
272
283
|
}),
|
|
273
284
|
content: label_identify_key_trends,
|
|
274
285
|
tooltipMessage: label_identify_key_trends,
|
|
@@ -286,8 +297,9 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
286
297
|
ignoreTag: true
|
|
287
298
|
});
|
|
288
299
|
return {
|
|
289
|
-
icon: /*#__PURE__*/React.createElement(
|
|
290
|
-
label: label_identify_key_points
|
|
300
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
301
|
+
label: label_identify_key_points,
|
|
302
|
+
size: iconSize
|
|
291
303
|
}),
|
|
292
304
|
content: label_identify_key_points,
|
|
293
305
|
tooltipMessage: label_identify_key_points,
|
|
@@ -305,8 +317,9 @@ const getPromptAction = (promptKey, intl, url = '', product) => {
|
|
|
305
317
|
ignoreTag: true
|
|
306
318
|
});
|
|
307
319
|
return {
|
|
308
|
-
icon: /*#__PURE__*/React.createElement(
|
|
309
|
-
label: label_find_open_questions
|
|
320
|
+
icon: /*#__PURE__*/React.createElement(AiChatIcon, {
|
|
321
|
+
label: label_find_open_questions,
|
|
322
|
+
size: iconSize
|
|
310
323
|
}),
|
|
311
324
|
content: label_find_open_questions,
|
|
312
325
|
tooltipMessage: label_find_open_questions,
|
|
@@ -359,7 +372,7 @@ const RovoChatAction = ({
|
|
|
359
372
|
content,
|
|
360
373
|
tooltipMessage,
|
|
361
374
|
data: promptData
|
|
362
|
-
} = getPromptAction(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product) || {};
|
|
375
|
+
} = getPromptAction(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product, props.iconSize, props.cardAppearance) || {};
|
|
363
376
|
return promptData ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
364
377
|
content: content,
|
|
365
378
|
icon: icon,
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
._4t3it94y{height:1px}
|
|
12
12
|
._bfhk1l7x{background-color:var(--ds-border,#0b120e24)}
|
|
13
13
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
14
|
-
.
|
|
14
|
+
._otyrutpp{margin-bottom:var(--ds-space-150,9pt)}
|
|
15
15
|
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
package/dist/es2019/view/FlexibleCard/components/blocks/action-block/ask-rovo-section-header.js
CHANGED
|
@@ -22,7 +22,7 @@ const AskRovoSectionHeader = ({
|
|
|
22
22
|
const intl = useIntl();
|
|
23
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
24
|
"data-testid": testId,
|
|
25
|
-
className: ax(["_zulputpp _1e0c1txw _2lx21bp4
|
|
25
|
+
className: ax(["_zulputpp _1e0c1txw _2lx21bp4 _otyrutpp _18u0v77o _1bsb1osq _1wpz1fhb"])
|
|
26
26
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27
27
|
role: "separator",
|
|
28
28
|
"aria-orientation": "horizontal",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}._16jlkb7n{flex-grow:1}
|
|
3
3
|
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
4
4
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
5
5
|
._1bsb1osq{width:100%}
|
|
6
|
+
._1e0c11p5{display:grid}
|
|
6
7
|
._1e0c1txw{display:flex}
|
|
7
8
|
._2hwxc10g{margin-right:calc(var(--container-gap-right)*-1)}
|
|
8
9
|
._2lx21bp4{flex-direction:column}
|
|
9
|
-
.
|
|
10
|
-
.
|
|
10
|
+
._vchhusvi{box-sizing:border-box}
|
|
11
|
+
._yv0e1ris{grid-template-columns:max-content}
|
|
@@ -114,7 +114,7 @@ const ActionBlock = ({
|
|
|
114
114
|
}, showRovoSectionHeader && /*#__PURE__*/React.createElement(AskRovoSectionHeader, {
|
|
115
115
|
testId: testId ? `${testId}-rovo-section-header` : undefined
|
|
116
116
|
}), /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: ax(["
|
|
117
|
+
className: ax(["_zulpu2gc _1e0c11p5 _yv0e1ris"])
|
|
118
118
|
}, actions), /*#__PURE__*/React.createElement(ActionFooter, {
|
|
119
119
|
message: message,
|
|
120
120
|
testId: testId
|
|
@@ -14,13 +14,16 @@ import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
|
14
14
|
import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import Tooltip from '@atlaskit/tooltip';
|
|
17
|
-
import { ActionName, SmartLinkSize } from '../../../../../constants';
|
|
17
|
+
import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
|
|
18
18
|
import { messages } from '../../../../../messages';
|
|
19
19
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
20
|
+
import { RovoChatPromptKey } from '../../actions/rovo-chat-action';
|
|
20
21
|
import { sizeToButtonSpacing } from '../../utils';
|
|
21
22
|
import { filterActionItems } from '../utils';
|
|
22
23
|
import ActionGroupItem from './action-group-item';
|
|
23
24
|
const styles = null;
|
|
25
|
+
const FULL_ACTIONS_SIZE = 450;
|
|
26
|
+
const REDUCED_ACTIONS_SIZE = 360;
|
|
24
27
|
const renderActionItems = (items = [], size = SmartLinkSize.Medium, appearance, asDropDownItems, onActionItemClick) => items.map((item, idx) => /*#__PURE__*/React.createElement(ActionGroupItem, {
|
|
25
28
|
item: item,
|
|
26
29
|
key: idx,
|
|
@@ -42,7 +45,8 @@ const ActionGroup = ({
|
|
|
42
45
|
size = SmartLinkSize.Medium,
|
|
43
46
|
appearance,
|
|
44
47
|
visibleButtonsNum = 2,
|
|
45
|
-
onDropdownOpenChange
|
|
48
|
+
onDropdownOpenChange,
|
|
49
|
+
containerWidth = Infinity
|
|
46
50
|
}) => {
|
|
47
51
|
var _context$actions;
|
|
48
52
|
const context = useFlexibleUiContext();
|
|
@@ -50,7 +54,7 @@ const ActionGroup = ({
|
|
|
50
54
|
const [isOpen, setIsOpen] = useState(false);
|
|
51
55
|
const renderableActionItems = useMemo(() => filterActionItems(items, context), [context, items]);
|
|
52
56
|
const isMoreThenTwoItems = renderableActionItems.length > visibleButtonsNum;
|
|
53
|
-
const isRovoActionsEnabled = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.RovoChatAction]);
|
|
57
|
+
const isRovoActionsEnabled = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.RovoChatAction]) && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
54
58
|
const onOpenChange = useCallback(attrs => {
|
|
55
59
|
setIsOpen(attrs.isOpen);
|
|
56
60
|
if (onDropdownOpenChange) {
|
|
@@ -65,21 +69,34 @@ const ActionGroup = ({
|
|
|
65
69
|
}
|
|
66
70
|
}, [isOpen, onOpenChange]);
|
|
67
71
|
const actionButtons = useMemo(() => {
|
|
68
|
-
if (isRovoActionsEnabled
|
|
69
|
-
const rovoActions = [...renderableActionItems.slice(0, visibleButtonsNum - 1), {
|
|
70
|
-
name: ActionName.
|
|
71
|
-
|
|
72
|
+
if (isRovoActionsEnabled) {
|
|
73
|
+
const rovoActions = [...(containerWidth >= REDUCED_ACTIONS_SIZE ? renderableActionItems.slice(0, visibleButtonsNum - 1) : []), {
|
|
74
|
+
name: ActionName.RovoChatAction,
|
|
75
|
+
prompts: [RovoChatPromptKey.ASK_ROVO_ANYTHING],
|
|
76
|
+
iconSize: 'small',
|
|
77
|
+
cardAppearance: CardDisplay.Block,
|
|
78
|
+
hideContent: containerWidth < FULL_ACTIONS_SIZE && containerWidth >= REDUCED_ACTIONS_SIZE
|
|
72
79
|
}, {
|
|
73
80
|
name: ActionName.CopyLinkAction,
|
|
74
|
-
hideContent: true
|
|
81
|
+
hideContent: true,
|
|
82
|
+
iconSize: 'small'
|
|
83
|
+
}, {
|
|
84
|
+
name: ActionName.PreviewAction,
|
|
85
|
+
hideContent: true,
|
|
86
|
+
iconSize: 'small'
|
|
75
87
|
}];
|
|
76
88
|
return renderActionItems(rovoActions, size, appearance, false, onActionItemClick);
|
|
77
89
|
}
|
|
78
90
|
const actionItems = isMoreThenTwoItems ? renderableActionItems.slice(0, visibleButtonsNum - 1) : renderableActionItems;
|
|
79
91
|
return renderActionItems(actionItems, size, appearance, false, onActionItemClick);
|
|
80
|
-
}, [appearance, isMoreThenTwoItems, onActionItemClick, renderableActionItems, size, visibleButtonsNum,
|
|
92
|
+
}, [appearance, isMoreThenTwoItems, isRovoActionsEnabled, onActionItemClick, renderableActionItems, size, visibleButtonsNum, containerWidth]);
|
|
81
93
|
const moreActionDropdown = useMemo(() => {
|
|
82
|
-
|
|
94
|
+
let actionItems;
|
|
95
|
+
if (isRovoActionsEnabled && containerWidth < REDUCED_ACTIONS_SIZE) {
|
|
96
|
+
actionItems = renderableActionItems;
|
|
97
|
+
} else {
|
|
98
|
+
actionItems = isMoreThenTwoItems ? renderableActionItems.slice(visibleButtonsNum - 1) : [];
|
|
99
|
+
}
|
|
83
100
|
if (actionItems.length > 0) {
|
|
84
101
|
const spacing = sizeToButtonSpacing[size];
|
|
85
102
|
const moreIcon = /*#__PURE__*/React.createElement(MoreIcon, {
|
|
@@ -99,7 +116,7 @@ const ActionGroup = ({
|
|
|
99
116
|
testId: "action-group-more-button-tooltip",
|
|
100
117
|
tag: "span"
|
|
101
118
|
}, /*#__PURE__*/React.createElement(Button, _extends({}, props, {
|
|
102
|
-
spacing: spacing,
|
|
119
|
+
spacing: isRovoActionsEnabled && fg('platform_sl_3p_auth_rovo_block_card_kill_switch') ? size === SmartLinkSize.XLarge ? 'default' : 'compact' : spacing,
|
|
103
120
|
testId: "action-group-more-button",
|
|
104
121
|
iconBefore: moreIcon,
|
|
105
122
|
ref: triggerRef
|
|
@@ -111,7 +128,7 @@ const ActionGroup = ({
|
|
|
111
128
|
}, renderActionItems(actionItems, size, appearance, true, onActionItemClick));
|
|
112
129
|
}
|
|
113
130
|
return null;
|
|
114
|
-
}, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum,
|
|
131
|
+
}, [appearance, isMoreThenTwoItems, isOpen, isRovoActionsEnabled, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum, containerWidth]);
|
|
115
132
|
return renderableActionItems.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
116
133
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
117
134
|
className: ax(["_1e0c116y _dzc21h6o _1ilq1i6y", "actions-button-group"]),
|
|
@@ -3,9 +3,10 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import { useCallback, useMemo } from 'react';
|
|
6
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { WidthObserver } from '@atlaskit/width-detector';
|
|
9
10
|
import { ActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
10
11
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
11
12
|
import { Provider } from '../../../elements';
|
|
@@ -15,6 +16,8 @@ import ElementGroup from '../../element-group';
|
|
|
15
16
|
import { filterActionItems } from '../../utils';
|
|
16
17
|
const actionGroupStyles = null;
|
|
17
18
|
const safariStyles = null;
|
|
19
|
+
const providerStyles = null;
|
|
20
|
+
const rovoActionStyles = null;
|
|
18
21
|
const FooterBlockResolvedView = props => {
|
|
19
22
|
var _context$actions;
|
|
20
23
|
const {
|
|
@@ -22,10 +25,12 @@ const FooterBlockResolvedView = props => {
|
|
|
22
25
|
testId,
|
|
23
26
|
onActionMenuOpenChange,
|
|
24
27
|
size = SmartLinkSize.Medium,
|
|
25
|
-
hideProvider
|
|
28
|
+
hideProvider,
|
|
29
|
+
isPreviewBlockErrored
|
|
26
30
|
} = props;
|
|
27
31
|
const context = useFlexibleUiContext();
|
|
28
|
-
const isRovoSupportedFeature = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.RovoChatAction]);
|
|
32
|
+
const isRovoSupportedFeature = !!(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.RovoChatAction]) && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
33
|
+
const hasPreview = isRovoSupportedFeature && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
|
|
29
34
|
const hasActions = useMemo(() => {
|
|
30
35
|
var _filterActionItems;
|
|
31
36
|
return ((_filterActionItems = filterActionItems(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
@@ -42,22 +47,31 @@ const FooterBlockResolvedView = props => {
|
|
|
42
47
|
});
|
|
43
48
|
}
|
|
44
49
|
}, [onActionMenuOpenChange]);
|
|
50
|
+
|
|
51
|
+
// WidthObserver fires whenever the footer's available width changes.
|
|
52
|
+
const [containerWidth, setContainerWidth] = useState(undefined);
|
|
45
53
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
46
54
|
testId: `${testId}-resolved-view`
|
|
47
55
|
}), !hideProvider && /*#__PURE__*/React.createElement(Provider, {
|
|
48
56
|
appearance: "subtle",
|
|
49
|
-
testId: `${testId}-provider
|
|
57
|
+
testId: `${testId}-provider`,
|
|
58
|
+
hideLabel: hasPreview,
|
|
59
|
+
className: ax([isRovoSupportedFeature && "_1wpz1h6o"])
|
|
50
60
|
}), actions && hasActions ? /*#__PURE__*/React.createElement(ElementGroup, {
|
|
51
61
|
testId: "smart-element-group-actions",
|
|
52
62
|
align: SmartLinkAlignment.Right,
|
|
53
63
|
direction: SmartLinkDirection.Horizontal,
|
|
54
64
|
width: SmartLinkWidth.Flexible,
|
|
55
|
-
className: ax([size === SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq"])
|
|
56
|
-
}, /*#__PURE__*/React.createElement(
|
|
65
|
+
className: ax([size === SmartLinkSize.XLarge && "_c71lxy5q", safari && "_4t3i1osq", isRovoSupportedFeature && "_kqswh2mm"])
|
|
66
|
+
}, isRovoSupportedFeature && /*#__PURE__*/React.createElement(WidthObserver, {
|
|
67
|
+
setWidth: setContainerWidth,
|
|
68
|
+
offscreen: true
|
|
69
|
+
}), /*#__PURE__*/React.createElement(ActionGroup, {
|
|
57
70
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
58
71
|
items: actions,
|
|
59
|
-
appearance: isRovoSupportedFeature
|
|
60
|
-
size: size
|
|
72
|
+
appearance: isRovoSupportedFeature ? 'subtle' : 'default',
|
|
73
|
+
size: isRovoSupportedFeature ? SmartLinkSize.Small : size,
|
|
74
|
+
containerWidth: isRovoSupportedFeature ? containerWidth : undefined
|
|
61
75
|
})) : null);
|
|
62
76
|
};
|
|
63
77
|
export default FooterBlockResolvedView;
|
package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.compiled.css
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
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)}
|
|
13
14
|
._1bah1y6m{justify-content:flex-start}
|
|
14
15
|
._1bsb129b{width:calc(100% + var(--container-gap-left) + var(--container-gap-right))}
|
|
15
16
|
._1e0c1txw{display:flex}
|
|
@@ -4,6 +4,8 @@ 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';
|
|
7
9
|
import { ActionName } from '../../../../../constants';
|
|
8
10
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
9
11
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -16,6 +18,7 @@ import Block from '../block';
|
|
|
16
18
|
*/
|
|
17
19
|
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
18
20
|
const ignoreContainerMarginStyles = null;
|
|
21
|
+
const inlineActionNudgeFooterMarginStyles = null;
|
|
19
22
|
const elevatedFooterStyles = null;
|
|
20
23
|
const providerStyles = null;
|
|
21
24
|
const actionsStyles = null;
|
|
@@ -57,7 +60,7 @@ const ResolvedHoverCardFooterBlock = ({
|
|
|
57
60
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
58
61
|
size: size,
|
|
59
62
|
testId: `${testId}-resolved-view`,
|
|
60
|
-
className: ax(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok"])
|
|
63
|
+
className: ax(["_18zrpxbi _1rjcutpp _vchhusvi _1bsb129b _18u01ivi _2hwxc10g _otyr1ya9 _4t3ioahv", "_zulpu2gc _x3doj0fz _bfhkhfxm _mrkb1mok _1o0z1mok", fg('rovogrowth-640-inline-action-nudge-fg') && expValEqualsNoExposure('rovogrowth-640-inline-action-nudge-exp', 'isEnabled', true) && "_19pkutpp"])
|
|
61
64
|
}), !hideProvider && /*#__PURE__*/React.createElement("div", {
|
|
62
65
|
className: ax(["_4t3i1ejb _1e0c1txw _4cvr1h6o _1bah1y6m _vchhusvi _16jlkb7n"])
|
|
63
66
|
}, /*#__PURE__*/React.createElement(Provider, {
|
|
@@ -14,7 +14,7 @@ const messages = defineMessages({
|
|
|
14
14
|
imageAltText: {
|
|
15
15
|
id: 'smart-link.image-icon.altText',
|
|
16
16
|
defaultMessage: 'Link Icon',
|
|
17
|
-
description: '
|
|
17
|
+
description: 'Alternative text for the link icon image displayed on a flexible smart link card, used by screen readers and when the image cannot be rendered.'
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
const ImageIcon = ({
|
package/dist/es2019/view/FlexibleCard/components/elements/common/base-badge-element/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
8
|
import { IconType } from '../../../../../../constants';
|
|
8
9
|
import { messages } from '../../../../../../messages';
|
|
@@ -82,7 +83,8 @@ const BaseBadgeRefreshNew = /*#__PURE__*/forwardRef(({
|
|
|
82
83
|
name,
|
|
83
84
|
testId = 'smart-element-badge',
|
|
84
85
|
url,
|
|
85
|
-
color
|
|
86
|
+
color,
|
|
87
|
+
hideLabel = false
|
|
86
88
|
}, ref) => {
|
|
87
89
|
const ui = useFlexibleUiOptionContext();
|
|
88
90
|
const formattedMessageOrLabel = getFormattedMessageFromIcon(icon) || label;
|
|
@@ -90,6 +92,7 @@ const BaseBadgeRefreshNew = /*#__PURE__*/forwardRef(({
|
|
|
90
92
|
if (!formattedMessageOrLabel || !badgeIcon) {
|
|
91
93
|
return null;
|
|
92
94
|
}
|
|
95
|
+
const shouldHideLabel = hideLabel && fg('platform_sl_3p_auth_rovo_block_card_kill_switch');
|
|
93
96
|
return /*#__PURE__*/React.createElement("span", {
|
|
94
97
|
"data-smart-element": name,
|
|
95
98
|
"data-smart-element-badge": true,
|
|
@@ -102,7 +105,7 @@ const BaseBadgeRefreshNew = /*#__PURE__*/forwardRef(({
|
|
|
102
105
|
}, !hideIcon && /*#__PURE__*/React.createElement(Box, {
|
|
103
106
|
as: "span",
|
|
104
107
|
xcss: styles.icon
|
|
105
|
-
}, badgeIcon), /*#__PURE__*/React.createElement(Box, {
|
|
108
|
+
}, badgeIcon), !shouldHideLabel && /*#__PURE__*/React.createElement(Box, {
|
|
106
109
|
as: "span",
|
|
107
110
|
testId: `${testId}-label`,
|
|
108
111
|
xcss: styles.text
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "44.
|
|
15
|
+
packageVersion: "44.4.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:58befa1fbc873aa0672a8e0a3cebe1903406324b6b86d9e1e331adf2237ca1c1
|
|
3
|
+
size 36884
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:3653660b252b46503f72959451e6cc6b9b34c5e6fb2aef765e8c59f1f7ff14e3
|
|
3
|
+
size 29363
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
*
|
|
5
5
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
6
6
|
*
|
|
7
|
-
* @codegen <<SignedSource::
|
|
7
|
+
* @codegen <<SignedSource::268e746266cde1271e40a794eb774cf3>>
|
|
8
8
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -13,12 +13,12 @@ var createEventPayload = function createEventPayload(eventKey) {
|
|
|
13
13
|
_ref[_key - 1] = arguments[_key];
|
|
14
14
|
}
|
|
15
15
|
var attributes = _ref[0];
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
eventType =
|
|
19
|
-
actionSubject =
|
|
20
|
-
action =
|
|
21
|
-
actionSubjectId =
|
|
16
|
+
var _ref2 = eventKey.split('.'),
|
|
17
|
+
_ref3 = _slicedToArray(_ref2, 4),
|
|
18
|
+
eventType = _ref3[0],
|
|
19
|
+
actionSubject = _ref3[1],
|
|
20
|
+
action = _ref3[2],
|
|
21
|
+
actionSubjectId = _ref3[3];
|
|
22
22
|
if (eventType === 'screen') {
|
|
23
23
|
return {
|
|
24
24
|
eventType: eventType,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::ac0d75fa9e8d43c947e88f47ba1267aa>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback } from 'react';
|