@atlaskit/smart-card 43.31.6 → 43.31.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-better-hovercard-killswitch-enabled--default.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-rovo-chat-action--default.png +0 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +0 -0
- package/dist/cjs/messages.js +14 -39
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +9 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -2
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +5 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +50 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +6 -38
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +14 -33
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +43 -37
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/common/base-icon-element/index.js +43 -5
- package/dist/cjs/view/HoverCard/components/ContentContainer.compiled.css +1 -1
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -4
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +4 -8
- package/dist/cjs/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +28 -5
- package/dist/cjs/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +75 -53
- package/dist/cjs/view/HoverCard/components/views/unauthorised/graphics.js +47 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-better-hovercard-killswitch-enabled--default.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-rovo-chat-action--default.png +0 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +0 -0
- package/dist/es2019/messages.js +14 -39
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +5 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +9 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +6 -2
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +31 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +6 -34
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +11 -29
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +44 -38
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/common/base-icon-element/index.js +38 -5
- package/dist/es2019/view/HoverCard/components/ContentContainer.compiled.css +1 -1
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -4
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +4 -8
- package/dist/es2019/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +28 -5
- package/dist/es2019/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +82 -58
- package/dist/es2019/view/HoverCard/components/views/unauthorised/graphics.js +39 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-better-hovercard-killswitch-enabled--default.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-rovo-chat-action--default.png +0 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +0 -0
- package/dist/esm/messages.js +14 -39
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.compiled.css +5 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js +9 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +6 -2
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +47 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +6 -38
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +13 -32
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +44 -38
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/common/base-icon-element/index.js +43 -5
- package/dist/esm/view/HoverCard/components/ContentContainer.compiled.css +1 -1
- package/dist/esm/view/HoverCard/components/ContentContainer.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -4
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +4 -8
- package/dist/esm/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +28 -5
- package/dist/esm/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +76 -54
- package/dist/esm/view/HoverCard/components/views/unauthorised/graphics.js +39 -0
- package/dist/types/common/analytics/generated/analytics.types.d.ts +4 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/analytics/useLinkClicked.d.ts +2 -2
- package/dist/types/state/hooks/use-invoke/index.d.ts +1 -1
- package/dist/types/state/hooks/use-resolve/index.d.ts +1 -1
- package/dist/types/state/hooks/use-resolve-hyperlink/index.d.ts +1 -1
- package/dist/types/state/hooks/use-resolve-hyperlink/useScheduledRegister.d.ts +1 -1
- package/dist/types/utils/analytics/click.d.ts +1 -1
- package/dist/types/utils/mocks.d.ts +3 -3
- package/dist/types/view/Card/index.d.ts +2 -2
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +2 -10
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +4 -7
- package/dist/types/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-items-group/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -1
- package/dist/types/view/HoverCard/components/views/unauthorised/graphics.d.ts +3 -0
- package/dist/types/view/InlineCard/Frame/styled.d.ts +2 -2
- package/dist/types/view/InlineCard/common/action-button/index.d.ts +1 -1
- package/dist/types/view/InlineCard/common/rovo-actions-button/index.d.ts +1 -1
- package/dist/types/view/RelatedLinksModal/components/EmptyState.d.ts +1 -1
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +1 -1
- package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +1 -1
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +4 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useLinkClicked.d.ts +2 -2
- package/dist/types-ts4.5/state/hooks/use-invoke/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-resolve/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-resolve-hyperlink/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-resolve-hyperlink/useScheduledRegister.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/click.d.ts +1 -1
- package/dist/types-ts4.5/utils/mocks.d.ts +3 -3
- package/dist/types-ts4.5/view/Card/index.d.ts +2 -2
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +2 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +4 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-badge-element/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-items-group/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/graphics.d.ts +3 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +2 -2
- package/dist/types-ts4.5/view/InlineCard/common/action-button/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/common/rovo-actions-button/index.d.ts +1 -1
- package/dist/types-ts4.5/view/RelatedLinksModal/components/EmptyState.d.ts +1 -1
- package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +1 -1
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +1 -1
- package/package.json +4 -5
package/dist/esm/messages.js
CHANGED
|
@@ -861,45 +861,20 @@ export var messages = defineMessages({
|
|
|
861
861
|
defaultMessage: 'Get smarter workflows by connecting your account',
|
|
862
862
|
description: 'Banner headline in Rovo unauthorised hover card header when the provider name is unknown.'
|
|
863
863
|
},
|
|
864
|
-
|
|
865
|
-
id: 'fabric.linking.rovo_unauthorised.feature.
|
|
866
|
-
defaultMessage: '
|
|
867
|
-
description: '
|
|
868
|
-
},
|
|
869
|
-
|
|
870
|
-
id: 'fabric.linking.rovo_unauthorised.feature.
|
|
871
|
-
defaultMessage: 'Understand
|
|
872
|
-
description: '
|
|
873
|
-
},
|
|
874
|
-
|
|
875
|
-
id: 'fabric.linking.rovo_unauthorised.feature.
|
|
876
|
-
defaultMessage: '
|
|
877
|
-
description: '
|
|
878
|
-
},
|
|
879
|
-
rovo_unauthorised_feature_smart_suggestions_desc: {
|
|
880
|
-
id: 'fabric.linking.rovo_unauthorised.feature.smart_suggestions.desc',
|
|
881
|
-
defaultMessage: 'Strengthen your drafts with actionable feedback',
|
|
882
|
-
description: 'Feature description in Rovo unauthorised view.'
|
|
883
|
-
},
|
|
884
|
-
rovo_unauthorised_feature_cross_reference_title: {
|
|
885
|
-
id: 'fabric.linking.rovo_unauthorised.feature.cross_reference.title',
|
|
886
|
-
defaultMessage: 'Tracked link mentions',
|
|
887
|
-
description: 'Feature title in Rovo unauthorised view.'
|
|
888
|
-
},
|
|
889
|
-
rovo_unauthorised_feature_cross_reference_desc: {
|
|
890
|
-
id: 'fabric.linking.rovo_unauthorised.feature.cross_reference.desc',
|
|
891
|
-
defaultMessage: 'Never miss where your work is referenced',
|
|
892
|
-
description: 'Feature description in Rovo unauthorised view.'
|
|
893
|
-
},
|
|
894
|
-
rovo_unauthorised_feature_related_content_title: {
|
|
895
|
-
id: 'fabric.linking.rovo_unauthorised.feature.related_content.title',
|
|
896
|
-
defaultMessage: 'Related content',
|
|
897
|
-
description: 'Feature title in Rovo unauthorised view.'
|
|
898
|
-
},
|
|
899
|
-
rovo_unauthorised_feature_related_content_desc: {
|
|
900
|
-
id: 'fabric.linking.rovo_unauthorised.feature.related_content.desc',
|
|
901
|
-
defaultMessage: 'Find relevant work and why it matters',
|
|
902
|
-
description: 'Feature description in Rovo unauthorised view.'
|
|
864
|
+
rovo_unauthorised_feature_clear_link_names: {
|
|
865
|
+
id: 'fabric.linking.rovo_unauthorised.feature.clear_link_names',
|
|
866
|
+
defaultMessage: 'Turn long URL into clear link names',
|
|
867
|
+
description: 'First feature bullet in Rovo unauthorised hover card.'
|
|
868
|
+
},
|
|
869
|
+
rovo_unauthorised_feature_understand_linked_docs: {
|
|
870
|
+
id: 'fabric.linking.rovo_unauthorised.feature.understand_linked_docs',
|
|
871
|
+
defaultMessage: 'Understand linked docs in seconds',
|
|
872
|
+
description: 'Second feature bullet in Rovo unauthorised hover card.'
|
|
873
|
+
},
|
|
874
|
+
rovo_unauthorised_feature_go_deeper_smart_suggestions: {
|
|
875
|
+
id: 'fabric.linking.rovo_unauthorised.feature.go_deeper_smart_suggestions',
|
|
876
|
+
defaultMessage: 'Go deeper with smart suggestions',
|
|
877
|
+
description: 'Third feature bullet in Rovo unauthorised hover card.'
|
|
903
878
|
},
|
|
904
879
|
rovo_unauthorised_connect_account: {
|
|
905
880
|
id: 'fabric.linking.rovo_unauthorised.connect_account',
|
|
@@ -1,6 +1,11 @@
|
|
|
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
2
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
3
|
+
._1bah1h6o{justify-content:center}
|
|
3
4
|
._1bsb1osq{width:100%}
|
|
5
|
+
._1bsb1tcg{width:24px}
|
|
6
|
+
._1e0c116y{display:inline-flex}
|
|
7
|
+
._4cvr1h6o{align-items:center}
|
|
8
|
+
._4t3i1tcg{height:24px}
|
|
4
9
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
5
10
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
6
11
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/action-button.js
CHANGED
|
@@ -8,11 +8,13 @@ import { cx } from '@atlaskit/css';
|
|
|
8
8
|
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
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
12
|
import { getPrimitivesInlineSpaceBySize } from '../../../utils';
|
|
12
13
|
import ActionIcon from '../action-icon';
|
|
13
14
|
var styles = {
|
|
14
15
|
button: "_bfhksm61 _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66 _1bsb1osq _1ah31i6y _irr31dpa _1di6fcek",
|
|
15
|
-
content: "_11c8wadc _syazi7uo"
|
|
16
|
+
content: "_11c8wadc _syazi7uo",
|
|
17
|
+
spinner: "_1bsb1tcg _4t3i1tcg _1e0c116y _4cvr1h6o _1bah1h6o"
|
|
16
18
|
};
|
|
17
19
|
var ActionButton = function ActionButton(_ref) {
|
|
18
20
|
var content = _ref.content,
|
|
@@ -33,7 +35,12 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
33
35
|
}
|
|
34
36
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
35
37
|
var icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
36
|
-
icon: /*#__PURE__*/React.createElement(
|
|
38
|
+
icon: expValEqualsNoExposure('platform_sl_3p_auth_rovo_action', 'isEnabled', true) && fg('platform_sl_3p_auth_rovo_action_kill_switch') ? /*#__PURE__*/React.createElement(Box, {
|
|
39
|
+
xcss: styles.spinner
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
41
|
+
size: 16,
|
|
42
|
+
testId: "".concat(testId, "-loading")
|
|
43
|
+
})) : /*#__PURE__*/React.createElement(Spinner, {
|
|
37
44
|
testId: "".concat(testId, "-loading")
|
|
38
45
|
})
|
|
39
46
|
}) : iconOption;
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
CHANGED
|
@@ -4,6 +4,7 @@ var _excluded = ["onClick", "onError", "testId", "status", "summariseUrl"];
|
|
|
4
4
|
import React, { useCallback } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
9
|
import { messages } from '../../../../../messages';
|
|
9
10
|
import Action from '../action';
|
|
@@ -35,11 +36,13 @@ export function AISummariseAction(_ref) {
|
|
|
35
36
|
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
36
37
|
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
37
38
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
38
|
-
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
39
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, _extends({
|
|
39
40
|
spacing: "spacious",
|
|
40
41
|
color: "currentColor",
|
|
41
42
|
label: "Summarise with AI"
|
|
42
|
-
})
|
|
43
|
+
}, fg('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
44
|
+
size: props.iconSize
|
|
45
|
+
} : {})),
|
|
43
46
|
onClick: handleActionClick,
|
|
44
47
|
testId: "".concat(testId, "-summarise-action"),
|
|
45
48
|
isLoading: status === 'loading',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { di } from 'react-magnetic-di';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
5
6
|
import { AISummariseAction } from './ai-summarise-action';
|
|
6
|
-
import { CopySummaryAction } from './copy-summary-action';
|
|
7
|
+
import { CopySummaryAction, CopySummaryActionNew } from './copy-summary-action';
|
|
7
8
|
export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
8
9
|
var url = props.url,
|
|
9
10
|
onLoadingChange = props.onLoadingChange,
|
|
@@ -17,7 +18,10 @@ export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
|
17
18
|
useEffect(function () {
|
|
18
19
|
onLoadingChange === null || onLoadingChange === void 0 || onLoadingChange(status === 'loading');
|
|
19
20
|
}, [onLoadingChange, status]);
|
|
20
|
-
return status === 'done' ? /*#__PURE__*/React.createElement(
|
|
21
|
+
return status === 'done' ? fg('platform_sl_3p_auth_rovo_action_kill_switch') ? /*#__PURE__*/React.createElement(CopySummaryActionNew, _extends({}, props, {
|
|
22
|
+
summary: content,
|
|
23
|
+
testId: testId
|
|
24
|
+
})) : /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
21
25
|
testId: testId,
|
|
22
26
|
content: content
|
|
23
27
|
})) : /*#__PURE__*/React.createElement(AISummariseAction, _extends({}, props, {
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
CHANGED
|
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["url", "onClick", "testId", "content"]
|
|
5
|
+
var _excluded = ["url", "onClick", "testId", "content"],
|
|
6
|
+
_excluded2 = ["url", "onClick", "summary", "testId"];
|
|
6
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
8
|
import React, { useCallback, useState } from 'react';
|
|
8
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -52,4 +53,49 @@ export function CopySummaryAction(_ref) {
|
|
|
52
53
|
return setTooltipMessage(messages.copy_summary_action_description);
|
|
53
54
|
}
|
|
54
55
|
}, props));
|
|
56
|
+
}
|
|
57
|
+
export function CopySummaryActionNew(_ref3) {
|
|
58
|
+
var url = _ref3.url,
|
|
59
|
+
onClickCallback = _ref3.onClick,
|
|
60
|
+
_ref3$summary = _ref3.summary,
|
|
61
|
+
summary = _ref3$summary === void 0 ? '' : _ref3$summary,
|
|
62
|
+
testId = _ref3.testId,
|
|
63
|
+
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
64
|
+
var _useAnalyticsEvents2 = useAnalyticsEvents(),
|
|
65
|
+
fireEvent = _useAnalyticsEvents2.fireEvent;
|
|
66
|
+
var _useState3 = useState(messages.copy_summary_action_description),
|
|
67
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
+
tooltipMessage = _useState4[0],
|
|
69
|
+
setTooltipMessage = _useState4[1];
|
|
70
|
+
var handleCopySummaryClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
71
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
72
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
fireEvent('ui.button.clicked.copySummary', {});
|
|
75
|
+
_context2.next = 3;
|
|
76
|
+
return navigator.clipboard.writeText(summary);
|
|
77
|
+
case 3:
|
|
78
|
+
setTooltipMessage(messages.copied_summary_action_description);
|
|
79
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
80
|
+
case 5:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context2.stop();
|
|
83
|
+
}
|
|
84
|
+
}, _callee2);
|
|
85
|
+
})), [fireEvent, onClickCallback, summary]);
|
|
86
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
87
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
88
|
+
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
89
|
+
color: "currentColor",
|
|
90
|
+
spacing: "spacious",
|
|
91
|
+
label: "Copy Summary",
|
|
92
|
+
size: props.iconSize
|
|
93
|
+
}),
|
|
94
|
+
onClick: handleCopySummaryClick,
|
|
95
|
+
testId: "".concat(testId, "-copy-summary-action"),
|
|
96
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
97
|
+
tooltipOnHide: function tooltipOnHide() {
|
|
98
|
+
return setTooltipMessage(messages.copy_summary_action_description);
|
|
99
|
+
}
|
|
100
|
+
}, props));
|
|
55
101
|
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
import "./index.compiled.css";
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
10
7
|
import { di } from 'react-magnetic-di';
|
|
11
|
-
import { FadeIn, StaggeredEntrance } from '@atlaskit/motion';
|
|
12
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
9
|
import { InternalActionName, SmartLinkSize } from '../../../../../constants';
|
|
14
10
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
15
|
-
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
16
11
|
import * as Actions from '../../actions';
|
|
17
12
|
import { ActionFooter } from './action-footer';
|
|
18
13
|
var ignoreContainerPaddingStyles = null;
|
|
@@ -58,7 +53,6 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
58
53
|
is3PAuthRovoActionsExperimentOn = _ref.is3PAuthRovoActionsExperimentOn;
|
|
59
54
|
var context = useFlexibleUiContext();
|
|
60
55
|
var ui = useFlexibleUiOptionContext();
|
|
61
|
-
var url = context === null || context === void 0 ? void 0 : context.url;
|
|
62
56
|
var isRovoChatActionAvailable = is3PAuthRovoActionsExperimentOn && fg('platform_sl_3p_auth_rovo_action_kill_switch') ? (context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.RovoChatAction]) !== undefined : undefined;
|
|
63
57
|
var _useState = useState(),
|
|
64
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -87,14 +81,11 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
87
81
|
return name !== InternalActionName.RovoChatAction;
|
|
88
82
|
}) : Object.keys(context.actions);
|
|
89
83
|
arr.sort(sort);
|
|
90
|
-
var renderAction = function renderAction(name
|
|
84
|
+
var renderAction = function renderAction(name) {
|
|
91
85
|
var Action = name in Actions ? Actions[name] : undefined;
|
|
92
86
|
if (!Action) {
|
|
93
87
|
return null;
|
|
94
88
|
}
|
|
95
|
-
var style = padding || motionStyle ? _objectSpread(_objectSpread({}, motionStyle || {}), padding && {
|
|
96
|
-
paddingInline: padding
|
|
97
|
-
}) : undefined;
|
|
98
89
|
return /*#__PURE__*/React.createElement(Action, {
|
|
99
90
|
as: "stack-item",
|
|
100
91
|
spaceInline: spaceInline,
|
|
@@ -105,41 +96,18 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
105
96
|
onError: onError,
|
|
106
97
|
onLoadingChange: onLoadingChange,
|
|
107
98
|
size: size || (ui === null || ui === void 0 ? void 0 : ui.size)
|
|
108
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
109
100
|
,
|
|
110
|
-
style:
|
|
101
|
+
style: padding && {
|
|
102
|
+
paddingInline: padding
|
|
103
|
+
},
|
|
111
104
|
hideTooltip: isLoading
|
|
112
105
|
});
|
|
113
106
|
};
|
|
114
|
-
return
|
|
115
|
-
columns: 1
|
|
116
|
-
}, arr.map(function (name, index) {
|
|
117
|
-
return /*#__PURE__*/React.createElement(FadeIn, {
|
|
118
|
-
duration: 'large',
|
|
119
|
-
key: index
|
|
120
|
-
}, function (motion) {
|
|
121
|
-
return renderAction(name, motion.style);
|
|
122
|
-
});
|
|
123
|
-
})) : arr.map(function (name) {
|
|
107
|
+
return arr.map(function (name) {
|
|
124
108
|
return renderAction(name);
|
|
125
109
|
});
|
|
126
110
|
}, [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]);
|
|
127
|
-
var aiSummaryConfig = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
128
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
129
|
-
useAISummaryAction(url !== null && url !== void 0 ? url : '') : undefined;
|
|
130
|
-
if (fg('platform_sl_3p_auth_rovo_action_kill_switch')) {
|
|
131
|
-
var shouldShowActions = !isRovoChatActionAvailable || isRovoChatActionAvailable && ((aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.state.status) === 'done' || (aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.state.status) === 'error');
|
|
132
|
-
return actions && shouldShowActions ? /*#__PURE__*/React.createElement("div", {
|
|
133
|
-
ref: blockRef,
|
|
134
|
-
"data-testid": testId
|
|
135
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
136
|
-
,
|
|
137
|
-
className: ax(["_1e0c1txw _2lx21bp4 _vchhusvi _16jlkb7n _1bsb129b _18u01ivi _2hwxc10g", className])
|
|
138
|
-
}, actions, /*#__PURE__*/React.createElement(ActionFooter, {
|
|
139
|
-
message: message,
|
|
140
|
-
testId: testId
|
|
141
|
-
})) : null;
|
|
142
|
-
}
|
|
143
111
|
return actions ? /*#__PURE__*/React.createElement("div", {
|
|
144
112
|
ref: blockRef,
|
|
145
113
|
"data-testid": testId
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["testId"]
|
|
4
|
-
_excluded2 = ["testId", "url"];
|
|
3
|
+
var _excluded = ["is3PAuthRovoActionsExperimentOn", "testId"];
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
|
|
7
6
|
import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -14,8 +13,9 @@ import AISummaryBlockResolvedView, { RovoSummaryBlockResolvedView } from './reso
|
|
|
14
13
|
* @see Block
|
|
15
14
|
*/
|
|
16
15
|
var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
17
|
-
var _context$actions, _props$
|
|
18
|
-
var
|
|
16
|
+
var _context$actions, _props$size2, _cardContext$ui2;
|
|
17
|
+
var is3PAuthRovoActionsExperimentOn = _ref.is3PAuthRovoActionsExperimentOn,
|
|
18
|
+
_ref$testId = _ref.testId,
|
|
19
19
|
testId = _ref$testId === void 0 ? 'smart-ai-summary-block' : _ref$testId,
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
21
|
var cardContext = useFlexibleCardContext();
|
|
@@ -27,37 +27,18 @@ var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
|
27
27
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Represents an AISummaryBlock, designed to summarising link resource
|
|
39
|
-
* content using AI.
|
|
40
|
-
* @public
|
|
41
|
-
* @param {RovoSummaryBlockProps} RovoSummaryBlock
|
|
42
|
-
* @see Block
|
|
43
|
-
*/
|
|
44
|
-
export var RovoSummaryBlock = function RovoSummaryBlock(_ref2) {
|
|
45
|
-
var _props$size2, _cardContext$ui2;
|
|
46
|
-
var _ref2$testId = _ref2.testId,
|
|
47
|
-
testId = _ref2$testId === void 0 ? 'smart-ai-summary-block' : _ref2$testId,
|
|
48
|
-
url = _ref2.url,
|
|
49
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
50
|
-
var cardContext = useFlexibleCardContext();
|
|
51
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
52
|
-
return null;
|
|
30
|
+
if (is3PAuthRovoActionsExperimentOn) {
|
|
31
|
+
var _props$size, _cardContext$ui;
|
|
32
|
+
return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
|
|
33
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
34
|
+
testId: testId,
|
|
35
|
+
url: actionData.url
|
|
36
|
+
}));
|
|
53
37
|
}
|
|
54
|
-
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
return /*#__PURE__*/React.createElement(RovoSummaryBlockResolvedView, _extends({}, props, {
|
|
38
|
+
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props, {
|
|
58
39
|
size: (_props$size2 = props.size) !== null && _props$size2 !== void 0 ? _props$size2 : cardContext === null || cardContext === void 0 || (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size,
|
|
59
40
|
testId: testId,
|
|
60
|
-
url: url
|
|
41
|
+
url: actionData.url
|
|
61
42
|
}));
|
|
62
43
|
};
|
|
63
44
|
export default AISummaryBlock;
|
|
@@ -3,7 +3,7 @@ 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 { Fragment,
|
|
6
|
+
import { Fragment, useRef } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { di } from 'react-magnetic-di';
|
|
9
9
|
import { RovoIcon } from '@atlaskit/logo';
|
|
@@ -62,29 +62,51 @@ export var RovoSummaryBlockResolvedView = function RovoSummaryBlockResolvedView(
|
|
|
62
62
|
var testId = props.testId,
|
|
63
63
|
_props$aiSummaryMinHe2 = props.aiSummaryMinHeight,
|
|
64
64
|
aiSummaryMinHeight = _props$aiSummaryMinHe2 === void 0 ? 0 : _props$aiSummaryMinHe2,
|
|
65
|
+
placeholder = props.placeholder,
|
|
65
66
|
url = props.url;
|
|
66
67
|
var _useAISummaryAction2 = useAISummaryAction(url),
|
|
67
68
|
_useAISummaryAction2$ = _useAISummaryAction2.state,
|
|
68
69
|
content = _useAISummaryAction2$.content,
|
|
69
|
-
status = _useAISummaryAction2$.status
|
|
70
|
-
summariseUrl = _useAISummaryAction2.summariseUrl;
|
|
71
|
-
var showAISummary = status === 'done' ||
|
|
72
|
-
// We want to display the AI Summary component only when there is content available during the loading process.
|
|
73
|
-
status === 'loading' && !!content;
|
|
70
|
+
status = _useAISummaryAction2$.status;
|
|
74
71
|
var isSummarisedOnMountRef = useRef(status === 'done');
|
|
75
|
-
useEffect(function () {
|
|
76
|
-
if (status !== 'ready' || isSummarisedOnMountRef.current) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
isSummarisedOnMountRef.current = true;
|
|
80
|
-
summariseUrl();
|
|
81
|
-
}, [status, summariseUrl]);
|
|
82
72
|
var minHeight = isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
|
|
83
73
|
if (status === 'error') {
|
|
84
74
|
return null;
|
|
85
75
|
}
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
|
|
77
|
+
// Show summary when there is content to display
|
|
78
|
+
if (content && content !== '') {
|
|
79
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
80
|
+
direction: SmartLinkDirection.Vertical,
|
|
81
|
+
testId: "".concat(testId, "-resolved-view"),
|
|
82
|
+
className: ax(["_1reoewfl _18m9ewfl"])
|
|
83
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
84
|
+
xcss: newStyles.summaryWrapper
|
|
85
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: ax([newStyles.iconWrapper])
|
|
87
|
+
}, /*#__PURE__*/React.createElement(RovoIcon, {
|
|
88
|
+
shouldUseHexLogo: true,
|
|
89
|
+
size: "xxsmall"
|
|
90
|
+
})), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
91
|
+
fromCache: isSummarisedOnMountRef.current
|
|
92
|
+
}), /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
93
|
+
minHeight: minHeight,
|
|
94
|
+
show: true,
|
|
95
|
+
showTransition: !isSummarisedOnMountRef.current
|
|
96
|
+
}, /*#__PURE__*/React.createElement(AISummary, {
|
|
97
|
+
testId: "".concat(testId, "-ai-summary"),
|
|
98
|
+
minHeight: minHeight,
|
|
99
|
+
content: content
|
|
100
|
+
}), status === 'done' && /*#__PURE__*/React.createElement(AIFooter, null))));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Show loading state on initial request where content hasn't returned yet.
|
|
104
|
+
if (status === 'loading') {
|
|
105
|
+
return /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
106
|
+
minHeight: minHeight,
|
|
107
|
+
show: true,
|
|
108
|
+
showTransition: true
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
88
110
|
testId: "".concat(testId, "-placeholder"),
|
|
89
111
|
xcss: newStyles.placeholderWrapper
|
|
90
112
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -99,29 +121,13 @@ export var RovoSummaryBlockResolvedView = function RovoSummaryBlockResolvedView(
|
|
|
99
121
|
xcss: newStyles.ellipsesContainer
|
|
100
122
|
}, /*#__PURE__*/React.createElement(EllipsesAnimation, {
|
|
101
123
|
isAnimated: true
|
|
102
|
-
})));
|
|
124
|
+
}))));
|
|
103
125
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: ax([newStyles.iconWrapper])
|
|
112
|
-
}, /*#__PURE__*/React.createElement(RovoIcon, {
|
|
113
|
-
shouldUseHexLogo: true,
|
|
114
|
-
size: 'xxsmall'
|
|
115
|
-
})), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
116
|
-
fromCache: isSummarisedOnMountRef.current
|
|
117
|
-
}), /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
118
|
-
minHeight: minHeight,
|
|
119
|
-
show: showAISummary,
|
|
120
|
-
showTransition: !isSummarisedOnMountRef.current
|
|
121
|
-
}, /*#__PURE__*/React.createElement(AISummary, {
|
|
122
|
-
testId: "".concat(testId, "-ai-summary"),
|
|
123
|
-
minHeight: minHeight,
|
|
124
|
-
content: content
|
|
125
|
-
}), status === 'done' && /*#__PURE__*/React.createElement(AIFooter, null))));
|
|
126
|
+
|
|
127
|
+
// Otherwise, show placeholder if provided
|
|
128
|
+
if (placeholder) {
|
|
129
|
+
return /*#__PURE__*/React.createElement(Fragment, null, placeholder);
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
126
132
|
};
|
|
127
133
|
export default AISummaryBlockResolvedView;
|
|
@@ -16,7 +16,7 @@ import Block from '../block';
|
|
|
16
16
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
17
17
|
* @featureGate platform_sl_3p_auth_rovo_action_kill_switch
|
|
18
18
|
*/
|
|
19
|
-
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [InternalActionName.
|
|
19
|
+
var HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [InternalActionName.RovoChatAction];
|
|
20
20
|
var ignoreContainerMarginStyles = null;
|
|
21
21
|
var elevatedFooterStyles = null;
|
|
22
22
|
var providerStyles = null;
|
|
@@ -60,6 +60,20 @@ var renderDefaultIcon = function renderDefaultIcon(label, testId) {
|
|
|
60
60
|
color: "currentColor"
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
|
+
var widthFromSize = function widthFromSize(size, isTiledIcon) {
|
|
64
|
+
switch (size) {
|
|
65
|
+
case SmartLinkSize.XLarge:
|
|
66
|
+
return "var(--ds-space-300, 24px)";
|
|
67
|
+
case SmartLinkSize.Large:
|
|
68
|
+
return "var(--ds-space-300, 24px)";
|
|
69
|
+
case SmartLinkSize.Medium:
|
|
70
|
+
return isTiledIcon ? "var(--ds-space-250, 20px)" : "var(--ds-space-200, 16px)";
|
|
71
|
+
case SmartLinkSize.Small:
|
|
72
|
+
return "var(--ds-space-200, 16px)";
|
|
73
|
+
default:
|
|
74
|
+
return "var(--ds-space-200, 16px)";
|
|
75
|
+
}
|
|
76
|
+
};
|
|
63
77
|
var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
64
78
|
var size = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SmartLinkSize.Medium;
|
|
65
79
|
var appearance = arguments.length > 4 ? arguments[4] : undefined;
|
|
@@ -80,7 +94,27 @@ var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
|
80
94
|
}));
|
|
81
95
|
}
|
|
82
96
|
};
|
|
83
|
-
|
|
97
|
+
var renderImageIconNew = function renderImageIconNew(defaultIcon, url, testId) {
|
|
98
|
+
var size = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SmartLinkSize.Medium;
|
|
99
|
+
var appearance = arguments.length > 4 ? arguments[4] : undefined;
|
|
100
|
+
var hideLoadingSkeleton = arguments.length > 5 ? arguments[5] : undefined;
|
|
101
|
+
var label = arguments.length > 6 ? arguments[6] : undefined;
|
|
102
|
+
var isTiledIcon = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
103
|
+
var width = widthFromSize(size, isTiledIcon);
|
|
104
|
+
if (url) {
|
|
105
|
+
return /*#__PURE__*/React.createElement(ImageIcon, _extends({}, fg('platform_navx_smart_link_icon_label_a11y') ? {
|
|
106
|
+
label: label
|
|
107
|
+
} : {}, {
|
|
108
|
+
defaultIcon: defaultIcon,
|
|
109
|
+
testId: testId,
|
|
110
|
+
url: url,
|
|
111
|
+
width: width,
|
|
112
|
+
height: width,
|
|
113
|
+
appearance: appearance,
|
|
114
|
+
hideLoadingSkeleton: hideLoadingSkeleton
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
84
118
|
/**
|
|
85
119
|
* A base element that displays an Icon or favicon.
|
|
86
120
|
* @internal
|
|
@@ -108,8 +142,8 @@ var IconElement = function IconElement(_ref) {
|
|
|
108
142
|
var label = fg('platform_navx_smart_link_icon_label_a11y') ? labelProp !== null && labelProp !== void 0 ? labelProp : '' : labelProp !== null && labelProp !== void 0 ? labelProp : 'Link';
|
|
109
143
|
var element = useMemo(function () {
|
|
110
144
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
111
|
-
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined) || renderAtlaskitIcon(icon, testId, size, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined) || defaultIcon;
|
|
112
|
-
}, [label, testId, overrideIcon, render, url, size, appearance, hideLoadingSkeleton, icon]);
|
|
145
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || (fg('platform_sl_3p_preauth_better_hovercard_killswitch') ? renderImageIconNew(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined, isTiledIcon) : renderImageIcon(defaultIcon, url, testId, size, appearance, hideLoadingSkeleton, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined)) || renderAtlaskitIcon(icon, testId, size, fg('platform_navx_smart_link_icon_label_a11y') ? label : undefined) || defaultIcon;
|
|
146
|
+
}, [label, testId, overrideIcon, render, url, size, appearance, hideLoadingSkeleton, icon, isTiledIcon]);
|
|
113
147
|
var width = getIconWidth(size);
|
|
114
148
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
149
|
"data-smart-element": name,
|
|
@@ -118,11 +152,15 @@ var IconElement = function IconElement(_ref) {
|
|
|
118
152
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
119
153
|
,
|
|
120
154
|
className: ax([styles.container, positionStyleMap[position], render && customRenderStyleMap[size], className])
|
|
121
|
-
}, isTiledIcon && isNewBlockcardUnauthorizedRefreshExperimentEnabled() ? /*#__PURE__*/React.createElement(Tile, {
|
|
155
|
+
}, isTiledIcon && (fg('platform_sl_3p_preauth_better_hovercard_killswitch') || isNewBlockcardUnauthorizedRefreshExperimentEnabled()) ? /*#__PURE__*/React.createElement(Tile, {
|
|
122
156
|
size: size,
|
|
123
|
-
|
|
157
|
+
hasBorder: true,
|
|
158
|
+
backgroundColor: "white",
|
|
159
|
+
label: label,
|
|
160
|
+
testId: "".concat(testId, "-tile")
|
|
124
161
|
}, element) : /*#__PURE__*/React.createElement(Box, {
|
|
125
162
|
xcss: styles.iconWrapperStyle,
|
|
163
|
+
testId: "".concat(testId, "-box"),
|
|
126
164
|
style: {
|
|
127
165
|
width: width,
|
|
128
166
|
height: width
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
._189eidpf{border-width:0}
|
|
4
4
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
5
5
|
._1bsb1f23{width:25rem}
|
|
6
|
-
.
|
|
6
|
+
._1bsbtye8{width:20rem}
|
|
7
7
|
._9spsglyw .smart-link-loading-placeholder{display:none}
|
|
8
8
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
9
9
|
._vchhusvi{box-sizing:border-box}
|
|
@@ -37,7 +37,7 @@ var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
|
|
|
37
37
|
var resolvedWidthAppearance = widthAppearance !== null && widthAppearance !== void 0 ? widthAppearance : 'default';
|
|
38
38
|
var container = /*#__PURE__*/React.createElement("div", _extends({
|
|
39
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
40
|
-
className: ax(["_11q7glyw _189eidpf _vchhusvi", resolvedWidthAppearance === 'slim' ? "
|
|
40
|
+
className: ax(["_11q7glyw _189eidpf _vchhusvi", resolvedWidthAppearance === 'slim' ? "_1bsbtye8" : "_1bsb1f23", "_9spsglyw", !isAIEnabled && "_2rko1mok _bfhk1bhr _16qs130s", hoverCardClassName]),
|
|
41
41
|
"data-testid": testId
|
|
42
42
|
}, props), children);
|
|
43
43
|
return isAIEnabled ? /*#__PURE__*/React.createElement(AIPrism, {
|
|
@@ -244,8 +244,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
244
244
|
flexibleCardProps: flexibleCardProps,
|
|
245
245
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
246
246
|
onActionClick: onActionClick,
|
|
247
|
-
titleBlockProps: titleBlockProps
|
|
248
|
-
url: url
|
|
247
|
+
titleBlockProps: titleBlockProps
|
|
249
248
|
}));
|
|
250
249
|
}
|
|
251
250
|
return null;
|
|
@@ -297,8 +296,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
|
|
|
297
296
|
flexibleCardProps: flexibleCardProps,
|
|
298
297
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
299
298
|
onActionClick: onActionClick,
|
|
300
|
-
titleBlockProps: titleBlockProps
|
|
301
|
-
url: url
|
|
299
|
+
titleBlockProps: titleBlockProps
|
|
302
300
|
}));
|
|
303
301
|
}
|
|
304
302
|
return null;
|
|
@@ -11,7 +11,6 @@ import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
|
11
11
|
import useAISummaryAction from '../../../../../state/hooks/use-ai-summary-action';
|
|
12
12
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
13
13
|
import { ActionBlock, AIFooterBlock, AISummaryBlock, ResolvedHoverCardFooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
14
|
-
import { RovoSummaryBlock } from '../../../../FlexibleCard/components/blocks/ai-summary-block';
|
|
15
14
|
import { getMetadata } from '../../../utils';
|
|
16
15
|
import ImagePreview from '../../ImagePreview';
|
|
17
16
|
var hiddenSnippetStyles = null;
|
|
@@ -27,8 +26,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
27
26
|
onActionClick = _ref.onActionClick,
|
|
28
27
|
showRovoResolvedView = _ref.showRovoResolvedView,
|
|
29
28
|
titleBlockProps = _ref.titleBlockProps,
|
|
30
|
-
id = _ref.id
|
|
31
|
-
url = _ref.url;
|
|
29
|
+
id = _ref.id;
|
|
32
30
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
33
31
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
34
32
|
|
|
@@ -79,12 +77,10 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
79
77
|
secondary: secondary,
|
|
80
78
|
maxLines: 1,
|
|
81
79
|
size: SmartLinkSize.Medium
|
|
82
|
-
}),
|
|
80
|
+
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
83
81
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
87
|
-
placeholder: snippet
|
|
82
|
+
placeholder: snippet,
|
|
83
|
+
is3PAuthRovoActionsExperimentOn: is3PAuthRovoActionsExperimentOn
|
|
88
84
|
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
89
85
|
testId: "hidden-snippet",
|
|
90
86
|
onRender: onSnippetRender,
|