@atlaskit/editor-plugin-card 3.0.3 → 3.0.5

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 3.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#142271](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142271)
14
+ [`b6147e8a87a2d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6147e8a87a2d) -
15
+ Add try/catch around localStorage usages
16
+
3
17
  ## 3.0.3
4
18
 
5
19
  ### Patch Changes
@@ -12,9 +12,18 @@ var LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = exports.LOCAL_STORAGE_DISCOVERY_KEY_TO
12
12
  var ONE_DAY_IN_MILLISECONDS = exports.ONE_DAY_IN_MILLISECONDS = 86400000;
13
13
  var storageClient = new _frontendUtilities.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
14
14
  var isLocalStorageKeyDiscovered = exports.isLocalStorageKeyDiscovered = function isLocalStorageKeyDiscovered(key) {
15
- var localStorageValue = storageClient.getItem(key);
16
- return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
15
+ try {
16
+ var localStorageValue = storageClient.getItem(key);
17
+ return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
18
+ } catch (_unused) {
19
+ // If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
20
+ return true;
21
+ }
17
22
  };
18
23
  var markLocalStorageKeyDiscovered = exports.markLocalStorageKeyDiscovered = function markLocalStorageKeyDiscovered(key, expiration) {
19
- storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
24
+ try {
25
+ storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
26
+ } catch (_unused2) {
27
+ // silent error
28
+ }
20
29
  };
@@ -6,9 +6,18 @@ export const LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = 'toolbar-upgrade-pulse';
6
6
  export const ONE_DAY_IN_MILLISECONDS = 86400000;
7
7
  const storageClient = new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
8
8
  export const isLocalStorageKeyDiscovered = key => {
9
- const localStorageValue = storageClient.getItem(key);
10
- return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
9
+ try {
10
+ const localStorageValue = storageClient.getItem(key);
11
+ return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
12
+ } catch {
13
+ // If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
14
+ return true;
15
+ }
11
16
  };
12
17
  export const markLocalStorageKeyDiscovered = (key, expiration) => {
13
- storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
18
+ try {
19
+ storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
20
+ } catch {
21
+ // silent error
22
+ }
14
23
  };
@@ -6,9 +6,18 @@ export var LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = 'toolbar-upgrade-pulse';
6
6
  export var ONE_DAY_IN_MILLISECONDS = 86400000;
7
7
  var storageClient = new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
8
8
  export var isLocalStorageKeyDiscovered = function isLocalStorageKeyDiscovered(key) {
9
- var localStorageValue = storageClient.getItem(key);
10
- return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
9
+ try {
10
+ var localStorageValue = storageClient.getItem(key);
11
+ return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
12
+ } catch (_unused) {
13
+ // If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
14
+ return true;
15
+ }
11
16
  };
12
17
  export var markLocalStorageKeyDiscovered = function markLocalStorageKeyDiscovered(key, expiration) {
13
- storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
18
+ try {
19
+ storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
20
+ } catch (_unused2) {
21
+ // silent error
22
+ }
14
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
35
  "@atlaskit/analytics-next": "^10.1.0",
36
36
  "@atlaskit/custom-steps": "^0.7.0",
37
- "@atlaskit/editor-common": "^89.3.0",
37
+ "@atlaskit/editor-common": "^90.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
39
39
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
40
40
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/icon": "^22.18.0",
50
50
  "@atlaskit/link-analytics": "^8.5.0",
51
51
  "@atlaskit/link-client-extension": "^2.4.0",
52
- "@atlaskit/link-datasource": "^3.0.0",
52
+ "@atlaskit/link-datasource": "^3.1.0",
53
53
  "@atlaskit/linking-common": "^5.11.0",
54
54
  "@atlaskit/linking-types": "^9.0.0",
55
55
  "@atlaskit/menu": "2.12.2",