@atlaskit/smart-card 44.1.1 → 44.1.2
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 +7 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/cjs/state/hooks/use-inline-action-nudge-experiment/index.js +5 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +2 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/es2019/state/hooks/use-inline-action-nudge-experiment/index.js +5 -3
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +2 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-resolved-view-with-rovo-actions-cta-treatment---default.png +2 -2
- package/dist/esm/state/hooks/use-inline-action-nudge-experiment/index.js +5 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +2 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-inline-action-nudge-experiment/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-inline-action-nudge-experiment/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2d863950af693`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2d863950af693) -
|
|
8
|
+
[ux] Only show the Rovo Actions cta icon if the link supports RovoActions
|
|
9
|
+
|
|
3
10
|
## 44.1.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:0bb73de3b7ca7afc29ffc4190e591840af572edf71c8c3fdb77a8fd1794399b7
|
|
3
|
+
size 13085
|
|
@@ -28,13 +28,15 @@ var NOT_ENABLED_RESULT = {
|
|
|
28
28
|
* The extension key is derived from the card store via the resolved URL,
|
|
29
29
|
* so callers don't need to thread it as a prop.
|
|
30
30
|
*/
|
|
31
|
-
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url) {
|
|
31
|
+
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview) {
|
|
32
|
+
var _cardState$details$me, _cardState$details;
|
|
32
33
|
var rovoConfig = (0, _useRovoConfig.default)();
|
|
33
34
|
var isRovoChatEnabled = (0, _rovo.getIsRovoChatEnabled)(rovoConfig);
|
|
34
35
|
var cardState = (0, _store.useSmartCardState)(url !== null && url !== void 0 ? url : '');
|
|
36
|
+
var supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 || (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.meta) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.supportedFeature) === null || _cardState$details === void 0 ? void 0 : _cardState$details.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
35
37
|
var extensionKey = (0, _helpers.getExtensionKey)(cardState.details);
|
|
36
38
|
return (0, _react.useMemo)(function () {
|
|
37
|
-
if (!isRovoChatEnabled) {
|
|
39
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
38
40
|
return NOT_ENABLED_RESULT;
|
|
39
41
|
}
|
|
40
42
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -44,6 +46,6 @@ var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url
|
|
|
44
46
|
return {
|
|
45
47
|
isEnabled: isEnabled
|
|
46
48
|
};
|
|
47
|
-
}, [isRovoChatEnabled, extensionKey]);
|
|
49
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
48
50
|
};
|
|
49
51
|
var _default = exports.default = useInlineActionNudgeExperiment;
|
|
@@ -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: "44.1.
|
|
14
|
+
packageVersion: "44.1.1"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -39,7 +39,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
39
39
|
id = _ref.id;
|
|
40
40
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
41
41
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
42
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(),
|
|
42
|
+
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(flexibleCardProps.url, true),
|
|
43
43
|
InlineActionNudgeExperimentValue = _useInlineActionNudge.isEnabled;
|
|
44
44
|
|
|
45
45
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
@@ -82,7 +82,7 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
82
82
|
type = _ref2.type,
|
|
83
83
|
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
84
84
|
lozenge = _ref2.lozenge;
|
|
85
|
-
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link),
|
|
85
|
+
var _useInlineActionNudge = (0, _useInlineActionNudgeExperiment.default)(link, showHoverPreview),
|
|
86
86
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
87
87
|
|
|
88
88
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
@@ -100,7 +100,7 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
100
100
|
titleTextColor: titleTextColor,
|
|
101
101
|
type: type,
|
|
102
102
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
103
|
-
}), (0, _renderLozenge.renderLozenge)(lozenge), isEnabled &&
|
|
103
|
+
}), (0, _renderLozenge.renderLozenge)(lozenge), isEnabled && /*#__PURE__*/_react.default.createElement(_rovoActionsCta.RovoActionsCta, {
|
|
104
104
|
testId: "".concat(testId, "-rovo-actions-cta")
|
|
105
105
|
}));
|
|
106
106
|
if (!showHoverPreview || !link) {
|
|
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
22
22
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
23
23
|
var PACKAGE_DATA = {
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "44.1.
|
|
25
|
+
packageVersion: "44.1.1",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:0bb73de3b7ca7afc29ffc4190e591840af572edf71c8c3fdb77a8fd1794399b7
|
|
3
|
+
size 13085
|
|
@@ -21,13 +21,15 @@ const NOT_ENABLED_RESULT = {
|
|
|
21
21
|
* The extension key is derived from the card store via the resolved URL,
|
|
22
22
|
* so callers don't need to thread it as a prop.
|
|
23
23
|
*/
|
|
24
|
-
const useInlineActionNudgeExperiment = url => {
|
|
24
|
+
const useInlineActionNudgeExperiment = (url, showHoverPreview) => {
|
|
25
|
+
var _cardState$details$me, _cardState$details, _cardState$details$me2, _cardState$details$me3;
|
|
25
26
|
const rovoConfig = useRovoConfig();
|
|
26
27
|
const isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
|
|
27
28
|
const cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
29
|
+
const supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 ? void 0 : (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : (_cardState$details$me2 = _cardState$details.meta) === null || _cardState$details$me2 === void 0 ? void 0 : (_cardState$details$me3 = _cardState$details$me2.supportedFeature) === null || _cardState$details$me3 === void 0 ? void 0 : _cardState$details$me3.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
28
30
|
const extensionKey = getExtensionKey(cardState.details);
|
|
29
31
|
return useMemo(() => {
|
|
30
|
-
if (!isRovoChatEnabled) {
|
|
32
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
31
33
|
return NOT_ENABLED_RESULT;
|
|
32
34
|
}
|
|
33
35
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -37,6 +39,6 @@ const useInlineActionNudgeExperiment = url => {
|
|
|
37
39
|
return {
|
|
38
40
|
isEnabled
|
|
39
41
|
};
|
|
40
|
-
}, [isRovoChatEnabled, extensionKey]);
|
|
42
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
41
43
|
};
|
|
42
44
|
export default useInlineActionNudgeExperiment;
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "44.1.
|
|
5
|
+
packageVersion: "44.1.1"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -34,7 +34,7 @@ const HoverCardResolvedView = ({
|
|
|
34
34
|
} = useAnalyticsEvents();
|
|
35
35
|
const {
|
|
36
36
|
isEnabled: InlineActionNudgeExperimentValue
|
|
37
|
-
} = useInlineActionNudgeExperiment();
|
|
37
|
+
} = useInlineActionNudgeExperiment(flexibleCardProps.url, true);
|
|
38
38
|
|
|
39
39
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
40
40
|
// by all the other condition defined above as a result of what was defined in actionOptions as well as in CardContext.
|
|
@@ -71,7 +71,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
71
71
|
}) {
|
|
72
72
|
const {
|
|
73
73
|
isEnabled
|
|
74
|
-
} = useInlineActionNudgeExperiment(link);
|
|
74
|
+
} = useInlineActionNudgeExperiment(link, showHoverPreview);
|
|
75
75
|
|
|
76
76
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
77
77
|
const frame = /*#__PURE__*/React.createElement(Frame, {
|
|
@@ -88,7 +88,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
|
|
|
88
88
|
titleTextColor: titleTextColor,
|
|
89
89
|
type: type,
|
|
90
90
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
91
|
-
}), renderLozenge(lozenge), isEnabled &&
|
|
91
|
+
}), renderLozenge(lozenge), isEnabled && /*#__PURE__*/React.createElement(RovoActionsCta, {
|
|
92
92
|
testId: `${testId}-rovo-actions-cta`
|
|
93
93
|
}));
|
|
94
94
|
if (!showHoverPreview || !link) {
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "44.1.
|
|
15
|
+
packageVersion: "44.1.1",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:0bb73de3b7ca7afc29ffc4190e591840af572edf71c8c3fdb77a8fd1794399b7
|
|
3
|
+
size 13085
|
|
@@ -21,13 +21,15 @@ var NOT_ENABLED_RESULT = {
|
|
|
21
21
|
* The extension key is derived from the card store via the resolved URL,
|
|
22
22
|
* so callers don't need to thread it as a prop.
|
|
23
23
|
*/
|
|
24
|
-
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url) {
|
|
24
|
+
var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url, showHoverPreview) {
|
|
25
|
+
var _cardState$details$me, _cardState$details;
|
|
25
26
|
var rovoConfig = useRovoConfig();
|
|
26
27
|
var isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
|
|
27
28
|
var cardState = useSmartCardState(url !== null && url !== void 0 ? url : '');
|
|
29
|
+
var supportsRovoActions = (_cardState$details$me = cardState === null || cardState === void 0 || (_cardState$details = cardState.details) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.meta) === null || _cardState$details === void 0 || (_cardState$details = _cardState$details.supportedFeature) === null || _cardState$details === void 0 ? void 0 : _cardState$details.includes('RovoActions')) !== null && _cardState$details$me !== void 0 ? _cardState$details$me : false;
|
|
28
30
|
var extensionKey = getExtensionKey(cardState.details);
|
|
29
31
|
return useMemo(function () {
|
|
30
|
-
if (!isRovoChatEnabled) {
|
|
32
|
+
if (!isRovoChatEnabled || !showHoverPreview || !supportsRovoActions || !url) {
|
|
31
33
|
return NOT_ENABLED_RESULT;
|
|
32
34
|
}
|
|
33
35
|
if (extensionKey && EXCLUDED_EXTENSION_KEYS.has(extensionKey)) {
|
|
@@ -37,6 +39,6 @@ var useInlineActionNudgeExperiment = function useInlineActionNudgeExperiment(url
|
|
|
37
39
|
return {
|
|
38
40
|
isEnabled: isEnabled
|
|
39
41
|
};
|
|
40
|
-
}, [isRovoChatEnabled, extensionKey]);
|
|
42
|
+
}, [isRovoChatEnabled, extensionKey, showHoverPreview, supportsRovoActions, url]);
|
|
41
43
|
};
|
|
42
44
|
export default useInlineActionNudgeExperiment;
|
|
@@ -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: "44.1.
|
|
7
|
+
packageVersion: "44.1.1"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -30,7 +30,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
30
30
|
id = _ref.id;
|
|
31
31
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
32
32
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
33
|
-
var _useInlineActionNudge = useInlineActionNudgeExperiment(),
|
|
33
|
+
var _useInlineActionNudge = useInlineActionNudgeExperiment(flexibleCardProps.url, true),
|
|
34
34
|
InlineActionNudgeExperimentValue = _useInlineActionNudge.isEnabled;
|
|
35
35
|
|
|
36
36
|
// We want to fire exposure event only for those cases when user otherwise can see the experiment which would be controlled
|
|
@@ -73,7 +73,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
73
73
|
type = _ref2.type,
|
|
74
74
|
hideIconLoadingSkeleton = _ref2.hideIconLoadingSkeleton,
|
|
75
75
|
lozenge = _ref2.lozenge;
|
|
76
|
-
var _useInlineActionNudge = useInlineActionNudgeExperiment(link),
|
|
76
|
+
var _useInlineActionNudge = useInlineActionNudgeExperiment(link, showHoverPreview),
|
|
77
77
|
isEnabled = _useInlineActionNudge.isEnabled;
|
|
78
78
|
|
|
79
79
|
// TODO https://hello.jira.atlassian.cloud/browse/NAVX-4436: fire analytics with cohort
|
|
@@ -91,7 +91,7 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
|
|
|
91
91
|
titleTextColor: titleTextColor,
|
|
92
92
|
type: type,
|
|
93
93
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton
|
|
94
|
-
}), renderLozenge(lozenge), isEnabled &&
|
|
94
|
+
}), renderLozenge(lozenge), isEnabled && /*#__PURE__*/React.createElement(RovoActionsCta, {
|
|
95
95
|
testId: "".concat(testId, "-rovo-actions-cta")
|
|
96
96
|
}));
|
|
97
97
|
if (!showHoverPreview || !link) {
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "44.1.
|
|
18
|
+
packageVersion: "44.1.1",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -17,5 +17,5 @@ export interface InlineActionNudgeExperiment {
|
|
|
17
17
|
* The extension key is derived from the card store via the resolved URL,
|
|
18
18
|
* so callers don't need to thread it as a prop.
|
|
19
19
|
*/
|
|
20
|
-
declare const useInlineActionNudgeExperiment: (url?: string) => InlineActionNudgeExperiment;
|
|
20
|
+
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean) => InlineActionNudgeExperiment;
|
|
21
21
|
export default useInlineActionNudgeExperiment;
|
|
@@ -17,5 +17,5 @@ export interface InlineActionNudgeExperiment {
|
|
|
17
17
|
* The extension key is derived from the card store via the resolved URL,
|
|
18
18
|
* so callers don't need to thread it as a prop.
|
|
19
19
|
*/
|
|
20
|
-
declare const useInlineActionNudgeExperiment: (url?: string) => InlineActionNudgeExperiment;
|
|
20
|
+
declare const useInlineActionNudgeExperiment: (url?: string, showHoverPreview?: boolean) => InlineActionNudgeExperiment;
|
|
21
21
|
export default useInlineActionNudgeExperiment;
|