oihana-next-ui 0.1.38 → 0.1.40
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/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display preference storage key helpers.
|
|
3
|
+
*
|
|
4
|
+
* No 'use client' directive — usable on both server and client.
|
|
5
|
+
*
|
|
6
|
+
* @module helpers/storage/displayStorageKey
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Prefix applied to all display preference storage keys.
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
export const DISPLAY_STORAGE_PREFIX = 'display__' ;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Builds the full storage / cookie key from a page identifier.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} pageKey - e.g. 'products' or 'app.products'
|
|
19
|
+
* @returns {string} - e.g. 'display__products'
|
|
20
|
+
*/
|
|
21
|
+
const getDisplayStorageKey = pageKey => `${ DISPLAY_STORAGE_PREFIX }${ pageKey }` ;
|
|
22
|
+
|
|
23
|
+
export default getDisplayStorageKey ;
|
|
@@ -26,24 +26,14 @@
|
|
|
26
26
|
|
|
27
27
|
import { useSyncExternalStore } from 'react' ;
|
|
28
28
|
|
|
29
|
-
import readStorage from '
|
|
30
|
-
import writeStorage from '
|
|
31
|
-
import removeStorage from '
|
|
32
|
-
import subscribeStorage from '
|
|
29
|
+
import readStorage from '../helpers/storage/readStorage' ;
|
|
30
|
+
import writeStorage from '../helpers/storage/writeStorage' ;
|
|
31
|
+
import removeStorage from '../helpers/storage/removeStorage' ;
|
|
32
|
+
import subscribeStorage from '../helpers/storage/subscribeStorage' ;
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
* Prefix applied to all display preference storage keys.
|
|
36
|
-
* @type {string}
|
|
37
|
-
*/
|
|
38
|
-
export const DISPLAY_STORAGE_PREFIX = 'display__' ;
|
|
34
|
+
import getDisplayStorageKey from '../helpers/storage/displayStorageKey' ;
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
* Builds the full storage key from a page identifier.
|
|
42
|
-
*
|
|
43
|
-
* @param {string} pageKey - e.g. 'products' or 'app.products'
|
|
44
|
-
* @returns {string} - e.g. 'display__products'
|
|
45
|
-
*/
|
|
46
|
-
export const getDisplayStorageKey = pageKey => `${ DISPLAY_STORAGE_PREFIX }${ pageKey }` ;
|
|
36
|
+
export { getDisplayStorageKey } ;
|
|
47
37
|
|
|
48
38
|
/**
|
|
49
39
|
* @param {string|null|undefined} pageKey - Page identifier — use `url` or `path` prop from ThingsPage.
|
package/src/version.js
CHANGED