@atlaskit/smart-card 28.1.6 → 28.1.7
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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +11 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +13 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +11 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/Card/types.d.ts +1 -0
- package/dist/types-ts4.5/view/Card/types.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 28.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142271](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142271)
|
|
8
|
+
[`b6147e8a87a2d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6147e8a87a2d) -
|
|
9
|
+
Add try/catch around localStorage usages
|
|
10
|
+
|
|
3
11
|
## 28.1.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -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: "28.1.
|
|
25
|
+
packageVersion: "28.1.7"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
CHANGED
|
@@ -32,7 +32,12 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
32
32
|
return new _storageClient.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
33
33
|
}, []);
|
|
34
34
|
var discovered = (0, _react2.useMemo)(function () {
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
37
|
+
} catch (_unused) {
|
|
38
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
36
41
|
}, [storageClient]);
|
|
37
42
|
(0, _react2.useEffect)(function () {
|
|
38
43
|
renderedTime.current = Date.now();
|
|
@@ -40,7 +45,11 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
40
45
|
if (!discovered && renderedTime.current) {
|
|
41
46
|
var duration = Date.now() - renderedTime.current;
|
|
42
47
|
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
43
|
-
|
|
48
|
+
try {
|
|
49
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
50
|
+
} catch (_unused2) {
|
|
51
|
+
// silent error
|
|
52
|
+
}
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
};
|
|
@@ -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: "28.1.
|
|
20
|
+
packageVersion: "28.1.7",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -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: "28.1.
|
|
7
|
+
packageVersion: "28.1.7"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
CHANGED
|
@@ -23,14 +23,25 @@ const FeatureDiscovery = ({
|
|
|
23
23
|
}) => {
|
|
24
24
|
const renderedTime = useRef();
|
|
25
25
|
const storageClient = useMemo(() => new StorageClient(LOCAL_STORAGE_CLIENT_KEY), []);
|
|
26
|
-
const discovered = useMemo(() =>
|
|
26
|
+
const discovered = useMemo(() => {
|
|
27
|
+
try {
|
|
28
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
29
|
+
} catch {
|
|
30
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}, [storageClient]);
|
|
27
34
|
useEffect(() => {
|
|
28
35
|
renderedTime.current = Date.now();
|
|
29
36
|
return () => {
|
|
30
37
|
if (!discovered && renderedTime.current) {
|
|
31
38
|
const duration = Date.now() - renderedTime.current;
|
|
32
39
|
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
33
|
-
|
|
40
|
+
try {
|
|
41
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
42
|
+
} catch {
|
|
43
|
+
// silent error
|
|
44
|
+
}
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
47
|
};
|
|
@@ -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: "28.1.
|
|
10
|
+
packageVersion: "28.1.7",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -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: "28.1.
|
|
18
|
+
packageVersion: "28.1.7"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js
CHANGED
|
@@ -25,7 +25,12 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
25
25
|
return new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
26
26
|
}, []);
|
|
27
27
|
var discovered = useMemo(function () {
|
|
28
|
-
|
|
28
|
+
try {
|
|
29
|
+
return storageClient.getItem(LOCAL_STORAGE_DISCOVERY_KEY) === LOCAL_STORAGE_DISCOVERY_VALUE;
|
|
30
|
+
} catch (_unused) {
|
|
31
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
29
34
|
}, [storageClient]);
|
|
30
35
|
useEffect(function () {
|
|
31
36
|
renderedTime.current = Date.now();
|
|
@@ -33,7 +38,11 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
|
|
|
33
38
|
if (!discovered && renderedTime.current) {
|
|
34
39
|
var duration = Date.now() - renderedTime.current;
|
|
35
40
|
if (duration > LOCAL_STORAGE_DISCOVERY_REQUIRED_TIME) {
|
|
36
|
-
|
|
41
|
+
try {
|
|
42
|
+
storageClient.setItemWithExpiry(LOCAL_STORAGE_DISCOVERY_KEY, LOCAL_STORAGE_DISCOVERY_VALUE, LOCAL_STORAGE_DISCOVERY_EXPIRY_IN_MS);
|
|
43
|
+
} catch (_unused2) {
|
|
44
|
+
// silent error
|
|
45
|
+
}
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
};
|
|
@@ -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: "28.1.
|
|
13
|
+
packageVersion: "28.1.7",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -107,6 +107,7 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
107
107
|
analyticsEvents?: AnalyticsFacade;
|
|
108
108
|
placeholder?: string;
|
|
109
109
|
/**
|
|
110
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
|
|
110
111
|
* When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
|
|
111
112
|
* Usage is strongly discouraged. This should only be used if there is a specific reason you're
|
|
112
113
|
* unable to use the new flexible block cards.
|
|
@@ -107,6 +107,7 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
107
107
|
analyticsEvents?: AnalyticsFacade;
|
|
108
108
|
placeholder?: string;
|
|
109
109
|
/**
|
|
110
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15021 Internal documentation for deprecation (no external access)}
|
|
110
111
|
* When enabled the legacy block card is always used, even if the enableFlexibleBlockCard flag is set to true.
|
|
111
112
|
* Usage is strongly discouraged. This should only be used if there is a specific reason you're
|
|
112
113
|
* unable to use the new flexible block cards.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "28.1.
|
|
3
|
+
"version": "28.1.7",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/logo": "^14.2.0",
|
|
49
49
|
"@atlaskit/lozenge": "^11.10.0",
|
|
50
50
|
"@atlaskit/menu": "^2.12.0",
|
|
51
|
-
"@atlaskit/modal-dialog": "^12.
|
|
51
|
+
"@atlaskit/modal-dialog": "^12.16.0",
|
|
52
52
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
54
54
|
"@atlaskit/popup": "^1.25.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@atlaskit/analytics-listeners": "^8.11.0",
|
|
91
91
|
"@atlaskit/css-reset": "^6.11.0",
|
|
92
92
|
"@atlaskit/link-test-helpers": "^7.5.0",
|
|
93
|
-
"@atlaskit/media-test-helpers": "^34.
|
|
93
|
+
"@atlaskit/media-test-helpers": "^34.4.0",
|
|
94
94
|
"@atlaskit/ssr": "*",
|
|
95
95
|
"@atlaskit/visual-regression": "*",
|
|
96
96
|
"@atlassian/analytics-tooling": "*",
|