@e1011/es-kit 1.0.230 → 1.0.232

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.
@@ -1,54 +1,11 @@
1
- .CollapsibleContainer-module_collapsible-container__u0Jmm {
2
- transform-origin: 0% 0%;
3
- opacity: 0;
4
- overflow: clip;
5
- }
6
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
7
- transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
8
- will-change: opacity, height, max-height;
9
- }
10
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
11
- height: 0;
12
- max-height: 0;
13
- opacity: 0;
14
- }
15
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
16
- height: var(--prop-value);
17
- max-height: var(--prop-value);
18
- opacity: 1;
19
- }
20
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
21
- transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
22
- will-change: opacity, width, max-width;
23
- }
24
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
25
- width: 0;
26
- max-width: 0;
27
- opacity: 0;
28
- }
29
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
30
- width: var(--prop-value);
31
- max-width: var(--prop-value);
32
- opacity: 1;
33
- }
34
- .divider-module_divider-line__6CesR {
35
- position: relative;
36
- display: block;
37
- transition: opacity, width, height 250ms ease-in-out;
38
- background-color: var(--color);
39
- opacity: var(--opacity);
40
- }
41
- .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
42
- height: var(--length);
43
- left: var(--left);
44
- width: var(--width);
45
- margin: var(--margin);
1
+ .errorBoundary-module_errorBoundary__gk9ps {
2
+ background: #EFEFEF;
3
+ width: 100%;
4
+ height: 100%;
46
5
  }
47
- .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
48
- width: var(--length);
49
- left: var(--left);
50
- height: var(--height);
51
- margin: var(--margin);
6
+
7
+ .errorBoundary-module_StyledIcon__IYHiU {
8
+ margin-right: 10px;
52
9
  }
53
10
  .icon-module_icon-base-parent__nOMvW {
54
11
  line-height: 1px !important;
@@ -80,14 +37,57 @@
80
37
  width: var(--height);
81
38
  height: var(--width);
82
39
  }
83
- .errorBoundary-module_errorBoundary__gk9ps {
84
- background: #EFEFEF;
85
- width: 100%;
86
- height: 100%;
40
+ .divider-module_divider-line__6CesR {
41
+ position: relative;
42
+ display: block;
43
+ transition: opacity, width, height 250ms ease-in-out;
44
+ background-color: var(--color);
45
+ opacity: var(--opacity);
87
46
  }
88
-
89
- .errorBoundary-module_StyledIcon__IYHiU {
90
- margin-right: 10px;
47
+ .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
48
+ height: var(--length);
49
+ left: var(--left);
50
+ width: var(--width);
51
+ margin: var(--margin);
52
+ }
53
+ .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
54
+ width: var(--length);
55
+ left: var(--left);
56
+ height: var(--height);
57
+ margin: var(--margin);
58
+ }
59
+ .CollapsibleContainer-module_collapsible-container__u0Jmm {
60
+ transform-origin: 0% 0%;
61
+ opacity: 0;
62
+ overflow: clip;
63
+ }
64
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
65
+ transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
66
+ will-change: opacity, height, max-height;
67
+ }
68
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
69
+ height: 0;
70
+ max-height: 0;
71
+ opacity: 0;
72
+ }
73
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
74
+ height: var(--prop-value);
75
+ max-height: var(--prop-value);
76
+ opacity: 1;
77
+ }
78
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
79
+ transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
80
+ will-change: opacity, width, max-width;
81
+ }
82
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
83
+ width: 0;
84
+ max-width: 0;
85
+ opacity: 0;
86
+ }
87
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
88
+ width: var(--prop-value);
89
+ max-width: var(--prop-value);
90
+ opacity: 1;
91
91
  }
92
92
  .lazyComponent-module_loader__brMEW {
93
93
  position: relative;
@@ -1,54 +1,11 @@
1
- .CollapsibleContainer-module_collapsible-container__u0Jmm {
2
- transform-origin: 0% 0%;
3
- opacity: 0;
4
- overflow: clip;
5
- }
6
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
7
- transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
8
- will-change: opacity, height, max-height;
9
- }
10
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
11
- height: 0;
12
- max-height: 0;
13
- opacity: 0;
14
- }
15
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
16
- height: var(--prop-value);
17
- max-height: var(--prop-value);
18
- opacity: 1;
19
- }
20
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
21
- transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
22
- will-change: opacity, width, max-width;
23
- }
24
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
25
- width: 0;
26
- max-width: 0;
27
- opacity: 0;
28
- }
29
- .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
30
- width: var(--prop-value);
31
- max-width: var(--prop-value);
32
- opacity: 1;
33
- }
34
- .divider-module_divider-line__6CesR {
35
- position: relative;
36
- display: block;
37
- transition: opacity, width, height 250ms ease-in-out;
38
- background-color: var(--color);
39
- opacity: var(--opacity);
40
- }
41
- .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
42
- height: var(--length);
43
- left: var(--left);
44
- width: var(--width);
45
- margin: var(--margin);
1
+ .errorBoundary-module_errorBoundary__gk9ps {
2
+ background: #EFEFEF;
3
+ width: 100%;
4
+ height: 100%;
46
5
  }
47
- .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
48
- width: var(--length);
49
- left: var(--left);
50
- height: var(--height);
51
- margin: var(--margin);
6
+
7
+ .errorBoundary-module_StyledIcon__IYHiU {
8
+ margin-right: 10px;
52
9
  }
53
10
  .icon-module_icon-base-parent__nOMvW {
54
11
  line-height: 1px !important;
@@ -80,14 +37,57 @@
80
37
  width: var(--height);
81
38
  height: var(--width);
82
39
  }
83
- .errorBoundary-module_errorBoundary__gk9ps {
84
- background: #EFEFEF;
85
- width: 100%;
86
- height: 100%;
40
+ .divider-module_divider-line__6CesR {
41
+ position: relative;
42
+ display: block;
43
+ transition: opacity, width, height 250ms ease-in-out;
44
+ background-color: var(--color);
45
+ opacity: var(--opacity);
87
46
  }
88
-
89
- .errorBoundary-module_StyledIcon__IYHiU {
90
- margin-right: 10px;
47
+ .divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
48
+ height: var(--length);
49
+ left: var(--left);
50
+ width: var(--width);
51
+ margin: var(--margin);
52
+ }
53
+ .divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
54
+ width: var(--length);
55
+ left: var(--left);
56
+ height: var(--height);
57
+ margin: var(--margin);
58
+ }
59
+ .CollapsibleContainer-module_collapsible-container__u0Jmm {
60
+ transform-origin: 0% 0%;
61
+ opacity: 0;
62
+ overflow: clip;
63
+ }
64
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
65
+ transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
66
+ will-change: opacity, height, max-height;
67
+ }
68
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
69
+ height: 0;
70
+ max-height: 0;
71
+ opacity: 0;
72
+ }
73
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
74
+ height: var(--prop-value);
75
+ max-height: var(--prop-value);
76
+ opacity: 1;
77
+ }
78
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
79
+ transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
80
+ will-change: opacity, width, max-width;
81
+ }
82
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
83
+ width: 0;
84
+ max-width: 0;
85
+ opacity: 0;
86
+ }
87
+ .CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
88
+ width: var(--prop-value);
89
+ max-width: var(--prop-value);
90
+ opacity: 1;
91
91
  }
92
92
  .lazyComponent-module_loader__brMEW {
93
93
  position: relative;
@@ -1 +1 @@
1
- {"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Store, StoreWithActions, Selector } from './store.vanillajs'\n\n\n/**\n * Represents the type for the partial store state used in the `useStore` hook.\n */\nexport type useStoreType<T> = Partial<T>\n\nexport type useStoreWithSetterType<T> = [Partial<T>, Store<T>['setState']]\n\ntype returnSetterTrueType = true\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T>): useStoreType<T>\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T>,\n returnSetter: returnSetterTrueType): useStoreWithSetterType<T>\n/**\n * Custom hook to subscribe to a store and retrieve the selected state.\n * @param store - The store to subscribe to.\n * @param selector - Optional selector function to transform the store state.\n * @param returnSetter - Optional flag to have setState returned\n * @returns The selected state from the store. or selected state and seState tuple\n */\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n returnSetter = false,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> | useStoreWithSetterType<T> {\n const getter = useSyncExternalStore(store.subscribe, () => (selector(store.getState()) as Partial<T>))\n\n if (returnSetter) {\n return [getter, store.setState] as useStoreWithSetterType<T>\n }\n\n return getter as useStoreType<T>\n}\n\n/**\n * Represents the type for the API returned by the `useStoreApi` hook.\n */\nexport type useStoreApiType<T> = [\n useStoreType<T>,\n Store<T>['getState'],\n Store<T>['setState'],\n StoreWithActions<T>['actions'],\n]\n\n/**\n * Custom hook to retrieve the store API including state, getters, setters, and actions (if applicable).\n * @param store - The store to retrieve the API from.\n * @param selector - Optional selector function to transform the store state.\n * @returns The store API including state, getters, setters, and actions (if applicable).\n */\nexport function useStoreApi<T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n): useStoreApiType<T> {\n return [\n useStore(store, selector),\n store.getState,\n store.setState,\n (store as StoreWithActions<T>).actions,\n ]\n}\n"],"names":["useStore","store","selector","arguments","length","undefined","state","returnSetter","getter","useSyncExternalStore","subscribe","getState","setState","actions"],"mappings":"oCA6BO,SAASA,EACdC,GAM6C,IAL7CC,EAAqBC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,EAC3DC,EAAYJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAKZ,MAAMK,EAASC,uBAAqBR,EAAMS,WAAW,IAAOR,EAASD,EAAMU,cAE3E,OAAIJ,EACK,CAACC,EAAQP,EAAMW,UAGjBJ,CACT,wCAkBO,SACLP,GAGA,MAAO,CACLD,EAASC,EAHUE,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,GAIzDL,EAAMU,SACNV,EAAMW,SACLX,EAA8BY,QAEnC"}
1
+ {"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Store, StoreWithActions, Selector } from './store.vanillajs'\n\n\n/**\n * Represents the type for the partial store state used in the `useStore` hook.\n */\nexport type useStoreType<T> = Partial<T>\n\nexport type useStoreWithSetterType<T> = [Partial<T>, Store<T>['setState']]\n\ntype returnSetterTrueType = true\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector?: Selector<T>): useStoreType<T>\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector?: Selector<T>,\n returnSetter?: returnSetterTrueType): useStoreWithSetterType<T>\n/**\n * Custom hook to subscribe to a store and retrieve the selected state.\n * @param store - The store to subscribe to.\n * @param selector - Optional selector function to transform the store state.\n * @param returnSetter - Optional flag to have setState returned\n * @returns The selected state from the store. or selected state and seState tuple\n */\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n returnSetter = false,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> | useStoreWithSetterType<T> {\n const getter = useSyncExternalStore(store.subscribe, () => (selector(store.getState()) as Partial<T>))\n\n if (returnSetter) {\n return [getter, store.setState] as useStoreWithSetterType<T>\n }\n\n return getter as useStoreType<T>\n}\n\n/**\n * Represents the type for the API returned by the `useStoreApi` hook.\n */\nexport type useStoreApiType<T> = [\n useStoreType<T>,\n Store<T>['getState'],\n Store<T>['setState'],\n StoreWithActions<T>['actions'],\n]\n\n/**\n * Custom hook to retrieve the store API including state, getters, setters, and actions (if applicable).\n * @param store - The store to retrieve the API from.\n * @param selector - Optional selector function to transform the store state.\n * @returns The store API including state, getters, setters, and actions (if applicable).\n */\nexport function useStoreApi<T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n): useStoreApiType<T> {\n return [\n useStore(store, selector),\n store.getState,\n store.setState,\n (store as StoreWithActions<T>).actions,\n ]\n}\n"],"names":["useStore","store","selector","arguments","length","undefined","state","returnSetter","getter","useSyncExternalStore","subscribe","getState","setState","actions"],"mappings":"oCA6BO,SAASA,EACdC,GAM6C,IAL7CC,EAAqBC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,EAC3DC,EAAYJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAKZ,MAAMK,EAASC,uBAAqBR,EAAMS,WAAW,IAAOR,EAASD,EAAMU,cAE3E,OAAIJ,EACK,CAACC,EAAQP,EAAMW,UAGjBJ,CACT,wCAkBO,SACLP,GAGA,MAAO,CACLD,EAASC,EAHUE,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,GAIzDL,EAAMU,SACNV,EAAMW,SACLX,EAA8BY,QAEnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Store, StoreWithActions, Selector } from './store.vanillajs'\n\n\n/**\n * Represents the type for the partial store state used in the `useStore` hook.\n */\nexport type useStoreType<T> = Partial<T>\n\nexport type useStoreWithSetterType<T> = [Partial<T>, Store<T>['setState']]\n\ntype returnSetterTrueType = true\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T>): useStoreType<T>\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T>,\n returnSetter: returnSetterTrueType): useStoreWithSetterType<T>\n/**\n * Custom hook to subscribe to a store and retrieve the selected state.\n * @param store - The store to subscribe to.\n * @param selector - Optional selector function to transform the store state.\n * @param returnSetter - Optional flag to have setState returned\n * @returns The selected state from the store. or selected state and seState tuple\n */\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n returnSetter = false,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> | useStoreWithSetterType<T> {\n const getter = useSyncExternalStore(store.subscribe, () => (selector(store.getState()) as Partial<T>))\n\n if (returnSetter) {\n return [getter, store.setState] as useStoreWithSetterType<T>\n }\n\n return getter as useStoreType<T>\n}\n\n/**\n * Represents the type for the API returned by the `useStoreApi` hook.\n */\nexport type useStoreApiType<T> = [\n useStoreType<T>,\n Store<T>['getState'],\n Store<T>['setState'],\n StoreWithActions<T>['actions'],\n]\n\n/**\n * Custom hook to retrieve the store API including state, getters, setters, and actions (if applicable).\n * @param store - The store to retrieve the API from.\n * @param selector - Optional selector function to transform the store state.\n * @returns The store API including state, getters, setters, and actions (if applicable).\n */\nexport function useStoreApi<T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n): useStoreApiType<T> {\n return [\n useStore(store, selector),\n store.getState,\n store.setState,\n (store as StoreWithActions<T>).actions,\n ]\n}\n"],"names":["useStore","store","selector","arguments","length","undefined","state","returnSetter","getter","useSyncExternalStore","subscribe","getState","setState","useStoreApi","actions"],"mappings":"6CA6BO,SAASA,EACdC,GAM6C,IAL7CC,EAAqBC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,EAC3DC,EAAYJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAKZ,MAAMK,EAASC,EAAqBR,EAAMS,WAAW,IAAOR,EAASD,EAAMU,cAE3E,OAAIJ,EACK,CAACC,EAAQP,EAAMW,UAGjBJ,CACT,CAkBO,SAASK,EACdZ,GAGA,MAAO,CACLD,EAASC,EAHUE,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,GAIzDL,EAAMU,SACNV,EAAMW,SACLX,EAA8Ba,QAEnC"}
1
+ {"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Store, StoreWithActions, Selector } from './store.vanillajs'\n\n\n/**\n * Represents the type for the partial store state used in the `useStore` hook.\n */\nexport type useStoreType<T> = Partial<T>\n\nexport type useStoreWithSetterType<T> = [Partial<T>, Store<T>['setState']]\n\ntype returnSetterTrueType = true\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector?: Selector<T>): useStoreType<T>\n\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector?: Selector<T>,\n returnSetter?: returnSetterTrueType): useStoreWithSetterType<T>\n/**\n * Custom hook to subscribe to a store and retrieve the selected state.\n * @param store - The store to subscribe to.\n * @param selector - Optional selector function to transform the store state.\n * @param returnSetter - Optional flag to have setState returned\n * @returns The selected state from the store. or selected state and seState tuple\n */\nexport function useStore<T>(\n store: Store<T> | StoreWithActions<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n returnSetter = false,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> | useStoreWithSetterType<T> {\n const getter = useSyncExternalStore(store.subscribe, () => (selector(store.getState()) as Partial<T>))\n\n if (returnSetter) {\n return [getter, store.setState] as useStoreWithSetterType<T>\n }\n\n return getter as useStoreType<T>\n}\n\n/**\n * Represents the type for the API returned by the `useStoreApi` hook.\n */\nexport type useStoreApiType<T> = [\n useStoreType<T>,\n Store<T>['getState'],\n Store<T>['setState'],\n StoreWithActions<T>['actions'],\n]\n\n/**\n * Custom hook to retrieve the store API including state, getters, setters, and actions (if applicable).\n * @param store - The store to retrieve the API from.\n * @param selector - Optional selector function to transform the store state.\n * @returns The store API including state, getters, setters, and actions (if applicable).\n */\nexport function useStoreApi<T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>): Partial<T> => state,\n): useStoreApiType<T> {\n return [\n useStore(store, selector),\n store.getState,\n store.setState,\n (store as StoreWithActions<T>).actions,\n ]\n}\n"],"names":["useStore","store","selector","arguments","length","undefined","state","returnSetter","getter","useSyncExternalStore","subscribe","getState","setState","useStoreApi","actions"],"mappings":"6CA6BO,SAASA,EACdC,GAM6C,IAL7CC,EAAqBC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,EAC3DC,EAAYJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAKZ,MAAMK,EAASC,EAAqBR,EAAMS,WAAW,IAAOR,EAASD,EAAMU,cAE3E,OAAIJ,EACK,CAACC,EAAQP,EAAMW,UAGjBJ,CACT,CAkBO,SAASK,EACdZ,GAGA,MAAO,CACLD,EAASC,EAHUE,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAIG,GAAAA,GAAkCA,GAIzDL,EAAMU,SACNV,EAAMW,SACLX,EAA8Ba,QAEnC"}