@atlaskit/smart-card 43.30.1 → 43.31.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 +12 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +3 -0
- package/dist/cjs/messages.js +60 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/HoverCard/components/ContentContainer.compiled.css +2 -1
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +11 -9
- package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +4 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +206 -73
- package/dist/cjs/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +16 -0
- package/dist/cjs/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +135 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +3 -0
- package/dist/es2019/messages.js +60 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/HoverCard/components/ContentContainer.compiled.css +1 -0
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +8 -2
- package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +4 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +188 -64
- package/dist/es2019/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +16 -0
- package/dist/es2019/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +125 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-true.png +3 -0
- package/dist/esm/messages.js +60 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/HoverCard/components/ContentContainer.compiled.css +2 -1
- package/dist/esm/view/HoverCard/components/ContentContainer.js +11 -9
- package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +4 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +207 -74
- package/dist/esm/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css +16 -0
- package/dist/esm/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.js +126 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/HoverCard/components/ContentContainer.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.d.ts +3 -0
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +4 -0
- package/dist/types/view/HoverCard/types.d.ts +9 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/ContentContainer.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.d.ts +3 -0
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/types.d.ts +4 -0
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +9 -0
- package/package.json +7 -4
- /package/dist/cjs/__tests__/vr-tests/__snapshots__/hover-card/{hover-card-unauthorised--default.png → hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png} +0 -0
- /package/dist/es2019/__tests__/vr-tests/__snapshots__/hover-card/{hover-card-unauthorised--default.png → hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png} +0 -0
- /package/dist/esm/__tests__/vr-tests/__snapshots__/hover-card/{hover-card-unauthorised--default.png → hover-card-unauthorised--default--platform-sl-3p-preauth-better-hovercard-false.png} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.31.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`78762fbea5fd4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/78762fbea5fd4) -
|
|
8
|
+
[ux] Show rovo-specific hover card for un-authenticated as part of
|
|
9
|
+
platform_sl_3p_preauth_better_hovercard experiment
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 43.30.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -857,6 +857,66 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
857
857
|
defaultMessage: 'Uses AI. Verify Results.',
|
|
858
858
|
description: 'Shown on a Rovo summary to indicate that the summary was generated by AI and should be verified by the user for accuracy.'
|
|
859
859
|
},
|
|
860
|
+
rovo_unauthorised_title: {
|
|
861
|
+
id: 'fabric.linking.rovo_unauthorised.title',
|
|
862
|
+
defaultMessage: 'Get smarter workflows by connecting your {context} account',
|
|
863
|
+
description: 'Banner headline in Rovo unauthorised hover card header. {context} is the third-party provider name (e.g. Google).'
|
|
864
|
+
},
|
|
865
|
+
rovo_unauthorised_title_no_provider: {
|
|
866
|
+
id: 'fabric.linking.rovo_unauthorised.title_no_provider',
|
|
867
|
+
defaultMessage: 'Get smarter workflows by connecting your account',
|
|
868
|
+
description: 'Banner headline in Rovo unauthorised hover card header when the provider name is unknown.'
|
|
869
|
+
},
|
|
870
|
+
rovo_unauthorised_feature_document_summaries_title: {
|
|
871
|
+
id: 'fabric.linking.rovo_unauthorised.feature.document_summaries.title',
|
|
872
|
+
defaultMessage: 'Quick summaries',
|
|
873
|
+
description: 'Feature title in Rovo unauthorised view.'
|
|
874
|
+
},
|
|
875
|
+
rovo_unauthorised_feature_document_summaries_desc: {
|
|
876
|
+
id: 'fabric.linking.rovo_unauthorised.feature.document_summaries.desc',
|
|
877
|
+
defaultMessage: 'Understand long docs in seconds',
|
|
878
|
+
description: 'Feature description in Rovo unauthorised view.'
|
|
879
|
+
},
|
|
880
|
+
rovo_unauthorised_feature_smart_suggestions_title: {
|
|
881
|
+
id: 'fabric.linking.rovo_unauthorised.feature.smart_suggestions.title',
|
|
882
|
+
defaultMessage: 'Smart suggestions',
|
|
883
|
+
description: 'Feature title in Rovo unauthorised view.'
|
|
884
|
+
},
|
|
885
|
+
rovo_unauthorised_feature_smart_suggestions_desc: {
|
|
886
|
+
id: 'fabric.linking.rovo_unauthorised.feature.smart_suggestions.desc',
|
|
887
|
+
defaultMessage: 'Strengthen your drafts with actionable feedback',
|
|
888
|
+
description: 'Feature description in Rovo unauthorised view.'
|
|
889
|
+
},
|
|
890
|
+
rovo_unauthorised_feature_cross_reference_title: {
|
|
891
|
+
id: 'fabric.linking.rovo_unauthorised.feature.cross_reference.title',
|
|
892
|
+
defaultMessage: 'Tracked link mentions',
|
|
893
|
+
description: 'Feature title in Rovo unauthorised view.'
|
|
894
|
+
},
|
|
895
|
+
rovo_unauthorised_feature_cross_reference_desc: {
|
|
896
|
+
id: 'fabric.linking.rovo_unauthorised.feature.cross_reference.desc',
|
|
897
|
+
defaultMessage: 'Never miss where your work is referenced',
|
|
898
|
+
description: 'Feature description in Rovo unauthorised view.'
|
|
899
|
+
},
|
|
900
|
+
rovo_unauthorised_feature_related_content_title: {
|
|
901
|
+
id: 'fabric.linking.rovo_unauthorised.feature.related_content.title',
|
|
902
|
+
defaultMessage: 'Related content',
|
|
903
|
+
description: 'Feature title in Rovo unauthorised view.'
|
|
904
|
+
},
|
|
905
|
+
rovo_unauthorised_feature_related_content_desc: {
|
|
906
|
+
id: 'fabric.linking.rovo_unauthorised.feature.related_content.desc',
|
|
907
|
+
defaultMessage: 'Find relevant work and why it matters',
|
|
908
|
+
description: 'Feature description in Rovo unauthorised view.'
|
|
909
|
+
},
|
|
910
|
+
rovo_unauthorised_connect_account: {
|
|
911
|
+
id: 'fabric.linking.rovo_unauthorised.connect_account',
|
|
912
|
+
defaultMessage: 'Connect',
|
|
913
|
+
description: 'Primary action button in Rovo unauthorised hover card.'
|
|
914
|
+
},
|
|
915
|
+
rovo_unauthorised_not_now: {
|
|
916
|
+
id: 'fabric.linking.rovo_unauthorised.not_now',
|
|
917
|
+
defaultMessage: 'Maybe later',
|
|
918
|
+
description: 'Secondary action in Rovo unauthorised hover card.'
|
|
919
|
+
},
|
|
860
920
|
rovo_prompt_context_generic: {
|
|
861
921
|
id: 'fabric.linking.rovo_prompt_context_confluence_page.non-final',
|
|
862
922
|
defaultMessage: 'page',
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "43.30.
|
|
14
|
+
packageVersion: "43.30.1"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
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
|
+
._1bsbiolt{width:22rem}
|
|
6
7
|
._9spsglyw .smart-link-loading-placeholder{display:none}
|
|
7
8
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
8
9
|
._vchhusvi{box-sizing:border-box}
|
|
@@ -18,14 +18,17 @@ var _reactMagneticDi = require("react-magnetic-di");
|
|
|
18
18
|
var _useAiSummaryAction = _interopRequireDefault(require("../../../state/hooks/use-ai-summary-action"));
|
|
19
19
|
var _aiPrism = _interopRequireDefault(require("../../common/ai-prism"));
|
|
20
20
|
var _HoverCardContent = require("./HoverCardContent");
|
|
21
|
-
var _excluded = ["children", "isAIEnabled", "testId", "url"],
|
|
22
|
-
_excluded2 = ["children", "isAIEnabled", "testId", "url"];
|
|
21
|
+
var _excluded = ["children", "widthAppearance", "isAIEnabled", "testId", "url"],
|
|
22
|
+
_excluded2 = ["children", "widthAppearance", "isAIEnabled", "testId", "url"];
|
|
23
23
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
|
-
var NEW_CARD_WIDTH_REM = 25;
|
|
25
24
|
var HoverCardContainerStyle = null;
|
|
25
|
+
var hoverCardShellWidthDefault = null;
|
|
26
|
+
var hoverCardShellWidthSlim = null;
|
|
27
|
+
var hoverCardShellHideLoadingPlaceholder = null;
|
|
26
28
|
var popupContainerStyles = null;
|
|
27
29
|
var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
|
|
28
30
|
var children = _ref.children,
|
|
31
|
+
widthAppearance = _ref.widthAppearance,
|
|
29
32
|
_ref$isAIEnabled = _ref.isAIEnabled,
|
|
30
33
|
isAIEnabled = _ref$isAIEnabled === void 0 ? false : _ref$isAIEnabled,
|
|
31
34
|
testId = _ref.testId,
|
|
@@ -40,15 +43,12 @@ var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
|
|
|
40
43
|
(0, _react.useEffect)(function () {
|
|
41
44
|
setShowPrism(status === 'loading');
|
|
42
45
|
}, [status]);
|
|
46
|
+
var resolvedWidthAppearance = widthAppearance !== null && widthAppearance !== void 0 ? widthAppearance : 'default';
|
|
43
47
|
var container = /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
44
48
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
45
|
-
className: (0, _runtime.ax)(["_11q7glyw _189eidpf _vchhusvi
|
|
49
|
+
className: (0, _runtime.ax)(["_11q7glyw _189eidpf _vchhusvi", resolvedWidthAppearance === 'slim' ? "_1bsbiolt" : "_1bsb1f23", "_9spsglyw", !isAIEnabled && "_2rko1mok _bfhk1bhr _16qs130s", _HoverCardContent.hoverCardClassName]),
|
|
46
50
|
"data-testid": testId
|
|
47
|
-
}, props,
|
|
48
|
-
style: {
|
|
49
|
-
"--_1rzblqv": (0, _runtime.ix)("".concat(NEW_CARD_WIDTH_REM, "rem"))
|
|
50
|
-
}
|
|
51
|
-
}), children);
|
|
51
|
+
}, props), children);
|
|
52
52
|
return isAIEnabled ? /*#__PURE__*/React.createElement(_aiPrism.default, {
|
|
53
53
|
isVisible: showPrism,
|
|
54
54
|
testId: "".concat(testId, "-prism")
|
|
@@ -56,12 +56,14 @@ var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
|
|
|
56
56
|
};
|
|
57
57
|
var ContentContainer = function ContentContainer(_ref2) {
|
|
58
58
|
var children = _ref2.children,
|
|
59
|
+
widthAppearance = _ref2.widthAppearance,
|
|
59
60
|
_ref2$isAIEnabled = _ref2.isAIEnabled,
|
|
60
61
|
isAIEnabled = _ref2$isAIEnabled === void 0 ? false : _ref2$isAIEnabled,
|
|
61
62
|
testId = _ref2.testId,
|
|
62
63
|
url = _ref2.url,
|
|
63
64
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
64
65
|
return /*#__PURE__*/React.createElement(ConnectedAIPrismContainer, (0, _extends2.default)({
|
|
66
|
+
widthAppearance: widthAppearance,
|
|
65
67
|
isAIEnabled: isAIEnabled,
|
|
66
68
|
url: url,
|
|
67
69
|
testId: testId
|
|
@@ -32,7 +32,10 @@ var CustomPopupContainer = /*#__PURE__*/_react.default.forwardRef(function (_ref
|
|
|
32
32
|
* Factory function to create a CustomPopupContainer with a specific z-index
|
|
33
33
|
*/
|
|
34
34
|
var createCustomPopupContainer = exports.createCustomPopupContainer = function createCustomPopupContainer(zIndex) {
|
|
35
|
-
return /*#__PURE__*/_react.default.forwardRef(
|
|
35
|
+
return /*#__PURE__*/_react.default.forwardRef(
|
|
36
|
+
// FIXME: ...props spreads all props to the div, including isReferenceHidden, which is not a valid prop for a div.
|
|
37
|
+
// Find another way but adding exceptions with _, __, ___ etc.
|
|
38
|
+
function (_ref2, ref) {
|
|
36
39
|
var children = _ref2.children,
|
|
37
40
|
_ = _ref2.shouldFitContainer,
|
|
38
41
|
__ = _ref2.shouldRenderToParent,
|
|
@@ -219,6 +219,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
219
219
|
onMouseLeave: initHideCard,
|
|
220
220
|
cardState: linkState,
|
|
221
221
|
onActionClick: onActionClick,
|
|
222
|
+
onDismiss: hideCard,
|
|
222
223
|
onResolve: update,
|
|
223
224
|
renderers: renderers,
|
|
224
225
|
actionOptions: actionOptions,
|
|
@@ -232,7 +233,7 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
232
233
|
id: id,
|
|
233
234
|
source: HOVER_CARD_SOURCE
|
|
234
235
|
}, /*#__PURE__*/_react.default.createElement(_HoverCardContent.default, hoverCardContentProps));
|
|
235
|
-
}, [initShowCard, initHideCard, linkState, onActionClick, renderers, actionOptions, url, id, hoverPreviewOptions]);
|
|
236
|
+
}, [initShowCard, initHideCard, linkState, onActionClick, hideCard, renderers, actionOptions, url, id, hoverPreviewOptions]);
|
|
236
237
|
var handleKeyDown = (0, _react.useCallback)(function (e) {
|
|
237
238
|
if (e.key === ' ') {
|
|
238
239
|
e.preventDefault();
|
|
@@ -13,6 +13,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
13
13
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
16
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
17
18
|
var _useAnalyticsEvents2 = require("../../../common/analytics/generated/use-analytics-events");
|
|
18
19
|
var _constants = require("../../../constants");
|
|
@@ -30,24 +31,52 @@ var _forbidden = _interopRequireDefault(require("./views/forbidden"));
|
|
|
30
31
|
var _resolved = _interopRequireDefault(require("./views/resolved"));
|
|
31
32
|
var _resolving = _interopRequireDefault(require("./views/resolving"));
|
|
32
33
|
var _unauthorised = _interopRequireDefault(require("./views/unauthorised"));
|
|
34
|
+
var _RovoUnauthorisedView = _interopRequireDefault(require("./views/unauthorised/RovoUnauthorisedView"));
|
|
33
35
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
34
36
|
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; }
|
|
35
37
|
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) { (0, _defineProperty2.default)(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; }
|
|
36
38
|
var hoverCardClassName = exports.hoverCardClassName = 'smart-links-hover-preview';
|
|
37
|
-
var
|
|
39
|
+
var useIsResolvedView = function useIsResolvedView(_ref) {
|
|
40
|
+
var _hoverPreviewOptions$;
|
|
41
|
+
var cardState = _ref.cardState,
|
|
42
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
43
|
+
return !(hoverPreviewOptions !== null && hoverPreviewOptions !== void 0 && (_hoverPreviewOptions$ = hoverPreviewOptions.render) !== null && _hoverPreviewOptions$ !== void 0 && _hoverPreviewOptions$.call(hoverPreviewOptions)) && cardState.status === 'resolved';
|
|
44
|
+
};
|
|
45
|
+
var useServices = function useServices(_ref2) {
|
|
46
|
+
var url = _ref2.url;
|
|
47
|
+
var linkState = (0, _store.useSmartCardState)(url);
|
|
48
|
+
var services = (0, _helpers.getServices)(linkState.details);
|
|
49
|
+
return services;
|
|
50
|
+
};
|
|
51
|
+
var useIsUnauthorisedView = function useIsUnauthorisedView(_ref3) {
|
|
52
|
+
var _hoverPreviewOptions$2;
|
|
53
|
+
var cardState = _ref3.cardState,
|
|
54
|
+
url = _ref3.url,
|
|
55
|
+
hoverPreviewOptions = _ref3.hoverPreviewOptions;
|
|
56
|
+
var services = useServices({
|
|
57
|
+
url: url
|
|
58
|
+
});
|
|
59
|
+
return !(hoverPreviewOptions !== null && hoverPreviewOptions !== void 0 && (_hoverPreviewOptions$2 = hoverPreviewOptions.render) !== null && _hoverPreviewOptions$2 !== void 0 && _hoverPreviewOptions$2.call(hoverPreviewOptions)) && cardState.status === 'unauthorized' && Boolean(services === null || services === void 0 ? void 0 : services.length);
|
|
60
|
+
};
|
|
61
|
+
var useIsShowPreauthBetterHovercard = function useIsShowPreauthBetterHovercard(props) {
|
|
62
|
+
var rovoConfig = (0, _useRovoConfig.default)();
|
|
63
|
+
return Boolean(useIsUnauthorisedView(props) && (rovoConfig === null || rovoConfig === void 0 ? void 0 : rovoConfig.isRovoEnabled) && (0, _expValEquals.expValEquals)('platform_sl_3p_preauth_better_hovercard', 'isEnabled', true));
|
|
64
|
+
};
|
|
65
|
+
var HoverCardContent = function HoverCardContent(_ref4) {
|
|
38
66
|
var _linkState$status, _cardState$details;
|
|
39
|
-
var
|
|
40
|
-
id =
|
|
41
|
-
cardState =
|
|
42
|
-
onActionClick =
|
|
43
|
-
onResolve =
|
|
44
|
-
renderers =
|
|
45
|
-
url =
|
|
46
|
-
onMouseEnter =
|
|
47
|
-
onMouseLeave =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
var _ref4$id = _ref4.id,
|
|
68
|
+
id = _ref4$id === void 0 ? '' : _ref4$id,
|
|
69
|
+
cardState = _ref4.cardState,
|
|
70
|
+
onActionClick = _ref4.onActionClick,
|
|
71
|
+
onResolve = _ref4.onResolve,
|
|
72
|
+
renderers = _ref4.renderers,
|
|
73
|
+
url = _ref4.url,
|
|
74
|
+
onMouseEnter = _ref4.onMouseEnter,
|
|
75
|
+
onMouseLeave = _ref4.onMouseLeave,
|
|
76
|
+
onDismiss = _ref4.onDismiss,
|
|
77
|
+
actionOptions = _ref4.actionOptions,
|
|
78
|
+
hoverPreviewOptions = _ref4.hoverPreviewOptions,
|
|
79
|
+
showRovoResolvedView = _ref4.showRovoResolvedView;
|
|
51
80
|
var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
52
81
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
53
82
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -148,82 +177,186 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
148
177
|
var onClickStopPropagation = (0, _react.useCallback)(function (e) {
|
|
149
178
|
return e.stopPropagation();
|
|
150
179
|
}, []);
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
180
|
+
var useIsResolvedViewGated = (0, _platformFeatureFlagsReact.functionUnionWithCondition)(function () {
|
|
181
|
+
return (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
182
|
+
}, useIsResolvedView, function () {
|
|
183
|
+
return undefined;
|
|
184
|
+
});
|
|
185
|
+
var useIsUnauthorisedViewGated = (0, _platformFeatureFlagsReact.functionUnionWithCondition)(function () {
|
|
186
|
+
return (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
187
|
+
}, useIsUnauthorisedView, function () {
|
|
188
|
+
return undefined;
|
|
189
|
+
});
|
|
190
|
+
var useIsShowPreauthBetterHovercardGated = (0, _platformFeatureFlagsReact.functionUnionWithCondition)(function () {
|
|
191
|
+
return (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
192
|
+
}, useIsShowPreauthBetterHovercard, function () {
|
|
193
|
+
return undefined;
|
|
194
|
+
});
|
|
195
|
+
var isResolved = useIsResolvedViewGated({
|
|
196
|
+
cardState: cardState,
|
|
197
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
198
|
+
});
|
|
199
|
+
var isUnauthorised = useIsUnauthorisedViewGated({
|
|
200
|
+
cardState: cardState,
|
|
201
|
+
url: url,
|
|
202
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
203
|
+
});
|
|
204
|
+
var showPreauthBetterHovercard = useIsShowPreauthBetterHovercardGated({
|
|
205
|
+
cardState: cardState,
|
|
206
|
+
url: url,
|
|
207
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
208
|
+
});
|
|
209
|
+
if ((0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch')) {
|
|
210
|
+
var cardView = function (_hoverPreviewOptions$3) {
|
|
211
|
+
var overrideView = hoverPreviewOptions === null || hoverPreviewOptions === void 0 || (_hoverPreviewOptions$3 = hoverPreviewOptions.render) === null || _hoverPreviewOptions$3 === void 0 ? void 0 : _hoverPreviewOptions$3.call(hoverPreviewOptions);
|
|
212
|
+
if (overrideView) {
|
|
213
|
+
return overrideView;
|
|
214
|
+
}
|
|
215
|
+
if (cardState.status === 'errored' && (0, _platformFeatureFlags.fg)('navx-2478-sl-fix-hover-card-unresolved-view')) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
if ((0, _platformFeatureFlags.fg)('navx-2478-sl-fix-hover-card-unresolved-view') ? cardState.status === 'resolving' || cardState.metadataStatus === 'pending' : cardState.metadataStatus === 'pending') {
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement(_resolving.default, {
|
|
220
|
+
flexibleCardProps: flexibleCardProps,
|
|
221
|
+
titleBlockProps: titleBlockProps
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
if (isUnauthorised) {
|
|
225
|
+
if (showPreauthBetterHovercard) {
|
|
226
|
+
return /*#__PURE__*/_react.default.createElement(_RovoUnauthorisedView.default, {
|
|
227
|
+
extensionKey: extensionKey,
|
|
228
|
+
id: id,
|
|
229
|
+
flexibleCardProps: flexibleCardProps,
|
|
230
|
+
onDismiss: onDismiss,
|
|
231
|
+
url: url
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
return /*#__PURE__*/_react.default.createElement(_unauthorised.default, {
|
|
235
|
+
extensionKey: extensionKey,
|
|
236
|
+
id: id,
|
|
237
|
+
flexibleCardProps: flexibleCardProps,
|
|
238
|
+
url: url
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
if (cardState.status === 'forbidden' || cardState.status === 'not_found') {
|
|
242
|
+
return /*#__PURE__*/_react.default.createElement(_forbidden.default, {
|
|
243
|
+
flexibleCardProps: flexibleCardProps
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
if (isResolved) {
|
|
247
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
248
|
+
actionOptions: actionOptions,
|
|
249
|
+
showRovoResolvedView: showRovoResolvedView
|
|
250
|
+
} : undefined, {
|
|
251
|
+
cardState: cardState,
|
|
252
|
+
extensionKey: extensionKey,
|
|
253
|
+
flexibleCardProps: flexibleCardProps,
|
|
254
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
255
|
+
onActionClick: onActionClick,
|
|
256
|
+
titleBlockProps: titleBlockProps,
|
|
257
|
+
url: url
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
158
260
|
return null;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
261
|
+
}();
|
|
262
|
+
return cardView ? /*#__PURE__*/_react.default.createElement(_ContentContainer.default, {
|
|
263
|
+
onMouseEnter: onMouseEnter,
|
|
264
|
+
onMouseLeave: onMouseLeave,
|
|
265
|
+
onClick: onClickStopPropagation,
|
|
266
|
+
widthAppearance: showPreauthBetterHovercard ? 'slim' : undefined,
|
|
267
|
+
isAIEnabled: isAISummaryEnabled,
|
|
268
|
+
url: url
|
|
269
|
+
}, cardView) : null;
|
|
270
|
+
} else {
|
|
271
|
+
var getCardView = function getCardView(cardState) {
|
|
272
|
+
var _hoverPreviewOptions$4;
|
|
273
|
+
var overrideView = hoverPreviewOptions === null || hoverPreviewOptions === void 0 || (_hoverPreviewOptions$4 = hoverPreviewOptions.render) === null || _hoverPreviewOptions$4 === void 0 ? void 0 : _hoverPreviewOptions$4.call(hoverPreviewOptions);
|
|
274
|
+
if (overrideView) {
|
|
275
|
+
return overrideView;
|
|
276
|
+
}
|
|
277
|
+
if (cardState.status === 'errored' && (0, _platformFeatureFlags.fg)('navx-2478-sl-fix-hover-card-unresolved-view')) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
if ((0, _platformFeatureFlags.fg)('navx-2478-sl-fix-hover-card-unresolved-view') ? cardState.status === 'resolving' || cardState.metadataStatus === 'pending' : cardState.metadataStatus === 'pending') {
|
|
281
|
+
return /*#__PURE__*/_react.default.createElement(_resolving.default, {
|
|
282
|
+
flexibleCardProps: flexibleCardProps,
|
|
283
|
+
titleBlockProps: titleBlockProps
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
if (cardState.status === 'unauthorized' && services !== null && services !== void 0 && services.length) {
|
|
287
|
+
return /*#__PURE__*/_react.default.createElement(_unauthorised.default, {
|
|
288
|
+
extensionKey: extensionKey,
|
|
289
|
+
id: id,
|
|
290
|
+
flexibleCardProps: flexibleCardProps,
|
|
291
|
+
url: url
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
if (cardState.status === 'forbidden' || cardState.status === 'not_found') {
|
|
295
|
+
return /*#__PURE__*/_react.default.createElement(_forbidden.default, {
|
|
296
|
+
flexibleCardProps: flexibleCardProps
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
if (cardState.status === 'resolved') {
|
|
300
|
+
return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch') ? {
|
|
301
|
+
actionOptions: actionOptions,
|
|
302
|
+
showRovoResolvedView: showRovoResolvedView
|
|
303
|
+
} : undefined, {
|
|
304
|
+
cardState: cardState,
|
|
305
|
+
extensionKey: extensionKey,
|
|
306
|
+
flexibleCardProps: flexibleCardProps,
|
|
307
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
308
|
+
onActionClick: onActionClick,
|
|
309
|
+
titleBlockProps: titleBlockProps,
|
|
310
|
+
url: url
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
};
|
|
315
|
+
var _cardView = getCardView(cardState);
|
|
316
|
+
return _cardView ? /*#__PURE__*/_react.default.createElement(_ContentContainer.default, {
|
|
317
|
+
onMouseEnter: onMouseEnter,
|
|
318
|
+
onMouseLeave: onMouseLeave,
|
|
319
|
+
onClick: onClickStopPropagation,
|
|
320
|
+
isAIEnabled: isAISummaryEnabled,
|
|
321
|
+
url: url
|
|
322
|
+
}, _cardView) : null;
|
|
323
|
+
}
|
|
203
324
|
};
|
|
204
325
|
var HoverCardContentWithViewVariant = function HoverCardContentWithViewVariant(props) {
|
|
205
|
-
var
|
|
326
|
+
var cardState = props.cardState,
|
|
327
|
+
actionOptions = props.actionOptions;
|
|
206
328
|
var rovoConfig = (0, _useRovoConfig.default)();
|
|
329
|
+
var isResolved = useIsResolvedView(props);
|
|
330
|
+
var showPreauthBetterHovercard = useIsShowPreauthBetterHovercard(props);
|
|
207
331
|
var showRovoResolvedView = (0, _react.useMemo)(function () {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
response: props === null || props === void 0 ? void 0 : props.cardState.details,
|
|
332
|
+
return isResolved && cardState.details && (0, _extractRovoChatAction.default)({
|
|
333
|
+
response: cardState.details,
|
|
211
334
|
rovoConfig: rovoConfig,
|
|
212
|
-
actionOptions:
|
|
335
|
+
actionOptions: actionOptions
|
|
213
336
|
}) !== undefined;
|
|
214
|
-
}, [
|
|
337
|
+
}, [actionOptions, cardState.details, rovoConfig, isResolved]);
|
|
215
338
|
var data = (0, _react.useMemo)(function () {
|
|
216
|
-
var viewVariant =
|
|
339
|
+
var viewVariant = 'default';
|
|
340
|
+
if (showRovoResolvedView && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_sl_3p_auth_rovo_action', 'isEnabled', true)) {
|
|
341
|
+
viewVariant = 'rovo-resolved-view';
|
|
342
|
+
} else if (showPreauthBetterHovercard) {
|
|
343
|
+
viewVariant = 'rovo-unauthorised-view';
|
|
344
|
+
}
|
|
217
345
|
return {
|
|
218
346
|
attributes: {
|
|
219
347
|
viewVariant: viewVariant
|
|
220
348
|
}
|
|
221
349
|
};
|
|
222
|
-
}, [showRovoResolvedView]);
|
|
350
|
+
}, [showRovoResolvedView, showPreauthBetterHovercard]);
|
|
223
351
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
224
352
|
data: data
|
|
225
353
|
}, /*#__PURE__*/_react.default.createElement(HoverCardContent, (0, _extends2.default)({}, props, {
|
|
226
354
|
showRovoResolvedView: showRovoResolvedView
|
|
227
355
|
})));
|
|
228
356
|
};
|
|
229
|
-
var _default = exports.default = (0, _platformFeatureFlagsReact.
|
|
357
|
+
var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
358
|
+
// We need to read both of them to sutisfy some of the tests that expect both to be checked.
|
|
359
|
+
var flagA = (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_better_hovercard_killswitch');
|
|
360
|
+
var flagB = (0, _platformFeatureFlags.fg)('platform_sl_3p_auth_rovo_action_kill_switch');
|
|
361
|
+
return flagA || flagB;
|
|
362
|
+
}, HoverCardContentWithViewVariant, HoverCardContent);
|
package/dist/cjs/view/HoverCard/components/views/unauthorised/RovoUnauthorisedView.compiled.css
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
._zulputpp{gap:var(--ds-space-150,9pt)}._13li1mok{border-top-left-radius:var(--ds-radius-large,8px)}
|
|
3
|
+
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
4
|
+
._19pkpxbi{margin-top:var(--ds-space-200,1pc)}
|
|
5
|
+
._1bahesu3{justify-content:flex-end}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1n261g80{flex-wrap:wrap}
|
|
8
|
+
._4cvr1h6o{align-items:center}
|
|
9
|
+
._bfhkomb0{background-color:var(--ds-background-brand-bold,#0052cc)}
|
|
10
|
+
._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
|
|
11
|
+
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
12
|
+
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
13
|
+
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
14
|
+
._qrwq1mok{border-top-right-radius:var(--ds-radius-large,8px)}
|
|
15
|
+
._syaz15cr{color:var(--ds-text-inverse,#fff)}
|
|
16
|
+
._u5f3pxbi{padding-right:var(--ds-space-200,1pc)}
|