@atlaskit/smart-card 46.22.3 → 46.23.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 +18 -0
- package/analytics.spec.yaml +6 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/extractors/flexible/actions/extract-remix-action.js +53 -0
- package/dist/cjs/extractors/flexible/actions/index.js +11 -2
- package/dist/cjs/extractors/flexible/index.js +7 -3
- package/dist/cjs/messages.js +4 -9
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/is-remix-action-enabled.js +48 -0
- package/dist/cjs/utils/use-remix-action-exposure.js +16 -0
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +18 -13
- package/dist/cjs/view/EmbedCard/components/rovo-actions-footer/index.js +58 -10
- package/dist/cjs/view/EmbedCard/index.js +2 -0
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +23 -7
- package/dist/cjs/view/FlexibleCard/components/actions/remix-action/index.js +81 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +5 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +10 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/index.js +9 -3
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
- package/dist/cjs/view/InlineCard/common/inline-card-action/index.js +70 -0
- package/dist/cjs/view/InlineCard/common/remix-action/index.compiled.css +5 -0
- package/dist/cjs/view/InlineCard/common/remix-action/index.js +77 -0
- package/dist/cjs/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/rovo-chat-utils/index.js +0 -28
- package/dist/cjs/view/common/rovo-post-auth-prompts/index.js +1 -16
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/es2019/constants.js +2 -0
- package/dist/es2019/extractors/flexible/actions/extract-remix-action.js +48 -0
- package/dist/es2019/extractors/flexible/actions/index.js +12 -0
- package/dist/es2019/extractors/flexible/index.js +4 -0
- package/dist/es2019/messages.js +4 -9
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/is-remix-action-enabled.js +39 -0
- package/dist/es2019/utils/use-remix-action-exposure.js +11 -0
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +19 -14
- package/dist/es2019/view/EmbedCard/components/rovo-actions-footer/index.js +43 -11
- package/dist/es2019/view/EmbedCard/index.js +2 -0
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +22 -7
- package/dist/es2019/view/FlexibleCard/components/actions/remix-action/index.js +54 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +9 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/index.js +8 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
- package/dist/es2019/view/InlineCard/common/inline-card-action/index.js +61 -0
- package/dist/es2019/view/InlineCard/common/remix-action/index.compiled.css +5 -0
- package/dist/es2019/view/InlineCard/common/remix-action/index.js +50 -0
- package/dist/es2019/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/rovo-chat-utils/index.js +0 -26
- package/dist/es2019/view/common/rovo-post-auth-prompts/index.js +1 -15
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-and-rovo-chat-action-opted-out--default.png +3 -0
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-remix-action-experiment-on---default.png +3 -0
- package/dist/esm/constants.js +2 -0
- package/dist/esm/extractors/flexible/actions/extract-remix-action.js +47 -0
- package/dist/esm/extractors/flexible/actions/index.js +11 -2
- package/dist/esm/extractors/flexible/index.js +7 -3
- package/dist/esm/messages.js +4 -9
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/is-remix-action-enabled.js +42 -0
- package/dist/esm/utils/use-remix-action-exposure.js +11 -0
- package/dist/esm/view/BlockCard/views/ResolvedView.js +19 -14
- package/dist/esm/view/EmbedCard/components/rovo-actions-footer/index.js +59 -11
- package/dist/esm/view/EmbedCard/index.js +2 -0
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +23 -7
- package/dist/esm/view/FlexibleCard/components/actions/remix-action/index.js +72 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +5 -1
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +11 -4
- package/dist/esm/view/FlexibleCard/components/blocks/hover-card-footer-block/index.js +1 -1
- package/dist/esm/view/FlexibleCard/index.js +9 -3
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +9 -1
- package/dist/esm/view/InlineCard/common/inline-card-action/index.js +61 -0
- package/dist/esm/view/InlineCard/common/remix-action/index.compiled.css +5 -0
- package/dist/esm/view/InlineCard/common/remix-action/index.js +70 -0
- package/dist/esm/view/InlineCard/common/rovo-actions-cta/index.js +1 -24
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/rovo-chat-utils/index.js +0 -28
- package/dist/esm/view/common/rovo-post-auth-prompts/index.js +1 -16
- package/dist/types/common/analytics/generated/analytics.types.d.ts +11 -1
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/extractors/flexible/actions/extract-remix-action.d.ts +15 -0
- package/dist/types/extractors/flexible/actions/index.d.ts +3 -1
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +5 -0
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +1 -1
- package/dist/types/utils/is-remix-action-enabled.d.ts +15 -0
- package/dist/types/utils/use-remix-action-exposure.d.ts +2 -0
- package/dist/types/view/Card/types.d.ts +10 -1
- package/dist/types/view/EmbedCard/components/rovo-actions-footer/index.d.ts +5 -4
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/remix-action/index.d.ts +4 -0
- 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/types.d.ts +8 -2
- package/dist/types/view/FlexibleCard/types.d.ts +2 -1
- package/dist/types/view/InlineCard/common/inline-card-action/index.d.ts +11 -0
- package/dist/types/view/InlineCard/common/remix-action/index.d.ts +9 -0
- package/dist/types/view/common/rovo-chat-utils/index.d.ts +1 -2
- package/dist/types/view/common/rovo-post-auth-prompts/index.d.ts +1 -10
- package/package.json +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/cjs/utils/is-rovo-chat-action-visualize-enabled.js +0 -43
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/es2019/utils/is-rovo-chat-action-visualize-enabled.js +0 -34
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/block-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/embed-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/inline-card-google-sheets-with-visualize-rovo-action-experiment-on---default.png +0 -3
- package/dist/esm/utils/is-rovo-chat-action-visualize-enabled.js +0 -37
- package/dist/types/utils/is-rovo-chat-action-visualize-enabled.d.ts +0 -18
- /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/cjs/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/es2019/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{block-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → block-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{embed-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → embed-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
- /package/dist/esm/__tests__/vr-tests/__snapshots__/google-sheets-visualize/{inline-card-google-sheets-without-visualize-rovo-action-experiment-off---default.png → inline-card-google-sheets-without-remix-action-experiment-off---default.png} +0 -0
|
@@ -5,8 +5,9 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
9
|
import { WidthObserver } from '@atlaskit/width-detector/width-observer';
|
|
9
|
-
import { ActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
10
|
+
import { ActionName, InternalActionName, SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
10
11
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context/useFlexibleUiContext';
|
|
11
12
|
import { default as Provider } from '../../../elements/provider-element';
|
|
12
13
|
import ActionGroup from '../../action-group';
|
|
@@ -18,7 +19,7 @@ const safariStyles = null;
|
|
|
18
19
|
const providerStyles = null;
|
|
19
20
|
const rovoActionStyles = null;
|
|
20
21
|
const FooterBlockResolvedView = props => {
|
|
21
|
-
var _context$actions;
|
|
22
|
+
var _context$actions, _context$actions2;
|
|
22
23
|
const {
|
|
23
24
|
actions,
|
|
24
25
|
testId,
|
|
@@ -32,6 +33,7 @@ const FooterBlockResolvedView = props => {
|
|
|
32
33
|
const isRovoActionsEnabled = useMemo(() => {
|
|
33
34
|
return !!rovoChatAction && rovoChatAction.product === 'CONFLUENCE' && (actions === null || actions === void 0 ? void 0 : actions.some(action => action.name === 'RovoChatAction'));
|
|
34
35
|
}, [rovoChatAction, actions]);
|
|
36
|
+
const hasExtraActionSlot = isRovoActionsEnabled && !!(context !== null && context !== void 0 && (_context$actions2 = context.actions) !== null && _context$actions2 !== void 0 && _context$actions2[InternalActionName.RemixAction]) && !!(actions !== null && actions !== void 0 && actions.some(action => action.name === InternalActionName.RemixAction)) && fg('platform_sl_3p_auth_visualize_killswitch');
|
|
35
37
|
const hasPreview = isRovoActionsEnabled && !!(context !== null && context !== void 0 && context.preview) && !isPreviewBlockErrored;
|
|
36
38
|
const hasActions = useMemo(() => {
|
|
37
39
|
var _filterActionItems;
|
|
@@ -68,12 +70,15 @@ const FooterBlockResolvedView = props => {
|
|
|
68
70
|
}, !!rovoChatAction && (rovoChatAction === null || rovoChatAction === void 0 ? void 0 : rovoChatAction.product) === 'CONFLUENCE' && /*#__PURE__*/React.createElement(WidthObserver, {
|
|
69
71
|
setWidth: setContainerWidth,
|
|
70
72
|
offscreen: true
|
|
71
|
-
}), /*#__PURE__*/React.createElement(ActionGroup, {
|
|
73
|
+
}), /*#__PURE__*/React.createElement(ActionGroup, _extends({}, fg('platform_sl_3p_auth_visualize_killswitch') ? {
|
|
74
|
+
visibleButtonsNum: hasExtraActionSlot ? 3 : undefined,
|
|
75
|
+
showRemainingActionsInOverflow: hasExtraActionSlot
|
|
76
|
+
} : undefined, {
|
|
72
77
|
onDropdownOpenChange: onDropdownOpenChange,
|
|
73
78
|
items: actions,
|
|
74
79
|
appearance: isRovoActionsEnabled ? 'subtle' : 'default',
|
|
75
80
|
size: isRovoActionsEnabled ? SmartLinkSize.Small : size,
|
|
76
81
|
containerWidth: isRovoActionsEnabled ? containerWidth : undefined
|
|
77
|
-
})) : null);
|
|
82
|
+
}))) : null);
|
|
78
83
|
};
|
|
79
84
|
export default FooterBlockResolvedView;
|
|
@@ -21,7 +21,7 @@ import Block from '../block';
|
|
|
21
21
|
/**
|
|
22
22
|
* Allowed footer actions for HoverCard, in display order. Fetched from context.
|
|
23
23
|
*/
|
|
24
|
-
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction];
|
|
24
|
+
const HIDDEN_HOVER_CARD_FOOTER_ACTIONS = [ActionName.RovoChatAction, InternalActionName.RemixAction];
|
|
25
25
|
const Actions = {
|
|
26
26
|
[ActionName.AutomationAction]: AutomationAction,
|
|
27
27
|
[ActionName.CopyLinkAction]: CopyLinkAction,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
3
|
+
import { usePlugins } from '@atlaskit/link-provider/use-plugins';
|
|
3
4
|
import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
|
|
4
5
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
6
|
import UFOHoldLoad from '@atlaskit/react-ufo/load-hold';
|
|
@@ -54,6 +55,9 @@ const FlexibleCard = ({
|
|
|
54
55
|
product
|
|
55
56
|
} = useSmartLinkContext();
|
|
56
57
|
const rovoConfig = useRovoConfig();
|
|
58
|
+
const {
|
|
59
|
+
remix
|
|
60
|
+
} = usePlugins();
|
|
57
61
|
const {
|
|
58
62
|
fireEvent
|
|
59
63
|
} = useAnalyticsEvents();
|
|
@@ -86,6 +90,9 @@ const FlexibleCard = ({
|
|
|
86
90
|
resolve,
|
|
87
91
|
product,
|
|
88
92
|
rovoConfig,
|
|
93
|
+
...(fg('platform_sl_3p_auth_visualize_killswitch') ? {
|
|
94
|
+
remix
|
|
95
|
+
} : undefined),
|
|
89
96
|
actionOptions,
|
|
90
97
|
status: placeholderCardState ? placeHolderStatus : status,
|
|
91
98
|
url,
|
|
@@ -95,7 +102,7 @@ const FlexibleCard = ({
|
|
|
95
102
|
} : undefined),
|
|
96
103
|
openPreviewPanel,
|
|
97
104
|
transformUrl
|
|
98
|
-
}), [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, status, transformUrl, url, fireEvent]);
|
|
105
|
+
}), [aiSummaryConfig, appearance, actionOptions, details, id, isPreviewPanelAvailable, isPreviewRestricted, onAuthorize, onClick, onAuxClick, onContextMenu, openPreviewPanel, origin, placeholderCardState, placeHolderStatus, product, renderers, resolve, rovoConfig, remix, status, transformUrl, url, fireEvent]);
|
|
99
106
|
const flexibleCardContext = useMemo(() => ({
|
|
100
107
|
data: context,
|
|
101
108
|
navigation: context ? navigation : undefined,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
3
|
import useInlineTailoredAction from '../../../state/hooks/use-inline-tailored-actions';
|
|
3
4
|
import { HoverCard } from '../../HoverCard';
|
|
5
|
+
import { InlineCardAction } from '../common/inline-card-action';
|
|
4
6
|
import { InlineRovoActionButton } from '../common/rovo-actions-cta';
|
|
5
7
|
import { Frame } from '../Frame';
|
|
6
8
|
import { IconAndTitleLayout } from '../IconAndTitleLayout';
|
|
@@ -47,7 +49,13 @@ export function InlineCardResolvedViewFunctional({
|
|
|
47
49
|
titleTextColor: titleTextColor,
|
|
48
50
|
type: type,
|
|
49
51
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
50
|
-
}), renderLozenge(lozenge),
|
|
52
|
+
}), renderLozenge(lozenge), fg('platform_sl_3p_auth_visualize_killswitch') ? /*#__PURE__*/React.createElement(InlineCardAction, {
|
|
53
|
+
id: id,
|
|
54
|
+
testId: testId,
|
|
55
|
+
url: link,
|
|
56
|
+
actionOptions: actionOptions,
|
|
57
|
+
showHoverPreview: showHoverPreview
|
|
58
|
+
}) : isInlineTailoredRovoActionEnabled && /*#__PURE__*/React.createElement(InlineRovoActionButton, {
|
|
51
59
|
testId: `${testId}-rovo-actions-cta`,
|
|
52
60
|
url: link,
|
|
53
61
|
actionOptions: actionOptions
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { usePlugins } from '@atlaskit/link-provider/use-plugins';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
+
import extractRemixAction from '../../../../extractors/flexible/actions/extract-remix-action';
|
|
6
|
+
import useInlineTailoredAction from '../../../../state/hooks/use-inline-tailored-actions';
|
|
7
|
+
import { useSmartCardState } from '../../../../state/store';
|
|
8
|
+
import InlineRemixAction from '../remix-action';
|
|
9
|
+
import { InlineRovoActionButton } from '../rovo-actions-cta';
|
|
10
|
+
const InlineChatAction = ({
|
|
11
|
+
actionOptions,
|
|
12
|
+
showHoverPreview,
|
|
13
|
+
testId,
|
|
14
|
+
url
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
isEnabled
|
|
18
|
+
} = useInlineTailoredAction(url, showHoverPreview, actionOptions);
|
|
19
|
+
return isEnabled ? /*#__PURE__*/React.createElement(InlineRovoActionButton, {
|
|
20
|
+
actionOptions: actionOptions,
|
|
21
|
+
testId: `${testId}-rovo-actions-cta`,
|
|
22
|
+
url: url
|
|
23
|
+
}) : null;
|
|
24
|
+
};
|
|
25
|
+
const InlineCardActionWithRemix = props => {
|
|
26
|
+
const {
|
|
27
|
+
actionOptions,
|
|
28
|
+
id,
|
|
29
|
+
testId,
|
|
30
|
+
url
|
|
31
|
+
} = props;
|
|
32
|
+
const {
|
|
33
|
+
remix
|
|
34
|
+
} = usePlugins();
|
|
35
|
+
const {
|
|
36
|
+
details
|
|
37
|
+
} = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
38
|
+
const data = useMemo(() => details ? extractRemixAction({
|
|
39
|
+
response: details,
|
|
40
|
+
url,
|
|
41
|
+
actionOptions,
|
|
42
|
+
remix,
|
|
43
|
+
appearance: 'inline',
|
|
44
|
+
id
|
|
45
|
+
}) : undefined, [details, url, actionOptions, remix, id]);
|
|
46
|
+
|
|
47
|
+
// Inline cards have one action slot. Eligible Remix takes priority over chat.
|
|
48
|
+
return data && remix ? /*#__PURE__*/React.createElement(InlineRemixAction, {
|
|
49
|
+
data: data,
|
|
50
|
+
remix: remix,
|
|
51
|
+
testId: `${testId}-remix-action`
|
|
52
|
+
}) : /*#__PURE__*/React.createElement(InlineChatAction, props);
|
|
53
|
+
};
|
|
54
|
+
export const InlineCardAction = ({
|
|
55
|
+
testId = 'inline-card',
|
|
56
|
+
...props
|
|
57
|
+
}) => fg('platform_sl_3p_auth_visualize_killswitch') ? /*#__PURE__*/React.createElement(InlineCardActionWithRemix, _extends({}, props, {
|
|
58
|
+
testId: testId
|
|
59
|
+
})) : /*#__PURE__*/React.createElement(InlineChatAction, _extends({}, props, {
|
|
60
|
+
testId: testId
|
|
61
|
+
}));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.4 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import RemixIcon from '@atlaskit/icon-lab/core/ai-generative-remix';
|
|
7
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
8
|
+
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
9
|
+
import { messages } from '../../../../messages';
|
|
10
|
+
import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
|
|
11
|
+
import { useRemixActionExposure } from '../../../../utils/use-remix-action-exposure';
|
|
12
|
+
import { ActionButton } from '../action-button';
|
|
13
|
+
const styles = {
|
|
14
|
+
text: "_19bv12x7 _1e0c116y _4cvr1h6o _s7n4nkob _19pk1i6y"
|
|
15
|
+
};
|
|
16
|
+
const InlineRemixAction = ({
|
|
17
|
+
data,
|
|
18
|
+
remix,
|
|
19
|
+
testId = 'inline-remix-action'
|
|
20
|
+
}) => {
|
|
21
|
+
const intl = useIntl();
|
|
22
|
+
const invoke = useInvokeClientAction({});
|
|
23
|
+
const label = intl.formatMessage(messages.rovo_prompt_button_remix);
|
|
24
|
+
useRemixActionExposure(true);
|
|
25
|
+
return /*#__PURE__*/React.createElement(ActionButton, {
|
|
26
|
+
"aria-label": label,
|
|
27
|
+
testId: testId,
|
|
28
|
+
onClick: event => {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
const anchorElement = event.currentTarget;
|
|
32
|
+
void invoke({
|
|
33
|
+
...data.invokeAction,
|
|
34
|
+
actionFn: async () => remix.open({
|
|
35
|
+
anchorElement,
|
|
36
|
+
url: data.url
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement(RemixIcon, {
|
|
41
|
+
label: "",
|
|
42
|
+
size: "small"
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
44
|
+
as: "span",
|
|
45
|
+
xcss: styles.text
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
47
|
+
size: "small"
|
|
48
|
+
}, label)));
|
|
49
|
+
};
|
|
50
|
+
export default InlineRemixAction;
|
|
@@ -13,7 +13,6 @@ import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-act
|
|
|
13
13
|
import useRovoChat from '../../../../state/hooks/use-rovo-chat';
|
|
14
14
|
import useRovoConfig from '../../../../state/hooks/use-rovo-config';
|
|
15
15
|
import { useSmartCardState } from '../../../../state/store';
|
|
16
|
-
import { isRovoChatActionVisualizeEnabled } from '../../../../utils/is-rovo-chat-action-visualize-enabled';
|
|
17
16
|
import { getPromptAction, RovoChatPromptKey } from '../../../common/rovo-chat-utils';
|
|
18
17
|
import { ActionButton } from '../action-button';
|
|
19
18
|
import { OneClickChatSpotlightLoader } from '../one-click-chat-spotlight/async';
|
|
@@ -52,14 +51,6 @@ const InlineRovoActionButtonLegacy = ({
|
|
|
52
51
|
switch (extensionKey) {
|
|
53
52
|
case 'google-object-provider':
|
|
54
53
|
if ((_cardState$details = cardState.details) !== null && _cardState$details !== void 0 && (_cardState$details$da = _cardState$details.data) !== null && _cardState$details$da !== void 0 && (_cardState$details$da2 = _cardState$details$da['@type']) !== null && _cardState$details$da2 !== void 0 && _cardState$details$da2.includes('schema:SpreadsheetDigitalDocument')) {
|
|
55
|
-
// Only evaluate Visualize (and fire exposure) when the Rovo chat action is available.
|
|
56
|
-
if (rovoChatAction && isRovoChatActionVisualizeEnabled({
|
|
57
|
-
extensionKey,
|
|
58
|
-
product: rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product,
|
|
59
|
-
response: cardState.details
|
|
60
|
-
})) {
|
|
61
|
-
return RovoChatPromptKey.VISUALIZE;
|
|
62
|
-
}
|
|
63
54
|
return;
|
|
64
55
|
}
|
|
65
56
|
if ((_cardState$details2 = cardState.details) !== null && _cardState$details2 !== void 0 && (_cardState$details2$d = _cardState$details2.data) !== null && _cardState$details2$d !== void 0 && (_cardState$details2$d2 = _cardState$details2$d['@type']) !== null && _cardState$details2$d2 !== void 0 && _cardState$details2$d2.includes('schema:PresentationDigitalDocument')) {
|
|
@@ -136,14 +127,6 @@ const InlineRovoActionButtonWithSpotlight = ({
|
|
|
136
127
|
const promptKey = useMemo(() => {
|
|
137
128
|
var _cardState$details3, _cardState$details3$d, _cardState$details3$d2, _cardState$details4, _cardState$details4$d, _cardState$details4$d2;
|
|
138
129
|
if (extensionKey === 'google-object-provider' && (_cardState$details3 = cardState.details) !== null && _cardState$details3 !== void 0 && (_cardState$details3$d = _cardState$details3.data) !== null && _cardState$details3$d !== void 0 && (_cardState$details3$d2 = _cardState$details3$d['@type']) !== null && _cardState$details3$d2 !== void 0 && _cardState$details3$d2.includes('schema:SpreadsheetDigitalDocument')) {
|
|
139
|
-
// Only evaluate Visualize (and fire exposure) when the Rovo chat action is available.
|
|
140
|
-
if (rovoChatAction && isRovoChatActionVisualizeEnabled({
|
|
141
|
-
extensionKey,
|
|
142
|
-
product: rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.product,
|
|
143
|
-
response: cardState.details
|
|
144
|
-
})) {
|
|
145
|
-
return RovoChatPromptKey.VISUALIZE;
|
|
146
|
-
}
|
|
147
130
|
return;
|
|
148
131
|
}
|
|
149
132
|
switch (extensionKey) {
|
|
@@ -189,7 +172,7 @@ const InlineRovoActionButtonWithSpotlight = ({
|
|
|
189
172
|
event.preventDefault();
|
|
190
173
|
event.stopPropagation();
|
|
191
174
|
invokePrompt();
|
|
192
|
-
}, [invokePrompt]);
|
|
175
|
+
}, [invokePrompt, promptKey]);
|
|
193
176
|
const button = promptData && content ? /*#__PURE__*/React.createElement(ActionButton, {
|
|
194
177
|
onClick: handleClick,
|
|
195
178
|
testId: testId
|
|
@@ -198,12 +181,6 @@ const InlineRovoActionButtonWithSpotlight = ({
|
|
|
198
181
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
199
182
|
size: "small"
|
|
200
183
|
}, content))) : null;
|
|
201
|
-
|
|
202
|
-
// Visualize is not part of the spotlight: its copy is generic ("See takeaways") and Sheets
|
|
203
|
-
// links are excluded from the spotlight experiment, so render the plain button.
|
|
204
|
-
if (promptKey === RovoChatPromptKey.VISUALIZE) {
|
|
205
|
-
return button;
|
|
206
|
-
}
|
|
207
184
|
return button && isRovoChatEnabled && rovoChatAction !== null && rovoChatAction !== void 0 && rovoChatAction.invokeAction ? /*#__PURE__*/React.createElement(OneClickChatSpotlightLoader, {
|
|
208
185
|
key: url,
|
|
209
186
|
url: url,
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "46.22.
|
|
12
|
+
packageVersion: "46.22.3",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
|
|
3
3
|
import AiChatIcon from '@atlaskit/icon/core/ai-chat';
|
|
4
4
|
import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
|
|
5
|
-
import ChartBarIcon from '@atlaskit/icon/core/chart-bar';
|
|
6
5
|
import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
|
|
7
6
|
import { RovoIcon } from '@atlaskit/logo/rovo/icon';
|
|
8
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -27,7 +26,6 @@ export let RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
|
27
26
|
RovoChatPromptKey["EXPLAIN_CODE"] = "explain-code";
|
|
28
27
|
RovoChatPromptKey["CATCH_UP"] = "catch-up";
|
|
29
28
|
RovoChatPromptKey["SALESFORCE_PREP"] = "salesforce-prep";
|
|
30
|
-
RovoChatPromptKey["VISUALIZE"] = "visualize";
|
|
31
29
|
return RovoChatPromptKey;
|
|
32
30
|
}({});
|
|
33
31
|
const getContext = (intl, product) => {
|
|
@@ -371,29 +369,5 @@ export const getPromptAction = ({
|
|
|
371
369
|
size: iconSize
|
|
372
370
|
})
|
|
373
371
|
};
|
|
374
|
-
case RovoChatPromptKey.VISUALIZE:
|
|
375
|
-
const label_visualize = intl.formatMessage(messages.rovo_prompt_button_visualize);
|
|
376
|
-
const html_visualize = intl.formatMessage(messages.rovo_prompt_message_visualize, {
|
|
377
|
-
url
|
|
378
|
-
}, {
|
|
379
|
-
ignoreTag: true
|
|
380
|
-
});
|
|
381
|
-
const visualizeIconProps = {
|
|
382
|
-
label: label_visualize,
|
|
383
|
-
size: iconSize,
|
|
384
|
-
...(cardAppearance === CardDisplay.HoverCardPreview ? {
|
|
385
|
-
spacing: 'spacious'
|
|
386
|
-
} : {})
|
|
387
|
-
};
|
|
388
|
-
return {
|
|
389
|
-
content: label_visualize,
|
|
390
|
-
tooltipMessage: label_visualize,
|
|
391
|
-
data: {
|
|
392
|
-
name: label_visualize,
|
|
393
|
-
dialogues: [],
|
|
394
|
-
prompt: htmlToAdf(html_visualize)
|
|
395
|
-
},
|
|
396
|
-
icon: /*#__PURE__*/React.createElement(ChartBarIcon, visualizeIconProps)
|
|
397
|
-
};
|
|
398
372
|
}
|
|
399
373
|
};
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
import { isRovoChatActionVisualizeEnabled } from '../../../utils/is-rovo-chat-action-visualize-enabled';
|
|
2
1
|
import { RovoChatPromptKey } from '../rovo-chat-utils';
|
|
3
2
|
export const getRovoPostAuthPromptKeys = ({
|
|
4
|
-
extensionKey
|
|
5
|
-
isRovoChatActionShown = false,
|
|
6
|
-
product,
|
|
7
|
-
response
|
|
3
|
+
extensionKey
|
|
8
4
|
}) => {
|
|
9
5
|
const defaultPrompts = [RovoChatPromptKey.KEY_HIGHLIGHTS];
|
|
10
6
|
if (extensionKey === 'github-object-provider' || extensionKey === 'gitlab-object-provider') {
|
|
11
7
|
return [RovoChatPromptKey.EXPLAIN_CODE, ...defaultPrompts];
|
|
12
8
|
}
|
|
13
|
-
if (isRovoChatActionShown && isRovoChatActionVisualizeEnabled({
|
|
14
|
-
extensionKey,
|
|
15
|
-
product,
|
|
16
|
-
response
|
|
17
|
-
})) {
|
|
18
|
-
// Visualize goes first (PM decision). The embed Rovo actions footer hides every prompt after
|
|
19
|
-
// the first below 320px (HIDE_SECONDARY_ACTIONS_WIDTH), so this keeps Visualize visible on
|
|
20
|
-
// narrow embeds whenever exposure fires.
|
|
21
|
-
return [RovoChatPromptKey.VISUALIZE, RovoChatPromptKey.SUMMARIZE_DOCUMENT, ...defaultPrompts];
|
|
22
|
-
}
|
|
23
9
|
return [RovoChatPromptKey.SUMMARIZE_DOCUMENT, ...defaultPrompts];
|
|
24
10
|
};
|
package/dist/esm/constants.js
CHANGED
|
@@ -164,6 +164,7 @@ export var ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
164
164
|
}({});
|
|
165
165
|
export var InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
166
166
|
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
167
|
+
InternalActionName["RemixAction"] = "RemixAction";
|
|
167
168
|
InternalActionName["UnresolvedAction"] = "UnresolvedAction";
|
|
168
169
|
InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
|
|
169
170
|
return InternalActionName;
|
|
@@ -267,6 +268,7 @@ export var CardAction = /*#__PURE__*/function (CardAction) {
|
|
|
267
268
|
CardAction["DownloadAction"] = "DownloadAction";
|
|
268
269
|
CardAction["FollowAction"] = "FollowAction";
|
|
269
270
|
CardAction["PreviewAction"] = "PreviewAction";
|
|
271
|
+
CardAction["RemixAction"] = "RemixAction";
|
|
270
272
|
CardAction["RovoChatAction"] = "RovoChatAction";
|
|
271
273
|
CardAction["ViewAction"] = "ViewAction";
|
|
272
274
|
return CardAction;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
|
|
2
|
+
import { CardAction, InternalActionName } from '../../../constants';
|
|
3
|
+
import { getDefinitionId } from '../../../state/getDefinitionId';
|
|
4
|
+
import { getExtensionKey } from '../../../state/getExtensionKey';
|
|
5
|
+
import { getResourceType } from '../../../state/getResourceType';
|
|
6
|
+
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
7
|
+
import { isRemixActionEnabled } from '../../../utils/is-remix-action-enabled';
|
|
8
|
+
var extractRemixAction = function extractRemixAction(_ref) {
|
|
9
|
+
var _actionOptions$remixA, _extractSmartLinkUrl;
|
|
10
|
+
var actionOptions = _ref.actionOptions,
|
|
11
|
+
appearance = _ref.appearance,
|
|
12
|
+
id = _ref.id,
|
|
13
|
+
remix = _ref.remix,
|
|
14
|
+
response = _ref.response,
|
|
15
|
+
url = _ref.url;
|
|
16
|
+
if (!canShowAction(CardAction.RemixAction, actionOptions)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!(actionOptions !== null && actionOptions !== void 0 && (_actionOptions$remixA = actionOptions.remixAction) !== null && _actionOptions$remixA !== void 0 && _actionOptions$remixA.optIn)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
var remixUrl = (_extractSmartLinkUrl = extractSmartLinkUrl(response)) !== null && _extractSmartLinkUrl !== void 0 ? _extractSmartLinkUrl : url;
|
|
23
|
+
if (!remixUrl) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
var extensionKey = getExtensionKey(response);
|
|
27
|
+
if (!isRemixActionEnabled({
|
|
28
|
+
extensionKey: extensionKey,
|
|
29
|
+
remix: remix,
|
|
30
|
+
response: response
|
|
31
|
+
})) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
invokeAction: {
|
|
36
|
+
actionSubjectId: 'remix',
|
|
37
|
+
actionType: InternalActionName.RemixAction,
|
|
38
|
+
definitionId: getDefinitionId(response),
|
|
39
|
+
display: appearance,
|
|
40
|
+
extensionKey: extensionKey,
|
|
41
|
+
id: id,
|
|
42
|
+
resourceType: getResourceType(response)
|
|
43
|
+
},
|
|
44
|
+
url: remixUrl
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default extractRemixAction;
|
|
@@ -9,6 +9,7 @@ import { extractCopyLinkClientAction } from './extract-copy-link-action';
|
|
|
9
9
|
import { extractDownloadClientAction } from './extract-download-action';
|
|
10
10
|
import extractFollowAction from './extract-follow-action';
|
|
11
11
|
import { extractPreviewClientAction } from './extract-preview-action';
|
|
12
|
+
import extractRemixAction from './extract-remix-action';
|
|
12
13
|
import extractRovoChatAction from './extract-rovo-chat-action';
|
|
13
14
|
import { extractViewRelatedLinksAction } from './extract-view-related-links-action';
|
|
14
15
|
export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref) {
|
|
@@ -19,6 +20,7 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
|
|
|
19
20
|
id = _ref.id,
|
|
20
21
|
origin = _ref.origin,
|
|
21
22
|
product = _ref.product,
|
|
23
|
+
remix = _ref.remix,
|
|
22
24
|
response = _ref.response,
|
|
23
25
|
rovoConfig = _ref.rovoConfig,
|
|
24
26
|
transformUrl = _ref.transformUrl,
|
|
@@ -26,7 +28,7 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
|
|
|
26
28
|
isPreviewPanelAvailable = _ref.isPreviewPanelAvailable,
|
|
27
29
|
isPreviewRestricted = _ref.isPreviewRestricted,
|
|
28
30
|
openPreviewPanel = _ref.openPreviewPanel;
|
|
29
|
-
var action =
|
|
31
|
+
var action = _objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ActionName.CopyLinkAction, extractCopyLinkClientAction({
|
|
30
32
|
actionOptions: actionOptions,
|
|
31
33
|
appearance: appearance,
|
|
32
34
|
id: id,
|
|
@@ -56,7 +58,14 @@ export var extractFlexibleCardActions = function extractFlexibleCardActions(_ref
|
|
|
56
58
|
product: product,
|
|
57
59
|
response: response,
|
|
58
60
|
rovoConfig: rovoConfig
|
|
59
|
-
})), InternalActionName.
|
|
61
|
+
})), fg('platform_sl_3p_auth_visualize_killswitch') ? _defineProperty({}, InternalActionName.RemixAction, extractRemixAction({
|
|
62
|
+
actionOptions: actionOptions,
|
|
63
|
+
appearance: appearance,
|
|
64
|
+
id: id,
|
|
65
|
+
remix: remix,
|
|
66
|
+
response: response,
|
|
67
|
+
url: url
|
|
68
|
+
})) : undefined), {}, _defineProperty({}, InternalActionName.ViewRelatedLinksAction, extractViewRelatedLinksAction(response)));
|
|
60
69
|
return Object.values(action).some(function (value) {
|
|
61
70
|
return Boolean(value);
|
|
62
71
|
}) ? action : undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
|
|
3
|
+
var _excluded = ["appearance", "fireEvent", "id", "onClick", "onAuxClick", "onContextMenu", "origin", "product", "resolve", "rovoConfig", "remix", "actionOptions", "response", "status", "aiSummaryConfig", "isPreviewPanelAvailable", "isPreviewRestricted", "openPreviewPanel", "transformUrl"];
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
6
|
import { extractPersonOwnedBy } from '@atlaskit/link-extractors/extract-person-owned-by';
|
|
@@ -62,6 +62,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
62
62
|
product = _ref.product,
|
|
63
63
|
resolve = _ref.resolve,
|
|
64
64
|
rovoConfig = _ref.rovoConfig,
|
|
65
|
+
remix = _ref.remix,
|
|
65
66
|
actionOptions = _ref.actionOptions,
|
|
66
67
|
response = _ref.response,
|
|
67
68
|
status = _ref.status,
|
|
@@ -80,7 +81,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
80
81
|
var meta = (_response$meta = response.meta) !== null && _response$meta !== void 0 ? _response$meta : {};
|
|
81
82
|
var url = extractSmartLinkUrl(response);
|
|
82
83
|
return {
|
|
83
|
-
actions: extractFlexibleCardActions(_objectSpread(_objectSpread({
|
|
84
|
+
actions: extractFlexibleCardActions(_objectSpread(_objectSpread(_objectSpread({
|
|
84
85
|
actionOptions: actionOptions,
|
|
85
86
|
aiSummaryConfig: aiSummaryConfig,
|
|
86
87
|
appearance: appearance,
|
|
@@ -88,7 +89,10 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
88
89
|
id: id,
|
|
89
90
|
origin: origin,
|
|
90
91
|
product: product,
|
|
91
|
-
rovoConfig: rovoConfig
|
|
92
|
+
rovoConfig: rovoConfig
|
|
93
|
+
}, fg('platform_sl_3p_auth_visualize_killswitch') ? {
|
|
94
|
+
remix: remix
|
|
95
|
+
} : undefined), {}, {
|
|
92
96
|
response: response,
|
|
93
97
|
url: props.url,
|
|
94
98
|
// Use the original URL in edge cases, such as short links for AI summary and copy link actions.
|
package/dist/esm/messages.js
CHANGED
|
@@ -1111,14 +1111,9 @@ export var messages = defineMessages({
|
|
|
1111
1111
|
defaultMessage: 'Your team sees richer <b>{provider}</b> previews.',
|
|
1112
1112
|
description: 'Social proof message shown on unauthorized 3P block cards when less than 30% of the tenant has connected the provider. {provider} is the 3P app name (e.g. OneDrive).'
|
|
1113
1113
|
},
|
|
1114
|
-
|
|
1115
|
-
id: 'fabric.linking.
|
|
1116
|
-
defaultMessage: '
|
|
1117
|
-
description: '
|
|
1118
|
-
},
|
|
1119
|
-
rovo_prompt_message_visualize: {
|
|
1120
|
-
id: 'fabric.linking.rovo_prompt_message_visualize.non-final',
|
|
1121
|
-
defaultMessage: '<p>Visualize this link <a>{url}</a></p>',
|
|
1122
|
-
description: 'The prompt message to send to Rovo Chat. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
1114
|
+
rovo_prompt_button_remix: {
|
|
1115
|
+
id: 'fabric.linking.rovo_prompt_button_remix.non-final',
|
|
1116
|
+
defaultMessage: 'Remix',
|
|
1117
|
+
description: 'Button that opens the Remix chooser for this Smart Link.'
|
|
1123
1118
|
}
|
|
1124
1119
|
});
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "46.22.
|
|
7
|
+
packageVersion: "46.22.3" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
+
/**
|
|
4
|
+
* Check rollout without exposure: the action may never be rendered, e.g. in a hover preview.
|
|
5
|
+
* Remove this function on experiment cleanup; the business rules stay.
|
|
6
|
+
*/
|
|
7
|
+
var isRemixExperimentEnabled = function isRemixExperimentEnabled() {
|
|
8
|
+
return fg('platform_sl_3p_auth_visualize_killswitch') && UNSAFE_expValNoExposure('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `@type` is a string or string array per JSON-LD, but it comes from the network, so guard
|
|
13
|
+
* against any other shape rather than calling `.includes` on it directly.
|
|
14
|
+
*/
|
|
15
|
+
var isGoogleSheetsType = function isGoogleSheetsType(response) {
|
|
16
|
+
var _response$data;
|
|
17
|
+
var type = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data['@type'];
|
|
18
|
+
var types = Array.isArray(type) ? type : [type];
|
|
19
|
+
return types.includes('schema:SpreadsheetDigitalDocument');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Capability callbacks are implemented outside smart-card. Treat a failure as
|
|
23
|
+
// unavailable instead of failing card extraction/rendering.
|
|
24
|
+
var isRemixAvailable = function isRemixAvailable(remix) {
|
|
25
|
+
try {
|
|
26
|
+
return Boolean(remix === null || remix === void 0 ? void 0 : remix.isAvailable());
|
|
27
|
+
} catch (_unused) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Whether the Remix action is offered for a resolved link.
|
|
34
|
+
*
|
|
35
|
+
* This check does not record exposure. The rendered Remix control owns exposure.
|
|
36
|
+
*/
|
|
37
|
+
export var isRemixActionEnabled = function isRemixActionEnabled(_ref) {
|
|
38
|
+
var extensionKey = _ref.extensionKey,
|
|
39
|
+
remix = _ref.remix,
|
|
40
|
+
response = _ref.response;
|
|
41
|
+
return extensionKey === 'google-object-provider' && isGoogleSheetsType(response) && isRemixAvailable(remix) && isRemixExperimentEnabled();
|
|
42
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
3
|
+
|
|
4
|
+
/** Record exposure only once the eligible Remix control has been committed. */
|
|
5
|
+
export var useRemixActionExposure = function useRemixActionExposure(isRendered) {
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
if (isRendered) {
|
|
8
|
+
expVal('platform_sl_3p_auth_visualize_exp', 'isEnabled', false);
|
|
9
|
+
}
|
|
10
|
+
}, [isRendered]);
|
|
11
|
+
};
|