@cloud-ru/uikit-product-header 5.1.0 → 5.1.1
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 +11 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +8 -8
- package/src/index.ts +1 -1
- package/dist/cjs/hooks/index.d.ts +0 -1
- package/dist/cjs/hooks/index.js +0 -17
- package/dist/cjs/hooks/useLocalStorage.d.ts +0 -1
- package/dist/cjs/hooks/useLocalStorage.js +0 -16
- package/dist/esm/hooks/index.d.ts +0 -1
- package/dist/esm/hooks/index.js +0 -1
- package/dist/esm/hooks/useLocalStorage.d.ts +0 -1
- package/dist/esm/hooks/useLocalStorage.js +0 -13
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useLocalStorage.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.1 (2025-12-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
* **DOCDEV-2456:** reexported useLocalStorage in header pckg ([b1b5d66](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/b1b5d6650736dcd7c06f0ee15840e4c19a7fabeb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 5.1.0 (2025-12-12)
|
|
7
18
|
|
|
8
19
|
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
-
export
|
|
2
|
+
export { useLocalStorage } from '@cloud-ru/uikit-product-utils';
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.useLocalStorage = void 0;
|
|
17
18
|
__exportStar(require("./components"), exports);
|
|
18
|
-
|
|
19
|
+
var uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
20
|
+
Object.defineProperty(exports, "useLocalStorage", { enumerable: true, get: function () { return uikit_product_utils_1.useLocalStorage; } });
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
-
export
|
|
2
|
+
export { useLocalStorage } from '@cloud-ru/uikit-product-utils';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
-
export
|
|
2
|
+
export { useLocalStorage } from '@cloud-ru/uikit-product-utils';
|
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.1.
|
|
4
|
+
"version": "5.1.1",
|
|
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.
|
|
40
|
-
"@cloud-ru/uikit-product-icons": "16.1.
|
|
41
|
-
"@cloud-ru/uikit-product-mobile-drawer": "0.9.
|
|
42
|
-
"@cloud-ru/uikit-product-mobile-modal": "0.9.
|
|
43
|
-
"@cloud-ru/uikit-product-title-clickable": "0.0.
|
|
44
|
-
"@cloud-ru/uikit-product-utils": "8.0
|
|
39
|
+
"@cloud-ru/uikit-product-card-predefined": "0.8.21",
|
|
40
|
+
"@cloud-ru/uikit-product-icons": "16.1.1",
|
|
41
|
+
"@cloud-ru/uikit-product-mobile-drawer": "0.9.25",
|
|
42
|
+
"@cloud-ru/uikit-product-mobile-modal": "0.9.28",
|
|
43
|
+
"@cloud-ru/uikit-product-title-clickable": "0.0.57",
|
|
44
|
+
"@cloud-ru/uikit-product-utils": "8.1.0",
|
|
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": "
|
|
67
|
+
"gitHead": "1a98d6d9bff32edcbb3f9b0be0a14dce3f2abe5d"
|
|
68
68
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
-
export
|
|
2
|
+
export { useLocalStorage } from '@cloud-ru/uikit-product-utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLocalStorage';
|
package/dist/cjs/hooks/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useLocalStorage"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocalStorage<T extends string = string>(key: string, defaultValue: T): [T, (newValue: T) => void];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useLocalStorage = useLocalStorage;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const utils_1 = require("@snack-uikit/utils");
|
|
6
|
-
function useLocalStorage(key, defaultValue) {
|
|
7
|
-
var _a;
|
|
8
|
-
const [value, setValueState] = (0, react_1.useState)(((_a = ((0, utils_1.isBrowser)() ? localStorage.getItem(key) : null)) !== null && _a !== void 0 ? _a : defaultValue));
|
|
9
|
-
const setValue = (0, react_1.useCallback)((newValue) => {
|
|
10
|
-
if ((0, utils_1.isBrowser)()) {
|
|
11
|
-
localStorage.setItem(key, newValue);
|
|
12
|
-
}
|
|
13
|
-
setValueState(newValue);
|
|
14
|
-
}, [key]);
|
|
15
|
-
return [value, setValue];
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLocalStorage';
|
package/dist/esm/hooks/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLocalStorage';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useLocalStorage<T extends string = string>(key: string, defaultValue: T): [T, (newValue: T) => void];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
import { isBrowser } from '@snack-uikit/utils';
|
|
3
|
-
export function useLocalStorage(key, defaultValue) {
|
|
4
|
-
var _a;
|
|
5
|
-
const [value, setValueState] = useState(((_a = (isBrowser() ? localStorage.getItem(key) : null)) !== null && _a !== void 0 ? _a : defaultValue));
|
|
6
|
-
const setValue = useCallback((newValue) => {
|
|
7
|
-
if (isBrowser()) {
|
|
8
|
-
localStorage.setItem(key, newValue);
|
|
9
|
-
}
|
|
10
|
-
setValueState(newValue);
|
|
11
|
-
}, [key]);
|
|
12
|
-
return [value, setValue];
|
|
13
|
-
}
|
package/src/hooks/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useLocalStorage';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { isBrowser } from '@snack-uikit/utils';
|
|
4
|
-
|
|
5
|
-
export function useLocalStorage<T extends string = string>(key: string, defaultValue: T): [T, (newValue: T) => void] {
|
|
6
|
-
const [value, setValueState] = useState<T>(((isBrowser() ? localStorage.getItem(key) : null) ?? defaultValue) as T);
|
|
7
|
-
|
|
8
|
-
const setValue = useCallback(
|
|
9
|
-
(newValue: T) => {
|
|
10
|
-
if (isBrowser()) {
|
|
11
|
-
localStorage.setItem(key, newValue);
|
|
12
|
-
}
|
|
13
|
-
setValueState(newValue);
|
|
14
|
-
},
|
|
15
|
-
[key],
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return [value, setValue];
|
|
19
|
-
}
|