@atlaskit/smart-card 26.43.9 → 26.44.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 +13 -0
- package/dist/cjs/extractors/flexible/extract-state.js +3 -4
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +2 -7
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -6
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-state.js +3 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +1 -6
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -6
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-state.js +3 -4
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +2 -6
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +2 -7
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -6
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/lozenge/types.d.ts +1 -3
- package/dist/types/extractors/flexible/actions/extract-follow-action.d.ts +1 -2
- package/dist/types/extractors/flexible/extract-state.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/type.d.ts +0 -1
- package/dist/types/view/FlexibleCard/types.d.ts +1 -22
- package/dist/types-ts4.5/extractors/common/lozenge/types.d.ts +1 -3
- package/dist/types-ts4.5/extractors/flexible/actions/extract-follow-action.d.ts +1 -2
- package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +1 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/type.d.ts +0 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -22
- package/package.json +3 -4
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -57
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -31
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -5
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -47
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -29
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.js +0 -50
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.js +0 -24
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.js +0 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.d.ts +0 -10
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.d.ts +0 -2
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.d.ts +0 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/index.d.ts +0 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/styled.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/feature-discovery/types.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.44.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#65223](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65223) [`ff157d5f6c61`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ff157d5f6c61) - [ux] Removed the discovery pulse for the Jira status change action
|
|
8
|
+
|
|
9
|
+
## 26.43.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#64758](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64758) [`8b6f084929b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b6f084929b5) - Removed usages of enableHoverCardResolutionTracking in HoverCard
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 26.43.9
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -26,7 +26,7 @@ var toInvokeRequest = function toInvokeRequest(extensionKey, resourceIdentifiers
|
|
|
26
26
|
details: details
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
var extractAction = function extractAction(response, id
|
|
29
|
+
var extractAction = function extractAction(response, id) {
|
|
30
30
|
var _action$dataRetrieval, _action$dataUpdateAct;
|
|
31
31
|
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
32
32
|
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -51,8 +51,7 @@ var extractAction = function extractAction(response, id, options) {
|
|
|
51
51
|
var update = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataUpdateAct = action.dataUpdateAction) === null || _action$dataUpdateAct === void 0 ? void 0 : _action$dataUpdateAct.name, details);
|
|
52
52
|
return read || update ? {
|
|
53
53
|
read: read,
|
|
54
|
-
update: update
|
|
55
|
-
showFeatureDiscovery: options === null || options === void 0 ? void 0 : options.showStateActionFeatureDiscovery
|
|
54
|
+
update: update
|
|
56
55
|
} : undefined;
|
|
57
56
|
};
|
|
58
57
|
var extractState = function extractState(response, showServerActions, id) {
|
|
@@ -66,7 +65,7 @@ var extractState = function extractState(response, showServerActions, id) {
|
|
|
66
65
|
if (!showServerActions) {
|
|
67
66
|
return lozenge;
|
|
68
67
|
}
|
|
69
|
-
var action = extractAction(response, id
|
|
68
|
+
var action = extractAction(response, id);
|
|
70
69
|
return _objectSpread(_objectSpread({}, lozenge), {}, {
|
|
71
70
|
action: action
|
|
72
71
|
});
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.44.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -67,12 +67,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
67
67
|
allowEventPropagation: true,
|
|
68
68
|
canOpen: canOpen,
|
|
69
69
|
closeOnChildClick: true,
|
|
70
|
-
hidePreviewButton: hideHoverCardPreviewButton
|
|
71
|
-
|
|
72
|
-
// an object. If we decide to use expose the type for hover preview
|
|
73
|
-
// remove the Boolean() conversion here.
|
|
74
|
-
,
|
|
75
|
-
showServerActions: Boolean(showServerActions),
|
|
70
|
+
hidePreviewButton: hideHoverCardPreviewButton,
|
|
71
|
+
showServerActions: showServerActions,
|
|
76
72
|
url: url
|
|
77
73
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
78
74
|
onMouseLeave: onMouseLeave,
|
|
@@ -146,11 +146,10 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
146
146
|
return (0, _react.jsx)(_lozengeActionTrigger.default, (0, _extends2.default)({}, props, {
|
|
147
147
|
appearance: selected.appearance,
|
|
148
148
|
isOpen: isOpen,
|
|
149
|
-
showFeatureDiscovery: action === null || action === void 0 ? void 0 : action.showFeatureDiscovery,
|
|
150
149
|
testId: testId,
|
|
151
150
|
text: selected.text
|
|
152
151
|
}));
|
|
153
|
-
}, [selected.appearance, selected.text, isOpen,
|
|
152
|
+
}, [selected.appearance, selected.text, isOpen, testId]);
|
|
154
153
|
var handleItemClick = (0, _react2.useCallback)( /*#__PURE__*/function () {
|
|
155
154
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id, text, appearance) {
|
|
156
155
|
var updateAction, request;
|
|
@@ -13,13 +13,11 @@ var _react2 = require("react");
|
|
|
13
13
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
14
14
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
15
15
|
var _styled = require("../styled");
|
|
16
|
-
var
|
|
17
|
-
var _excluded = ["appearance", "isOpen", "showFeatureDiscovery", "testId", "text", "triggerRef"];
|
|
16
|
+
var _excluded = ["appearance", "isOpen", "testId", "text", "triggerRef"];
|
|
18
17
|
/** @jsx jsx */
|
|
19
18
|
var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
20
19
|
var appearance = _ref.appearance,
|
|
21
20
|
isOpen = _ref.isOpen,
|
|
22
|
-
showFeatureDiscovery = _ref.showFeatureDiscovery,
|
|
23
21
|
testId = _ref.testId,
|
|
24
22
|
text = _ref.text,
|
|
25
23
|
triggerRef = _ref.triggerRef,
|
|
@@ -54,9 +52,6 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
54
52
|
onMouseEnter: onMouseEnter,
|
|
55
53
|
onMouseLeave: onMouseLeave,
|
|
56
54
|
ref: triggerRef
|
|
57
|
-
}),
|
|
58
|
-
appearance: appearance,
|
|
59
|
-
testId: testId
|
|
60
|
-
}, lozenge) : lozenge);
|
|
55
|
+
}), lozenge);
|
|
61
56
|
};
|
|
62
57
|
var _default = exports.default = LozengeActionTrigger;
|
|
@@ -21,7 +21,6 @@ var _constants = require("../../../constants");
|
|
|
21
21
|
var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnalyticsContext");
|
|
22
22
|
var _actions = require("../../../state/actions");
|
|
23
23
|
var _analytics = require("../../../state/analytics");
|
|
24
|
-
var _linkProvider = require("@atlaskit/link-provider");
|
|
25
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
26
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
26
|
/** @jsx jsx */
|
|
@@ -65,7 +64,6 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
65
64
|
var analytics = (0, _analytics.useSmartLinkAnalytics)(url, undefined, id);
|
|
66
65
|
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
67
66
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
68
|
-
var enableHoverCardResolutionTracking = (0, _linkProvider.useFeatureFlag)('enableHoverCardResolutionTracking');
|
|
69
67
|
var setMousePosition = (0, _react2.useCallback)(function (event) {
|
|
70
68
|
if (isOpen && canOpen) {
|
|
71
69
|
return;
|
|
@@ -138,12 +136,9 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
138
136
|
if (!resolveTimeOutId.current && isLinkUnresolved) {
|
|
139
137
|
resolveTimeOutId.current = setTimeout(function () {
|
|
140
138
|
loadMetadata();
|
|
141
|
-
if (enableHoverCardResolutionTracking) {
|
|
142
|
-
analytics.track.hoverCardResolutionStarted();
|
|
143
|
-
}
|
|
144
139
|
}, RESOLVE_DELAY);
|
|
145
140
|
}
|
|
146
|
-
}, [
|
|
141
|
+
}, [linkState.metadataStatus, linkState.status, loadMetadata]);
|
|
147
142
|
var initShowCard = (0, _react2.useCallback)(function (event) {
|
|
148
143
|
// clearing out fadeOutTimeoutId in case it's already counting down to hide the card
|
|
149
144
|
if (fadeOutTimeoutId.current) {
|
|
@@ -154,9 +154,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
154
154
|
onClick: onClick,
|
|
155
155
|
onResolve: onResolve,
|
|
156
156
|
renderers: renderers,
|
|
157
|
-
showServerActions: showServerActions
|
|
158
|
-
showStateActionFeatureDiscovery: true
|
|
159
|
-
} : false,
|
|
157
|
+
showServerActions: showServerActions,
|
|
160
158
|
ui: _styled.flexibleUiOptions,
|
|
161
159
|
url: url,
|
|
162
160
|
children: {},
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.
|
|
20
|
+
packageVersion: "26.44.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -16,7 +16,7 @@ const toInvokeRequest = (extensionKey, resourceIdentifiers, actionType, details)
|
|
|
16
16
|
details
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
const extractAction = (response, id
|
|
19
|
+
const extractAction = (response, id) => {
|
|
20
20
|
var _action$dataRetrieval, _action$dataUpdateAct;
|
|
21
21
|
const extensionKey = getExtensionKey(response);
|
|
22
22
|
const data = response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -39,8 +39,7 @@ const extractAction = (response, id, options) => {
|
|
|
39
39
|
const update = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataUpdateAct = action.dataUpdateAction) === null || _action$dataUpdateAct === void 0 ? void 0 : _action$dataUpdateAct.name, details);
|
|
40
40
|
return read || update ? {
|
|
41
41
|
read,
|
|
42
|
-
update
|
|
43
|
-
showFeatureDiscovery: options === null || options === void 0 ? void 0 : options.showStateActionFeatureDiscovery
|
|
42
|
+
update
|
|
44
43
|
} : undefined;
|
|
45
44
|
};
|
|
46
45
|
const extractState = (response, showServerActions, id) => {
|
|
@@ -54,7 +53,7 @@ const extractState = (response, showServerActions, id) => {
|
|
|
54
53
|
if (!showServerActions) {
|
|
55
54
|
return lozenge;
|
|
56
55
|
}
|
|
57
|
-
const action = extractAction(response, id
|
|
56
|
+
const action = extractAction(response, id);
|
|
58
57
|
return {
|
|
59
58
|
...lozenge,
|
|
60
59
|
action
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.44.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -53,12 +53,8 @@ const HoverCardControl = ({
|
|
|
53
53
|
allowEventPropagation: true,
|
|
54
54
|
canOpen: canOpen,
|
|
55
55
|
closeOnChildClick: true,
|
|
56
|
-
hidePreviewButton: hideHoverCardPreviewButton
|
|
57
|
-
|
|
58
|
-
// an object. If we decide to use expose the type for hover preview
|
|
59
|
-
// remove the Boolean() conversion here.
|
|
60
|
-
,
|
|
61
|
-
showServerActions: Boolean(showServerActions),
|
|
56
|
+
hidePreviewButton: hideHoverCardPreviewButton,
|
|
57
|
+
showServerActions: showServerActions,
|
|
62
58
|
url: url
|
|
63
59
|
}, /*#__PURE__*/React.createElement("span", {
|
|
64
60
|
onMouseLeave: onMouseLeave,
|
|
@@ -86,10 +86,9 @@ const LozengeAction = ({
|
|
|
86
86
|
const trigger = useCallback(props => jsx(LozengeActionTrigger, _extends({}, props, {
|
|
87
87
|
appearance: selected.appearance,
|
|
88
88
|
isOpen: isOpen,
|
|
89
|
-
showFeatureDiscovery: action === null || action === void 0 ? void 0 : action.showFeatureDiscovery,
|
|
90
89
|
testId: testId,
|
|
91
90
|
text: selected.text
|
|
92
|
-
})), [selected.appearance, selected.text, isOpen,
|
|
91
|
+
})), [selected.appearance, selected.text, isOpen, testId]);
|
|
93
92
|
const handleItemClick = useCallback(async (id, text, appearance) => {
|
|
94
93
|
try {
|
|
95
94
|
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionListItemClickedEvent();
|
|
@@ -5,11 +5,9 @@ import { useCallback, useMemo, useState } from 'react';
|
|
|
5
5
|
import Lozenge from '@atlaskit/lozenge';
|
|
6
6
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
7
7
|
import { triggerButtonStyles, triggerLozengeStyles } from '../styled';
|
|
8
|
-
import FeatureDiscovery from '../feature-discovery';
|
|
9
8
|
const LozengeActionTrigger = ({
|
|
10
9
|
appearance,
|
|
11
10
|
isOpen,
|
|
12
|
-
showFeatureDiscovery,
|
|
13
11
|
testId,
|
|
14
12
|
text,
|
|
15
13
|
triggerRef,
|
|
@@ -36,9 +34,6 @@ const LozengeActionTrigger = ({
|
|
|
36
34
|
onMouseEnter: onMouseEnter,
|
|
37
35
|
onMouseLeave: onMouseLeave,
|
|
38
36
|
ref: triggerRef
|
|
39
|
-
}),
|
|
40
|
-
appearance: appearance,
|
|
41
|
-
testId: testId
|
|
42
|
-
}, lozenge) : lozenge);
|
|
37
|
+
}), lozenge);
|
|
43
38
|
};
|
|
44
39
|
export default LozengeActionTrigger;
|
|
@@ -13,7 +13,6 @@ import { CardDisplay } from '../../../constants';
|
|
|
13
13
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
14
14
|
import { useSmartCardActions } from '../../../state/actions';
|
|
15
15
|
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
16
|
-
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
17
16
|
const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
18
17
|
const FADE_IN_DELAY = 500;
|
|
19
18
|
const FADE_OUT_DELAY = 300;
|
|
@@ -44,7 +43,6 @@ export const HoverCardComponent = ({
|
|
|
44
43
|
const {
|
|
45
44
|
loadMetadata
|
|
46
45
|
} = useSmartCardActions(id, url, analytics);
|
|
47
|
-
const enableHoverCardResolutionTracking = useFeatureFlag('enableHoverCardResolutionTracking');
|
|
48
46
|
const setMousePosition = useCallback(event => {
|
|
49
47
|
if (isOpen && canOpen) {
|
|
50
48
|
return;
|
|
@@ -116,12 +114,9 @@ export const HoverCardComponent = ({
|
|
|
116
114
|
if (!resolveTimeOutId.current && isLinkUnresolved) {
|
|
117
115
|
resolveTimeOutId.current = setTimeout(() => {
|
|
118
116
|
loadMetadata();
|
|
119
|
-
if (enableHoverCardResolutionTracking) {
|
|
120
|
-
analytics.track.hoverCardResolutionStarted();
|
|
121
|
-
}
|
|
122
117
|
}, RESOLVE_DELAY);
|
|
123
118
|
}
|
|
124
|
-
}, [
|
|
119
|
+
}, [linkState.metadataStatus, linkState.status, loadMetadata]);
|
|
125
120
|
const initShowCard = useCallback(event => {
|
|
126
121
|
// clearing out fadeOutTimeoutId in case it's already counting down to hide the card
|
|
127
122
|
if (fadeOutTimeoutId.current) {
|
|
@@ -117,9 +117,7 @@ const HoverCardContent = ({
|
|
|
117
117
|
onClick: onClick,
|
|
118
118
|
onResolve: onResolve,
|
|
119
119
|
renderers: renderers,
|
|
120
|
-
showServerActions
|
|
121
|
-
showStateActionFeatureDiscovery: true
|
|
122
|
-
} : false,
|
|
120
|
+
showServerActions,
|
|
123
121
|
ui: flexibleUiOptions,
|
|
124
122
|
url: url,
|
|
125
123
|
children: {},
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.
|
|
10
|
+
packageVersion: "26.44.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -19,7 +19,7 @@ var toInvokeRequest = function toInvokeRequest(extensionKey, resourceIdentifiers
|
|
|
19
19
|
details: details
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
var extractAction = function extractAction(response, id
|
|
22
|
+
var extractAction = function extractAction(response, id) {
|
|
23
23
|
var _action$dataRetrieval, _action$dataUpdateAct;
|
|
24
24
|
var extensionKey = getExtensionKey(response);
|
|
25
25
|
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -44,8 +44,7 @@ var extractAction = function extractAction(response, id, options) {
|
|
|
44
44
|
var update = toInvokeRequest(extensionKey, action.resourceIdentifiers, (_action$dataUpdateAct = action.dataUpdateAction) === null || _action$dataUpdateAct === void 0 ? void 0 : _action$dataUpdateAct.name, details);
|
|
45
45
|
return read || update ? {
|
|
46
46
|
read: read,
|
|
47
|
-
update: update
|
|
48
|
-
showFeatureDiscovery: options === null || options === void 0 ? void 0 : options.showStateActionFeatureDiscovery
|
|
47
|
+
update: update
|
|
49
48
|
} : undefined;
|
|
50
49
|
};
|
|
51
50
|
var extractState = function extractState(response, showServerActions, id) {
|
|
@@ -59,7 +58,7 @@ var extractState = function extractState(response, showServerActions, id) {
|
|
|
59
58
|
if (!showServerActions) {
|
|
60
59
|
return lozenge;
|
|
61
60
|
}
|
|
62
|
-
var action = extractAction(response, id
|
|
61
|
+
var action = extractAction(response, id);
|
|
63
62
|
return _objectSpread(_objectSpread({}, lozenge), {}, {
|
|
64
63
|
action: action
|
|
65
64
|
});
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.44.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -57,12 +57,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
57
57
|
allowEventPropagation: true,
|
|
58
58
|
canOpen: canOpen,
|
|
59
59
|
closeOnChildClick: true,
|
|
60
|
-
hidePreviewButton: hideHoverCardPreviewButton
|
|
61
|
-
|
|
62
|
-
// an object. If we decide to use expose the type for hover preview
|
|
63
|
-
// remove the Boolean() conversion here.
|
|
64
|
-
,
|
|
65
|
-
showServerActions: Boolean(showServerActions),
|
|
60
|
+
hidePreviewButton: hideHoverCardPreviewButton,
|
|
61
|
+
showServerActions: showServerActions,
|
|
66
62
|
url: url
|
|
67
63
|
}, /*#__PURE__*/React.createElement("span", {
|
|
68
64
|
onMouseLeave: onMouseLeave,
|
|
@@ -138,11 +138,10 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
138
138
|
return jsx(LozengeActionTrigger, _extends({}, props, {
|
|
139
139
|
appearance: selected.appearance,
|
|
140
140
|
isOpen: isOpen,
|
|
141
|
-
showFeatureDiscovery: action === null || action === void 0 ? void 0 : action.showFeatureDiscovery,
|
|
142
141
|
testId: testId,
|
|
143
142
|
text: selected.text
|
|
144
143
|
}));
|
|
145
|
-
}, [selected.appearance, selected.text, isOpen,
|
|
144
|
+
}, [selected.appearance, selected.text, isOpen, testId]);
|
|
146
145
|
var handleItemClick = useCallback( /*#__PURE__*/function () {
|
|
147
146
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, text, appearance) {
|
|
148
147
|
var updateAction, request;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["appearance", "isOpen", "
|
|
4
|
+
var _excluded = ["appearance", "isOpen", "testId", "text", "triggerRef"];
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { useCallback, useMemo, useState } from 'react';
|
|
8
8
|
import Lozenge from '@atlaskit/lozenge';
|
|
9
9
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
10
10
|
import { triggerButtonStyles, triggerLozengeStyles } from '../styled';
|
|
11
|
-
import FeatureDiscovery from '../feature-discovery';
|
|
12
11
|
var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
13
12
|
var appearance = _ref.appearance,
|
|
14
13
|
isOpen = _ref.isOpen,
|
|
15
|
-
showFeatureDiscovery = _ref.showFeatureDiscovery,
|
|
16
14
|
testId = _ref.testId,
|
|
17
15
|
text = _ref.text,
|
|
18
16
|
triggerRef = _ref.triggerRef,
|
|
@@ -47,9 +45,6 @@ var LozengeActionTrigger = function LozengeActionTrigger(_ref) {
|
|
|
47
45
|
onMouseEnter: onMouseEnter,
|
|
48
46
|
onMouseLeave: onMouseLeave,
|
|
49
47
|
ref: triggerRef
|
|
50
|
-
}),
|
|
51
|
-
appearance: appearance,
|
|
52
|
-
testId: testId
|
|
53
|
-
}, lozenge) : lozenge);
|
|
48
|
+
}), lozenge);
|
|
54
49
|
};
|
|
55
50
|
export default LozengeActionTrigger;
|
|
@@ -14,7 +14,6 @@ import { CardDisplay } from '../../../constants';
|
|
|
14
14
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
15
15
|
import { useSmartCardActions } from '../../../state/actions';
|
|
16
16
|
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
17
|
-
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
18
17
|
var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
19
18
|
var FADE_IN_DELAY = 500;
|
|
20
19
|
var FADE_OUT_DELAY = 300;
|
|
@@ -54,7 +53,6 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
54
53
|
var analytics = useSmartLinkAnalytics(url, undefined, id);
|
|
55
54
|
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
56
55
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
57
|
-
var enableHoverCardResolutionTracking = useFeatureFlag('enableHoverCardResolutionTracking');
|
|
58
56
|
var setMousePosition = useCallback(function (event) {
|
|
59
57
|
if (isOpen && canOpen) {
|
|
60
58
|
return;
|
|
@@ -127,12 +125,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
127
125
|
if (!resolveTimeOutId.current && isLinkUnresolved) {
|
|
128
126
|
resolveTimeOutId.current = setTimeout(function () {
|
|
129
127
|
loadMetadata();
|
|
130
|
-
if (enableHoverCardResolutionTracking) {
|
|
131
|
-
analytics.track.hoverCardResolutionStarted();
|
|
132
|
-
}
|
|
133
128
|
}, RESOLVE_DELAY);
|
|
134
129
|
}
|
|
135
|
-
}, [
|
|
130
|
+
}, [linkState.metadataStatus, linkState.status, loadMetadata]);
|
|
136
131
|
var initShowCard = useCallback(function (event) {
|
|
137
132
|
// clearing out fadeOutTimeoutId in case it's already counting down to hide the card
|
|
138
133
|
if (fadeOutTimeoutId.current) {
|
|
@@ -143,9 +143,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
143
143
|
onClick: onClick,
|
|
144
144
|
onResolve: onResolve,
|
|
145
145
|
renderers: renderers,
|
|
146
|
-
showServerActions: showServerActions
|
|
147
|
-
showStateActionFeatureDiscovery: true
|
|
148
|
-
} : false,
|
|
146
|
+
showServerActions: showServerActions,
|
|
149
147
|
ui: flexibleUiOptions,
|
|
150
148
|
url: url,
|
|
151
149
|
children: {},
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.44.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
2
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
3
|
-
export type LinkLozengeInvokeActions = InvokeActions
|
|
4
|
-
showFeatureDiscovery?: boolean;
|
|
5
|
-
};
|
|
3
|
+
export type LinkLozengeInvokeActions = InvokeActions;
|
|
6
4
|
export interface LinkLozenge {
|
|
7
5
|
action?: LinkLozengeInvokeActions;
|
|
8
6
|
text: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ServerActionProp } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
4
|
-
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => ServerActionProp<boolean> | undefined;
|
|
3
|
+
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => ServerActionProp<boolean> | undefined;
|
|
5
4
|
export default extractFollowAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { LinkLozenge } from '../common/lozenge/types';
|
|
3
|
-
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
|
|
3
|
+
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
|
|
5
4
|
export default extractState;
|
|
@@ -4,7 +4,6 @@ import type { CustomTriggerProps } from '@atlaskit/dropdown-menu';
|
|
|
4
4
|
export type LozengeActionTriggerProps = {
|
|
5
5
|
appearance?: ThemeAppearance;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
-
showFeatureDiscovery?: boolean;
|
|
8
7
|
testId?: string;
|
|
9
8
|
text: string | React.ReactNode;
|
|
10
9
|
} & CustomTriggerProps<HTMLButtonElement>;
|
|
@@ -59,7 +59,7 @@ export type FlexibleCardProps = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Determines whether to show available server actions.
|
|
61
61
|
*/
|
|
62
|
-
showServerActions?: boolean
|
|
62
|
+
showServerActions?: boolean;
|
|
63
63
|
/**
|
|
64
64
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
65
65
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -124,27 +124,6 @@ export type FlexibleUiOptions = {
|
|
|
124
124
|
*/
|
|
125
125
|
zIndex?: number;
|
|
126
126
|
};
|
|
127
|
-
/**
|
|
128
|
-
* Server action options to control action behaviour.
|
|
129
|
-
*
|
|
130
|
-
* If the type is applied to exported component (<Card />, <HoverCard />)
|
|
131
|
-
* please verify with the team if the deprecated prop can be removed prior.
|
|
132
|
-
*
|
|
133
|
-
* In the case that it is being exposed in HoverCard, please remove
|
|
134
|
-
* boolean conversion `Boolean(showServerActions)` in
|
|
135
|
-
* /src/view/FlexibleCard/components/container/index.tsx line 287
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
export type ServerActionOptions = {
|
|
139
|
-
/**
|
|
140
|
-
* DO NOT USE: This prop is part of an experiment. It will be removed once
|
|
141
|
-
* the experiment is completed.
|
|
142
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
143
|
-
* @internal
|
|
144
|
-
* @deprecated
|
|
145
|
-
*/
|
|
146
|
-
showStateActionFeatureDiscovery?: boolean;
|
|
147
|
-
};
|
|
148
127
|
/**
|
|
149
128
|
* Retry options used if Smart Link resolves to an errored state.
|
|
150
129
|
*/
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { InvokeActions } from '../../../state/hooks/use-invoke/types';
|
|
2
2
|
export type LinkLozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
3
|
-
export type LinkLozengeInvokeActions = InvokeActions
|
|
4
|
-
showFeatureDiscovery?: boolean;
|
|
5
|
-
};
|
|
3
|
+
export type LinkLozengeInvokeActions = InvokeActions;
|
|
6
4
|
export interface LinkLozenge {
|
|
7
5
|
action?: LinkLozengeInvokeActions;
|
|
8
6
|
text: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { ServerActionProp } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
|
|
4
|
-
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => ServerActionProp<boolean> | undefined;
|
|
3
|
+
declare const extractFollowAction: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => ServerActionProp<boolean> | undefined;
|
|
5
4
|
export default extractFollowAction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { LinkLozenge } from '../common/lozenge/types';
|
|
3
|
-
|
|
4
|
-
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean | ServerActionOptions, id?: string) => LinkLozenge | undefined;
|
|
3
|
+
declare const extractState: (response?: JsonLd.Response, showServerActions?: boolean, id?: string) => LinkLozenge | undefined;
|
|
5
4
|
export default extractState;
|
|
@@ -4,7 +4,6 @@ import type { CustomTriggerProps } from '@atlaskit/dropdown-menu';
|
|
|
4
4
|
export type LozengeActionTriggerProps = {
|
|
5
5
|
appearance?: ThemeAppearance;
|
|
6
6
|
isOpen?: boolean;
|
|
7
|
-
showFeatureDiscovery?: boolean;
|
|
8
7
|
testId?: string;
|
|
9
8
|
text: string | React.ReactNode;
|
|
10
9
|
} & CustomTriggerProps<HTMLButtonElement>;
|
|
@@ -59,7 +59,7 @@ export type FlexibleCardProps = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Determines whether to show available server actions.
|
|
61
61
|
*/
|
|
62
|
-
showServerActions?: boolean
|
|
62
|
+
showServerActions?: boolean;
|
|
63
63
|
/**
|
|
64
64
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
65
65
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -124,27 +124,6 @@ export type FlexibleUiOptions = {
|
|
|
124
124
|
*/
|
|
125
125
|
zIndex?: number;
|
|
126
126
|
};
|
|
127
|
-
/**
|
|
128
|
-
* Server action options to control action behaviour.
|
|
129
|
-
*
|
|
130
|
-
* If the type is applied to exported component (<Card />, <HoverCard />)
|
|
131
|
-
* please verify with the team if the deprecated prop can be removed prior.
|
|
132
|
-
*
|
|
133
|
-
* In the case that it is being exposed in HoverCard, please remove
|
|
134
|
-
* boolean conversion `Boolean(showServerActions)` in
|
|
135
|
-
* /src/view/FlexibleCard/components/container/index.tsx line 287
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
export type ServerActionOptions = {
|
|
139
|
-
/**
|
|
140
|
-
* DO NOT USE: This prop is part of an experiment. It will be removed once
|
|
141
|
-
* the experiment is completed.
|
|
142
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
143
|
-
* @internal
|
|
144
|
-
* @deprecated
|
|
145
|
-
*/
|
|
146
|
-
showStateActionFeatureDiscovery?: boolean;
|
|
147
|
-
};
|
|
148
127
|
/**
|
|
149
128
|
* Retry options used if Smart Link resolves to an errored state.
|
|
150
129
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.44.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"@atlaskit/avatar": "^21.4.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
29
29
|
"@atlaskit/badge": "^15.2.0",
|
|
30
|
-
"@atlaskit/button": "^17.
|
|
30
|
+
"@atlaskit/button": "^17.2.0",
|
|
31
31
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
32
|
-
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
33
32
|
"@atlaskit/icon": "^22.0.0",
|
|
34
33
|
"@atlaskit/icon-file-type": "^6.4.0",
|
|
35
34
|
"@atlaskit/icon-object": "^6.3.0",
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
39
38
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
40
39
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
41
|
-
"@atlaskit/linking-common": "^5.
|
|
40
|
+
"@atlaskit/linking-common": "^5.3.0",
|
|
42
41
|
"@atlaskit/linking-types": "^8.5.0",
|
|
43
42
|
"@atlaskit/logo": "^13.14.0",
|
|
44
43
|
"@atlaskit/lozenge": "^11.5.0",
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("@emotion/react");
|
|
8
|
-
var _react2 = require("react");
|
|
9
|
-
var _storageClient = require("@atlaskit/frontend-utilities/storage-client");
|
|
10
|
-
var _styled = require("./styled");
|
|
11
|
-
/** @jsx jsx */
|
|
12
|
-
|
|
13
|
-
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
14
|
-
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
15
|
-
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
16
|
-
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
17
|
-
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This is a hacky solution to help with the feature discovery.
|
|
21
|
-
* This implementation must be removed once the experiment is completed.
|
|
22
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
23
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
24
|
-
*/
|
|
25
|
-
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
26
|
-
var appearance = _ref.appearance,
|
|
27
|
-
children = _ref.children,
|
|
28
|
-
testId = _ref.testId;
|
|
29
|
-
var renderedTime = (0, _react2.useRef)();
|
|
30
|
-
var storageClient = (0, _react2.useMemo)(function () {
|
|
31
|
-
return new _storageClient.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
32
|
-
}, []);
|
|
33
|
-
var discovered = (0, _react2.useMemo)(function () {
|
|
34
|
-
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
35
|
-
}, [storageClient]);
|
|
36
|
-
(0, _react2.useEffect)(function () {
|
|
37
|
-
renderedTime.current = Date.now();
|
|
38
|
-
return function () {
|
|
39
|
-
if (!discovered && renderedTime.current) {
|
|
40
|
-
var duration = Date.now() - renderedTime.current;
|
|
41
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
42
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}, [storageClient, discovered]);
|
|
47
|
-
var component = (0, _react2.useMemo)(function () {
|
|
48
|
-
if (!discovered) {
|
|
49
|
-
return (0, _react.jsx)("span", {
|
|
50
|
-
css: (0, _styled.getPulseStyles)(appearance),
|
|
51
|
-
"data-testid": "".concat(testId, "-discovery")
|
|
52
|
-
}, children);
|
|
53
|
-
}
|
|
54
|
-
}, [appearance, children, discovered, testId]);
|
|
55
|
-
return component !== null && component !== void 0 ? component : children;
|
|
56
|
-
};
|
|
57
|
-
var _default = exports.default = FeatureDiscovery;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getPulseStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _templateObject, _templateObject2;
|
|
11
|
-
var pulseKeyframes = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n to {\n box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);\n }\n"])));
|
|
12
|
-
var getPulseColor = function getPulseColor(appearance) {
|
|
13
|
-
switch (appearance) {
|
|
14
|
-
case 'inprogress':
|
|
15
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
16
|
-
case 'moved':
|
|
17
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
18
|
-
case 'new':
|
|
19
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
20
|
-
case 'removed':
|
|
21
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
22
|
-
case 'success':
|
|
23
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
24
|
-
case 'default':
|
|
25
|
-
default:
|
|
26
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var getPulseStyles = exports.getPulseStyles = function getPulseStyles(appearance) {
|
|
30
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n border-radius: 3px;\n box-shadow: 0 0 0 0 ", ";\n animation: ", " 1.45s cubic-bezier(0.5, 0, 0, 1) 3;\n"])), getPulseColor(appearance), pulseKeyframes);
|
|
31
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
-
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
5
|
-
import { getPulseStyles } from './styled';
|
|
6
|
-
const LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
-
const LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
8
|
-
const LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
-
const LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
-
const LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is a hacky solution to help with the feature discovery.
|
|
14
|
-
* This implementation must be removed once the experiment is completed.
|
|
15
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
16
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
17
|
-
*/
|
|
18
|
-
const FeatureDiscovery = ({
|
|
19
|
-
appearance,
|
|
20
|
-
children,
|
|
21
|
-
testId
|
|
22
|
-
}) => {
|
|
23
|
-
const renderedTime = useRef();
|
|
24
|
-
const storageClient = useMemo(() => new StorageClient(LOCAL_STORAGE_CLIENT_KEY), []);
|
|
25
|
-
const discovered = useMemo(() => storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE, [storageClient]);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
renderedTime.current = Date.now();
|
|
28
|
-
return () => {
|
|
29
|
-
if (!discovered && renderedTime.current) {
|
|
30
|
-
const duration = Date.now() - renderedTime.current;
|
|
31
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
32
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}, [storageClient, discovered]);
|
|
37
|
-
const component = useMemo(() => {
|
|
38
|
-
if (!discovered) {
|
|
39
|
-
return jsx("span", {
|
|
40
|
-
css: getPulseStyles(appearance),
|
|
41
|
-
"data-testid": `${testId}-discovery`
|
|
42
|
-
}, children);
|
|
43
|
-
}
|
|
44
|
-
}, [appearance, children, discovered, testId]);
|
|
45
|
-
return component !== null && component !== void 0 ? component : children;
|
|
46
|
-
};
|
|
47
|
-
export default FeatureDiscovery;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
const pulseKeyframes = keyframes`
|
|
3
|
-
to {
|
|
4
|
-
box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);
|
|
5
|
-
}
|
|
6
|
-
`;
|
|
7
|
-
const getPulseColor = appearance => {
|
|
8
|
-
switch (appearance) {
|
|
9
|
-
case 'inprogress':
|
|
10
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
11
|
-
case 'moved':
|
|
12
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
13
|
-
case 'new':
|
|
14
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
15
|
-
case 'removed':
|
|
16
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
17
|
-
case 'success':
|
|
18
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
19
|
-
case 'default':
|
|
20
|
-
default:
|
|
21
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export const getPulseStyles = appearance => css`
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
border-radius: 3px;
|
|
27
|
-
box-shadow: 0 0 0 0 ${getPulseColor(appearance)};
|
|
28
|
-
animation: ${pulseKeyframes} 1.45s cubic-bezier(0.5, 0, 0, 1) 3;
|
|
29
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
-
import { StorageClient } from '@atlaskit/frontend-utilities/storage-client';
|
|
5
|
-
import { getPulseStyles } from './styled';
|
|
6
|
-
var LOCAL_STORAGE_CLIENT_KEY = '@atlaskit/smart-card';
|
|
7
|
-
var LOCAL_STORAGE_DISCOVERY_KEY = 'action-discovery-status';
|
|
8
|
-
var LOCAL_STORAGE_DISCOVERY_VALUE = 'discovered';
|
|
9
|
-
var LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS = 15552000000; // 180 days
|
|
10
|
-
var LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME = 2000; // 2s
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is a hacky solution to help with the feature discovery.
|
|
14
|
-
* This implementation must be removed once the experiment is completed.
|
|
15
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
16
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
17
|
-
*/
|
|
18
|
-
var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
19
|
-
var appearance = _ref.appearance,
|
|
20
|
-
children = _ref.children,
|
|
21
|
-
testId = _ref.testId;
|
|
22
|
-
var renderedTime = useRef();
|
|
23
|
-
var storageClient = useMemo(function () {
|
|
24
|
-
return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
25
|
-
}, []);
|
|
26
|
-
var discovered = useMemo(function () {
|
|
27
|
-
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
28
|
-
}, [storageClient]);
|
|
29
|
-
useEffect(function () {
|
|
30
|
-
renderedTime.current = Date.now();
|
|
31
|
-
return function () {
|
|
32
|
-
if (!discovered && renderedTime.current) {
|
|
33
|
-
var duration = Date.now() - renderedTime.current;
|
|
34
|
-
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
35
|
-
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}, [storageClient, discovered]);
|
|
40
|
-
var component = useMemo(function () {
|
|
41
|
-
if (!discovered) {
|
|
42
|
-
return jsx("span", {
|
|
43
|
-
css: getPulseStyles(appearance),
|
|
44
|
-
"data-testid": "".concat(testId, "-discovery")
|
|
45
|
-
}, children);
|
|
46
|
-
}
|
|
47
|
-
}, [appearance, children, discovered, testId]);
|
|
48
|
-
return component !== null && component !== void 0 ? component : children;
|
|
49
|
-
};
|
|
50
|
-
export default FeatureDiscovery;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
|
-
import { css, keyframes } from '@emotion/react';
|
|
4
|
-
var pulseKeyframes = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n to {\n box-shadow: 0 0 0 7px rgba(0, 0, 0, 0);\n }\n"])));
|
|
5
|
-
var getPulseColor = function getPulseColor(appearance) {
|
|
6
|
-
switch (appearance) {
|
|
7
|
-
case 'inprogress':
|
|
8
|
-
return "var(--ds-background-information-bold, #0052CC)";
|
|
9
|
-
case 'moved':
|
|
10
|
-
return "var(--ds-background-warning-bold, #FFAB00)";
|
|
11
|
-
case 'new':
|
|
12
|
-
return "var(--ds-background-discovery-bold, #5243AA)";
|
|
13
|
-
case 'removed':
|
|
14
|
-
return "var(--ds-background-danger-bold, #DE350B)";
|
|
15
|
-
case 'success':
|
|
16
|
-
return "var(--ds-background-success-bold, #00875A)";
|
|
17
|
-
case 'default':
|
|
18
|
-
default:
|
|
19
|
-
return "var(--ds-background-neutral-bold, #42526E)";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export var getPulseStyles = function getPulseStyles(appearance) {
|
|
23
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-flex;\n border-radius: 3px;\n box-shadow: 0 0 0 0 ", ";\n animation: ", " 1.45s cubic-bezier(0.5, 0, 0, 1) 3;\n"])), getPulseColor(appearance), pulseKeyframes);
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { FeatureDiscoveryProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a hacky solution to help with the feature discovery.
|
|
5
|
-
* This implementation must be removed once the experiment is completed.
|
|
6
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
7
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
8
|
-
*/
|
|
9
|
-
declare const FeatureDiscovery: FC<FeatureDiscoveryProps>;
|
|
10
|
-
export default FeatureDiscovery;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { FeatureDiscoveryProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a hacky solution to help with the feature discovery.
|
|
5
|
-
* This implementation must be removed once the experiment is completed.
|
|
6
|
-
* Cleanup on https://product-fabric.atlassian.net/browse/EDM-5795
|
|
7
|
-
* @see https://team.atlassian.com/project/ATLAS-13099/about
|
|
8
|
-
*/
|
|
9
|
-
declare const FeatureDiscovery: FC<FeatureDiscoveryProps>;
|
|
10
|
-
export default FeatureDiscovery;
|