@atlaskit/smart-card 45.4.3 → 45.6.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 +29 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/cjs/state/hooks/use-embed-rovo-actions-footer-experiment/index.js +65 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +1 -0
- package/dist/cjs/view/CardWithUrl/experiment-meta-event-attributes/index.js +17 -3
- package/dist/cjs/view/EmbedCard/components/rovo-actions-footer/index.compiled.css +3 -0
- package/dist/cjs/view/EmbedCard/components/rovo-actions-footer/index.js +138 -0
- package/dist/cjs/view/EmbedCard/index.js +2 -0
- package/dist/cjs/view/EmbedCard/views/ResolvedView.compiled.css +6 -0
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +129 -36
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/rovo-post-auth-prompts/index.js +15 -0
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/es2019/state/hooks/use-embed-rovo-actions-footer-experiment/index.js +58 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +1 -0
- package/dist/es2019/view/CardWithUrl/experiment-meta-event-attributes/index.js +18 -2
- package/dist/es2019/view/EmbedCard/components/rovo-actions-footer/index.compiled.css +3 -0
- package/dist/es2019/view/EmbedCard/components/rovo-actions-footer/index.js +100 -0
- package/dist/es2019/view/EmbedCard/index.js +2 -0
- package/dist/es2019/view/EmbedCard/views/ResolvedView.compiled.css +6 -0
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +94 -13
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/rovo-post-auth-prompts/index.js +10 -0
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +3 -1
- package/dist/esm/state/hooks/use-embed-rovo-actions-footer-experiment/index.js +58 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +1 -0
- package/dist/esm/view/CardWithUrl/experiment-meta-event-attributes/index.js +17 -3
- package/dist/esm/view/EmbedCard/components/rovo-actions-footer/index.compiled.css +3 -0
- package/dist/esm/view/EmbedCard/components/rovo-actions-footer/index.js +129 -0
- package/dist/esm/view/EmbedCard/index.js +2 -0
- package/dist/esm/view/EmbedCard/views/ResolvedView.compiled.css +6 -0
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +125 -36
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/rovo-post-auth-prompts/index.js +9 -0
- package/dist/types/extractors/flexible/actions/extract-rovo-chat-action.d.ts +2 -1
- package/dist/types/state/hooks/use-embed-rovo-actions-footer-experiment/index.d.ts +23 -0
- package/dist/types/view/CardWithUrl/experiment-meta-event-attributes/index.d.ts +5 -2
- package/dist/types/view/EmbedCard/components/rovo-actions-footer/index.d.ts +14 -0
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +8 -0
- package/dist/types/view/common/rovo-post-auth-prompts/index.d.ts +5 -0
- package/package.json +56 -49
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
import "./index.compiled.css";
|
|
6
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
11
|
+
import { useIntl } from 'react-intl';
|
|
12
|
+
import Button from '@atlaskit/button/new';
|
|
13
|
+
import { WidthObserver } from '@atlaskit/width-detector';
|
|
14
|
+
import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
|
|
15
|
+
import useRovoChat from '../../../../state/hooks/use-rovo-chat';
|
|
16
|
+
import { getPromptAction } from '../../../common/rovo-chat-utils';
|
|
17
|
+
import AIEditIcon from '../../../FlexibleCard/assets/ai-edit-icon';
|
|
18
|
+
var HIDE_SECONDARY_ACTIONS_WIDTH = 320;
|
|
19
|
+
var PRIMARY_ACTION_ICON_ONLY_WIDTH = 220;
|
|
20
|
+
var styles = {
|
|
21
|
+
actionGroup: "_zulpidpf _1e0c1txw _2lx2vrvc"
|
|
22
|
+
};
|
|
23
|
+
var RovoPromptButton = function RovoPromptButton(_ref) {
|
|
24
|
+
var _ref$hideContent = _ref.hideContent,
|
|
25
|
+
hideContent = _ref$hideContent === void 0 ? false : _ref$hideContent,
|
|
26
|
+
icon = _ref.icon,
|
|
27
|
+
onClick = _ref.onClick,
|
|
28
|
+
promptAction = _ref.promptAction,
|
|
29
|
+
promptKey = _ref.promptKey,
|
|
30
|
+
testId = _ref.testId;
|
|
31
|
+
var iconBefore = useCallback(function () {
|
|
32
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, icon);
|
|
35
|
+
}, [icon]);
|
|
36
|
+
var label = promptAction.data.name;
|
|
37
|
+
var handleClick = useCallback(function (event) {
|
|
38
|
+
return onClick(event, promptAction.data, promptKey);
|
|
39
|
+
}, [onClick, promptAction.data, promptKey]);
|
|
40
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
41
|
+
appearance: "subtle",
|
|
42
|
+
"aria-label": hideContent ? label : undefined,
|
|
43
|
+
iconBefore: iconBefore,
|
|
44
|
+
onClick: handleClick,
|
|
45
|
+
spacing: "compact",
|
|
46
|
+
testId: "".concat(testId, "-").concat(promptKey)
|
|
47
|
+
}, hideContent ? null : label);
|
|
48
|
+
};
|
|
49
|
+
var EmbedRovoActionsFooter = function EmbedRovoActionsFooter(_ref2) {
|
|
50
|
+
var actionData = _ref2.actionData,
|
|
51
|
+
prompts = _ref2.prompts,
|
|
52
|
+
_ref2$testId = _ref2.testId,
|
|
53
|
+
testId = _ref2$testId === void 0 ? 'embed-rovo-actions-footer' : _ref2$testId;
|
|
54
|
+
var intl = useIntl();
|
|
55
|
+
var invoke = useInvokeClientAction({});
|
|
56
|
+
var _useRovoChat = useRovoChat(),
|
|
57
|
+
isRovoChatEnabled = _useRovoChat.isRovoChatEnabled,
|
|
58
|
+
sendPromptMessage = _useRovoChat.sendPromptMessage;
|
|
59
|
+
var _useState = useState(undefined),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
containerWidth = _useState2[0],
|
|
62
|
+
setContainerWidth = _useState2[1];
|
|
63
|
+
var shouldHideSecondaryActions = containerWidth !== undefined && containerWidth < HIDE_SECONDARY_ACTIONS_WIDTH;
|
|
64
|
+
var shouldHidePrimaryActionContent = containerWidth !== undefined && containerWidth < PRIMARY_ACTION_ICON_ONLY_WIDTH;
|
|
65
|
+
var onClick = useCallback(function (event, promptData, promptKey) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
invoke(_objectSpread(_objectSpread({}, actionData.invokeAction), {}, {
|
|
69
|
+
actionFn: function () {
|
|
70
|
+
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
71
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
return _context.abrupt("return", sendPromptMessage(promptData));
|
|
75
|
+
case 1:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee);
|
|
80
|
+
}));
|
|
81
|
+
function actionFn() {
|
|
82
|
+
return _actionFn.apply(this, arguments);
|
|
83
|
+
}
|
|
84
|
+
return actionFn;
|
|
85
|
+
}(),
|
|
86
|
+
prompt: promptKey
|
|
87
|
+
}));
|
|
88
|
+
}, [actionData.invokeAction, invoke, sendPromptMessage]);
|
|
89
|
+
var promptActions = useMemo(function () {
|
|
90
|
+
return prompts.reduce(function (actions, promptKey) {
|
|
91
|
+
if (shouldHideSecondaryActions && actions.length > 0) {
|
|
92
|
+
return actions;
|
|
93
|
+
}
|
|
94
|
+
var promptAction = getPromptAction({
|
|
95
|
+
promptKey: promptKey,
|
|
96
|
+
intl: intl,
|
|
97
|
+
url: actionData.url,
|
|
98
|
+
product: actionData.product,
|
|
99
|
+
iconSize: 'small'
|
|
100
|
+
});
|
|
101
|
+
if (!promptAction) {
|
|
102
|
+
return actions;
|
|
103
|
+
}
|
|
104
|
+
var isPrimaryAction = actions.length === 0;
|
|
105
|
+
actions.push( /*#__PURE__*/React.createElement(RovoPromptButton, {
|
|
106
|
+
hideContent: isPrimaryAction && shouldHidePrimaryActionContent,
|
|
107
|
+
icon: isPrimaryAction ? /*#__PURE__*/React.createElement(AIEditIcon, null) : promptAction.icon,
|
|
108
|
+
key: promptKey,
|
|
109
|
+
onClick: onClick,
|
|
110
|
+
promptAction: promptAction,
|
|
111
|
+
promptKey: promptKey,
|
|
112
|
+
testId: testId
|
|
113
|
+
}));
|
|
114
|
+
return actions;
|
|
115
|
+
}, []);
|
|
116
|
+
}, [actionData.product, actionData.url, intl, onClick, prompts, shouldHidePrimaryActionContent, shouldHideSecondaryActions, testId]);
|
|
117
|
+
if (!isRovoChatEnabled || promptActions.length === 0) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
"data-testid": testId
|
|
122
|
+
}, /*#__PURE__*/React.createElement(WidthObserver, {
|
|
123
|
+
setWidth: setContainerWidth,
|
|
124
|
+
offscreen: true
|
|
125
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: ax([styles.actionGroup])
|
|
127
|
+
}, promptActions));
|
|
128
|
+
};
|
|
129
|
+
export default EmbedRovoActionsFooter;
|
|
@@ -97,6 +97,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref2, iframeRef)
|
|
|
97
97
|
}
|
|
98
98
|
if (resolvedViewProps.preview) {
|
|
99
99
|
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
100
|
+
actionOptions: actionOptions,
|
|
101
|
+
details: details,
|
|
100
102
|
isSelected: isSelected,
|
|
101
103
|
frameStyle: frameStyle,
|
|
102
104
|
inheritDimensions: inheritDimensions,
|
|
@@ -1,37 +1,118 @@
|
|
|
1
|
+
/* ResolvedView.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import "./ResolvedView.compiled.css";
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
3
6
|
import React from 'react';
|
|
7
|
+
import Loadable from 'react-loadable';
|
|
4
8
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
5
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
6
11
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
12
|
+
import { CardDisplay } from '../../../constants';
|
|
13
|
+
import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
|
|
14
|
+
import { getExtensionKey } from '../../../state/helpers';
|
|
15
|
+
import useEmbedRovoActionsFooterExperiment from '../../../state/hooks/use-embed-rovo-actions-footer-experiment';
|
|
16
|
+
import useRovoConfig from '../../../state/hooks/use-rovo-config';
|
|
7
17
|
import { getPreviewUrlWithTheme, isProfileType } from '../../../utils';
|
|
18
|
+
import { getRovoPostAuthPromptKeys } from '../../common/rovo-post-auth-prompts';
|
|
8
19
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
9
20
|
import { Frame } from '../components/Frame';
|
|
10
21
|
import { ImageIcon } from '../components/ImageIcon';
|
|
11
22
|
import { useEmbedResolvePostMessageListener } from '../useEmbedResolvePostMessageListener';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
var EmbedRovoActionsFooter = Loadable({
|
|
24
|
+
loader: function loader() {
|
|
25
|
+
return import( /* webpackChunkName: "smart-card-embed-rovo-actions-footer" */'../components/rovo-actions-footer').then(function (module) {
|
|
26
|
+
return module.default;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
loading: function loading() {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
EmbedRovoActionsFooter.displayName = 'lazy(EmbedRovoActionsFooter)';
|
|
34
|
+
var styles = {
|
|
35
|
+
contentWithFooter: "_1e0c1txw _2lx21bp4 _4t3i1osq _1tkeidpf",
|
|
36
|
+
frameWithFooter: "_16jlkb7n _1tkeidpf",
|
|
37
|
+
footer: "_1e0c1txw _1bah1y6m"
|
|
38
|
+
};
|
|
39
|
+
var EmbedFrameWithRovoFooter = function EmbedFrameWithRovoFooter(_ref) {
|
|
40
|
+
var actionOptions = _ref.actionOptions,
|
|
41
|
+
details = _ref.details,
|
|
42
|
+
frame = _ref.frame,
|
|
43
|
+
link = _ref.link,
|
|
44
|
+
testId = _ref.testId;
|
|
45
|
+
var _useRovoConfig = useRovoConfig(),
|
|
46
|
+
rovoOptions = _useRovoConfig.rovoOptions,
|
|
47
|
+
product = _useRovoConfig.product;
|
|
48
|
+
var _useEmbedRovoActionsF = useEmbedRovoActionsFooterExperiment(link, actionOptions, rovoOptions, product),
|
|
49
|
+
isEmbedRovoActionsFooterEnabled = _useEmbedRovoActionsF.isEnabled;
|
|
50
|
+
var rovoActionData = React.useMemo(function () {
|
|
51
|
+
return isEmbedRovoActionsFooterEnabled && details ? extractRovoChatAction({
|
|
52
|
+
response: details,
|
|
53
|
+
rovoConfig: {
|
|
54
|
+
rovoOptions: rovoOptions,
|
|
55
|
+
product: product
|
|
56
|
+
},
|
|
57
|
+
product: product,
|
|
58
|
+
actionOptions: actionOptions,
|
|
59
|
+
appearance: CardDisplay.Embed,
|
|
60
|
+
isEmbedRovoActionsFooterExperimentEnabled: isEmbedRovoActionsFooterEnabled
|
|
61
|
+
}) : undefined;
|
|
62
|
+
}, [actionOptions, details, isEmbedRovoActionsFooterEnabled, product, rovoOptions]);
|
|
63
|
+
var prompts = React.useMemo(function () {
|
|
64
|
+
if (!isEmbedRovoActionsFooterEnabled) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return getRovoPostAuthPromptKeys({
|
|
68
|
+
extensionKey: getExtensionKey(details)
|
|
69
|
+
});
|
|
70
|
+
}, [details, isEmbedRovoActionsFooterEnabled]);
|
|
71
|
+
var footer = React.useMemo(function () {
|
|
72
|
+
return rovoActionData && prompts.length > 0 ? /*#__PURE__*/React.createElement(EmbedRovoActionsFooter, {
|
|
73
|
+
actionData: rovoActionData,
|
|
74
|
+
prompts: prompts,
|
|
75
|
+
testId: "".concat(testId, "-rovo-actions-footer")
|
|
76
|
+
}) : undefined;
|
|
77
|
+
}, [prompts, rovoActionData, testId]);
|
|
78
|
+
return footer ? /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: ax([styles.contentWithFooter])
|
|
80
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: ax([styles.frameWithFooter])
|
|
82
|
+
}, frame), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: ax([styles.footer])
|
|
84
|
+
}, footer)) : frame;
|
|
85
|
+
};
|
|
86
|
+
var EmbedFrameWithoutRovoFooter = function EmbedFrameWithoutRovoFooter(_ref2) {
|
|
87
|
+
var frame = _ref2.frame;
|
|
88
|
+
return frame;
|
|
89
|
+
};
|
|
90
|
+
var EmbedFrameWithOptionalRovoFooter = componentWithFG('platform_sl_3p_auth_rovo_embed_footer_kill_switch', EmbedFrameWithRovoFooter, EmbedFrameWithoutRovoFooter);
|
|
91
|
+
export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref3, embedIframeRef) {
|
|
92
|
+
var actionOptions = _ref3.actionOptions,
|
|
93
|
+
link = _ref3.link,
|
|
94
|
+
context = _ref3.context,
|
|
95
|
+
details = _ref3.details,
|
|
96
|
+
onClick = _ref3.onClick,
|
|
97
|
+
onAuxClick = _ref3.onAuxClick,
|
|
98
|
+
onContextMenu = _ref3.onContextMenu,
|
|
99
|
+
isSelected = _ref3.isSelected,
|
|
100
|
+
frameStyle = _ref3.frameStyle,
|
|
101
|
+
preview = _ref3.preview,
|
|
102
|
+
title = _ref3.title,
|
|
103
|
+
isTrusted = _ref3.isTrusted,
|
|
104
|
+
_ref3$testId = _ref3.testId,
|
|
105
|
+
testId = _ref3$testId === void 0 ? 'embed-card-resolved-view' : _ref3$testId,
|
|
106
|
+
inheritDimensions = _ref3.inheritDimensions,
|
|
107
|
+
onIframeDwell = _ref3.onIframeDwell,
|
|
108
|
+
onIframeFocus = _ref3.onIframeFocus,
|
|
109
|
+
onIframeMouseEnter = _ref3.onIframeMouseEnter,
|
|
110
|
+
onIframeMouseLeave = _ref3.onIframeMouseLeave,
|
|
111
|
+
isSupportTheming = _ref3.isSupportTheming,
|
|
112
|
+
type = _ref3.type,
|
|
113
|
+
CompetitorPrompt = _ref3.CompetitorPrompt,
|
|
114
|
+
hideIconLoadingSkeleton = _ref3.hideIconLoadingSkeleton,
|
|
115
|
+
extensionKey = _ref3.extensionKey;
|
|
35
116
|
var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
36
117
|
var iconLabel = context === null || context === void 0 ? void 0 : context.iconLabel;
|
|
37
118
|
var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
@@ -70,6 +151,26 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
70
151
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
71
152
|
isMouseOver = _React$useState2[0],
|
|
72
153
|
setMouseOver = _React$useState2[1];
|
|
154
|
+
var frame = /*#__PURE__*/React.createElement(Frame, {
|
|
155
|
+
url: previewUrl,
|
|
156
|
+
isTrusted: isTrusted,
|
|
157
|
+
testId: testId,
|
|
158
|
+
ref: embedIframeRef,
|
|
159
|
+
onIframeDwell: onIframeDwell,
|
|
160
|
+
onIframeFocus: onIframeFocus,
|
|
161
|
+
onIframeMouseEnter: onIframeMouseEnter,
|
|
162
|
+
onIframeMouseLeave: onIframeMouseLeave,
|
|
163
|
+
isMouseOver: isMouseOver,
|
|
164
|
+
title: text,
|
|
165
|
+
extensionKey: extensionKey
|
|
166
|
+
});
|
|
167
|
+
var frameWithFooter = /*#__PURE__*/React.createElement(EmbedFrameWithOptionalRovoFooter, {
|
|
168
|
+
actionOptions: actionOptions,
|
|
169
|
+
details: details,
|
|
170
|
+
frame: frame,
|
|
171
|
+
link: link,
|
|
172
|
+
testId: testId
|
|
173
|
+
});
|
|
73
174
|
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
74
175
|
isSelected: isSelected,
|
|
75
176
|
frameStyle: frameStyle,
|
|
@@ -91,17 +192,5 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
|
|
|
91
192
|
setMouseOver(false);
|
|
92
193
|
onIframeMouseLeave === null || onIframeMouseLeave === void 0 || onIframeMouseLeave();
|
|
93
194
|
}
|
|
94
|
-
},
|
|
95
|
-
url: previewUrl,
|
|
96
|
-
isTrusted: isTrusted,
|
|
97
|
-
testId: testId,
|
|
98
|
-
ref: embedIframeRef,
|
|
99
|
-
onIframeDwell: onIframeDwell,
|
|
100
|
-
onIframeFocus: onIframeFocus,
|
|
101
|
-
onIframeMouseEnter: onIframeMouseEnter,
|
|
102
|
-
onIframeMouseLeave: onIframeMouseLeave,
|
|
103
|
-
isMouseOver: isMouseOver,
|
|
104
|
-
title: text,
|
|
105
|
-
extensionKey: extensionKey
|
|
106
|
-
}));
|
|
195
|
+
}, frameWithFooter);
|
|
107
196
|
});
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.
|
|
15
|
+
packageVersion: "45.5.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RovoChatPromptKey } from '../rovo-chat-utils';
|
|
2
|
+
export var getRovoPostAuthPromptKeys = function getRovoPostAuthPromptKeys(_ref) {
|
|
3
|
+
var extensionKey = _ref.extensionKey;
|
|
4
|
+
var defaultPrompts = [RovoChatPromptKey.KEY_HIGHLIGHTS];
|
|
5
|
+
if (extensionKey === 'github-object-provider' || extensionKey === 'gitlab-object-provider') {
|
|
6
|
+
return [RovoChatPromptKey.EXPLAIN_CODE].concat(defaultPrompts);
|
|
7
|
+
}
|
|
8
|
+
return [RovoChatPromptKey.SUMMARIZE_DOCUMENT].concat(defaultPrompts);
|
|
9
|
+
};
|
|
@@ -8,9 +8,10 @@ type ExtractInvokeRovoChatActionParam = {
|
|
|
8
8
|
actionOptions?: CardActionOptions;
|
|
9
9
|
appearance?: FlexibleCardProps['appearance'];
|
|
10
10
|
id?: string;
|
|
11
|
+
isEmbedRovoActionsFooterExperimentEnabled?: boolean;
|
|
11
12
|
product?: ProductType;
|
|
12
13
|
response: JsonLd.Response;
|
|
13
14
|
rovoConfig?: RovoConfig;
|
|
14
15
|
};
|
|
15
|
-
declare const extractRovoChatAction: ({ actionOptions, appearance, id, product, response, rovoConfig, }: ExtractInvokeRovoChatActionParam) => RovoChatActionData | undefined;
|
|
16
|
+
declare const extractRovoChatAction: ({ actionOptions, appearance, id, isEmbedRovoActionsFooterExperimentEnabled, product, response, rovoConfig, }: ExtractInvokeRovoChatActionParam) => RovoChatActionData | undefined;
|
|
16
17
|
export default extractRovoChatAction;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ProductType } from '@atlaskit/linking-common';
|
|
2
|
+
import type { RovoConfig } from '../../../state/hooks/use-rovo-config';
|
|
3
|
+
import type { CardActionOptions } from '../../../view/Card/types';
|
|
4
|
+
export declare const EMBED_ROVO_ACTIONS_FOOTER_EXPERIMENT_KEY = "platform_sl_3p_auth_rovo_embed_footer_exp";
|
|
5
|
+
type EmbedRovoActionsFooterExperimentMetadata = {
|
|
6
|
+
isEligible: boolean;
|
|
7
|
+
isTreatment?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type EmbedRovoActionsFooterExperimentMeta = {
|
|
10
|
+
[EMBED_ROVO_ACTIONS_FOOTER_EXPERIMENT_KEY]: EmbedRovoActionsFooterExperimentMetadata;
|
|
11
|
+
};
|
|
12
|
+
export interface EmbedRovoActionsFooterExperiment {
|
|
13
|
+
isEnabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const isEmbedRovoActionsFooterExperimentEnabled: (product?: ProductType) => boolean;
|
|
16
|
+
export declare const getEmbedRovoActionsFooterExperimentMeta: ({ extensionKey, isRovoChatActionOptedIn, isRovoChatEnabled, product, }: {
|
|
17
|
+
extensionKey?: string;
|
|
18
|
+
isRovoChatActionOptedIn: boolean;
|
|
19
|
+
isRovoChatEnabled: boolean;
|
|
20
|
+
product?: ProductType;
|
|
21
|
+
}) => EmbedRovoActionsFooterExperimentMeta | undefined;
|
|
22
|
+
declare const useEmbedRovoActionsFooterExperiment: (url?: string, actionOptions?: CardActionOptions, rovoOptions?: RovoConfig["rovoOptions"], product?: ProductType) => EmbedRovoActionsFooterExperiment;
|
|
23
|
+
export default useEmbedRovoActionsFooterExperiment;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { CardAppearance, CardState } from '@atlaskit/linking-common';
|
|
2
|
+
import { type EmbedRovoActionsFooterExperimentMeta } from '../../../state/hooks/use-embed-rovo-actions-footer-experiment';
|
|
2
3
|
import { type BlockCardSocialProofExperimentMeta, type InlineSocialProofExperimentMeta } from '../../../state/hooks/use-social-proof-experiment';
|
|
3
|
-
type
|
|
4
|
+
import type { InternalCardActionOptions } from '../../Card/types';
|
|
5
|
+
type ExperimentMetaEventAttributes = Partial<BlockCardSocialProofExperimentMeta & InlineSocialProofExperimentMeta & EmbedRovoActionsFooterExperimentMeta>;
|
|
4
6
|
type ExperimentMetaEventAttributesParams = {
|
|
7
|
+
actionOptions?: InternalCardActionOptions;
|
|
5
8
|
appearance: CardAppearance;
|
|
6
9
|
state: CardState;
|
|
7
10
|
};
|
|
8
|
-
declare const useExperimentMetaEventAttributes: ({ appearance, state, }: ExperimentMetaEventAttributesParams) => ExperimentMetaEventAttributes | undefined;
|
|
11
|
+
declare const useExperimentMetaEventAttributes: ({ actionOptions, appearance, state, }: ExperimentMetaEventAttributesParams) => ExperimentMetaEventAttributes | undefined;
|
|
9
12
|
export default useExperimentMetaEventAttributes;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { RovoChatActionData } from '../../../../state/flexible-ui-context/types';
|
|
7
|
+
import { type RovoChatPromptKey } from '../../../common/rovo-chat-utils';
|
|
8
|
+
type EmbedRovoActionsFooterProps = {
|
|
9
|
+
actionData: RovoChatActionData;
|
|
10
|
+
prompts: RovoChatPromptKey[];
|
|
11
|
+
testId?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const EmbedRovoActionsFooter: ({ actionData, prompts, testId, }: EmbedRovoActionsFooterProps) => React.JSX.Element | null;
|
|
14
|
+
export default EmbedRovoActionsFooter;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
1
5
|
import React from 'react';
|
|
6
|
+
import { type JsonLd } from '@atlaskit/json-ld-types';
|
|
7
|
+
import type { InternalCardActionOptions as CardActionOptions } from '../../Card/types';
|
|
2
8
|
import { type ContextViewModel, type FrameStyle } from '../types';
|
|
3
9
|
export interface EmbedCardResolvedViewProps {
|
|
10
|
+
actionOptions?: CardActionOptions;
|
|
4
11
|
/** Component to prompt for competitor link */
|
|
5
12
|
CompetitorPrompt?: React.ComponentType<{
|
|
6
13
|
linkType?: string;
|
|
@@ -8,6 +15,7 @@ export interface EmbedCardResolvedViewProps {
|
|
|
8
15
|
}>;
|
|
9
16
|
/** The context view model */
|
|
10
17
|
context?: ContextViewModel;
|
|
18
|
+
details?: JsonLd.Response;
|
|
11
19
|
/** The extension key */
|
|
12
20
|
extensionKey?: string;
|
|
13
21
|
/** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.6.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,60 +39,60 @@
|
|
|
39
39
|
"@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.6.0",
|
|
40
40
|
"@atlaskit/analytics-cross-product": "^2.0.0",
|
|
41
41
|
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
42
|
-
"@atlaskit/analytics-next": "^12.
|
|
43
|
-
"@atlaskit/avatar": "^26.
|
|
44
|
-
"@atlaskit/avatar-group": "^13.
|
|
45
|
-
"@atlaskit/badge": "^19.
|
|
46
|
-
"@atlaskit/browser-apis": "^1.
|
|
47
|
-
"@atlaskit/button": "^24.
|
|
48
|
-
"@atlaskit/checkbox": "^18.
|
|
42
|
+
"@atlaskit/analytics-next": "^12.1.0",
|
|
43
|
+
"@atlaskit/avatar": "^26.1.0",
|
|
44
|
+
"@atlaskit/avatar-group": "^13.1.0",
|
|
45
|
+
"@atlaskit/badge": "^19.1.0",
|
|
46
|
+
"@atlaskit/browser-apis": "^1.1.0",
|
|
47
|
+
"@atlaskit/button": "^24.2.0",
|
|
48
|
+
"@atlaskit/checkbox": "^18.1.0",
|
|
49
49
|
"@atlaskit/css": "^1.0.0",
|
|
50
|
-
"@atlaskit/dropdown-menu": "^17.
|
|
51
|
-
"@atlaskit/embedded-confluence": "^6.
|
|
50
|
+
"@atlaskit/dropdown-menu": "^17.1.0",
|
|
51
|
+
"@atlaskit/embedded-confluence": "^6.1.0",
|
|
52
52
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
53
|
-
"@atlaskit/flag": "^18.
|
|
54
|
-
"@atlaskit/form": "^16.
|
|
55
|
-
"@atlaskit/frontend-utilities": "^4.
|
|
56
|
-
"@atlaskit/heading": "^6.
|
|
57
|
-
"@atlaskit/icon": "^36.
|
|
58
|
-
"@atlaskit/icon-file-type": "^8.
|
|
59
|
-
"@atlaskit/icon-lab": "^7.
|
|
60
|
-
"@atlaskit/image": "^4.
|
|
53
|
+
"@atlaskit/flag": "^18.1.0",
|
|
54
|
+
"@atlaskit/form": "^16.1.0",
|
|
55
|
+
"@atlaskit/frontend-utilities": "^4.1.0",
|
|
56
|
+
"@atlaskit/heading": "^6.1.0",
|
|
57
|
+
"@atlaskit/icon": "^36.1.0",
|
|
58
|
+
"@atlaskit/icon-file-type": "^8.1.0",
|
|
59
|
+
"@atlaskit/icon-lab": "^7.2.0",
|
|
60
|
+
"@atlaskit/image": "^4.1.0",
|
|
61
61
|
"@atlaskit/json-ld-types": "^2.0.0",
|
|
62
|
-
"@atlaskit/link": "^4.
|
|
63
|
-
"@atlaskit/link-analytics": "^12.
|
|
64
|
-
"@atlaskit/link-client-extension": "^7.
|
|
65
|
-
"@atlaskit/link-extractors": "^3.
|
|
62
|
+
"@atlaskit/link": "^4.1.0",
|
|
63
|
+
"@atlaskit/link-analytics": "^12.1.0",
|
|
64
|
+
"@atlaskit/link-client-extension": "^7.1.0",
|
|
65
|
+
"@atlaskit/link-extractors": "^3.2.0",
|
|
66
66
|
"@atlaskit/link-test-helpers": "^11.0.0",
|
|
67
67
|
"@atlaskit/linking-common": "^11.0.0",
|
|
68
68
|
"@atlaskit/linking-types": "^15.0.0",
|
|
69
|
-
"@atlaskit/logo": "^21.
|
|
70
|
-
"@atlaskit/lozenge": "^14.
|
|
71
|
-
"@atlaskit/menu": "^9.
|
|
72
|
-
"@atlaskit/modal-dialog": "^16.
|
|
73
|
-
"@atlaskit/motion": "^7.
|
|
74
|
-
"@atlaskit/object": "^2.
|
|
69
|
+
"@atlaskit/logo": "^21.2.0",
|
|
70
|
+
"@atlaskit/lozenge": "^14.1.0",
|
|
71
|
+
"@atlaskit/menu": "^9.1.0",
|
|
72
|
+
"@atlaskit/modal-dialog": "^16.1.0",
|
|
73
|
+
"@atlaskit/motion": "^7.2.0",
|
|
74
|
+
"@atlaskit/object": "^2.1.0",
|
|
75
75
|
"@atlaskit/outbound-auth-flow-client": "^4.0.0",
|
|
76
76
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
77
|
-
"@atlaskit/platform-feature-flags-react": "^1.
|
|
78
|
-
"@atlaskit/popup": "^5.
|
|
79
|
-
"@atlaskit/primitives": "^20.
|
|
77
|
+
"@atlaskit/platform-feature-flags-react": "^1.1.0",
|
|
78
|
+
"@atlaskit/popup": "^5.1.0",
|
|
79
|
+
"@atlaskit/primitives": "^20.1.0",
|
|
80
80
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
81
|
-
"@atlaskit/react-ufo": "^7.
|
|
82
|
-
"@atlaskit/rovo-triggers": "^9.
|
|
83
|
-
"@atlaskit/section-message": "^9.
|
|
84
|
-
"@atlaskit/select": "^22.
|
|
85
|
-
"@atlaskit/spinner": "^20.
|
|
86
|
-
"@atlaskit/tag": "^15.
|
|
87
|
-
"@atlaskit/textarea": "^9.
|
|
88
|
-
"@atlaskit/textfield": "^9.
|
|
89
|
-
"@atlaskit/theme": "^26.
|
|
90
|
-
"@atlaskit/tile": "^2.
|
|
91
|
-
"@atlaskit/tmp-editor-statsig": "^114.
|
|
92
|
-
"@atlaskit/tokens": "^15.
|
|
93
|
-
"@atlaskit/tooltip": "^23.
|
|
81
|
+
"@atlaskit/react-ufo": "^7.3.0",
|
|
82
|
+
"@atlaskit/rovo-triggers": "^9.3.0",
|
|
83
|
+
"@atlaskit/section-message": "^9.2.0",
|
|
84
|
+
"@atlaskit/select": "^22.2.0",
|
|
85
|
+
"@atlaskit/spinner": "^20.1.0",
|
|
86
|
+
"@atlaskit/tag": "^15.1.0",
|
|
87
|
+
"@atlaskit/textarea": "^9.1.0",
|
|
88
|
+
"@atlaskit/textfield": "^9.1.0",
|
|
89
|
+
"@atlaskit/theme": "^26.1.0",
|
|
90
|
+
"@atlaskit/tile": "^2.1.0",
|
|
91
|
+
"@atlaskit/tmp-editor-statsig": "^114.2.0",
|
|
92
|
+
"@atlaskit/tokens": "^15.1.0",
|
|
93
|
+
"@atlaskit/tooltip": "^23.1.0",
|
|
94
94
|
"@atlaskit/ufo": "^1.0.0",
|
|
95
|
-
"@atlaskit/width-detector": "^6.
|
|
95
|
+
"@atlaskit/width-detector": "^6.1.0",
|
|
96
96
|
"@babel/runtime": "^7.0.0",
|
|
97
97
|
"@compiled/react": "^0.20.0",
|
|
98
98
|
"@formatjs/intl-utils": "^3.8.4",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"uuid": "^3.1.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@atlaskit/link-provider": "^5.
|
|
111
|
+
"@atlaskit/link-provider": "^5.1.0",
|
|
112
112
|
"react": "^18.2.0",
|
|
113
113
|
"react-dom": "^18.2.0",
|
|
114
114
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -116,16 +116,16 @@
|
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@af/integration-testing": "workspace:^",
|
|
118
118
|
"@af/visual-regression": "workspace:^",
|
|
119
|
-
"@atlaskit/analytics-listeners": "^11.
|
|
119
|
+
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
120
120
|
"@atlaskit/css-reset": "^8.0.0",
|
|
121
|
-
"@atlaskit/media-test-helpers": "^42.
|
|
121
|
+
"@atlaskit/media-test-helpers": "^42.1.0",
|
|
122
122
|
"@atlaskit/ssr": "workspace:^",
|
|
123
123
|
"@atlassian/a11y-jest-testing": "^0.13.0",
|
|
124
124
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
125
125
|
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
126
126
|
"@atlassian/gemini": "^1.47.0",
|
|
127
127
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
128
|
-
"@atlassian/testing-library": "^0.
|
|
128
|
+
"@atlassian/testing-library": "^0.7.0",
|
|
129
129
|
"@testing-library/dom": "^10.1.0",
|
|
130
130
|
"@testing-library/jest-dom": "^6.4.5",
|
|
131
131
|
"@types/facepaint": "^1.2.1",
|
|
@@ -240,6 +240,13 @@
|
|
|
240
240
|
"smart-card-inline-resolved-view-refactor": {
|
|
241
241
|
"type": "boolean"
|
|
242
242
|
},
|
|
243
|
+
"platform_sl_3p_auth_rovo_embed_footer_kill_switch": {
|
|
244
|
+
"type": "boolean"
|
|
245
|
+
},
|
|
246
|
+
"platform_sl_3p_auth_rovo_embed_footer_exp": {
|
|
247
|
+
"type": "boolean",
|
|
248
|
+
"referenceOnly": true
|
|
249
|
+
},
|
|
243
250
|
"dfo-fix-preview-dynamic-style": {
|
|
244
251
|
"type": "boolean"
|
|
245
252
|
},
|