@cloud-ru/uikit-product-header 5.0.25 → 5.1.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 CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 5.1.0 (2025-12-12)
7
+
8
+
9
+ ### Features
10
+
11
+ * **EVOVPC-2169:** add virtualip to service groups constant ([133fd82](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/133fd82ca67900a90dc8861ba6a5dbb1eb6c7119))
12
+
13
+
14
+
15
+
16
+
17
+ ## 5.0.26 (2025-12-08)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **FF-7187:** add SSR safety checks for localStorage and navigator usage ([c2c7561](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/c2c7561c9a2f5e3b1bd897b696b33ea309f39dfa))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 5.0.25 (2025-11-28)
7
29
 
8
30
  ### Only dependencies have been changed
@@ -2,11 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLocalStorage = useLocalStorage;
4
4
  const react_1 = require("react");
5
+ const utils_1 = require("@snack-uikit/utils");
5
6
  function useLocalStorage(key, defaultValue) {
6
7
  var _a;
7
- const [value, setValueState] = (0, react_1.useState)((_a = localStorage.getItem(key)) !== null && _a !== void 0 ? _a : defaultValue);
8
+ const [value, setValueState] = (0, react_1.useState)(((_a = ((0, utils_1.isBrowser)() ? localStorage.getItem(key) : null)) !== null && _a !== void 0 ? _a : defaultValue));
8
9
  const setValue = (0, react_1.useCallback)((newValue) => {
9
- localStorage.setItem(key, newValue);
10
+ if ((0, utils_1.isBrowser)()) {
11
+ localStorage.setItem(key, newValue);
12
+ }
10
13
  setValueState(newValue);
11
14
  }, [key]);
12
15
  return [value, setValue];
@@ -1,9 +1,12 @@
1
1
  import { useCallback, useState } from 'react';
2
+ import { isBrowser } from '@snack-uikit/utils';
2
3
  export function useLocalStorage(key, defaultValue) {
3
4
  var _a;
4
- const [value, setValueState] = useState((_a = localStorage.getItem(key)) !== null && _a !== void 0 ? _a : defaultValue);
5
+ const [value, setValueState] = useState(((_a = (isBrowser() ? localStorage.getItem(key) : null)) !== null && _a !== void 0 ? _a : defaultValue));
5
6
  const setValue = useCallback((newValue) => {
6
- localStorage.setItem(key, newValue);
7
+ if (isBrowser()) {
8
+ localStorage.setItem(key, newValue);
9
+ }
7
10
  setValueState(newValue);
8
11
  }, [key]);
9
12
  return [value, setValue];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-header",
3
3
  "title": "Header",
4
- "version": "5.0.25",
4
+ "version": "5.1.0",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -36,12 +36,12 @@
36
36
  },
37
37
  "scripts": {},
38
38
  "dependencies": {
39
- "@cloud-ru/uikit-product-card-predefined": "0.8.18",
40
- "@cloud-ru/uikit-product-icons": "16.0.0",
41
- "@cloud-ru/uikit-product-mobile-drawer": "0.9.22",
42
- "@cloud-ru/uikit-product-mobile-modal": "0.9.25",
43
- "@cloud-ru/uikit-product-title-clickable": "0.0.54",
44
- "@cloud-ru/uikit-product-utils": "8.0.1",
39
+ "@cloud-ru/uikit-product-card-predefined": "0.8.20",
40
+ "@cloud-ru/uikit-product-icons": "16.1.0",
41
+ "@cloud-ru/uikit-product-mobile-drawer": "0.9.24",
42
+ "@cloud-ru/uikit-product-mobile-modal": "0.9.27",
43
+ "@cloud-ru/uikit-product-title-clickable": "0.0.56",
44
+ "@cloud-ru/uikit-product-utils": "8.0.2",
45
45
  "@snack-uikit/avatar": "0.8.14",
46
46
  "@snack-uikit/breadcrumbs": "0.11.22",
47
47
  "@snack-uikit/button": "0.19.16",
@@ -64,5 +64,5 @@
64
64
  "peerDependencies": {
65
65
  "@cloud-ru/uikit-product-locale": "*"
66
66
  },
67
- "gitHead": "f67d8d3987dc49157789aebe9e083c42d0abf5c3"
67
+ "gitHead": "7303f734eef30f1ac7ac3a279bcf324dcd549059"
68
68
  }
@@ -1,11 +1,15 @@
1
1
  import { useCallback, useState } from 'react';
2
2
 
3
+ import { isBrowser } from '@snack-uikit/utils';
4
+
3
5
  export function useLocalStorage<T extends string = string>(key: string, defaultValue: T): [T, (newValue: T) => void] {
4
- const [value, setValueState] = useState((localStorage.getItem(key) as T) ?? defaultValue);
6
+ const [value, setValueState] = useState<T>(((isBrowser() ? localStorage.getItem(key) : null) ?? defaultValue) as T);
5
7
 
6
8
  const setValue = useCallback(
7
9
  (newValue: T) => {
8
- localStorage.setItem(key, newValue);
10
+ if (isBrowser()) {
11
+ localStorage.setItem(key, newValue);
12
+ }
9
13
  setValueState(newValue);
10
14
  },
11
15
  [key],